There is no need for struct vcpu to live below the 4G boundary if shadow paging is compiled out.
Signed-off-by: Andrew Cooper <andrew.coop...@citrix.com> --- CC: Jan Beulich <jbeul...@suse.com> CC: Wei Liu <wei.l...@citrix.com> CC: George Dunlap <george.dun...@eu.citrix.com> CC: Tim Deegan <t...@xen.org> --- xen/arch/x86/domain.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 943f95b..35cfa24 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -311,8 +311,11 @@ struct vcpu *alloc_vcpu_struct(void) * may require that the shadow CR3 points below 4GB, and hence the whole * structure must satisfy this restriction. Thus we specify MEMF_bits(32). */ + unsigned int memflags = + IS_ENABLED(CONFIG_SHADOW_PAGING) ? MEMF_bits(32) : 0; + BUILD_BUG_ON(sizeof(*v) > PAGE_SIZE); - v = alloc_xenheap_pages(0, MEMF_bits(32)); + v = alloc_xenheap_pages(0, memflags); if ( v != NULL ) clear_page(v); return v; -- 2.1.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel