If using less than 32 vCPUs (XEN_LEGACY_MAX_VCPUS).

This is a workaround that should allow to boot the shim on hypervisors
without commit "x86/upcall: inject a spurious event after setting
upcall vector" as long as less than 32 vCPUs are assigned to the
shim.

Signed-off-by: Roger Pau MonnĂ© <[email protected]>
---
Cc: Jan Beulich <[email protected]>
Cc: Andrew Cooper <[email protected]>
Cc: Wei Liu <[email protected]>
Cc: Ian Jackson <[email protected]>
Cc: George Dunlap <[email protected]>
---
ONLY apply to the 4.10.0-shim-comet branch. Long term we don't want to
carry this patch since it would prevent the vcpu_info mapping code
from being tested unless a shim with > 32 vCPUs is created, which
doesn't seem very common.
---
 xen/arch/x86/guest/xen.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/guest/xen.c b/xen/arch/x86/guest/xen.c
index 2a5554ab26..ed8b8c8c7b 100644
--- a/xen/arch/x86/guest/xen.c
+++ b/xen/arch/x86/guest/xen.c
@@ -257,7 +257,8 @@ void __init hypervisor_setup(void)
     map_shared_info();
 
     set_vcpu_id();
-    vcpu_info = xzalloc_array(struct vcpu_info, nr_cpu_ids);
+    if ( nr_cpu_ids > XEN_LEGACY_MAX_VCPUS )
+        vcpu_info = xzalloc_array(struct vcpu_info, nr_cpu_ids);
     if ( map_vcpuinfo() )
     {
         xfree(vcpu_info);
-- 
2.15.1


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to