aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common/sysctl.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2008-09-04 11:25:09 +0100
committerKeir Fraser <keir.fraser@citrix.com>2008-09-04 11:25:09 +0100
commitaff2988ad524ed3835bd0c402f8ec25264db61ea (patch)
tree12ba50c678f9862e3b519adf0605c97d2c7d3df3 /xen/common/sysctl.c
parent06cfe5df7bdadd1972619d26127bd18a56a1db04 (diff)
downloadxen-aff2988ad524ed3835bd0c402f8ec25264db61ea.tar.gz
xen-aff2988ad524ed3835bd0c402f8ec25264db61ea.tar.bz2
xen-aff2988ad524ed3835bd0c402f8ec25264db61ea.zip
xsm: refactor IO hooks/sysctl hooks
- The patch refactors the IO resource checks into the rangeset add/del code. This produces a much more architecture friendly implementation and ensures that HVM and paravirtualized guests are checked consistently. - The patch removes the following hooks in support of the refactoring of the IO resource checks: - xsm_irq_permission - xsm_iomem_permission - xsm_ioport_permission - The patch adds the following hooks in support of the refactoring of the IO resource checks: - xsm_add_range - xsm_remove_range - These IO refactoring changes are transparent to any pre-existing Flask policies. - The patch adds also adds hooks for sysctl functionality that was added since the last major XSM patch. The following hooks were added: - xsm_set_target - xsm_debug_keys - xsm_getcpuinfo - xsm_availheap - xsm_firmware_info - xsm_acpi_sleep - xsm_change_freq - xsm_getidletime - xsm_sendtrigger - xsm_test_assign_device - xsm_assign_device - xsm_deassign_device - xsm_bind_pt_irq - xsm_pin_mem_cacheattr - xsm_ext_vcpucontext Signed-off-by: George Coker <gscoker@alpha.ncsc.mil>
Diffstat (limited to 'xen/common/sysctl.c')
-rw-r--r--xen/common/sysctl.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
index 0b32378df7..c3f1b42716 100644
--- a/xen/common/sysctl.c
+++ b/xen/common/sysctl.c
@@ -149,6 +149,10 @@ long do_sysctl(XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl)
char c;
uint32_t i;
+ ret = xsm_debug_keys();
+ if ( ret )
+ break;
+
for ( i = 0; i < op->u.debug_keys.nr_keys; i++ )
{
if ( copy_from_guest_offset(&c, op->u.debug_keys.keys, i, 1) )
@@ -166,6 +170,10 @@ long do_sysctl(XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl)
nr_cpus = min_t(uint32_t, op->u.getcpuinfo.max_cpus, NR_CPUS);
+ ret = xsm_getcpuinfo();
+ if ( ret )
+ break;
+
for ( i = 0; i < nr_cpus; i++ )
{
/* Assume no holes in idle-vcpu map. */
@@ -188,6 +196,10 @@ long do_sysctl(XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl)
case XEN_SYSCTL_availheap:
{
+ ret = xsm_availheap();
+ if ( ret )
+ break;
+
op->u.availheap.avail_bytes = avail_domheap_pages_region(
op->u.availheap.node,
op->u.availheap.min_bitwidth,