From: Sergiy Kibrik' via OSv Development <osv-dev@googlegroups.com>
Committer: Nadav Har'El <n...@scylladb.com>
Branch: master

osv: xen: make shared structures arch-independent

xen_shared_info & xen_vcpu_info are different on x64/aarch64, so couple of fixes
needed so that shared data is consistent with what hypervisor presumes.

Signed-off-by: Sergiy Kibrik <sergiy.kib...@globallogic.com>
Message-Id: <1487597529-28580-9-git-send-email-sergiy.kib...@globallogic.com>

---
diff --git a/bsd/sys/xen/interface/arch-aarch64.h b/bsd/sys/xen/interface/arch-aarch64.h
--- a/bsd/sys/xen/interface/arch-aarch64.h
+++ b/bsd/sys/xen/interface/arch-aarch64.h
@@ -37,6 +37,7 @@ typedef uint64_t xen_ulong_t;
 #define PRI_xen_ulong "llx"

 struct arch_vcpu_info {
+    int empty[0];      /* force zero size */
 };
 typedef struct arch_vcpu_info arch_vcpu_info_t;

diff --git a/include/osv/xen.hh b/include/osv/xen.hh
--- a/include/osv/xen.hh
+++ b/include/osv/xen.hh
@@ -30,13 +30,12 @@ struct xen_vcpu_info {
     uint8_t evtchn_upcall_pending;
     uint8_t evtchn_upcall_mask;
     std::atomic<uint64_t> evtchn_pending_sel;
-    uint64_t cr2;
-    uint64_t pad;
+    arch_vcpu_info_t arch;
     pvclock_vcpu_time_info time;
 };

 struct xen_shared_info {
-    struct xen_vcpu_info vcpu_info[32];
+    struct xen_vcpu_info vcpu_info[MAX_VIRT_CPUS];

     std::atomic<unsigned long> evtchn_pending[sizeof(unsigned long) * 8];
     std::atomic<unsigned long> evtchn_mask[sizeof(unsigned long) * 8];

--
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to