On 02/26/2017 11:08 AM, Nadav Har'El wrote:
I'll commit this because obviously you understand this stuff better than I do, 
and have also tested it, but I do have a couple of questions:

On Mon, Feb 20, 2017 at 3:32 PM, 'Sergiy Kibrik' via OSv Development 
<osv-dev@googlegroups.com <mailto:osv-dev@googlegroups.com>> wrote:

    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 
<mailto:sergiy.kib...@globallogic.com>>
    ---
     bsd/sys/xen/interface/arch-aarch64.h | 1 +
     include/osv/xen.hh                   | 5 ++---
     2 files changed, 3 insertions(+), 3 deletions(-)

    diff --git a/bsd/sys/xen/interface/arch-aarch64.h 
b/bsd/sys/xen/interface/arch-aarch64.h
    index 998cd5e..ca47783 100644
    --- 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
    index 4c38447..504720b 100644
    --- 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;


Doesn't this patch change the layout of this structure also on x86? Is this 
acceptable?


         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];


A quick grep suggests that MAX_VIRT_CPUS on aarch64 is set to 1. Does this make 
sense?


hi Nadav,
vcpu_info[N] with N>1 is legacy interface and doesn't actually get used by Xen 
on ARM for SMP purposes.
MAX_VIRT_CPUS set to 1 in ARM part of hypervisor code as well, so we're safe 
here.

--
regards,
Sergiy


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

    --
    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 
<mailto:osv-dev%2bunsubscr...@googlegroups.com>.
    For more options, visit https://groups.google.com/d/optout 
<https://groups.google.com/d/optout>.



--
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