The Xen Blanket: hypervisor interface for PV drivers on nested Xen
RFC 2/9 x86: Introduce Xen detection as separate logic from Xen Guest support.
In reply to Christopher ClarkAdd Kconfig option XEN_DETECT for:
"Support for Xen detecting when it is running under Xen".
If running under Xen is detected, a boot message will indicate the hypervisor version obtained from cpuid.
Update the XEN_GUEST Kconfig option text to reflect its current purpose:
"Common PVH_GUEST and PV_SHIM logic for Xen as a Xen-aware guest".
Update calibrate_APIC_clock to use Xen-specific init if nested Xen is detected, even if not operating as a PV shim or booted as PVH.
This work is a precursor to adding the interface for support of PV drivers on nested Xen.
--- xen/arch/x86/Kconfig | 11 ++++++++++- xen/arch/x86/Makefile | 2 +- xen/arch/x86/apic.c | 4 ++-- xen/arch/x86/guest/Makefile | 2 +- xen/arch/x86/guest/xen-guest.c | 10 ++++++++++ xen/arch/x86/guest/xen.c | 23 ++++++++++++++++++----- xen/arch/x86/setup.c | 3 +++ xen/include/asm-x86/guest/xen.h | 26 +++++++++++++++++++++----- 8 files changed, 66 insertions(+), 15 deletions(-)
xen/arch/x86/Kconfig +10 -1
@@ -161,11 +161,20 @@ config XEN_ALIGN_2M endchoice +config XEN_DETECT + def_bool y + prompt "Xen Detection" + ---help--- + Support for Xen detecting when it is running under Xen. + + If unsure, say Y. + config XEN_GUEST def_bool n prompt "Xen Guest" + depends on XEN_DETECT ---help--- - Support for Xen detecting when it is running under Xen. + Common PVH_GUEST and PV_SHIM logic for Xen as a Xen-aware guest. If unsure, say N.
xen/arch/x86/Makefile +1 -1
@@ -1,7 +1,7 @@ subdir-y += acpi subdir-y += cpu subdir-y += genapic -subdir-$(CONFIG_XEN_GUEST) += guest +subdir-$(CONFIG_XEN_DETECT) += guest subdir-$(CONFIG_HVM) += hvm subdir-y += mm subdir-$(CONFIG_XENOPROF) += oprofile
xen/arch/x86/apic.c +2 -2
@@ -1247,7 +1247,7 @@ static int __init calibrate_APIC_clock(void)*/ __setup_APIC_LVTT (1000000000 ); -if ( !xen_guest ) +if ( !xen_detected )/* * The timer chip counts down to zero. Let's wait * for a wraparound to start exact measurement:
@@ -1267,7 +1267,7 @@ static int __init calibrate_APIC_clock(void)* Let's wait LOOPS ticks: */ for (i =0 ; i <LOOPS ; i++) -if ( !xen_guest ) +if ( !xen_detected )wait_8254_wraparound ();else wait_tick_pvh ();
xen/arch/x86/guest/Makefile +1 -1
@@ -1,4 +1,4 @@ -obj-y += hypercall_page.o +obj-$(CONFIG_XEN_GUEST) += hypercall_page.o obj-y += xen.o obj-$(CONFIG_XEN_GUEST) += xen-guest.o
xen/arch/x86/guest/xen-guest.c +10 -0
@@ -35,6 +35,8 @@#include <public/arch-x86/cpuid.h> #include <public/hvm/params.h> +extern char hypercall_page[]; +bool __read_mostly xen_guest;static struct rangeset *mem;
@@ -45,6 +47,14 @@ static struct vcpu_info *vcpu_info;static unsigned long vcpu_info_mapped[BITS_TO_LONGS (NR_CPUS )]; DEFINE_PER_CPU(struct vcpu_info *, vcpu_info); +void xen_guest_enable (void ) +{ +/* Fill the hypercall page. */ +wrmsrl (cpuid_ebx (hypervisor_cpuid_base () +2 ),__pa (hypercall_page)); + + xen_guest = true; +} +static void map_shared_info (void ) {mfn_t mfn;
xen/arch/x86/guest/xen.c +18 -5
@@ -33,8 +33,10 @@#include <public/arch-x86/cpuid.h> #include <public/hvm/params.h> +/* xen_detected: Xen running on Xen detected */ +bool __read_mostly xen_detected; +static __read_mostly uint32_t xen_cpuid_base; -extern char hypercall_page[];static void __init find_xen_leaves (void ) {
@@ -58,7 +60,7 @@ static void __init find_xen_leaves(void)void __init probe_hypervisor (void ) { -if ( xen_guest ) +if ( xen_detected )return ;/* Too early to use cpu_has_hypervisor */
@@ -70,10 +72,21 @@ void __init probe_hypervisor(void)if ( !xen_cpuid_base )return ; -/* Fill the hypercall page. */ -wrmsrl (cpuid_ebx (xen_cpuid_base +2 ),__pa (hypercall_page)); + xen_detected = true; + +xen_guest_enable (); +} + +void __init hypervisor_print_info (void ) +{ +uint32_t eax, ebx, ecx, edx; +unsigned int major, minor; + +cpuid (xen_cpuid_base +1 , &eax, &ebx, &ecx, &edx); - xen_guest = true; + major = eax >>16 ; + minor = eax &0xffff ; +printk ("Nested Xen version %u.%u.\n" , major, minor); }uint32_t hypervisor_cpuid_base (void )
xen/arch/x86/setup.c +3 -0
@@ -774,6 +774,9 @@ void __init noreturn __start_xen(unsigned long mbi_p)ehci_dbgp_init ();console_init_preirq (); +if ( xen_detected ) +hypervisor_print_info (); +if ( pvh_boot )pvh_print_info ();
xen/include/asm-x86/guest/xen.h +21 -5
@@ -24,20 +24,37 @@#include <asm/e820.h> #include <asm/fixmap.h> -#define XEN_shared_info ((struct shared_info *)fix_to_virt(FIX_XEN_SHARED_INFO)) +#ifdef CONFIG_XEN_DETECT + +extern bool xen_detected; + +void probe_hypervisor (void ); +void hypervisor_print_info (void ); +uint32_t hypervisor_cpuid_base (void ); + +#else + +#define xen_detected 0 + +static inline void probe_hypervisor (void ) {} +static inline void hypervisor_print_info (void ) { +ASSERT_UNREACHABLE (); +} + +#endif /* CONFIG_XEN_DETECT */ #ifdef CONFIG_XEN_GUEST +#define XEN_shared_info ((struct shared_info *)fix_to_virt(FIX_XEN_SHARED_INFO))extern bool xen_guest;extern bool pv_console; -void probe_hypervisor (void );void hypervisor_setup (void );void hypervisor_ap_setup (void );int hypervisor_alloc_unused_page (mfn_t *mfn);int hypervisor_free_unused_page (mfn_t mfn); -uint32_t hypervisor_cpuid_base (void );void hypervisor_resume (void ); +void xen_guest_enable (void ); DECLARE_PER_CPU(unsigned int, vcpu_id); DECLARE_PER_CPU(struct vcpu_info *, vcpu_info);
@@ -47,8 +64,6 @@ DECLARE_PER_CPU(struct vcpu_info *, vcpu_info);#define xen_guest 0#define pv_console 0 -static inline void probe_hypervisor (void ) {} -static inline void hypervisor_setup (void ) {ASSERT_UNREACHABLE ();
@@ -57,6 +72,7 @@ static inline void hypervisor_ap_setup(void) {ASSERT_UNREACHABLE (); } +static inline void xen_guest_enable (void ) {}#endif /* CONFIG_XEN_GUEST */ #endif /* __X86_GUEST_XEN_H__ */
Signature · 7 lines
2.17.1 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
cover The Xen Blanket: hypervisor interface for PV drivers on nested Xen
This RFC patch series adds a new hypervisor interface to support running a set of PV front end device drivers within dom0 of a guest Xen running on Xen.
A practical deployment scenario is a system running PV guest VMs that use unmodified Xen PV device drivers, on a guest Xen hypervisor with a dom0 using PV drivers itself, all within a HVM guest of a hosting Xen hypervisor (eg. from a cloud provider). Multiple PV guest VMs can reside within a single cloud instance; guests can be live-migrated between cloud instances that run nested Xen, and virtual machine introspection of guests can be performed without requiring cloud provider support.
The name "The Xen Blanket" was given by researchers from IBM and Cornell when the original work was published at the ACM Eurosys 2012 conference.
http://www1.unine.ch/eurosys2012/program/conference.html https://dl.acm.org/citation.cfm?doid=2168836.2168849
This patch series is a reimplementation of this architecture on modern Xen by Star Lab.
A patch to the Linux kernel to add device drivers using this blanket interface is at:
https://github.com/starlab-io/xenblanket-linux
(This is an example, enabling operation and testing of a Xen Blanket nested system. Further work would be necessary for Linux upstreaming.) Relevant other current Linux work is occurring here:
https://lkml.org/lkml/2019/4/8/67 https://lists.xenproject.org/archives/html/xen-devel/2019-05/msg00743.html
thanks,
Christopher
Christopher Clark (9):
x86/guest: code movement to separate Xen detection from guest
functions
x86: Introduce Xen detection as separate logic from Xen Guest support. x86/nested: add nested_xen_version hypercall
XSM: Add hook for nested xen version op; revises non-nested version op x86/nested, xsm: add nested_memory_op hypercall x86/nested, xsm: add nested_hvm_op hypercall
x86/nested, xsm: add nested_grant_table_op hypercall x86/nested, xsm: add nested_event_channel_op hypercall x86/nested, xsm: add nested_schedop_shutdown hypercall
tools/flask/policy/modules/dom0.te | 14 +- tools/flask/policy/modules/guest_features.te | 5 +- tools/flask/policy/modules/xen.te | 3 + tools/flask/policy/policy/initial_sids | 3 + xen/arch/x86/Kconfig | 33 +- xen/arch/x86/Makefile | 2 +- xen/arch/x86/apic.c | 4 +- xen/arch/x86/guest/Makefile | 4 + xen/arch/x86/guest/hypercall_page.S | 6 + xen/arch/x86/guest/xen-guest.c | 311 ++++++++++++++++ xen/arch/x86/guest/xen-nested.c | 350 +++++++++++++++++++ xen/arch/x86/guest/xen.c | 264 +------------- xen/arch/x86/hypercall.c | 8 + xen/arch/x86/pv/hypercall.c | 8 + xen/arch/x86/setup.c | 3 + xen/include/asm-x86/guest/hypercall.h | 7 +- xen/include/asm-x86/guest/xen.h | 36 +- xen/include/public/xen.h | 6 + xen/include/xen/hypercall.h | 33 ++ xen/include/xsm/dummy.h | 48 ++- xen/include/xsm/xsm.h | 49 +++ xen/xsm/dummy.c | 8 + xen/xsm/flask/hooks.c | 133 ++++++- xen/xsm/flask/policy/access_vectors | 26 ++ xen/xsm/flask/policy/initial_sids | 1 + xen/xsm/flask/policy/security_classes | 1 + 26 files changed, 1086 insertions(+), 280 deletions(-) create mode 100644 xen/arch/x86/guest/xen-guest.c create mode 100644 xen/arch/x86/guest/xen-nested.c
Signature · 7 lines
2.17.1 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
RFC 1/9 x86/guest: code movement to separate Xen detection from guest functions
Move some logic from: xen/arch/x86/guest/xen.c
into a new file: xen/arch/x86/guest/xen-guest.c
xen.c then contains the functions for basic Xen detection and xen-guest.c implements the intended behaviour changes when Xen is running as a guest.
Since CONFIG_XEN_GUEST must currently be defined for any of this code to be included, making xen-guest.o conditional upon it here works correctly and avoids further change to it in later patches in the series.
No functional change intended.
--- xen/arch/x86/guest/Makefile | 1 + xen/arch/x86/guest/xen-guest.c | 301 +++++++++++++++++++++++++++++++++ xen/arch/x86/guest/xen.c | 254 ---------------------------- 3 files changed, 302 insertions(+), 254 deletions(-) create mode 100644 xen/arch/x86/guest/xen-guest.c
xen/arch/x86/guest/Makefile +1 -0
@@ -1,4 +1,5 @@ obj-y += hypercall_page.o obj-y += xen.o +obj-$(CONFIG_XEN_GUEST) += xen-guest.o obj-bin-$(CONFIG_PVH_GUEST) += pvh-boot.init.o
xen/arch/x86/guest/xen-guest.c new file +301 -0
301 lines not on this page · raw message
xen/arch/x86/guest/xen.c +0 -254
280 lines not on this page · raw message
Signature · 7 lines
2.17.1 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
RFC 3/9 x86/nested: add nested_xen_version hypercall
In reply to Christopher ClarkProvides proxying to the host hypervisor for XENVER_version and XENVER_get_features ops.
The nested PV interface is only enabled when Xen is not running as either the PV shim or booted as PVH, since the initialization performed within the hypervisor in those cases - ie. as a Xen guest - claims resources that are normally operated by the control domain.
This nested hypercall only permits access from the control domain. The XSM policy hook implementation is deferred to a subsequent commit.
--- xen/arch/x86/Kconfig | 22 +++++++ xen/arch/x86/guest/Makefile | 5 +- xen/arch/x86/guest/hypercall_page.S | 1 + xen/arch/x86/guest/xen-nested.c | 82 +++++++++++++++++++++++++++ xen/arch/x86/guest/xen.c | 5 +- xen/arch/x86/hypercall.c | 3 + xen/arch/x86/pv/hypercall.c | 3 + xen/include/asm-x86/guest/hypercall.h | 7 ++- xen/include/asm-x86/guest/xen.h | 10 ++++ xen/include/public/xen.h | 1 + xen/include/xen/hypercall.h | 6 ++ 11 files changed, 142 insertions(+), 3 deletions(-) create mode 100644 xen/arch/x86/guest/xen-nested.c
xen/arch/x86/Kconfig +22 -0
@@ -207,6 +207,28 @@ config PV_SHIM_EXCLUSIVE option is only intended for use when building a dedicated PV Shim firmware, and will not function correctly in other scenarios. + If unsure, say N. + +config XEN_NESTED + bool "Xen PV driver interface for nested Xen" if EXPERT = "y" + depends on XEN_DETECT + ---help--- + Enables a second PV driver interface in the hypervisor to support running + two sets of PV drivers within a single privileged guest (eg. guest dom0) + of a system running Xen under Xen: + + 1) host set: frontends to access devices provided by lower hypervisor + 2) guest set: backends to support existing PV drivers in nested guest VMs + + This interface supports the host set of drivers and performs proxying of a + limited set of hypercall operations from the guest to the host hypervisor. + + This feature is for the guest hypervisor and is transparent to the + host hypervisor. Guest VMs of the guest hypervisor use the standard + PV driver interfaces and unmodified drivers. + + Feature is also known as "The Xen-Blanket", presented at Eurosys 2012. + If unsure, say N. endmenu
xen/arch/x86/guest/Makefile +4 -1
@@ -1,5 +1,8 @@ -obj-$(CONFIG_XEN_GUEST) += hypercall_page.o +ifneq ($(filter y,$(CONFIG_XEN_GUEST) $(CONFIG_XEN_NESTED) $(CONFIG_PVH_GUEST)),) +obj-y += hypercall_page.o +endif obj-y += xen.o obj-$(CONFIG_XEN_GUEST) += xen-guest.o +obj-$(CONFIG_XEN_NESTED) += xen-nested.o obj-bin-$(CONFIG_PVH_GUEST) += pvh-boot.init.o
xen/arch/x86/guest/hypercall_page.S +1 -0
@@ -60,6 +60,7 @@ DECLARE_HYPERCALL(domctl) DECLARE_HYPERCALL(kexec_op) DECLARE_HYPERCALL(argo_op) DECLARE_HYPERCALL(xenpmu_op) +DECLARE_HYPERCALL(nested_xen_version) DECLARE_HYPERCALL(arch_0) DECLARE_HYPERCALL(arch_1)
xen/arch/x86/guest/xen-nested.c new file +82 -0
82 lines not on this page · raw message
xen/arch/x86/guest/xen.c +4 -1
@@ -74,7 +74,10 @@ void __init probe_hypervisor(void) xen_detected = true; -xen_guest_enable (); +if ( pv_shim || pvh_boot ) +xen_guest_enable (); +else +xen_nested_enable (); }void __init hypervisor_print_info (void )
xen/arch/x86/hypercall.c +3 -0
@@ -72,6 +72,9 @@ const hypercall_args_t hypercall_args_table[NR_hypercalls] =#ifdef CONFIG_HVM ARGS(hvm_op, 2), ARGS(dm_op, 3), +#endif +#ifdef CONFIG_XEN_NESTED +ARGS (nested_xen_version,2 ), #endifARGS (mca,1 ), ARGS(arch_1, 1),
xen/arch/x86/pv/hypercall.c +3 -0
@@ -83,6 +83,9 @@ const hypercall_table_t pv_hypercall_table[] = {#ifdef CONFIG_HVM HYPERCALL(hvm_op), COMPAT_CALL(dm_op), +#endif +#ifdef CONFIG_XEN_NESTED +HYPERCALL (nested_xen_version), #endifHYPERCALL (mca), HYPERCALL(arch_1),
xen/include/asm-x86/guest/hypercall.h +6 -1
@@ -19,7 +19,7 @@#ifndef __X86_XEN_HYPERCALL_H__#define __X86_XEN_HYPERCALL_H__ -#ifdef CONFIG_XEN_GUEST +#if defined(CONFIG_XEN_GUEST ) || defined (CONFIG_XEN_NESTED )#include <xen/types.h>
@@ -123,6 +123,11 @@ static inline long xen_hypercall_hvm_op(unsigned int op, void *arg)return _hypercall64_2 (long, __HYPERVISOR_hvm_op, op, arg); } +static inline long xen_hypercall_xen_version (unsigned int op,void *arg) +{ +return _hypercall64_2 (long, __HYPERVISOR_xen_version, op, arg); +} +/* * Higher level hypercall helpers */
xen/include/asm-x86/guest/xen.h +10 -0
@@ -43,6 +43,16 @@ static inline void hypervisor_print_info(void) {#endif /* CONFIG_XEN_DETECT */ +#ifdef CONFIG_XEN_NESTED + +void xen_nested_enable (void ); + +#else + +static inline void xen_nested_enable (void ) {} + +#endif /* CONFIG_XEN_NESTED */ +#ifdef CONFIG_XEN_GUEST #define XEN_shared_info ((struct shared_info *)fix_to_virt(FIX_XEN_SHARED_INFO))
xen/include/public/xen.h +1 -0
@@ -121,6 +121,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_ulong_t);#define __HYPERVISOR_argo_op 39#define __HYPERVISOR_xenpmu_op 40#define __HYPERVISOR_dm_op 41 +#define __HYPERVISOR_nested_xen_version 42/* Architecture-specific hypercall definitions. */ #define __HYPERVISOR_arch_0 48
xen/include/xen/hypercall.h +6 -0
@@ -150,6 +150,12 @@ do_dm_op( unsigned int nr_bufs, XEN_GUEST_HANDLE_PARAM(xen_dm_op_buf_t) bufs); +#ifdef CONFIG_XEN_NESTED +extern long do_nested_xen_version ( +int cmd, +XEN_GUEST_HANDLE_PARAM (void ) arg); +#endif +#ifdef CONFIG_COMPAT extern int
Signature · 7 lines
2.17.1 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
RFC 4/9 XSM: Add hook for nested xen version op; revises non-nested version op
In reply to Christopher ClarkExpand XSM control to the full set of Xen version ops, to allow for granular control over ops a domain is allowed to issue for the nested case.
Applies const to args of xsm_default_action.
--- tools/flask/policy/modules/dom0.te | 7 ++- tools/flask/policy/modules/guest_features.te | 5 +- tools/flask/policy/modules/xen.te | 3 ++ tools/flask/policy/policy/initial_sids | 3 ++ xen/arch/x86/guest/xen-nested.c | 6 +-- xen/include/xsm/dummy.h | 12 ++++- xen/include/xsm/xsm.h | 13 ++++++ xen/xsm/dummy.c | 3 ++ xen/xsm/flask/hooks.c | 49 ++++++++++++++------ xen/xsm/flask/policy/access_vectors | 6 +++ xen/xsm/flask/policy/initial_sids | 1 + 11 files changed, 86 insertions(+), 22 deletions(-)
tools/flask/policy/modules/dom0.te +5 -2
@@ -22,9 +22,9 @@ allow dom0_t xen_t:xen2 { # Allow dom0 to use all XENVER_ subops that have checks. # Note that dom0 is part of domain_type so this has duplicates. allow dom0_t xen_t:version { - xen_extraversion xen_compile_info xen_capabilities + xen_version xen_extraversion xen_compile_info xen_capabilities xen_changeset xen_pagesize xen_guest_handle xen_commandline - xen_build_id + xen_build_id xen_get_features xen_platform_parameters }; allow dom0_t xen_t:mmu memorymap;
@@ -43,6 +43,9 @@ allow dom0_t dom0_t:domain2 { }; allow dom0_t dom0_t:resource { add remove }; +# Allow dom0 to communicate with a nested Xen hypervisor +allow dom0_t nestedxen_t:version { xen_version xen_get_features }; + # These permissions allow using the FLASK security server to compute access # checks locally, which could be used by a domain or service (such as xenstore) # that does not have its own security server to make access decisions based on
tools/flask/policy/modules/guest_features.te +3 -2
@@ -21,8 +21,9 @@ if (guest_writeconsole) { # For normal guests, allow all queries except XENVER_commandline. allow domain_type xen_t:version { - xen_extraversion xen_compile_info xen_capabilities - xen_changeset xen_pagesize xen_guest_handle + xen_version xen_extraversion xen_compile_info xen_capabilities + xen_changeset xen_pagesize xen_guest_handle xen_get_features + xen_platform_parameters }; # Version queries don't need auditing when denied. They can be
tools/flask/policy/modules/xen.te +3 -0
@@ -26,6 +26,9 @@ attribute mls_priv; # The hypervisor itself type xen_t, xen_type, mls_priv; +# A nested Xen hypervisor, if any +type nestedxen_t, xen_type; + # Domain 0 declare_singleton_domain(dom0_t, mls_priv);
tools/flask/policy/policy/initial_sids +3 -0
@@ -16,3 +16,6 @@ sid device gen_context(system_u:object_r:device_t,s0) # Initial SIDs used by the toolstack for domains without defined labels sid domU gen_context(system_u:system_r:domU_t,s0) sid domDM gen_context(system_u:system_r:dm_dom_t,s0) + +# Initial SID for nested Xen on Xen +sid nestedxen gen_context(system_u:system_r:nestedxen_t,s0)
xen/arch/x86/guest/xen-nested.c +3 -3
@@ -47,9 +47,9 @@ long do_nested_xen_version(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)if ( !xen_nested )return -ENOSYS ; -/* FIXME: apply XSM check here */ -if ( !is_control_domain (current->domain) ) -return -EPERM ; + ret =xsm_nested_xen_version (XSM_PRIV , current->domain, cmd); +if ( ret ) +return ret;gprintk (XENLOG_DEBUG ,"Nested xen_version: %d.\n" , cmd);
xen/include/xsm/dummy.h +11 -1
@@ -69,7 +69,7 @@ void __xsm_action_mismatch_detected(void);#endif /* CONFIG_XSM */ static always_inline int xsm_default_action( -xsm_default_t action,struct domain *src,struct domain *target) +xsm_default_t action,const struct domain *src,const struct domain *target) {switch ( action ) {case XSM_HOOK :
@@ -739,6 +739,16 @@ static XSM_INLINE int xsm_argo_send(const struct domain *d,#endif /* CONFIG_ARGO */ +#ifdef CONFIG_XEN_NESTED +static XSM_INLINE int xsm_nested_xen_version(XSM_DEFAULT_ARG + const struct domain *d, +unsigned int cmd) +{ +XSM_ASSERT_ACTION (XSM_PRIV ); +return xsm_default_action (action, d,NULL ); +} +#endif +#include <public/version.h> static XSM_INLINE int xsm_xen_version (XSM_DEFAULT_ARG uint32_t op) {
xen/include/xsm/xsm.h +13 -0
@@ -187,6 +187,9 @@ struct xsm_operations {int (*argo_register_any_source) (const struct domain *d);int (*argo_send) (const struct domain *d,const struct domain *t);#endif +#ifdef CONFIG_XEN_NESTED +int (*nested_xen_version) (const struct domain *d,unsigned int cmd); +#endif };#ifdef CONFIG_XSM
@@ -723,6 +726,16 @@ static inline int xsm_argo_send(const struct domain *d, const struct domain *t)#endif /* CONFIG_ARGO */ +#ifdef CONFIG_XEN_NESTED +static inline int xsm_nested_xen_version (xsm_default_t def, +const struct domain *d, +unsigned int cmd) +{ +return xsm_ops->nested_xen_version (d, cmd); +} + +#endif /* CONFIG_XEN_NESTED */ +#endif /* XSM_NO_WRAPPERS */ #ifdef CONFIG_MULTIBOOT
xen/xsm/dummy.c +3 -0
@@ -157,4 +157,7 @@ void __init xsm_fixup_ops (struct xsm_operations *ops)set_to_dummy_if_null (ops, argo_register_any_source);set_to_dummy_if_null (ops, argo_send);#endif +#ifdef CONFIG_XEN_NESTED +set_to_dummy_if_null (ops, nested_xen_version); +#endif }
xen/xsm/flask/hooks.c +35 -14
93 lines not on this page · raw message
xen/xsm/flask/policy/access_vectors +6 -0
@@ -510,6 +510,8 @@ class security # class version { +# Basic information + xen_version # Extra informations (-unstable). xen_extraversion # Compile information of the hypervisor.
@@ -518,6 +520,10 @@ class version xen_capabilities # Source code changeset. xen_changeset +# Hypervisor virt start + xen_platform_parameters +# Query for bitmap of platform features + xen_get_features # Page size the hypervisor uses. xen_pagesize # An value that the control stack can choose.
xen/xsm/flask/policy/initial_sids +1 -0
@@ -15,4 +15,5 @@ sid irq sid device sid domU sid domDM +sid nestedxen # FLASK
Signature · 7 lines
2.17.1 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
RFC 5/9 x86/nested, xsm: add nested_memory_op hypercall
In reply to Christopher ClarkProvides proxying to the host hypervisor for the XENMEM_add_to_physmap op only for the XENMAPSPACE_shared_info and XENMAPSPACE_grant_table spaces, for DOMID_SELF.
Both compat and native entry points.
--- tools/flask/policy/modules/dom0.te | 1 + xen/arch/x86/guest/hypercall_page.S | 1 + xen/arch/x86/guest/xen-nested.c | 80 +++++++++++++++++++++++++++++ xen/arch/x86/hypercall.c | 1 + xen/arch/x86/pv/hypercall.c | 1 + xen/include/public/xen.h | 1 + xen/include/xen/hypercall.h | 10 ++++ xen/include/xsm/dummy.h | 7 +++ xen/include/xsm/xsm.h | 7 +++ xen/xsm/dummy.c | 1 + xen/xsm/flask/hooks.c | 15 ++++++ 11 files changed, 125 insertions(+)
tools/flask/policy/modules/dom0.te +1 -0
@@ -45,6 +45,7 @@ allow dom0_t dom0_t:resource { add remove }; # Allow dom0 to communicate with a nested Xen hypervisor allow dom0_t nestedxen_t:version { xen_version xen_get_features }; +allow dom0_t nestedxen_t:mmu physmap; # These permissions allow using the FLASK security server to compute access # checks locally, which could be used by a domain or service (such as xenstore)
xen/arch/x86/guest/hypercall_page.S +1 -0
@@ -61,6 +61,7 @@ DECLARE_HYPERCALL(kexec_op) DECLARE_HYPERCALL(argo_op) DECLARE_HYPERCALL(xenpmu_op) DECLARE_HYPERCALL(nested_xen_version) +DECLARE_HYPERCALL(nested_memory_op) DECLARE_HYPERCALL(arch_0) DECLARE_HYPERCALL(arch_1)
xen/arch/x86/guest/xen-nested.c +80 -0
94 lines not on this page · raw message
xen/arch/x86/hypercall.c +1 -0
@@ -75,6 +75,7 @@ const hypercall_args_t hypercall_args_table[NR_hypercalls] =#endif #ifdef CONFIG_XEN_NESTED ARGS (nested_xen_version,2 ), +COMP (nested_memory_op,2 ,2 ), #endifARGS (mca,1 ), ARGS(arch_1, 1),
xen/arch/x86/pv/hypercall.c +1 -0
@@ -86,6 +86,7 @@ const hypercall_table_t pv_hypercall_table[] = {#endif #ifdef CONFIG_XEN_NESTED HYPERCALL (nested_xen_version), +COMPAT_CALL (nested_memory_op), #endifHYPERCALL (mca), HYPERCALL(arch_1),
xen/include/public/xen.h +1 -0
@@ -122,6 +122,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_ulong_t);#define __HYPERVISOR_xenpmu_op 40#define __HYPERVISOR_dm_op 41#define __HYPERVISOR_nested_xen_version 42 +#define __HYPERVISOR_nested_memory_op 43/* Architecture-specific hypercall definitions. */ #define __HYPERVISOR_arch_0 48
xen/include/xen/hypercall.h +10 -0
@@ -154,6 +154,10 @@ do_dm_op(extern long do_nested_xen_version (int cmd,XEN_GUEST_HANDLE_PARAM (void ) arg); + +extern long do_nested_memory_op ( +int cmd, +XEN_GUEST_HANDLE_PARAM (void ) arg);#endif #ifdef CONFIG_COMPAT
@@ -222,6 +226,12 @@ compat_dm_op( unsigned int nr_bufs, XEN_GUEST_HANDLE_PARAM(void) bufs); +#ifdef CONFIG_XEN_NESTED +extern int compat_nested_memory_op ( +int cmd, +XEN_GUEST_HANDLE_PARAM (void ) arg); +#endif +#endif void arch_get_xen_caps (xen_capabilities_info_t *info);
xen/include/xsm/dummy.h +7 -0
@@ -747,6 +747,13 @@ static XSM_INLINE int xsm_nested_xen_version(XSM_DEFAULT_ARGXSM_ASSERT_ACTION (XSM_PRIV );return xsm_default_action (action, d,NULL ); } + +static XSM_INLINE int xsm_nested_add_to_physmap(XSM_DEFAULT_ARG + const struct domain *d) +{ +XSM_ASSERT_ACTION (XSM_PRIV ); +return xsm_default_action (action, d,NULL ); +}#endif #include <public/version.h>
xen/include/xsm/xsm.h +7 -0
@@ -189,6 +189,7 @@ struct xsm_operations {#endif #ifdef CONFIG_XEN_NESTED int (*nested_xen_version) (const struct domain *d,unsigned int cmd); +int (*nested_add_to_physmap) (const struct domain *d);#endif };
@@ -734,6 +735,12 @@ static inline int xsm_nested_xen_version(xsm_default_t def,return xsm_ops->nested_xen_version (d, cmd); } +static inline int xsm_nested_add_to_physmap (xsm_default_t def, +const struct domain *d) +{ +return xsm_ops->nested_add_to_physmap (d); +} +#endif /* CONFIG_XEN_NESTED */ #endif /* XSM_NO_WRAPPERS */
xen/xsm/dummy.c +1 -0
@@ -159,5 +159,6 @@ void __init xsm_fixup_ops (struct xsm_operations *ops)#endif #ifdef CONFIG_XEN_NESTED set_to_dummy_if_null (ops, nested_xen_version); +set_to_dummy_if_null (ops, nested_add_to_physmap);#endif }
xen/xsm/flask/hooks.c +15 -0
@@ -1749,6 +1749,20 @@ static int flask_argo_send(const struct domain *d, const struct domain *t)#endif #ifdef CONFIG_XEN_NESTED +static int domain_has_nested_perm (const struct domain *d,u16 class,u32 perm) +{ +struct avc_audit_data ad; + +AVC_AUDIT_DATA_INIT (&ad,NONE ); + +return avc_has_perm (domain_sid (d),SECINITSID_NESTEDXEN , class, perm, &ad); +} + +static int flask_nested_add_to_physmap (const struct domain *d) +{ +return domain_has_nested_perm (d,SECCLASS_MMU ,MMU__PHYSMAP ); +} +static int flask_nested_xen_version (const struct domain *d,unsigned int op) {return domain_has_xen_version (d,SECINITSID_NESTEDXEN , op);
@@ -1897,6 +1911,7 @@ static struct xsm_operations flask_ops = {#endif #ifdef CONFIG_XEN_NESTED .nested_xen_version = flask_nested_xen_version, + .nested_add_to_physmap = flask_nested_add_to_physmap,#endif };
Signature · 7 lines
2.17.1 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
RFC 6/9 x86/nested, xsm: add nested_hvm_op hypercall
In reply to Christopher ClarkProvides proxying to the host hypervisor for HVMOP_get_param and HVMOP_set_param ops.
--- tools/flask/policy/modules/dom0.te | 1 + xen/arch/x86/guest/hypercall_page.S | 1 + xen/arch/x86/guest/xen-nested.c | 42 +++++++++++++++++++++++++++++ xen/arch/x86/hypercall.c | 1 + xen/arch/x86/pv/hypercall.c | 1 + xen/include/public/xen.h | 1 + xen/include/xen/hypercall.h | 4 +++ xen/include/xsm/dummy.h | 7 +++++ xen/include/xsm/xsm.h | 7 +++++ xen/xsm/dummy.c | 1 + xen/xsm/flask/hooks.c | 22 +++++++++++++++ 11 files changed, 88 insertions(+)
tools/flask/policy/modules/dom0.te +1 -0
@@ -46,6 +46,7 @@ allow dom0_t dom0_t:resource { add remove }; # Allow dom0 to communicate with a nested Xen hypervisor allow dom0_t nestedxen_t:version { xen_version xen_get_features }; allow dom0_t nestedxen_t:mmu physmap; +allow dom0_t nestedxen_t:hvm { setparam getparam }; # These permissions allow using the FLASK security server to compute access # checks locally, which could be used by a domain or service (such as xenstore)
xen/arch/x86/guest/hypercall_page.S +1 -0
@@ -62,6 +62,7 @@ DECLARE_HYPERCALL(argo_op) DECLARE_HYPERCALL(xenpmu_op) DECLARE_HYPERCALL(nested_xen_version) DECLARE_HYPERCALL(nested_memory_op) +DECLARE_HYPERCALL(nested_hvm_op) DECLARE_HYPERCALL(arch_0) DECLARE_HYPERCALL(arch_1)
xen/arch/x86/guest/xen-nested.c +42 -0
51 lines not on this page · raw message
xen/arch/x86/hypercall.c +1 -0
@@ -76,6 +76,7 @@ const hypercall_args_t hypercall_args_table[NR_hypercalls] =#ifdef CONFIG_XEN_NESTED ARGS (nested_xen_version,2 ),COMP (nested_memory_op,2 ,2 ), +ARGS (nested_hvm_op,2 ), #endifARGS (mca,1 ), ARGS(arch_1, 1),
xen/arch/x86/pv/hypercall.c +1 -0
@@ -87,6 +87,7 @@ const hypercall_table_t pv_hypercall_table[] = {#ifdef CONFIG_XEN_NESTED HYPERCALL (nested_xen_version),COMPAT_CALL (nested_memory_op), +HYPERCALL (nested_hvm_op), #endifHYPERCALL (mca), HYPERCALL(arch_1),
xen/include/public/xen.h +1 -0
@@ -123,6 +123,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_ulong_t);#define __HYPERVISOR_dm_op 41#define __HYPERVISOR_nested_xen_version 42#define __HYPERVISOR_nested_memory_op 43 +#define __HYPERVISOR_nested_hvm_op 44/* Architecture-specific hypercall definitions. */ #define __HYPERVISOR_arch_0 48
xen/include/xen/hypercall.h +4 -0
@@ -158,6 +158,10 @@ extern long do_nested_xen_version(extern long do_nested_memory_op (int cmd,XEN_GUEST_HANDLE_PARAM (void ) arg); + +extern long do_nested_hvm_op ( +int cmd, +XEN_GUEST_HANDLE_PARAM (void ) arg);#endif #ifdef CONFIG_COMPAT
xen/include/xsm/dummy.h +7 -0
@@ -754,6 +754,13 @@ static XSM_INLINE int xsm_nested_add_to_physmap(XSM_DEFAULT_ARGXSM_ASSERT_ACTION (XSM_PRIV );return xsm_default_action (action, d,NULL ); } + +static XSM_INLINE int xsm_nested_hvm_op(XSM_DEFAULT_ARG const struct domain *d, +unsigned int cmd) +{ +XSM_ASSERT_ACTION (XSM_PRIV ); +return xsm_default_action (action, d,NULL ); +}#endif #include <public/version.h>
xen/include/xsm/xsm.h +7 -0
@@ -190,6 +190,7 @@ struct xsm_operations {#ifdef CONFIG_XEN_NESTED int (*nested_xen_version) (const struct domain *d,unsigned int cmd);int (*nested_add_to_physmap) (const struct domain *d); +int (*nested_hvm_op) (const struct domain *d,unsigned int cmd);#endif };
@@ -741,6 +742,12 @@ static inline int xsm_nested_add_to_physmap(xsm_default_t def,return xsm_ops->nested_add_to_physmap (d); } +static inline int xsm_nested_hvm_op (xsm_default_t def,const struct domain *d, +unsigned int cmd) +{ +return xsm_ops->nested_hvm_op (d, cmd); +} +#endif /* CONFIG_XEN_NESTED */ #endif /* XSM_NO_WRAPPERS */
xen/xsm/dummy.c +1 -0
@@ -160,5 +160,6 @@ void __init xsm_fixup_ops (struct xsm_operations *ops)#ifdef CONFIG_XEN_NESTED set_to_dummy_if_null (ops, nested_xen_version);set_to_dummy_if_null (ops, nested_add_to_physmap); +set_to_dummy_if_null (ops, nested_hvm_op);#endif }
xen/xsm/flask/hooks.c +22 -0
@@ -1768,6 +1768,27 @@ static int flask_nested_xen_version(const struct domain *d, unsigned int op) return domain_has_xen_version(d, SECINITSID_NESTEDXEN, op); } +static int flask_nested_hvm_op (const struct domain *d,unsigned int op) +{ +u32 perm; + +switch ( op ) + { +case HVMOP_set_param: + perm =HVM__SETPARAM ; +break ; + +case HVMOP_get_param: + perm =HVM__GETPARAM ; +break ; + +default : + perm =HVM__HVMCTL ; + } + +return domain_has_nested_perm (d,SECCLASS_HVM , perm); +} +#endif long do_flask_op (XEN_GUEST_HANDLE_PARAM (xsm_op_t) u_flask_op);
@@ -1912,6 +1933,7 @@ static struct xsm_operations flask_ops = {#ifdef CONFIG_XEN_NESTED .nested_xen_version = flask_nested_xen_version, .nested_add_to_physmap = flask_nested_add_to_physmap, + .nested_hvm_op = flask_nested_hvm_op,#endif };
Signature · 7 lines
2.17.1 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
RFC 7/9 x86/nested, xsm: add nested_grant_table_op hypercall
In reply to Christopher ClarkProvides proxying to the host hypervisor for the GNTTABOP_query_size op.
--- tools/flask/policy/modules/dom0.te | 1 + xen/arch/x86/guest/hypercall_page.S | 1 + xen/arch/x86/guest/xen-nested.c | 37 +++++++++++++++++++++++++++++ xen/arch/x86/hypercall.c | 1 + xen/arch/x86/pv/hypercall.c | 1 + xen/include/public/xen.h | 1 + xen/include/xen/hypercall.h | 5 ++++ xen/include/xsm/dummy.h | 7 ++++++ xen/include/xsm/xsm.h | 7 ++++++ xen/xsm/dummy.c | 1 + xen/xsm/flask/hooks.c | 6 +++++ 11 files changed, 68 insertions(+)
tools/flask/policy/modules/dom0.te +1 -0
@@ -47,6 +47,7 @@ allow dom0_t dom0_t:resource { add remove }; allow dom0_t nestedxen_t:version { xen_version xen_get_features }; allow dom0_t nestedxen_t:mmu physmap; allow dom0_t nestedxen_t:hvm { setparam getparam }; +allow dom0_t nestedxen_t:grant query; # These permissions allow using the FLASK security server to compute access # checks locally, which could be used by a domain or service (such as xenstore)
xen/arch/x86/guest/hypercall_page.S +1 -0
@@ -63,6 +63,7 @@ DECLARE_HYPERCALL(xenpmu_op) DECLARE_HYPERCALL(nested_xen_version) DECLARE_HYPERCALL(nested_memory_op) DECLARE_HYPERCALL(nested_hvm_op) +DECLARE_HYPERCALL(nested_grant_table_op) DECLARE_HYPERCALL(arch_0) DECLARE_HYPERCALL(arch_1)
xen/arch/x86/guest/xen-nested.c +37 -0
@@ -22,6 +22,7 @@#include <xen/lib.h> #include <xen/sched.h> +#include <public/grant_table.h> #include <public/hvm/hvm_op.h> #include <public/memory.h> #include <public/version.h>
@@ -202,3 +203,39 @@ long do_nested_hvm_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)return -EOPNOTSUPP ; } } + +long do_nested_grant_table_op (unsigned int cmd, +XEN_GUEST_HANDLE_PARAM (void ) uop, +unsigned int count) +{ +struct gnttab_query_size op; +long ret; + +if ( !xen_nested ) +return -ENOSYS ; + +if ( cmd != GNTTABOP_query_size ) + { +gprintk (XENLOG_ERR ,"Nested grant table op %u not supported.\n" , cmd); +return -EOPNOTSUPP ; + } + +if ( count !=1 ) +return -EINVAL ; + +if (copy_from_guest (&op, uop,1 ) ) +return -EFAULT ; + +if ( op.dom !=DOMID_SELF ) +return -EPERM ; + + ret =xsm_nested_grant_query_size (XSM_PRIV , current->domain); +if ( ret ) +return ret; + + ret =xen_hypercall_grant_table_op (cmd, &op,1 ); +if ( !ret &&__copy_to_guest (uop, &op,1 ) ) +return -EFAULT ; + +return ret; +}
xen/arch/x86/hypercall.c +1 -0
@@ -77,6 +77,7 @@ const hypercall_args_t hypercall_args_table[NR_hypercalls] =ARGS (nested_xen_version,2 ),COMP (nested_memory_op,2 ,2 ),ARGS (nested_hvm_op,2 ), +ARGS (nested_grant_table_op,3 ), #endifARGS (mca,1 ), ARGS(arch_1, 1),
xen/arch/x86/pv/hypercall.c +1 -0
@@ -88,6 +88,7 @@ const hypercall_table_t pv_hypercall_table[] = {HYPERCALL (nested_xen_version),COMPAT_CALL (nested_memory_op),HYPERCALL (nested_hvm_op), +HYPERCALL (nested_grant_table_op), #endifHYPERCALL (mca), HYPERCALL(arch_1),
xen/include/public/xen.h +1 -0
@@ -124,6 +124,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_ulong_t);#define __HYPERVISOR_nested_xen_version 42#define __HYPERVISOR_nested_memory_op 43#define __HYPERVISOR_nested_hvm_op 44 +#define __HYPERVISOR_nested_grant_table_op 45/* Architecture-specific hypercall definitions. */ #define __HYPERVISOR_arch_0 48
xen/include/xen/hypercall.h +5 -0
@@ -162,6 +162,11 @@ extern long do_nested_memory_op(extern long do_nested_hvm_op (int cmd,XEN_GUEST_HANDLE_PARAM (void ) arg); + +extern long do_nested_grant_table_op ( +unsigned int cmd, +XEN_GUEST_HANDLE_PARAM (void ) uop, +unsigned int count);#endif #ifdef CONFIG_COMPAT
xen/include/xsm/dummy.h +7 -0
@@ -761,6 +761,13 @@ static XSM_INLINE int xsm_nested_hvm_op(XSM_DEFAULT_ARG const struct domain *d,XSM_ASSERT_ACTION (XSM_PRIV );return xsm_default_action (action, d,NULL ); } + +static XSM_INLINE int xsm_nested_grant_query_size(XSM_DEFAULT_ARG + const struct domain *d) +{ +XSM_ASSERT_ACTION (XSM_PRIV ); +return xsm_default_action (action, d,NULL ); +}#endif #include <public/version.h>
xen/include/xsm/xsm.h +7 -0
@@ -191,6 +191,7 @@ struct xsm_operations {int (*nested_xen_version) (const struct domain *d,unsigned int cmd);int (*nested_add_to_physmap) (const struct domain *d);int (*nested_hvm_op) (const struct domain *d,unsigned int cmd); +int (*nested_grant_query_size) (const struct domain *d);#endif };
@@ -748,6 +749,12 @@ static inline int xsm_nested_hvm_op(xsm_default_t def, const struct domain *d,return xsm_ops->nested_hvm_op (d, cmd); } +static inline int xsm_nested_grant_query_size (xsm_default_t def, +const struct domain *d) +{ +return xsm_ops->nested_grant_query_size (d); +} +#endif /* CONFIG_XEN_NESTED */ #endif /* XSM_NO_WRAPPERS */
xen/xsm/dummy.c +1 -0
@@ -161,5 +161,6 @@ void __init xsm_fixup_ops (struct xsm_operations *ops)set_to_dummy_if_null (ops, nested_xen_version);set_to_dummy_if_null (ops, nested_add_to_physmap);set_to_dummy_if_null (ops, nested_hvm_op); +set_to_dummy_if_null (ops, nested_grant_query_size);#endif }
xen/xsm/flask/hooks.c +6 -0
@@ -1789,6 +1789,11 @@ static int flask_nested_hvm_op(const struct domain *d, unsigned int op) return domain_has_nested_perm(d, SECCLASS_HVM, perm); } +static int flask_nested_grant_query_size (const struct domain *d) +{ +return domain_has_nested_perm (d,SECCLASS_GRANT ,GRANT__QUERY ); +} +#endif long do_flask_op (XEN_GUEST_HANDLE_PARAM (xsm_op_t) u_flask_op);
@@ -1934,6 +1939,7 @@ static struct xsm_operations flask_ops = { .nested_xen_version = flask_nested_xen_version, .nested_add_to_physmap = flask_nested_add_to_physmap, .nested_hvm_op = flask_nested_hvm_op, + .nested_grant_query_size = flask_nested_grant_query_size,#endif };
Signature · 7 lines
2.17.1 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
RFC 8/9 x86/nested, xsm: add nested_event_channel_op hypercall
In reply to Christopher ClarkProvides proxying to the host hypervisor for these event channel ops:
* EVTCHNOP_alloc_unbound
* EVTCHNOP_bind_vcpu
* EVTCHNOP_close
* EVTCHNOP_send
* EVTCHNOP_unmask
Introduces a new XSM access vector class for policy control applied to this
operation: nested_event.
This is required because the existing 'event' access vector is unsuitable for repurposing to the nested case: it operates on per-channel security identifiers that are generated from a combination of the security identifiers of the two communicating endpoints and data is not available for the remote endpoint in the nested case.
--- tools/flask/policy/modules/dom0.te | 3 + xen/arch/x86/guest/hypercall_page.S | 1 + xen/arch/x86/guest/xen-nested.c | 84 +++++++++++++++++++++++++++ xen/arch/x86/hypercall.c | 1 + xen/arch/x86/pv/hypercall.c | 1 + xen/include/public/xen.h | 1 + xen/include/xen/hypercall.h | 4 ++ xen/include/xsm/dummy.h | 8 +++ xen/include/xsm/xsm.h | 8 +++ xen/xsm/dummy.c | 1 + xen/xsm/flask/hooks.c | 35 +++++++++++ xen/xsm/flask/policy/access_vectors | 20 +++++++ xen/xsm/flask/policy/security_classes | 1 + 13 files changed, 168 insertions(+)
tools/flask/policy/modules/dom0.te +3 -0
@@ -48,6 +48,9 @@ allow dom0_t nestedxen_t:version { xen_version xen_get_features }; allow dom0_t nestedxen_t:mmu physmap; allow dom0_t nestedxen_t:hvm { setparam getparam }; allow dom0_t nestedxen_t:grant query; +allow dom0_t nestedxen_t:nested_event { + alloc_unbound bind_vcpu close send unmask +}; # These permissions allow using the FLASK security server to compute access # checks locally, which could be used by a domain or service (such as xenstore)
xen/arch/x86/guest/hypercall_page.S +1 -0
@@ -64,6 +64,7 @@ DECLARE_HYPERCALL(nested_xen_version) DECLARE_HYPERCALL(nested_memory_op) DECLARE_HYPERCALL(nested_hvm_op) DECLARE_HYPERCALL(nested_grant_table_op) +DECLARE_HYPERCALL(nested_event_channel_op) DECLARE_HYPERCALL(arch_0) DECLARE_HYPERCALL(arch_1)
xen/arch/x86/guest/xen-nested.c +84 -0
93 lines not on this page · raw message
xen/arch/x86/hypercall.c +1 -0
@@ -78,6 +78,7 @@ const hypercall_args_t hypercall_args_table[NR_hypercalls] =COMP (nested_memory_op,2 ,2 ),ARGS (nested_hvm_op,2 ),ARGS (nested_grant_table_op,3 ), +ARGS (nested_event_channel_op,2 ), #endifARGS (mca,1 ), ARGS(arch_1, 1),
xen/arch/x86/pv/hypercall.c +1 -0
@@ -89,6 +89,7 @@ const hypercall_table_t pv_hypercall_table[] = {COMPAT_CALL (nested_memory_op),HYPERCALL (nested_hvm_op),HYPERCALL (nested_grant_table_op), +HYPERCALL (nested_event_channel_op), #endifHYPERCALL (mca), HYPERCALL(arch_1),
xen/include/public/xen.h +1 -0
@@ -125,6 +125,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_ulong_t);#define __HYPERVISOR_nested_memory_op 43#define __HYPERVISOR_nested_hvm_op 44#define __HYPERVISOR_nested_grant_table_op 45 +#define __HYPERVISOR_nested_event_channel_op 46/* Architecture-specific hypercall definitions. */ #define __HYPERVISOR_arch_0 48
xen/include/xen/hypercall.h +4 -0
@@ -167,6 +167,10 @@ extern long do_nested_grant_table_op( unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) uop, unsigned int count); + +extern long do_nested_event_channel_op ( +int cmd, +XEN_GUEST_HANDLE_PARAM (void ) arg);#endif #ifdef CONFIG_COMPAT
xen/include/xsm/dummy.h +8 -0
@@ -768,6 +768,14 @@ static XSM_INLINE int xsm_nested_grant_query_size(XSM_DEFAULT_ARGXSM_ASSERT_ACTION (XSM_PRIV );return xsm_default_action (action, d,NULL ); } + +static XSM_INLINE int xsm_nested_event_channel_op(XSM_DEFAULT_ARG + const struct domain *d, +unsigned int cmd) +{ +XSM_ASSERT_ACTION (XSM_PRIV ); +return xsm_default_action (action, d,NULL ); +}#endif #include <public/version.h>
xen/include/xsm/xsm.h +8 -0
@@ -192,6 +192,7 @@ struct xsm_operations {int (*nested_add_to_physmap) (const struct domain *d);int (*nested_hvm_op) (const struct domain *d,unsigned int cmd);int (*nested_grant_query_size) (const struct domain *d); +int (*nested_event_channel_op) (const struct domain *d,unsigned int cmd);#endif };
@@ -755,6 +756,13 @@ static inline int xsm_nested_grant_query_size(xsm_default_t def,return xsm_ops->nested_grant_query_size (d); } +static inline int xsm_nested_event_channel_op (xsm_default_t def, +const struct domain *d, +unsigned int cmd) +{ +return xsm_ops->nested_event_channel_op (d, cmd); +} +#endif /* CONFIG_XEN_NESTED */ #endif /* XSM_NO_WRAPPERS */
xen/xsm/dummy.c +1 -0
@@ -162,5 +162,6 @@ void __init xsm_fixup_ops (struct xsm_operations *ops)set_to_dummy_if_null (ops, nested_add_to_physmap);set_to_dummy_if_null (ops, nested_hvm_op);set_to_dummy_if_null (ops, nested_grant_query_size); +set_to_dummy_if_null (ops, nested_event_channel_op);#endif }
xen/xsm/flask/hooks.c +35 -0
@@ -1794,6 +1794,40 @@ static int flask_nested_grant_query_size(const struct domain *d) return domain_has_nested_perm(d, SECCLASS_GRANT, GRANT__QUERY); } +static int flask_nested_event_channel_op (const struct domain *d, +unsigned int op) +{ +u32 perm; + +switch ( op ) + { +case EVTCHNOP_alloc_unbound: + perm =NESTED_EVENT__ALLOC_UNBOUND ; +break ; + +case EVTCHNOP_bind_vcpu: + perm =NESTED_EVENT__BIND_VCPU ; +break ; + +case EVTCHNOP_close: + perm =NESTED_EVENT__CLOSE ; +break ; + +case EVTCHNOP_send: + perm =NESTED_EVENT__SEND ; +break ; + +case EVTCHNOP_unmask: + perm =NESTED_EVENT__UNMASK ; +break ; + +default : +return avc_unknown_permission ("nested event channel op" , op); + } + +return domain_has_nested_perm (d,SECCLASS_NESTED_EVENT , perm); +} +#endif long do_flask_op (XEN_GUEST_HANDLE_PARAM (xsm_op_t) u_flask_op);
@@ -1940,6 +1974,7 @@ static struct xsm_operations flask_ops = { .nested_add_to_physmap = flask_nested_add_to_physmap, .nested_hvm_op = flask_nested_hvm_op, .nested_grant_query_size = flask_nested_grant_query_size, + .nested_event_channel_op = flask_nested_event_channel_op,#endif };
xen/xsm/flask/policy/access_vectors +20 -0
@@ -316,6 +316,26 @@ class event reset } +# Class nested_event describes event channels to the host hypervisor +# in a nested Xen-on-Xen system. Policy controls for these differ +# from the interdomain event channels between guest VMs: +# the guest hypervisor does not maintain security identifier information about +# the remote event endpoint managed by the host hypervisor, so nested_event +# channels do not have their own security label derived from a type transition. +class nested_event +{ + # nested_event_channel_op: EVTCHNOP_alloc_unbound + alloc_unbound + # nested_event_channel_op: EVTCHNOP_bind_vcpu + bind_vcpu + # nested_event_channel_op: EVTCHNOP_close + close + # nested_event_channel_op: EVTCHNOP_send + send + # nested_event_channel_op: EVTCHNOP_unmask + unmask +} + # Class grant describes pages shared by grant mappings. Pages use the security # label of their owning domain. class grant
xen/xsm/flask/policy/security_classes +1 -0
@@ -20,5 +20,6 @@ class grant class security class version class argo +class nested_event # FLASK
Signature · 7 lines
2.17.1 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
RFC 9/9 x86/nested, xsm: add nested_schedop_shutdown hypercall
In reply to Christopher ClarkProvides proxying to the host hypervisor for SCHEDOP_shutdown op.
--- tools/flask/policy/modules/dom0.te | 1 + xen/arch/x86/guest/hypercall_page.S | 1 + xen/arch/x86/guest/xen-nested.c | 25 +++++++++++++++++++++++++ xen/arch/x86/hypercall.c | 1 + xen/arch/x86/pv/hypercall.c | 1 + xen/include/public/xen.h | 1 + xen/include/xen/hypercall.h | 4 ++++ xen/include/xsm/dummy.h | 7 +++++++ xen/include/xsm/xsm.h | 7 +++++++ xen/xsm/dummy.c | 1 + xen/xsm/flask/hooks.c | 6 ++++++ 11 files changed, 55 insertions(+)
tools/flask/policy/modules/dom0.te +1 -0
@@ -51,6 +51,7 @@ allow dom0_t nestedxen_t:grant query; allow dom0_t nestedxen_t:nested_event { alloc_unbound bind_vcpu close send unmask }; +allow dom0_t nestedxen_t:domain { shutdown }; # These permissions allow using the FLASK security server to compute access # checks locally, which could be used by a domain or service (such as xenstore)
xen/arch/x86/guest/hypercall_page.S +1 -0
@@ -65,6 +65,7 @@ DECLARE_HYPERCALL(nested_memory_op) DECLARE_HYPERCALL(nested_hvm_op) DECLARE_HYPERCALL(nested_grant_table_op) DECLARE_HYPERCALL(nested_event_channel_op) +DECLARE_HYPERCALL(nested_sched_op) DECLARE_HYPERCALL(arch_0) DECLARE_HYPERCALL(arch_1)
xen/arch/x86/guest/xen-nested.c +25 -0
@@ -26,6 +26,7 @@#include <public/grant_table.h> #include <public/hvm/hvm_op.h> #include <public/memory.h> +#include <public/sched.h> #include <public/version.h> #include <public/xen.h>
@@ -323,3 +324,27 @@ long do_nested_event_channel_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)return ret; } + +long do_nested_sched_op (int cmd,XEN_GUEST_HANDLE_PARAM (void ) arg) +{ +struct sched_shutdown sched_shutdown; +long ret; + +if ( !xen_nested ) +return -ENOSYS ; + +if ( cmd != SCHEDOP_shutdown ) + { +gprintk (XENLOG_ERR ,"Nested: sched op %d not supported.\n" , cmd); +return -EOPNOTSUPP ; + } + + ret =xsm_nested_schedop_shutdown (XSM_PRIV , current->domain); +if ( ret ) +return ret; + +if (copy_from_guest (&sched_shutdown, arg,1 ) ) +return -EFAULT ; + +return xen_hypercall_sched_op (cmd, &sched_shutdown); +}
xen/arch/x86/hypercall.c +1 -0
@@ -79,6 +79,7 @@ const hypercall_args_t hypercall_args_table[NR_hypercalls] =ARGS (nested_hvm_op,2 ),ARGS (nested_grant_table_op,3 ),ARGS (nested_event_channel_op,2 ), +ARGS (nested_sched_op,2 ), #endifARGS (mca,1 ), ARGS(arch_1, 1),
xen/arch/x86/pv/hypercall.c +1 -0
@@ -90,6 +90,7 @@ const hypercall_table_t pv_hypercall_table[] = {HYPERCALL (nested_hvm_op),HYPERCALL (nested_grant_table_op),HYPERCALL (nested_event_channel_op), +HYPERCALL (nested_sched_op), #endifHYPERCALL (mca), HYPERCALL(arch_1),
xen/include/public/xen.h +1 -0
@@ -126,6 +126,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_ulong_t);#define __HYPERVISOR_nested_hvm_op 44#define __HYPERVISOR_nested_grant_table_op 45#define __HYPERVISOR_nested_event_channel_op 46 +#define __HYPERVISOR_nested_sched_op 47/* Architecture-specific hypercall definitions. */ #define __HYPERVISOR_arch_0 48
xen/include/xen/hypercall.h +4 -0
@@ -171,6 +171,10 @@ extern long do_nested_grant_table_op(extern long do_nested_event_channel_op (int cmd,XEN_GUEST_HANDLE_PARAM (void ) arg); + +extern long do_nested_sched_op ( +int cmd, +XEN_GUEST_HANDLE_PARAM (void ) arg);#endif #ifdef CONFIG_COMPAT
xen/include/xsm/dummy.h +7 -0
@@ -776,6 +776,13 @@ static XSM_INLINE int xsm_nested_event_channel_op(XSM_DEFAULT_ARGXSM_ASSERT_ACTION (XSM_PRIV );return xsm_default_action (action, d,NULL ); } + +static XSM_INLINE int xsm_nested_schedop_shutdown(XSM_DEFAULT_ARG + const struct domain *d) +{ +XSM_ASSERT_ACTION (XSM_PRIV ); +return xsm_default_action (action, d,NULL ); +}#endif #include <public/version.h>
xen/include/xsm/xsm.h +7 -0
@@ -193,6 +193,7 @@ struct xsm_operations {int (*nested_hvm_op) (const struct domain *d,unsigned int cmd);int (*nested_grant_query_size) (const struct domain *d);int (*nested_event_channel_op) (const struct domain *d,unsigned int cmd); +int (*nested_schedop_shutdown) (const struct domain *d);#endif };
@@ -763,6 +764,12 @@ static inline int xsm_nested_event_channel_op(xsm_default_t def,return xsm_ops->nested_event_channel_op (d, cmd); } +static inline int xsm_nested_schedop_shutdown (xsm_default_t def, +const struct domain *d) +{ +return xsm_ops->nested_schedop_shutdown (d); +} +#endif /* CONFIG_XEN_NESTED */ #endif /* XSM_NO_WRAPPERS */
xen/xsm/dummy.c +1 -0
@@ -163,5 +163,6 @@ void __init xsm_fixup_ops (struct xsm_operations *ops)set_to_dummy_if_null (ops, nested_hvm_op);set_to_dummy_if_null (ops, nested_grant_query_size);set_to_dummy_if_null (ops, nested_event_channel_op); +set_to_dummy_if_null (ops, nested_schedop_shutdown);#endif }
xen/xsm/flask/hooks.c +6 -0
@@ -1828,6 +1828,11 @@ static int flask_nested_event_channel_op(const struct domain *d, return domain_has_nested_perm(d, SECCLASS_NESTED_EVENT, perm); } +static int flask_nested_schedop_shutdown (const struct domain *d) +{ +return domain_has_nested_perm (d,SECCLASS_DOMAIN ,DOMAIN__SHUTDOWN ); +} +#endif long do_flask_op (XEN_GUEST_HANDLE_PARAM (xsm_op_t) u_flask_op);
@@ -1975,6 +1980,7 @@ static struct xsm_operations flask_ops = { .nested_hvm_op = flask_nested_hvm_op, .nested_grant_query_size = flask_nested_grant_query_size, .nested_event_channel_op = flask_nested_event_channel_op, + .nested_schedop_shutdown = flask_nested_schedop_shutdown,#endif };
Signature · 7 lines
2.17.1 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 71 lines · Christopher Clark
This RFC patch series adds a new hypervisor interface to support running a set of PV front end device drivers within dom0 of a guest Xen running on Xen.
A practical deployment scenario is a system running PV guest VMs that use unmodified Xen PV device drivers, on a guest Xen hypervisor with a dom0 using PV drivers itself, all within a HVM guest of a hosting Xen hypervisor (eg. from a cloud provider). Multiple PV guest VMs can reside within a single cloud instance; guests can be live-migrated between cloud instances that run nested Xen, and virtual machine introspection of guests can be performed without requiring cloud provider support.
The name "The Xen Blanket" was given by researchers from IBM and Cornell when the original work was published at the ACM Eurosys 2012 conference.
http://www1.unine.ch/eurosys2012/program/conference.html https://dl.acm.org/citation.cfm?doid=2168836.2168849This patch series is a reimplementation of this architecture on modern Xen by Star Lab.
A patch to the Linux kernel to add device drivers using this blanket interface is at:
https://github.com/starlab-io/xenblanket-linux
(This is an example, enabling operation and testing of a Xen Blanket nested system. Further work would be necessary for Linux upstreaming.) Relevant other current Linux work is occurring here:https://lkml.org/lkml/2019/4/8/67 https://lists.xenproject.org/archives/html/xen-devel/2019-05/msg00743.htmlthanks,
Christopher
Christopher Clark (9):
x86/guest: code movement to separate Xen detection from guest
functions
x86: Introduce Xen detection as separate logic from Xen Guest support. x86/nested: addnested_xen_versionhypercall
XSM: Add hook for nested xen version op; revises non-nested version op x86/nested, xsm: addnested_memory_ophypercall x86/nested, xsm: addnested_hvm_ophypercall
x86/nested, xsm: addnested_grant_table_ophypercall x86/nested, xsm: addnested_event_channel_ophypercall x86/nested, xsm: addnested_schedop_shutdownhypercalltools/flask/policy/modules/dom0.te | 14 +- tools/flask/policy/modules/guest_features.te | 5 +- tools/flask/policy/modules/xen.te | 3 + tools/flask/policy/policy/initial_sids | 3 + xen/arch/x86/Kconfig | 33 +- xen/arch/x86/Makefile | 2 +- xen/arch/x86/apic.c | 4 +- xen/arch/x86/guest/Makefile | 4 + xen/arch/x86/guest/hypercall_page.S | 6 + xen/arch/x86/guest/xen-guest.c | 311 ++++++++++++++++ xen/arch/x86/guest/xen-nested.c | 350 +++++++++++++++++++ xen/arch/x86/guest/xen.c | 264 +------------- xen/arch/x86/hypercall.c | 8 + xen/arch/x86/pv/hypercall.c | 8 + xen/arch/x86/setup.c | 3 + xen/include/asm-x86/guest/hypercall.h | 7 +- xen/include/asm-x86/guest/xen.h | 36 +- xen/include/public/xen.h | 6 + xen/include/xen/hypercall.h | 33 ++ xen/include/xsm/dummy.h | 48 ++- xen/include/xsm/xsm.h | 49 +++ xen/xsm/dummy.c | 8 + xen/xsm/flask/hooks.c | 133 ++++++- xen/xsm/flask/policy/access_vectors | 26 ++ xen/xsm/flask/policy/initial_sids | 1 + xen/xsm/flask/policy/security_classes | 1 + 26 files changed, 1086 insertions(+), 280 deletions(-)
Quoted 3 lines
create mode 100644
xen/arch/x86/guest/xen-guest.ccreate mode 100644xen/arch/x86/guest/xen-nested.c
I think we should discuss that topic at the Xen developer summit in Chicago. Suddenly there seems to be a rush in nested Xen development and related areas, so syncing the efforts seems to be a good idea.
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 88 lines
-----Original Message-----
From: Xen-devel <[email protected]> On Behalf Of Juergen Gross
Sent: 20 June 2019 05:18
To: Christopher Clark <[email protected]>; [email protected]
Cc: Stefano Stabellini <[email protected]>; Wei Liu <[email protected]>; Konrad Rzeszutek Wilk <[email protected]>; George Dunlap <[email protected]>; Andrew Cooper <[email protected]>; Ian Jackson <[email protected]>; Rich Persaud <[email protected]>; Ankur Arora <[email protected]>; Tim (Xen.org) <[email protected]>; Julien Grall <[email protected]>; Jan Beulich <[email protected]>; Daniel De Graaf <[email protected]>; Christopher Clark <[email protected]>; Roger Pau Monne <[email protected]>
Subject: Re: [Xen-devel] [RFC 0/9] The Xen Blanket: hypervisor interface for PV drivers on nested XenQuoted 71 lines · Christopher Clark
This RFC patch series adds a new hypervisor interface to support running a set of PV front end device drivers within dom0 of a guest Xen running on Xen.
A practical deployment scenario is a system running PV guest VMs that use unmodified Xen PV device drivers, on a guest Xen hypervisor with a dom0 using PV drivers itself, all within a HVM guest of a hosting Xen hypervisor (eg. from a cloud provider). Multiple PV guest VMs can reside within a single cloud instance; guests can be live-migrated between cloud instances that run nested Xen, and virtual machine introspection of guests can be performed without requiring cloud provider support.
The name "The Xen Blanket" was given by researchers from IBM and Cornell when the original work was published at the ACM Eurosys 2012 conference.
http://www1.unine.ch/eurosys2012/program/conference.html https://dl.acm.org/citation.cfm?doid=2168836.2168849This patch series is a reimplementation of this architecture on modern Xen by Star Lab.
A patch to the Linux kernel to add device drivers using this blanket interface is at:
https://github.com/starlab-io/xenblanket-linux
(This is an example, enabling operation and testing of a Xen Blanket nested system. Further work would be necessary for Linux upstreaming.) Relevant other current Linux work is occurring here:https://lkml.org/lkml/2019/4/8/67 https://lists.xenproject.org/archives/html/xen-devel/2019-05/msg00743.htmlthanks,
Christopher
Christopher Clark (9):
x86/guest: code movement to separate Xen detection from guest
functions
x86: Introduce Xen detection as separate logic from Xen Guest support. x86/nested: addnested_xen_versionhypercall
XSM: Add hook for nested xen version op; revises non-nested version op x86/nested, xsm: addnested_memory_ophypercall x86/nested, xsm: addnested_hvm_ophypercall
x86/nested, xsm: addnested_grant_table_ophypercall x86/nested, xsm: addnested_event_channel_ophypercall x86/nested, xsm: addnested_schedop_shutdownhypercalltools/flask/policy/modules/dom0.te | 14 +- tools/flask/policy/modules/guest_features.te | 5 +- tools/flask/policy/modules/xen.te | 3 + tools/flask/policy/policy/initial_sids | 3 + xen/arch/x86/Kconfig | 33 +- xen/arch/x86/Makefile | 2 +- xen/arch/x86/apic.c | 4 +- xen/arch/x86/guest/Makefile | 4 + xen/arch/x86/guest/hypercall_page.S | 6 + xen/arch/x86/guest/xen-guest.c | 311 ++++++++++++++++ xen/arch/x86/guest/xen-nested.c | 350 +++++++++++++++++++ xen/arch/x86/guest/xen.c | 264 +------------- xen/arch/x86/hypercall.c | 8 + xen/arch/x86/pv/hypercall.c | 8 + xen/arch/x86/setup.c | 3 + xen/include/asm-x86/guest/hypercall.h | 7 +- xen/include/asm-x86/guest/xen.h | 36 +- xen/include/public/xen.h | 6 + xen/include/xen/hypercall.h | 33 ++ xen/include/xsm/dummy.h | 48 ++- xen/include/xsm/xsm.h | 49 +++ xen/xsm/dummy.c | 8 + xen/xsm/flask/hooks.c | 133 ++++++- xen/xsm/flask/policy/access_vectors | 26 ++ xen/xsm/flask/policy/initial_sids | 1 + xen/xsm/flask/policy/security_classes | 1 + 26 files changed, 1086 insertions(+), 280 deletions(-)Quoted 3 lines
create mode 100644
xen/arch/x86/guest/xen-guest.ccreate mode 100644xen/arch/x86/guest/xen-nested.c
Quoted 4 lines
I think we should discuss that topic at the Xen developer summit in Chicago. Suddenly there seems to be a rush in nested Xen development and related areas, so syncing the efforts seems to be a good idea.
+1 from me on that...
Paul
Quoted 7 lines
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 89 lines · Paul Durrant
Quoted 89 lines
-----Original Message-----
From: Xen-devel <[email protected]> On Behalf Of Juergen Gross
Sent: 20 June 2019 05:18
To: Christopher Clark <[email protected]>; [email protected]
Cc: Stefano Stabellini <[email protected]>; Wei Liu <[email protected]>; Konrad Rzeszutek Wilk <[email protected]>; George Dunlap <[email protected]>; Andrew Cooper <[email protected]>; Ian Jackson <[email protected]>; Rich Persaud <[email protected]>; Ankur Arora <[email protected]>; Tim (Xen.org) <[email protected]>; Julien Grall <[email protected]>; Jan Beulich <[email protected]>; Daniel De Graaf <[email protected]>; Christopher Clark <[email protected]>; Roger Pau Monne <[email protected]>
Subject: Re: [Xen-devel] [RFC 0/9] The Xen Blanket: hypervisor interface for PV drivers on nested XenQuoted 74 lines · Christopher Clark
This RFC patch series adds a new hypervisor interface to support running a set of PV front end device drivers within dom0 of a guest Xen running on Xen.
A practical deployment scenario is a system running PV guest VMs that use unmodified Xen PV device drivers, on a guest Xen hypervisor with a dom0 using PV drivers itself, all within a HVM guest of a hosting Xen hypervisor (eg. from a cloud provider). Multiple PV guest VMs can reside within a single cloud instance; guests can be live-migrated between cloud instances that run nested Xen, and virtual machine introspection of guests can be performed without requiring cloud provider support.
The name "The Xen Blanket" was given by researchers from IBM and Cornell when the original work was published at the ACM Eurosys 2012 conference.
http://www1.unine.ch/eurosys2012/program/conference.html https://dl.acm.org/citation.cfm?doid=2168836.2168849This patch series is a reimplementation of this architecture on modern Xen by Star Lab.
A patch to the Linux kernel to add device drivers using this blanket interface is at:
https://github.com/starlab-io/xenblanket-linux
(This is an example, enabling operation and testing of a Xen Blanket nested system. Further work would be necessary for Linux upstreaming.) Relevant other current Linux work is occurring here:https://lkml.org/lkml/2019/4/8/67 https://lists.xenproject.org/archives/html/xen-devel/2019-05/msg00743.htmlthanks,
Christopher
Christopher Clark (9):
x86/guest: code movement to separate Xen detection from guest
functions
x86: Introduce Xen detection as separate logic from Xen Guest support. x86/nested: addnested_xen_versionhypercall
XSM: Add hook for nested xen version op; revises non-nested version op x86/nested, xsm: addnested_memory_ophypercall x86/nested, xsm: addnested_hvm_ophypercall
x86/nested, xsm: addnested_grant_table_ophypercall x86/nested, xsm: addnested_event_channel_ophypercall x86/nested, xsm: addnested_schedop_shutdownhypercalltools/flask/policy/modules/dom0.te | 14 +- tools/flask/policy/modules/guest_features.te | 5 +- tools/flask/policy/modules/xen.te | 3 + tools/flask/policy/policy/initial_sids | 3 + xen/arch/x86/Kconfig | 33 +- xen/arch/x86/Makefile | 2 +- xen/arch/x86/apic.c | 4 +- xen/arch/x86/guest/Makefile | 4 + xen/arch/x86/guest/hypercall_page.S | 6 + xen/arch/x86/guest/xen-guest.c | 311 ++++++++++++++++ xen/arch/x86/guest/xen-nested.c | 350 +++++++++++++++++++ xen/arch/x86/guest/xen.c | 264 +------------- xen/arch/x86/hypercall.c | 8 + xen/arch/x86/pv/hypercall.c | 8 + xen/arch/x86/setup.c | 3 + xen/include/asm-x86/guest/hypercall.h | 7 +- xen/include/asm-x86/guest/xen.h | 36 +- xen/include/public/xen.h | 6 + xen/include/xen/hypercall.h | 33 ++ xen/include/xsm/dummy.h | 48 ++- xen/include/xsm/xsm.h | 49 +++ xen/xsm/dummy.c | 8 + xen/xsm/flask/hooks.c | 133 ++++++- xen/xsm/flask/policy/access_vectors | 26 ++ xen/xsm/flask/policy/initial_sids | 1 + xen/xsm/flask/policy/security_classes | 1 + 26 files changed, 1086 insertions(+), 280 deletions(-)create mode 100644
xen/arch/x86/guest/xen-guest.ccreate mode 100644xen/arch/x86/guest/xen-nested.c
Quoted 5 lines
Quoted 3 lines
I think we should discuss that topic at the Xen developer summit in Chicago. Suddenly there seems to be a rush in nested Xen development and related areas, so syncing the efforts seems to be a good idea.
+1 from me on that...
Excellent -- thanks.
Christopher
Quoted 10 lines
Paul
Quoted 7 lines
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel