[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 0/3] Fix access_with_adjusted_size() on big-endian

From: Philippe Mathieu-Daudé
Subject: [Qemu-devel] [PATCH 0/3] Fix access_with_adjusted_size() on big-endian
Date: Thu, 27 Sep 2018 02:24:13 +0200


This series fix a bug I'v been hunting for a long time.

With BE regions, if the guest used smaller access than the region
implementation, the shift value is negative, but since access_fn()
uses unsigned type for shift, it result in a huge positive value,
then accessors shift the value which eventually becomes 0.

The fix is simply to use signed type for the shift, and shift to
the opposite direction for negative values.



Philippe Mathieu-Daudé (3):
  memory: Use MAKE_64BIT_MASK()
  memory: Refactor common shifting code from accessors
  memory: Fix access_with_adjusted_size(small size) on big-endian memory

 memory.c | 58 +++++++++++++++++++++++++++++++++++++++-----------------
 1 file changed, 41 insertions(+), 17 deletions(-)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]