diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2008-07-11 12:51:26 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2008-07-11 12:51:26 +0100 |
commit | 41296317a3156c84206de931ba9118330e0c3fc4 (patch) | |
tree | f2728d5585d608d74570bd3dea5647490584f94e /tools/libxc | |
parent | 04e28c8d4f8411cb8af638124676142edfcda1b5 (diff) | |
download | xen-41296317a3156c84206de931ba9118330e0c3fc4.tar.gz xen-41296317a3156c84206de931ba9118330e0c3fc4.tar.bz2 xen-41296317a3156c84206de931ba9118330e0c3fc4.zip |
x86: allow control domain to limit machine addresses given to a particular guest
This allows domains which make buggy assumptions about the maximum
possible MFN to be worked around.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'tools/libxc')
-rw-r--r-- | tools/libxc/xc_domain.c | 29 | ||||
-rw-r--r-- | tools/libxc/xenctrl.h | 6 |
2 files changed, 35 insertions, 0 deletions
diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c index 3b08922067..551d8d1ada 100644 --- a/tools/libxc/xc_domain.c +++ b/tools/libxc/xc_domain.c @@ -993,6 +993,35 @@ int xc_domain_subscribe_for_suspend( return do_domctl(xc_handle, &domctl); } +int xc_domain_set_machine_address_size(int xc, + uint32_t domid, + unsigned int width) +{ + DECLARE_DOMCTL; + + memset(&domctl, 0, sizeof(domctl)); + domctl.domain = domid; + domctl.cmd = XEN_DOMCTL_set_machine_address_size; + domctl.u.address_size.size = width; + + return do_domctl(xc, &domctl); +} + + +int xc_domain_get_machine_address_size(int xc, uint32_t domid) +{ + DECLARE_DOMCTL; + int rc; + + memset(&domctl, 0, sizeof(domctl)); + domctl.domain = domid; + domctl.cmd = XEN_DOMCTL_get_machine_address_size; + + rc = do_domctl(xc, &domctl); + + return rc == 0 ? domctl.u.address_size.size : rc; +} + /* * Local variables: * mode: C diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h index b70c3b8193..69d58950d5 100644 --- a/tools/libxc/xenctrl.h +++ b/tools/libxc/xenctrl.h @@ -1076,6 +1076,12 @@ int xc_domain_bind_pt_isa_irq(int xc_handle, uint32_t domid, uint8_t machine_irq); +int xc_domain_set_machine_address_size(int handle, + uint32_t domid, + unsigned int width); +int xc_domain_get_machine_address_size(int handle, + uint32_t domid); + /* Set the target domain */ int xc_domain_set_target(int xc_handle, uint32_t domid, |