[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] 32-on-64: New set_address_size domctl for switching to compat mode.
# HG changeset patch # User kaf24@xxxxxxxxxxxxxxxxxxxxx # Date 1169818021 0 # Node ID e0291e3ed603f5437d1e88c7b746b6617346792c # Parent 2f8a7e5fd8bab112208c7cf51941aaa79afc615f 32-on-64: New set_address_size domctl for switching to compat mode. From: Gerd Hoffmann <kraxel@xxxxxxx> Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx> --- tools/libxc/xc_dom_boot.c | 20 ++++++++------------ xen/arch/x86/domctl.c | 40 ++++++++++++++++++++++++++++++++++++++++ xen/include/public/domctl.h | 8 ++++++++ 3 files changed, 56 insertions(+), 12 deletions(-) diff -r 2f8a7e5fd8ba -r e0291e3ed603 tools/libxc/xc_dom_boot.c --- a/tools/libxc/xc_dom_boot.c Fri Jan 26 10:10:12 2007 +0000 +++ b/tools/libxc/xc_dom_boot.c Fri Jan 26 13:27:01 2007 +0000 @@ -91,37 +91,33 @@ static int clear_page(struct xc_dom_imag static int x86_compat(int xc, domid_t domid, char *guest_type) { -#ifdef XEN_DOMCTL_set_compat static const struct { char *guest; - unsigned long cmd; + uint32_t size; } types[] = { - { "xen-3.0-x86_32p", XEN_DOMCTL_set_compat }, - { "xen-3.0-x86_64", XEN_DOMCTL_set_native }, + { "xen-3.0-x86_32p", 32 }, + { "xen-3.0-x86_64", 64 }, }; DECLARE_DOMCTL; int i,rc; memset(&domctl, 0, sizeof(domctl)); domctl.domain = domid; + domctl.cmd = XEN_DOMCTL_set_address_size; for (i = 0; i < sizeof(types)/sizeof(types[0]); i++) if (0 == strcmp(types[i].guest, guest_type)) - domctl.cmd = types[i].cmd; - if (0 == domctl.cmd) + domctl.u.address_size.size = types[i].size; + if (0 == domctl.u.address_size.size) /* nothing to do */ return 0; - xc_dom_printf("%s: guest %s, cmd %d\n", __FUNCTION__, - guest_type, domctl.cmd); + xc_dom_printf("%s: guest %s, address size %" PRId32 "\n", __FUNCTION__, + guest_type, domctl.u.address_size.size); rc = do_domctl(xc, &domctl); if (0 != rc) xc_dom_printf("%s: warning: failed (rc=%d)\n", __FUNCTION__, rc); return rc; -#else - xc_dom_printf("%s: compiled without compat/native switching\n", __FUNCTION__); - return 0; -#endif /* XEN_DOMCTL_set_compat */ } diff -r 2f8a7e5fd8ba -r e0291e3ed603 xen/arch/x86/domctl.c --- a/xen/arch/x86/domctl.c Fri Jan 26 10:10:12 2007 +0000 +++ b/xen/arch/x86/domctl.c Fri Jan 26 13:27:01 2007 +0000 @@ -354,6 +354,46 @@ long arch_do_domctl( } break; + case XEN_DOMCTL_set_address_size: + { + struct domain *d; + + ret = -ESRCH; + if ( (d = find_domain_by_id(domctl->domain)) == NULL ) + break; + + switch ( domctl->u.address_size.size ) + { +#ifdef CONFIG_COMPAT + case 32: + ret = switch_compat(d); + break; + case 64: + ret = switch_native(d); + break; +#endif + default: + ret = (domctl->u.address_size.size == BITS_PER_LONG) ? 0 : -EINVAL; + break; + } + + put_domain(d); + } + + case XEN_DOMCTL_get_address_size: + { + struct domain *d; + + ret = -ESRCH; + if ( (d = find_domain_by_id(domctl->domain)) == NULL ) + break; + + domctl->u.address_size.size = BITS_PER_GUEST_LONG(d); + + ret = 0; + put_domain(d); + } + default: ret = -ENOSYS; break; diff -r 2f8a7e5fd8ba -r e0291e3ed603 xen/include/public/domctl.h --- a/xen/include/public/domctl.h Fri Jan 26 10:10:12 2007 +0000 +++ b/xen/include/public/domctl.h Fri Jan 26 13:27:01 2007 +0000 @@ -401,6 +401,13 @@ typedef struct xen_domctl_hvmcontext { } xen_domctl_hvmcontext_t; DEFINE_XEN_GUEST_HANDLE(xen_domctl_hvmcontext_t); +#define XEN_DOMCTL_set_address_size 35 +#define XEN_DOMCTL_get_address_size 36 +typedef struct xen_domctl_address_size { + uint32_t size; +} xen_domctl_address_size_t; +DEFINE_XEN_GUEST_HANDLE(xen_domctl_address_size_t); + #define XEN_DOMCTL_real_mode_area 26 struct xen_domctl_real_mode_area { uint32_t log; /* log2 of Real Mode Area size */ @@ -435,6 +442,7 @@ struct xen_domctl { struct xen_domctl_settimeoffset settimeoffset; struct xen_domctl_real_mode_area real_mode_area; struct xen_domctl_hvmcontext hvmcontext; + struct xen_domctl_address_size address_size; uint8_t pad[128]; } u; }; _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |