Re: [Qemu-devel] [PATCH] configure: more resilient Python version capture

2019-08-24 Thread tony.nguyen
> -python_version=$($python -V 2>&1 | sed -e 's/Python\ //') > +python_version=$(python2 -c 'import sys; print("%d.%d.%d" % > (sys.version_info[0], sys.version_info[1], sys.version_info[2]))' 2>/dev/null) On a Python 3 only system, configure will no longer print the version. e.g. /*

Re: [Qemu-devel] [PATCH v9 00/20] Invert Endian bit in SPARCv9 MMU TTE

2019-08-23 Thread tony.nguyen
On 8/22/19 12:29 PM, Richard Henderson wrote: > So... after an hour only the cover letter has arrived. > I'm thinking that it didn't work. Frustratingly, I keep getting blocked. Perhaps new GMail and Mail.com accounts sending in bulk on behalf of bt.com falls foul of spam filters. *sigh* I am

Re: [Qemu-devel] [PATCH v7 00/42] Invert Endian bit in SPARCv9 MMU TTE

2019-08-16 Thread tony.nguyen
Hi Phillippe, On 8/16/19 7:58 PM, Philippe Mathieu-Daudé wrote: >On 8/16/19 8:28 AM, tony.ngu...@bt.com wrote: >> This patchset implements the IE (Invert Endian) bit in SPARCv9 MMU TTE. >> >> v7: >[...] >> - Re-declared many native endian devices as little or big endian. This is why >> v7 has

[Qemu-devel] [PATCH v7 37/42] cputlb: Replace size and endian operands for MemOp

2019-08-16 Thread tony.nguyen
Preparation for collapsing the two byte swaps adjust_endianness and handle_bswap into the former. Signed-off-by: Tony Nguyen --- accel/tcg/cputlb.c | 172 +-- include/exec/memop.h | 6 ++ memory.c | 11 +--- 3 files changed, 90

[Qemu-devel] [PATCH v7 40/42] cputlb: Byte swap memory transaction attribute

2019-08-16 Thread tony.nguyen
Notice new attribute, byte swap, and force the transaction through the memory slow path. Required by architectures that can invert endianness of memory transaction, e.g. SPARC64 has the Invert Endian TTE bit. Suggested-by: Richard Henderson Signed-off-by: Tony Nguyen Reviewed-by: Richard

[Qemu-devel] [PATCH v7 39/42] cpu: TLB_FLAGS_MASK bit to force memory slow path

2019-08-16 Thread tony.nguyen
The fast path is taken when TLB_FLAGS_MASK is all zero. TLB_FORCE_SLOW is simply a TLB_FLAGS_MASK bit to force the slow path, there are no other side effects. Signed-off-by: Tony Nguyen Reviewed-by: Richard Henderson --- include/exec/cpu-all.h | 10 -- 1 file changed, 8 insertions(+),

[Qemu-devel] [PATCH v7 34/42] exec: Delete device_endian

2019-08-16 Thread tony.nguyen
device_endian has been made redundant by MemOp. Signed-off-by: Tony Nguyen Reviewed-by: Richard Henderson --- include/exec/cpu-common.h | 8 1 file changed, 8 deletions(-) diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h index 01a29ba..7eeb78c 100644 ---

[Qemu-devel] [PATCH v7 42/42] target/sparc: sun4u Invert Endian TTE bit

2019-08-16 Thread tony.nguyen
This bit configures endianness of PCI MMIO devices. It is used by Solaris and OpenBSD sunhme drivers. Tested working on OpenBSD. Unfortunately Solaris 10 had a unrelated keyboard issue blocking testing... another inch towards Solaris 10 on SPARC64 =) Signed-off-by: Tony Nguyen Reviewed-by:

[Qemu-devel] [PATCH v7 30/42] hw/timer: Declare device little or big endian

2019-08-16 Thread tony.nguyen
For each device declared with DEVICE_NATIVE_ENDIAN, find the set of targets from the set of target/hw/*/device.o. If the set of targets are all little or all big endian, re-declare the device endianness as DEVICE_LITTLE_ENDIAN or DEVICE_BIG_ENDIAN respectively. This *naive* deduction may result

[Qemu-devel] [PATCH v7 32/42] exec: Map device_endian onto MemOp

2019-08-16 Thread tony.nguyen
Preparation to replace device_endian with MemOp. Mapping device_endian onto MemOp limits behaviour changes to this relatively smaller patch. The next patch will replace all device_endian usages with the equivalent MemOp. That patch will be large but have no behaviour changes. A subsequent patch

[Qemu-devel] [PATCH v7 38/42] memory: Single byte swap along the I/O path

2019-08-16 Thread tony.nguyen
Now that MemOp has been pushed down into the memory API, and callers are encoding endianness, we can collapse byte swaps along the I/O path into the accelerator and target independent adjust_endianness. Collapsing byte swaps along the I/O path enables additional endian inversion logic, e.g.

[Qemu-devel] [PATCH v7 28/42] hw/sd: Declare device little or big endian

2019-08-16 Thread tony.nguyen
For each device declared with DEVICE_NATIVE_ENDIAN, find the set of targets from the set of target/hw/*/device.o. If the set of targets are all little or all big endian, re-declare the device endianness as DEVICE_LITTLE_ENDIAN or DEVICE_BIG_ENDIAN respectively. This *naive* deduction may result

[Qemu-devel] [PATCH v7 36/42] memory: Access MemoryRegion with endianness

2019-08-16 Thread tony.nguyen
Preparation for collapsing the two byte swaps adjust_endianness and handle_bswap into the former. Call memory_region_dispatch_{read|write} with endianness encoded into the "MemOp op" operand. This patch does not change any behaviour as memory_region_dispatch_{read|write} is yet to handle the

[Qemu-devel] [PATCH v7 35/42] exec: Delete DEVICE_HOST_ENDIAN

2019-08-16 Thread tony.nguyen
DEVICE_HOST_ENDIAN is conditional upon HOST_WORDS_BIGENDIAN. Code is cleaner if the single use of DEVICE_HOST_ENDIAN is instead directly conditional upon HOST_WORDS_BIGENDIAN. Signed-off-by: Tony Nguyen --- include/exec/cpu-common.h | 8 memory.c | 2 +- 2 files

[Qemu-devel] [PATCH v7 19/42] hw/dma: Declare device little or big endian

2019-08-16 Thread tony.nguyen
For each device declared with DEVICE_NATIVE_ENDIAN, find the set of targets from the set of target/hw/*/device.o. If the set of targets are all little or all big endian, re-declare the device endianness as DEVICE_LITTLE_ENDIAN or DEVICE_BIG_ENDIAN respectively. This *naive* deduction may result

[Qemu-devel] [PATCH v7 26/42] hw/net: Declare device little or big endian

2019-08-16 Thread tony.nguyen
For each device declared with DEVICE_NATIVE_ENDIAN, find the set of targets from the set of target/hw/*/device.o. If the set of targets are all little or all big endian, re-declare the device endianness as DEVICE_LITTLE_ENDIAN or DEVICE_BIG_ENDIAN respectively. This *naive* deduction may result

[Qemu-devel] [PATCH v7 29/42] hw/ssi: Declare device little or big endian

2019-08-16 Thread tony.nguyen
For each device declared with DEVICE_NATIVE_ENDIAN, find the set of targets from the set of target/hw/*/device.o. If the set of targets are all little or all big endian, re-declare the device endianness as DEVICE_LITTLE_ENDIAN or DEVICE_BIG_ENDIAN respectively. This *naive* deduction may result

[Qemu-devel] [PATCH v7 23/42] hw/intc: Declare device little or big endian

2019-08-16 Thread tony.nguyen
For each device declared with DEVICE_NATIVE_ENDIAN, find the set of targets from the set of target/hw/*/device.o. If the set of targets are all little or all big endian, re-declare the device endianness as DEVICE_LITTLE_ENDIAN or DEVICE_BIG_ENDIAN respectively. This *naive* deduction may result

[Qemu-devel] [PATCH v7 25/42] hw/misc: Declare device little or big endian

2019-08-16 Thread tony.nguyen
For each device declared with DEVICE_NATIVE_ENDIAN, find the set of targets from the set of target/hw/*/device.o. If the set of targets are all little or all big endian, re-declare the device endianness as DEVICE_LITTLE_ENDIAN or DEVICE_BIG_ENDIAN respectively. This *naive* deduction may result

[Qemu-devel] [PATCH v7 24/42] hw/isa: Declare device little or big endian

2019-08-16 Thread tony.nguyen
For each device declared with DEVICE_NATIVE_ENDIAN, find the set of targets from the set of target/hw/*/device.o. If the set of targets are all little or all big endian, re-declare the device endianness as DEVICE_LITTLE_ENDIAN or DEVICE_BIG_ENDIAN respectively. This *naive* deduction may result

[Qemu-devel] [PATCH v7 17/42] hw/char: Declare device little or big endian

2019-08-16 Thread tony.nguyen
For each device declared with DEVICE_NATIVE_ENDIAN, find the set of targets from the set of target/hw/*/device.o. If the set of targets are all little or all big endian, re-declare the device endianness as DEVICE_LITTLE_ENDIAN or DEVICE_BIG_ENDIAN respectively. This *naive* deduction may result

[Qemu-devel] [PATCH v7 41/42] target/sparc: Add TLB entry with attributes

2019-08-16 Thread tony.nguyen
Append MemTxAttrs to interfaces so we can pass along up coming Invert Endian TTE bit on SPARC64. Signed-off-by: Tony Nguyen Reviewed-by: Richard Henderson --- target/sparc/mmu_helper.c | 32 ++-- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git

[Qemu-devel] [PATCH v7 22/42] hw/input: Declare device little or big endian

2019-08-16 Thread tony.nguyen
For each device declared with DEVICE_NATIVE_ENDIAN, find the set of targets from the set of target/hw/*/device.o. If the set of targets are all little or all big endian, re-declare the device endianness as DEVICE_LITTLE_ENDIAN or DEVICE_BIG_ENDIAN respectively. This *naive* deduction may result

[Qemu-devel] [PATCH v7 31/42] build: Correct non-common common-obj-* to obj-*

2019-08-16 Thread tony.nguyen
Preparation for replacing device_endian with MemOp. Device realizing code with MemorRegionOps endianness as DEVICE_NATIVE_ENDIAN is not common code. Corrected devices were identified by making the declaration of DEVICE_NATIVE_ENDIAN conditional upon NEED_CPU_H and then listing what failed to

[Qemu-devel] [PATCH v7 16/42] hw/block: Declare device little or big endian

2019-08-16 Thread tony.nguyen
For each device declared with DEVICE_NATIVE_ENDIAN, find the set of targets from the set of target/hw/*/device.o. If the set of targets are all little or all big endian, re-declare the device endianness as DEVICE_LITTLE_ENDIAN or DEVICE_BIG_ENDIAN respectively. This *naive* deduction may result

[Qemu-devel] [PATCH v7 21/42] hw/i2c: Declare device little or big endian

2019-08-16 Thread tony.nguyen
For each device declared with DEVICE_NATIVE_ENDIAN, find the set of targets from the set of target/hw/*/device.o. If the set of targets are all little or all big endian, re-declare the device endianness as DEVICE_LITTLE_ENDIAN or DEVICE_BIG_ENDIAN respectively. This *naive* deduction may result

[Qemu-devel] [PATCH v7 15/42] hw/audio: Declare device little or big endian

2019-08-16 Thread tony.nguyen
For each device declared with DEVICE_NATIVE_ENDIAN, find the set of targets from the set of target/hw/*/device.o. If the set of targets are all little or all big endian, re-declare the device endianness as DEVICE_LITTLE_ENDIAN or DEVICE_BIG_ENDIAN respectively. This *naive* deduction may result

[Qemu-devel] [PATCH v7 13/42] target/mips: Hard code size with MO_{8|16|32|64}

2019-08-16 Thread tony.nguyen
Temporarily no-op size_memop was introduced to aid the conversion of memory_region_dispatch_{read|write} operand "unsigned size" into "MemOp op". Now size_memop is implemented, again hard coded size but with MO_{8|16|32|64}. This is more expressive and avoids size_memop calls. Signed-off-by:

[Qemu-devel] [PATCH v7 27/42] hw/pci-host: Declare device little or big endian

2019-08-16 Thread tony.nguyen
For each device declared with DEVICE_NATIVE_ENDIAN, find the set of targets from the set of target/hw/*/device.o. If the set of targets are all little or all big endian, re-declare the device endianness as DEVICE_LITTLE_ENDIAN or DEVICE_BIG_ENDIAN respectively. This *naive* deduction may result

[Qemu-devel] [PATCH v7 12/42] hw/s390x: Hard code size with MO_{8|16|32|64}

2019-08-16 Thread tony.nguyen
Temporarily no-op size_memop was introduced to aid the conversion of memory_region_dispatch_{read|write} operand "unsigned size" into "MemOp op". Now size_memop is implemented, again hard coded size but with MO_{8|16|32|64}. This is more expressive and avoids size_memop calls. Signed-off-by:

[Qemu-devel] [PATCH v7 18/42] hw/display: Declare device little or big endian

2019-08-16 Thread tony.nguyen
For each device declared with DEVICE_NATIVE_ENDIAN, find the set of targets from the set of target/hw/*/device.o. If the set of targets are all little or all big endian, re-declare the device endianness as DEVICE_LITTLE_ENDIAN or DEVICE_BIG_ENDIAN respectively. This *naive* deduction may result

[Qemu-devel] [PATCH v7 11/42] memory: Access MemoryRegion with MemOp

2019-08-16 Thread tony.nguyen
Convert memory_region_dispatch_{read|write} operand "unsigned size" into a "MemOp op". Signed-off-by: Tony Nguyen Reviewed-by: Richard Henderson --- include/exec/memop.h | 20 ++-- include/exec/memory.h | 9 + memory.c | 7 +-- 3 files changed, 24

[Qemu-devel] [PATCH v7 08/42] hw/vfio: Access MemoryRegion with MemOp

2019-08-16 Thread tony.nguyen
The memory_region_dispatch_{read|write} operand "unsigned size" is being converted into a "MemOp op". Convert interfaces by using no-op size_memop. After all interfaces are converted, size_memop will be implemented and the memory_region_dispatch_{read|write} operand "unsigned size" will be

[Qemu-devel] [PATCH v7 14/42] exec: Hard code size with MO_{8|16|32|64}

2019-08-16 Thread tony.nguyen
Temporarily no-op size_memop was introduced to aid the conversion of memory_region_dispatch_{read|write} operand "unsigned size" into "MemOp op". Now size_memop is implemented, again hard coded size but with MO_{8|16|32|64}. This is more expressive and avoids size_memop calls. Signed-off-by:

[Qemu-devel] [PATCH v7 20/42] hw/gpio: Declare device little or big endian

2019-08-16 Thread tony.nguyen
For each device declared with DEVICE_NATIVE_ENDIAN, find the set of targets from the set of target/hw/*/device.o. If the set of targets are all little or all big endian, re-declare the device endianness as DEVICE_LITTLE_ENDIAN or DEVICE_BIG_ENDIAN respectively. This *naive* deduction may result

[Qemu-devel] [PATCH v7 10/42] cputlb: Access MemoryRegion with MemOp

2019-08-16 Thread tony.nguyen
The memory_region_dispatch_{read|write} operand "unsigned size" is being converted into a "MemOp op". Convert interfaces by using no-op size_memop. After all interfaces are converted, size_memop will be implemented and the memory_region_dispatch_{read|write} operand "unsigned size" will be

[Qemu-devel] [PATCH v7 07/42] hw/virtio: Access MemoryRegion with MemOp

2019-08-16 Thread tony.nguyen
The memory_region_dispatch_{read|write} operand "unsigned size" is being converted into a "MemOp op". Convert interfaces by using no-op size_memop. After all interfaces are converted, size_memop will be implemented and the memory_region_dispatch_{read|write} operand "unsigned size" will be

[Qemu-devel] [PATCH v7 06/42] hw/intc/armv7m_nic: Access MemoryRegion with MemOp

2019-08-16 Thread tony.nguyen
The memory_region_dispatch_{read|write} operand "unsigned size" is being converted into a "MemOp op". Convert interfaces by using no-op size_memop. After all interfaces are converted, size_memop will be implemented and the memory_region_dispatch_{read|write} operand "unsigned size" will be

[Qemu-devel] [PATCH v7 09/42] exec: Access MemoryRegion with MemOp

2019-08-16 Thread tony.nguyen
The memory_region_dispatch_{read|write} operand "unsigned size" is being converted into a "MemOp op". Convert interfaces by using no-op size_memop. After all interfaces are converted, size_memop will be implemented and the memory_region_dispatch_{read|write} operand "unsigned size" will be

[Qemu-devel] [PATCH v7 05/42] hw/s390x: Access MemoryRegion with MemOp

2019-08-16 Thread tony.nguyen
The memory_region_dispatch_{read|write} operand "unsigned size" is being converted into a "MemOp op". Convert interfaces by using no-op size_memop. After all interfaces are converted, size_memop will be implemented and the memory_region_dispatch_{read|write} operand "unsigned size" will be

[Qemu-devel] [PATCH v7 02/42] tcg: TCGMemOp is now accelerator independent MemOp

2019-08-16 Thread tony.nguyen
Preparation for collapsing the two byte swaps, adjust_endianness and handle_bswap, along the I/O path. Target dependant attributes are conditionalized upon NEED_CPU_H. Signed-off-by: Tony Nguyen Acked-by: David Gibson Reviewed-by: Richard Henderson Acked-by: Cornelia Huck --- MAINTAINERS

[Qemu-devel] [PATCH v7 04/42] target/mips: Access MemoryRegion with MemOp

2019-08-16 Thread tony.nguyen
The memory_region_dispatch_{read|write} operand "unsigned size" is being converted into a "MemOp op". Convert interfaces by using no-op size_memop. After all interfaces are converted, size_memop will be implemented and the memory_region_dispatch_{read|write} operand "unsigned size" will be

[Qemu-devel] [PATCH v7 03/42] memory: Introduce size_memop

2019-08-16 Thread tony.nguyen
The memory_region_dispatch_{read|write} operand "unsigned size" is being converted into a "MemOp op". Introduce no-op size_memop to aid preparatory conversion of interfaces. Once interfaces are converted, size_memop will be implemented to return a MemOp from size in bytes. Signed-off-by: Tony

[Qemu-devel] [PATCH v7 01/42] configure: Define TARGET_ALIGNED_ONLY

2019-08-16 Thread tony.nguyen
Rename ALIGNED_ONLY to TARGET_ALIGNED_ONLY for clarity and move defines out of target/foo/cpu.h into configure, as we do with TARGET_WORDS_BIGENDIAN, so that it is always defined early. Poisoned TARGET_ALIGNED_ONLY to prevent use in common code. Signed-off-by: Tony Nguyen Reviewed-by: Philippe

[Qemu-devel] [PATCH v7 00/42] Invert Endian bit in SPARCv9 MMU TTE

2019-08-16 Thread tony.nguyen
This patchset implements the IE (Invert Endian) bit in SPARCv9 MMU TTE. It is an attempt of the instructions outlined by Richard Henderson to Mark Cave-Ayland. Tested with OpenBSD on sun4u. Solaris 10 is my actual goal, but unfortunately a separate keyboard issue remains in the way. On 01/11/17

Re: [Qemu-devel] [PATCH v6 26/26] target/sparc: sun4u Invert Endian TTE bit

2019-08-07 Thread tony.nguyen
Sorry, I missed a tag.? Tested-by: Mark Cave-Ayland

Re: [Qemu-devel] [PATCH v6 09/26] exec: Access MemoryRegion with MemOp

2019-08-07 Thread tony.nguyen
Sorry, I missed a tag. Reviewed-by: Philippe Mathieu-Daudé ?

Re: [Qemu-devel] [PATCH v6 06/26] hw/intc/armv7m_nic: Access MemoryRegion with MemOp

2019-08-07 Thread tony.nguyen
Sorry, I missed a tag. Reviewed-by: Philippe Mathieu-Daudé ?

Re: [Qemu-devel] [PATCH v6 04/26] target/mips: Access MemoryRegion with MemOp

2019-08-07 Thread tony.nguyen
Sorry, I missed a tag. Reviewed-by: Philippe Mathieu-Daudé ?

Re: [Qemu-devel] [PATCH v6 10/26] cputlb: Access MemoryRegion with MemOp

2019-08-07 Thread tony.nguyen
Sorry, I missed a tag. Reviewed-by: Philippe Mathieu-Daudé

Re: [Qemu-devel] [PATCH v6 00/26] Invert Endian bit in SPARCv9 MMU TTE

2019-08-07 Thread tony.nguyen
On 8/7/19 8:37 PM, Philippe Mathieu-Daudé wrote: > I'm confused I think I already reviewed various patches of your previous ?> series but don't see my Reviewed-by tags.? Apologies Philippe! I am the confused one here =/ Will append. Thank you very much for the reviews and qemu-devel newbie

[Qemu-devel] [PATCH v6 21/26] cputlb: Replace size and endian operands for MemOp

2019-08-07 Thread tony.nguyen
Preparation for collapsing the two byte swaps adjust_endianness and handle_bswap into the former. Signed-off-by: Tony Nguyen --- accel/tcg/cputlb.c | 170 +-- include/exec/memop.h | 6 ++ memory.c | 11 +--- 3 files changed, 90

[Qemu-devel] [PATCH v6 15/26] build: Correct non-common common-obj-* to obj-*

2019-08-07 Thread tony.nguyen
Preparation for replacing device_endian with MemOp. Device realizing code with MemorRegionOps endianness as DEVICE_NATIVE_ENDIAN is not common code. Corrected devices were identified by making the declaration of DEVICE_NATIVE_ENDIAN conditional upon NEED_CPU_H and then listing what failed to

[Qemu-devel] [PATCH v6 22/26] memory: Single byte swap along the I/O path

2019-08-07 Thread tony.nguyen
Now that MemOp has been pushed down into the memory API, and callers are encoding endianness, we can collapse byte swaps along the I/O path into the accelerator and target independent adjust_endianness. Collapsing byte swaps along the I/O path enables additional endian inversion logic, e.g.

[Qemu-devel] [PATCH v6 26/26] target/sparc: sun4u Invert Endian TTE bit

2019-08-07 Thread tony.nguyen
This bit configures endianness of PCI MMIO devices. It is used by Solaris and OpenBSD sunhme drivers. Tested working on OpenBSD. Unfortunately Solaris 10 had a unrelated keyboard issue blocking testing... another inch towards Solaris 10 on SPARC64 =) Signed-off-by: Tony Nguyen Reviewed-by:

[Qemu-devel] [PATCH v6 18/26] exec: Delete device_endian

2019-08-07 Thread tony.nguyen
device_endian has been made redundant by MemOp. Signed-off-by: Tony Nguyen --- include/exec/cpu-common.h | 8 1 file changed, 8 deletions(-) diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h index 01a29ba..7eeb78c 100644 --- a/include/exec/cpu-common.h +++

[Qemu-devel] [PATCH v6 23/26] cpu: TLB_FLAGS_MASK bit to force memory slow path

2019-08-07 Thread tony.nguyen
The fast path is taken when TLB_FLAGS_MASK is all zero. TLB_FORCE_SLOW is simply a TLB_FLAGS_MASK bit to force the slow path, there are no other side effects. Signed-off-by: Tony Nguyen Reviewed-by: Richard Henderson --- include/exec/cpu-all.h | 10 -- 1 file changed, 8 insertions(+),

[Qemu-devel] [PATCH v6 24/26] cputlb: Byte swap memory transaction attribute

2019-08-07 Thread tony.nguyen
Notice new attribute, byte swap, and force the transaction through the memory slow path. Required by architectures that can invert endianness of memory transaction, e.g. SPARC64 has the Invert Endian TTE bit. Suggested-by: Richard Henderson Signed-off-by: Tony Nguyen Reviewed-by: Richard

[Qemu-devel] [PATCH v6 25/26] target/sparc: Add TLB entry with attributes

2019-08-07 Thread tony.nguyen
Append MemTxAttrs to interfaces so we can pass along up coming Invert Endian TTE bit on SPARC64. Signed-off-by: Tony Nguyen Reviewed-by: Richard Henderson --- target/sparc/mmu_helper.c | 32 ++-- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git

[Qemu-devel] [PATCH v6 14/26] exec: Hard code size with MO_{8|16|32|64}

2019-08-07 Thread tony.nguyen
Temporarily no-op size_memop was introduced to aid the conversion of memory_region_dispatch_{read|write} operand "unsigned size" into "MemOp op". Now size_memop is implemented, again hard coded size but with MO_{8|16|32|64}. This is more expressive and avoid size_memop calls. Signed-off-by: Tony

[Qemu-devel] [PATCH v6 20/26] memory: Access MemoryRegion with endianness

2019-08-07 Thread tony.nguyen
Preparation for collapsing the two byte swaps adjust_endianness and handle_bswap into the former. Call memory_region_dispatch_{read|write} with endianness encoded into the "MemOp op" operand. This patch does not change any behaviour as memory_region_dispatch_{read|write} is yet to handle the

[Qemu-devel] [PATCH v6 16/26] exec: Map device_endian onto MemOp

2019-08-07 Thread tony.nguyen
Preparation to replace device_endian with MemOp. Mapping device_endian onto MemOp limits behaviour changes to this relatively smaller patch. The next patch will replace all device_endian usages with the equivalent MemOp. That patch will be large but have no behaviour changes. A subsequent patch

[Qemu-devel] [PATCH v6 13/26] target/mips: Hard code size with MO_{8|16|32|64}

2019-08-07 Thread tony.nguyen
Temporarily no-op size_memop was introduced to aid the conversion of memory_region_dispatch_{read|write} operand "unsigned size" into "MemOp op". Now size_memop is implemented, again hard coded size but with MO_{8|16|32|64}. This is more expressive and avoid size_memop calls. Signed-off-by: Tony

[Qemu-devel] [PATCH v6 19/26] exec: Delete DEVICE_HOST_ENDIAN

2019-08-07 Thread tony.nguyen
DEVICE_HOST_ENDIAN is conditional upon HOST_WORDS_BIGENDIAN. Code is cleaner if the single use of DEVICE_HOST_ENDIAN is instead directly conditional upon HOST_WORDS_BIGENDIAN. Signed-off-by: Tony Nguyen --- include/exec/cpu-common.h | 8 memory.c | 6 +- 2 files

[Qemu-devel] [PATCH v6 09/26] exec: Access MemoryRegion with MemOp

2019-08-07 Thread tony.nguyen
The memory_region_dispatch_{read|write} operand "unsigned size" is being converted into a "MemOp op". Convert interfaces by using no-op size_memop. After all interfaces are converted, size_memop will be implemented and the memory_region_dispatch_{read|write} operand "unsigned size" will be

[Qemu-devel] [PATCH v6 08/26] hw/vfio: Access MemoryRegion with MemOp

2019-08-07 Thread tony.nguyen
The memory_region_dispatch_{read|write} operand "unsigned size" is being converted into a "MemOp op". Convert interfaces by using no-op size_memop. After all interfaces are converted, size_memop will be implemented and the memory_region_dispatch_{read|write} operand "unsigned size" will be

[Qemu-devel] [PATCH v6 10/26] cputlb: Access MemoryRegion with MemOp

2019-08-07 Thread tony.nguyen
The memory_region_dispatch_{read|write} operand "unsigned size" is being converted into a "MemOp op". Convert interfaces by using no-op size_memop. After all interfaces are converted, size_memop will be implemented and the memory_region_dispatch_{read|write} operand "unsigned size" will be

[Qemu-devel] [PATCH v6 12/26] hw/s390x: Hard code size with MO_{8|16|32|64}

2019-08-07 Thread tony.nguyen
Temporarily no-op size_memop was introduced to aid the conversion of memory_region_dispatch_{read|write} operand "unsigned size" into "MemOp op". Now size_memop is implemented, again hard coded size but with MO_{8|16|32|64}. This is more expressive and avoid size_memop calls. Signed-off-by: Tony

[Qemu-devel] [PATCH v6 11/26] memory: Access MemoryRegion with MemOp

2019-08-07 Thread tony.nguyen
Convert memory_region_dispatch_{read|write} operand "unsigned size" into a "MemOp op". Signed-off-by: Tony Nguyen --- include/exec/memop.h | 18 +- include/exec/memory.h | 9 + memory.c | 7 +-- 3 files changed, 23 insertions(+), 11 deletions(-) diff

[Qemu-devel] [PATCH v6 05/26] hw/s390x: Access MemoryRegion with MemOp

2019-08-07 Thread tony.nguyen
The memory_region_dispatch_{read|write} operand "unsigned size" is being converted into a "MemOp op". Convert interfaces by using no-op size_memop. After all interfaces are converted, size_memop will be implemented and the memory_region_dispatch_{read|write} operand "unsigned size" will be

[Qemu-devel] [PATCH v6 07/26] hw/virtio: Access MemoryRegion with MemOp

2019-08-07 Thread tony.nguyen
The memory_region_dispatch_{read|write} operand "unsigned size" is being converted into a "MemOp op". Convert interfaces by using no-op size_memop. After all interfaces are converted, size_memop will be implemented and the memory_region_dispatch_{read|write} operand "unsigned size" will be

[Qemu-devel] [PATCH v6 06/26] hw/intc/armv7m_nic: Access MemoryRegion with MemOp

2019-08-07 Thread tony.nguyen
The memory_region_dispatch_{read|write} operand "unsigned size" is being converted into a "MemOp op". Convert interfaces by using no-op size_memop. After all interfaces are converted, size_memop will be implemented and the memory_region_dispatch_{read|write} operand "unsigned size" will be

[Qemu-devel] [PATCH v6 04/26] target/mips: Access MemoryRegion with MemOp

2019-08-07 Thread tony.nguyen
The memory_region_dispatch_{read|write} operand "unsigned size" is being converted into a "MemOp op". Convert interfaces by using no-op size_memop. After all interfaces are converted, size_memop will be implemented and the memory_region_dispatch_{read|write} operand "unsigned size" will be

[Qemu-devel] [PATCH v6 02/26] tcg: TCGMemOp is now accelerator independent MemOp

2019-08-07 Thread tony.nguyen
Preparation for collapsing the two byte swaps, adjust_endianness and handle_bswap, along the I/O path. Target dependant attributes are conditionalize upon NEED_CPU_H. Signed-off-by: Tony Nguyen Acked-by: David Gibson Reviewed-by: Richard Henderson --- MAINTAINERS

[Qemu-devel] [PATCH v6 03/26] memory: Introduce size_memop

2019-08-07 Thread tony.nguyen
The memory_region_dispatch_{read|write} operand "unsigned size" is being converted into a "MemOp op". Introduce no-op size_memop to aid preparatory conversion of interfaces. Once interfaces are converted, size_memop will be implemented to return a MemOp from size in bytes. Signed-off-by: Tony

[Qemu-devel] [PATCH v6 01/26] configure: Define TARGET_ALIGNED_ONLY

2019-08-07 Thread tony.nguyen
Rename ALIGNED_ONLY to TARGET_ALIGNED_ONLY for clarity and move defines out of target/foo/cpu.h into configure, as we do with TARGET_WORDS_BIGENDIAN, so that it is always defined early. Poisoned TARGET_ALIGNED_ONLY to prevent use in common code. Signed-off-by: Tony Nguyen Reviewed-by: Philippe

[Qemu-devel] [PATCH v6 00/26] Invert Endian bit in SPARCv9 MMU TTE

2019-08-07 Thread tony.nguyen
This patchset implements the IE (Invert Endian) bit in SPARCv9 MMU TTE. It is an attempt of the instructions outlined by Richard Henderson to Mark Cave-Ayland. Tested with OpenBSD on sun4u. Solaris 10 is my actual goal, but unfortunately a separate keyboard issue remains in the way. On 01/11/17

[Qemu-devel] [PATCH v4 1/1] configure: Define target access alignment in configure

2019-07-31 Thread tony.nguyen
Rename ALIGNED_ONLY to TARGET_ALIGNED_ONLY for clarity and move defines out of target/foo/cpu.h into configure, as we do with TARGET_WORDS_BIGENDIAN, so that it is always defined early. Poison TARGET_ALIGNED_ONLY to prevent use in common code. Signed-off-by: Tony Nguyen Reviewed-by: Philippe

[Qemu-devel] [PATCH v4 1/1] configure: Define target access alignment in configure

2019-07-31 Thread tony.nguyen
Rename ALIGNED_ONLY to TARGET_ALIGNED_ONLY for clarity and move defines out of target/foo/cpu.h into configure, as we do with TARGET_WORDS_BIGENDIAN, so that it is always defined early. Poison TARGET_ALIGNED_ONLY to prevent use in common code. Signed-off-by: Tony Nguyen Reviewed-by: Philippe

[Qemu-devel] [PATCH v4 0/1] configure: Define target access alignment in configure

2019-07-31 Thread tony.nguyen
Move the define of target access alignment earlier from target/foo/cpu.h to configure. Suggested in Richard Henderson's reply to "[PATCH 1/4] tcg: TCGMemOp is now accelerator independent MemOp" Analysed target/foo/cpu.h for more candidates to define earlier but did not spot any other straight

[Qemu-devel] [PATCH v4 0/1] configure: Define target access alignment in configure

2019-07-30 Thread tony.nguyen
Move the define of target access alignment earlier from target/foo/cpu.h to configure. Suggested in Richard Henderson's reply to "[PATCH 1/4] tcg: TCGMemOp is now accelerator independent MemOp" Analysed target/foo/cpu.h for more candidates to define earlier but did not spot any other straight

[Qemu-devel] [PATCH v5 15/15] target/sparc: sun4u Invert Endian TTE bit

2019-07-26 Thread tony.nguyen
This bit configures endianness of PCI MMIO devices. It is used by Solaris and OpenBSD sunhme drivers. Tested working on OpenBSD. Unfortunately Solaris 10 had a unrelated keyboard issue blocking testing... another inch towards Solaris 10 on SPARC64 =) Signed-off-by: Tony Nguyen ---

[Qemu-devel] [PATCH v5 13/15] cputlb: Byte swap memory transaction attribute

2019-07-26 Thread tony.nguyen
Notice new attribute, byte swap, and force the transaction through the memory slow path. Required by architectures that can invert endianness of memory transaction, e.g. SPARC64 has the Invert Endian TTE bit. Signed-off-by: Tony Nguyen --- accel/tcg/cputlb.c | 11 +++

[Qemu-devel] [PATCH v5 14/15] target/sparc: Add TLB entry with attributes

2019-07-26 Thread tony.nguyen
Append MemTxAttrs to interfaces so we can pass along up coming Invert Endian TTE bit on SPARC64. Signed-off-by: Tony Nguyen --- target/sparc/mmu_helper.c | 32 ++-- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/target/sparc/mmu_helper.c

[Qemu-devel] [PATCH v5 12/15] cpu: TLB_FLAGS_MASK bit to force memory slow path

2019-07-26 Thread tony.nguyen
The fast path is taken when TLB_FLAGS_MASK is all zero. TLB_FORCE_SLOW is simply a TLB_FLAGS_MASK bit to force the slow path, there are no other side effects. Signed-off-by: Tony Nguyen --- include/exec/cpu-all.h | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git

[Qemu-devel] [PATCH v5 11/15] memory: Single byte swap along the I/O path

2019-07-26 Thread tony.nguyen
Now that MemOp has been pushed down into the memory API, we can collapse the two byte swaps adjust_endianness and handle_bswap into the former. Collapsing byte swaps along the I/O path enables additional endian inversion logic, e.g. SPARC64 Invert Endian TTE bit, with redundant byte swaps

[Qemu-devel] [PATCH v5 10/15] memory: Access MemoryRegion with MemOp semantics

2019-07-26 Thread tony.nguyen
To convert interfaces of MemoryRegion access, MEMOP_SIZE and SIZE_MEMOP no-op stubs were introduced to change syntax while keeping the existing semantics. Now with interfaces converted, we fill the stubs and use MemOp semantics. Signed-off-by: Tony Nguyen --- include/exec/memop.h | 5 ++---

[Qemu-devel] [PATCH v5 08/15] exec: Access MemoryRegion with MemOp

2019-07-26 Thread tony.nguyen
No-op SIZE_MEMOP macro allows us to later easily convert memory_region_dispatch_{read|write} paramter "unsigned size" into a size+sign+endianness encoded "MemOp op". Being a no-op macro, this patch does not introduce any logical change. Signed-off-by: Tony Nguyen Reviewed-by: Philippe

[Qemu-devel] [PATCH v5 09/15] cputlb: Access MemoryRegion with MemOp

2019-07-26 Thread tony.nguyen
No-op MEMOP_SIZE and SIZE_MEMOP macros allows us to later easily convert memory_region_dispatch_{read|write} paramter "unsigned size" into a size+sign+endianness encoded "MemOp op". Being a no-op macro, this patch does not introduce any logical change. Signed-off-by: Tony Nguyen ---

[Qemu-devel] [PATCH v5 07/15] hw/vfio: Access MemoryRegion with MemOp

2019-07-26 Thread tony.nguyen
No-op SIZE_MEMOP macro allows us to later easily convert memory_region_dispatch_{read|write} paramter "unsigned size" into a size+sign+endianness encoded "MemOp op". Being a no-op macro, this patch does not introduce any logical change. Signed-off-by: Tony Nguyen --- hw/vfio/pci-quirks.c | 5

[Qemu-devel] [PATCH v5 06/15] hw/virtio: Access MemoryRegion with MemOp

2019-07-26 Thread tony.nguyen
No-op SIZE_MEMOP macro allows us to later easily convert memory_region_dispatch_{read|write} paramter "unsigned size" into a size+sign+endianness encoded "MemOp op". Being a no-op macro, this patch does not introduce any logical change. Signed-off-by: Tony Nguyen --- hw/virtio/virtio-pci.c | 7

[Qemu-devel] [PATCH v5 05/15] hw/intc/armv7m_nic: Access MemoryRegion with MemOp

2019-07-26 Thread tony.nguyen
No-op SIZE_MEMOP macro allows us to later easily convert memory_region_dispatch_{read|write} paramter "unsigned size" into a size+sign+endianness encoded "MemOp op". Being a no-op macro, this patch does not introduce any logical change. Signed-off-by: Tony Nguyen Reviewed-by: Philippe

[Qemu-devel] [PATCH v5 01/15] tcg: TCGMemOp is now accelerator independent MemOp

2019-07-26 Thread tony.nguyen
Preparation for collapsing the two byte swaps, adjust_endianness and handle_bswap, along the I/O path. Target dependant attributes are conditionalize upon NEED_CPU_H. Signed-off-by: Tony Nguyen --- MAINTAINERS | 1 + accel/tcg/cputlb.c | 2

[Qemu-devel] [PATCH v5 04/15] hw/s390x: Access MemoryRegion with MemOp

2019-07-26 Thread tony.nguyen
No-op SIZE_MEMOP macro allows us to later easily convert memory_region_dispatch_{read|write} paramter "unsigned size" into a size+sign+endianness encoded "MemOp op". Being a no-op macro, this patch does not introduce any logical change. Signed-off-by: Tony Nguyen --- hw/s390x/s390-pci-inst.c |

[Qemu-devel] [PATCH v5 03/15] target/mips: Access MemoryRegion with MemOp

2019-07-26 Thread tony.nguyen
No-op SIZE_MEMOP macro allows us to later easily convert memory_region_dispatch_{read|write} paramter "unsigned size" into a size+sign+endianness encoded "MemOp op". Being a no-op macro, this patch does not introduce any logical change. Signed-off-by: Tony Nguyen Reviewed-by: Philippe

[Qemu-devel] [PATCH v5 02/15] memory: Access MemoryRegion with MemOp

2019-07-26 Thread tony.nguyen
Change memory_region_dispatch_{read|write} parameter "unsigned size" to "MemOp op". The endianness encoded in MemOp will enable the collapse of two byte swaps, adjust_endianness and handle_bswap, along the I/O path. Interfaces will be converted in two steps: first syntactically then

[Qemu-devel] [PATCH v5 00/15] Invert Endian bit in SPARCv9 MMU TTE

2019-07-26 Thread tony.nguyen
This patchset implements the IE (Invert Endian) bit in SPARCv9 MMU TTE. It is an attempt of the instructions outlined by Richard Henderson to Mark Cave-Ayland. Tested with OpenBSD on sun4u. Solaris 10 is my actual goal, but unfortunately a separate keyboard issue remains in the way. On 01/11/17

Re: [Qemu-devel] [PATCH v4 02/15] memory: Access MemoryRegion with MemOp

2019-07-26 Thread tony.nguyen
On 7/25/19 9:45 PM, Philippe Mathieu-Daudé wrote: >On 7/25/19 11:52 AM, tony.ngu...@bt.com wrote: >> Replacing size with size+sign+endianness (MemOp) will enable us to >> collapse the two byte swaps, adjust_endianness and handle_bswap, along >> the I/O path. >> >> While interfaces are converted,

[Qemu-devel] [PATCH v4 15/15] target/sparc: sun4u Invert Endian TTE bit

2019-07-25 Thread tony.nguyen
This bit configures endianness of PCI MMIO devices. It is used by Solaris and OpenBSD sunhme drivers. Tested working on OpenBSD. Unfortunately Solaris 10 had a unrelated keyboard issue blocking testing... another inch towards Solaris 10 on SPARC64 =) Signed-off-by: Tony Nguyen ---

[Qemu-devel] [PATCH v4 13/15] cputlb: Byte swap memory transaction attribute

2019-07-25 Thread tony.nguyen
Notice new attribute, byte swap, and force the transaction through the memory slow path. Required by architectures that can invert endianness of memory transaction, e.g. SPARC64 has the Invert Endian TTE bit. Signed-off-by: Tony Nguyen --- accel/tcg/cputlb.c | 11 +++

  1   2   >