Skip to content
  • Yongji Xie's avatar
    c99a29e7
    memory: Introduce DEVICE_HOST_ENDIAN for ram device · c99a29e7
    Yongji Xie authored
    
    
    At the moment ram device's memory regions are DEVICE_NATIVE_ENDIAN. It's
    incorrect. This memory region is backed by a MMIO area in host, so the
    uint64_t data that MemoryRegionOps read from/write to this area should be
    host-endian rather than target-endian. Hence, current code does not work
    when target and host endianness are different which is the most common case
    on PPC64. To fix it, this introduces DEVICE_HOST_ENDIAN for the ram device.
    
    This has been tested on PPC64 BE/LE host/guest in all possible combinations
    including TCG.
    
    Suggested-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: default avatarYongji Xie <xyjxie@linux.vnet.ibm.com>
    Message-Id: <1488171164-28319-1-git-send-email-xyjxie@linux.vnet.ibm.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    c99a29e7
    memory: Introduce DEVICE_HOST_ENDIAN for ram device
    Yongji Xie authored
    
    
    At the moment ram device's memory regions are DEVICE_NATIVE_ENDIAN. It's
    incorrect. This memory region is backed by a MMIO area in host, so the
    uint64_t data that MemoryRegionOps read from/write to this area should be
    host-endian rather than target-endian. Hence, current code does not work
    when target and host endianness are different which is the most common case
    on PPC64. To fix it, this introduces DEVICE_HOST_ENDIAN for the ram device.
    
    This has been tested on PPC64 BE/LE host/guest in all possible combinations
    including TCG.
    
    Suggested-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: default avatarYongji Xie <xyjxie@linux.vnet.ibm.com>
    Message-Id: <1488171164-28319-1-git-send-email-xyjxie@linux.vnet.ibm.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Loading