-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'xen-arm64-3.1-tag' of git://git.kernel.org/pub/scm/linux/k…
…ernel/git/sstabellini/xen into upstream Introduce Xen support to ARM64 * tag 'xen-arm64-3.1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/sstabellini/xen: MAINTAINERS: add myself as arm64/xen maintainer arm64/xen: introduce CONFIG_XEN and hypercall.S on ARM64 arm64/xen: use XEN_IO_PROTO_ABI_ARM on ARM64 arm64/xen: implement ioremap_cached on arm64 arm64/xen: introduce asm/xen header files on arm64 arm/xen: define xen_remap as ioremap_cached
- Loading branch information
Showing
15 changed files
with
173 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#ifndef _ASM_ARM64_HYPERVISOR_H | ||
#define _ASM_ARM64_HYPERVISOR_H | ||
|
||
#include <asm/xen/hypervisor.h> | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#ifndef __ASM_SYNC_BITOPS_H__ | ||
#define __ASM_SYNC_BITOPS_H__ | ||
|
||
#include <asm/bitops.h> | ||
#include <asm/cmpxchg.h> | ||
|
||
/* sync_bitops functions are equivalent to the SMP implementation of the | ||
* original functions, independently from CONFIG_SMP being defined. | ||
* | ||
* We need them because _set_bit etc are not SMP safe if !CONFIG_SMP. But | ||
* under Xen you might be communicating with a completely external entity | ||
* who might be on another CPU (e.g. two uniprocessor guests communicating | ||
* via event channels and grant tables). So we need a variant of the bit | ||
* ops which are SMP safe even on a UP kernel. | ||
*/ | ||
|
||
#define sync_set_bit(nr, p) set_bit(nr, p) | ||
#define sync_clear_bit(nr, p) clear_bit(nr, p) | ||
#define sync_change_bit(nr, p) change_bit(nr, p) | ||
#define sync_test_and_set_bit(nr, p) test_and_set_bit(nr, p) | ||
#define sync_test_and_clear_bit(nr, p) test_and_clear_bit(nr, p) | ||
#define sync_test_and_change_bit(nr, p) test_and_change_bit(nr, p) | ||
#define sync_test_bit(nr, addr) test_bit(nr, addr) | ||
#define sync_cmpxchg cmpxchg | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#ifndef _ASM_ARM64_XEN_EVENTS_H | ||
#define _ASM_ARM64_XEN_EVENTS_H | ||
|
||
#include <asm/ptrace.h> | ||
#include <asm/atomic.h> | ||
|
||
enum ipi_vector { | ||
XEN_PLACEHOLDER_VECTOR, | ||
|
||
/* Xen IPIs go here */ | ||
XEN_NR_IPIS, | ||
}; | ||
|
||
static inline int xen_irqs_disabled(struct pt_regs *regs) | ||
{ | ||
return raw_irqs_disabled_flags((unsigned long) regs->pstate); | ||
} | ||
|
||
#define xchg_xen_ulong(ptr, val) xchg((ptr), (val)) | ||
|
||
#endif /* _ASM_ARM64_XEN_EVENTS_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#include <../../arm/include/asm/xen/hypercall.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#include <../../arm/include/asm/xen/hypervisor.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#include <../../arm/include/asm/xen/interface.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#include <../../arm/include/asm/xen/page.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
xen-arm-y += $(addprefix ../../arm/xen/, enlighten.o grant-table.o) | ||
obj-y := xen-arm.o hypercall.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
/****************************************************************************** | ||
* hypercall.S | ||
* | ||
* Xen hypercall wrappers | ||
* | ||
* Stefano Stabellini <stefano.stabellini@eu.citrix.com>, Citrix, 2012 | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License version 2 | ||
* as published by the Free Software Foundation; or, when distributed | ||
* separately from the Linux kernel or incorporated into other | ||
* software packages, subject to the following license: | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this source file (the "Software"), to deal in the Software without | ||
* restriction, including without limitation the rights to use, copy, modify, | ||
* merge, publish, distribute, sublicense, and/or sell copies of the Software, | ||
* and to permit persons to whom the Software is furnished to do so, subject to | ||
* the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | ||
* IN THE SOFTWARE. | ||
*/ | ||
|
||
/* | ||
* The Xen hypercall calling convention is very similar to the procedure | ||
* call standard for the ARM 64-bit architecture: the first parameter is | ||
* passed in x0, the second in x1, the third in x2, the fourth in x3 and | ||
* the fifth in x4. | ||
* | ||
* The hypercall number is passed in x16. | ||
* | ||
* The return value is in x0. | ||
* | ||
* The hvc ISS is required to be 0xEA1, that is the Xen specific ARM | ||
* hypercall tag. | ||
* | ||
* Parameter structs passed to hypercalls are laid out according to | ||
* the ARM 64-bit EABI standard. | ||
*/ | ||
|
||
#include <linux/linkage.h> | ||
#include <asm/assembler.h> | ||
#include <xen/interface/xen.h> | ||
|
||
|
||
#define XEN_IMM 0xEA1 | ||
|
||
#define HYPERCALL_SIMPLE(hypercall) \ | ||
ENTRY(HYPERVISOR_##hypercall) \ | ||
mov x16, #__HYPERVISOR_##hypercall; \ | ||
hvc XEN_IMM; \ | ||
ret; \ | ||
ENDPROC(HYPERVISOR_##hypercall) | ||
|
||
#define HYPERCALL0 HYPERCALL_SIMPLE | ||
#define HYPERCALL1 HYPERCALL_SIMPLE | ||
#define HYPERCALL2 HYPERCALL_SIMPLE | ||
#define HYPERCALL3 HYPERCALL_SIMPLE | ||
#define HYPERCALL4 HYPERCALL_SIMPLE | ||
#define HYPERCALL5 HYPERCALL_SIMPLE | ||
|
||
.text | ||
|
||
HYPERCALL2(xen_version); | ||
HYPERCALL3(console_io); | ||
HYPERCALL3(grant_table_op); | ||
HYPERCALL2(sched_op); | ||
HYPERCALL2(event_channel_op); | ||
HYPERCALL2(hvm_op); | ||
HYPERCALL2(memory_op); | ||
HYPERCALL2(physdev_op); | ||
HYPERCALL3(vcpu_op); | ||
|
||
ENTRY(privcmd_call) | ||
mov x16, x0 | ||
mov x0, x1 | ||
mov x1, x2 | ||
mov x2, x3 | ||
mov x3, x4 | ||
mov x4, x5 | ||
hvc XEN_IMM | ||
ret | ||
ENDPROC(privcmd_call); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters