[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [XenPPC] [rfc] [patch] 64-bitize guest handles
This is the final patch I would propose. Compile tested in linux, xen/xen and xen/tools Also sync'd the linux and xen copy of arch-ppc64.h any last kvetches before I push? -JX --- hg diff xen/include/asm-ppc/guest_access.h xen/include/public/arch-ppc64.h diff -r 10db0f8c710d xen/include/asm-ppc/guest_access.h --- a/xen/include/asm-ppc/guest_access.h Wed Jun 28 15:37:45 2006 -0400 +++ b/xen/include/asm-ppc/guest_access.h Wed Jun 28 20:42:06 2006 -0400 @@ -39,7 +39,9 @@ extern void xencomm_add_offset(void *han /* Cast a guest handle to the specified type of handle. */ #define guest_handle_cast(hnd, type) ({ \ type *_x = (hnd).p; \ - (XEN_GUEST_HANDLE(type)) { _x }; \ + XEN_GUEST_HANDLE(type) _y; \ + set_xen_guest_handle(_y, _x); \ + _y; \ }) /* Since we run in real mode, we can safely access all addresses. That also diff -r 10db0f8c710d xen/include/public/arch-ppc64.h --- a/xen/include/public/arch-ppc64.h Wed Jun 28 15:37:45 2006 -0400 +++ b/xen/include/public/arch-ppc64.h Wed Jun 28 20:42:06 2006 -0400 @@ -13,7 +13,7 @@ * along with this program; if not, write to the Free Software * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * Copyright (C) IBM Corp. 2005 + * Copyright (C) IBM Corp. 2005,2006 * * Authors: Hollis Blanchard <hollisb@xxxxxxxxxx> */ @@ -27,11 +27,20 @@ #endif #define __DEFINE_XEN_GUEST_HANDLE(name, type) \ - typedef struct { type *p; } __guest_handle_ ## name + typedef struct { \ + int __pad[(sizeof (long long) - sizeof (void *)) / 4]; \ + type *p; \ + } __attribute__((__aligned__(8))) __guest_handle_ ## name #define DEFINE_XEN_GUEST_HANDLE(name) __DEFINE_XEN_GUEST_HANDLE(name, name) #define XEN_GUEST_HANDLE(name) __guest_handle_ ## name -#define set_xen_guest_handle(hnd, val) do { (hnd).p = val; } while (0) +#define set_xen_guest_handle(hnd, val) \ + do { \ + if (sizeof ((hnd).__pad)) \ + (hnd).__pad[0] = 0; \ + (hnd).p = val; \ + } while (0) + #ifdef __XEN_TOOLS__ #define get_xen_guest_handle(val, hnd) do { val = (hnd).p; } while (0) #endif @@ -70,7 +79,7 @@ typedef unsigned long cpureg_t; /* Ful /* User-accessible registers: need to be saved/restored for every nested Xen * invocation. */ -typedef struct cpu_user_regs +struct cpu_user_regs { uint64_t gprs[32]; uint64_t lr; @@ -84,16 +93,18 @@ typedef struct cpu_user_regs uint64_t hid4; uint32_t cr; uint32_t entry_vector; -} cpu_user_regs_t; +}; +typedef struct cpu_user_regs cpu_user_regs_t; typedef uint64_t tsc_timestamp_t; /* RDTSC timestamp */ /* XXX timebase */ /* ONLY used to communicate with dom0! See also struct exec_domain. */ -typedef struct vcpu_guest_context { +struct vcpu_guest_context { cpu_user_regs_t user_regs; /* User-level CPU registers */ uint64_t sdr1; /* Pagetable base */ /* XXX etc */ -} vcpu_guest_context_t; +}; +typedef struct vcpu_guest_context vcpu_guest_context_t; DEFINE_XEN_GUEST_HANDLE(vcpu_guest_context_t); struct arch_shared_info { _______________________________________________ Xen-ppc-devel mailing list Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-ppc-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |