Re: [Qemu-devel] [PATCH 2/3] cputlb: Replace switches in load/store_helper with callback

2019-09-11 Thread Tony Nguyen
On Wed, Sep 11, 2019 at 09:22:39AM -0400, Richard Henderson wrote: > I would be hesitant to call this just "lduw_be"; I think that's confusing when > it's calling lduw_be_p. But perhaps "wrap_*" or "wide_*"? Agree, some hamming distance is needed. "wrap_*", "wide_*", or "direct_*" all works for

Re: [Qemu-devel] [PATCH 3/3] cputlb: Introduce TLB_BSWAP

2019-09-11 Thread Tony Nguyen
On Tue, Sep 10, 2019 at 09:43:53PM -0400, Richard Henderson wrote: > Handle bswap on ram directly in load/store_helper. This fixes a > bug with the previous implementation in that one cannot use the > I/O path for RAM. > > Fixes: a26fc6f5152b47f1 > Signed-off-by: Richard Henderson > --- > inclu

Re: [Qemu-devel] [PATCH 2/3] cputlb: Replace switches in load/store_helper with callback

2019-09-11 Thread Tony Nguyen
rchState *env, > target_ulong addr, >TCGMemOpIdx oi, uintptr_t retaddr) > { > return load_helper(env, addr, oi, retaddr, MO_BEUL, true, > - full_be_ldul_cmmu); > + full_be_ldul_cmmu, direct_ldul_be); > } > > uint32_t helper_be_ldl_cmmu(CPUArchState *env, target_ulong addr, > @@ -1866,12 +1871,12 @@ uint64_t helper_le_ldq_cmmu(CPUArchState *env, > target_ulong addr, > TCGMemOpIdx oi, uintptr_t retaddr) > { > return load_helper(env, addr, oi, retaddr, MO_LEQ, true, > - helper_le_ldq_cmmu); > + helper_le_ldq_cmmu, ldq_le_p); > } > > uint64_t helper_be_ldq_cmmu(CPUArchState *env, target_ulong addr, > TCGMemOpIdx oi, uintptr_t retaddr) > { > return load_helper(env, addr, oi, retaddr, MO_BEQ, true, > - helper_be_ldq_cmmu); > + helper_be_ldq_cmmu, ldq_be_p); > } > -- > 2.17.1 > > Reviewed-by: Tony Nguyen

Re: [Qemu-devel] [PATCH] memory: Set notdirty_mem_ops validator

2019-09-03 Thread Tony Nguyen
On Tue, Sep 03, 2019 at 05:50:56PM +0100, Peter Maydell wrote: > Do you have a backtrace of QEMU from the segfault? I'm having trouble > thinking of what the situation is when we'd try to invoke the > read handler on io_mem_notdirty... Using tcg-next https://github.com/rth7680/qemu/commit/c25c283

Re: [Qemu-devel] [PATCH] memory: Set notdirty_mem_ops validator

2019-09-03 Thread Tony Nguyen
On Tue, Sep 03, 2019 at 11:25:28AM +0100, Peter Maydell wrote: > On Mon, 2 Sep 2019 at 02:36, Tony Nguyen wrote: > > > > Existing read rejecting validator was mistakenly cleared. > > > > Reads dispatched to io_mem_notdirty then segfaults as there is no read > &

[Qemu-devel] [PATCH] memory: Set notdirty_mem_ops validator

2019-09-01 Thread Tony Nguyen
Existing read rejecting validator was mistakenly cleared. Reads dispatched to io_mem_notdirty then segfaults as there is no read handler. Signed-off-by: Tony Nguyen --- exec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exec.c b/exec.c index 1df966d17a..05d664541f

Re: [Qemu-devel] [PATCH v2 01/13] introduce g_autowipe

2019-08-27 Thread Tony Nguyen
Hi Maxim, On Mon, Aug 26, 2019 at 04:50:51PM +0300, Maxim Levitsky wrote: > 2. is it portable enought for us to use malloc_usable_size > to get the size of malloced pointer in the autofree callback? > This function is aviable in glibc (but no wrapper in glib). We will also need to consider host p

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

2019-08-26 Thread Tony Nguyen
kefile.include b/tests/Makefile.include > index 49684fd4f4..f5ac09549c 100644 > --- a/tests/Makefile.include > +++ b/tests/Makefile.include > @@ -1135,7 +1135,7 @@ TESTS_RESULTS_DIR=$(BUILD_DIR)/tests/results > AVOCADO_SHOW=app > AVOCADO_TAGS=$(patsubst %-softmmu,-t arch:%, $(filter > %-softmmu,$(TARGET_DIRS))) > > -ifneq ($(findstring v2,"v$(PYTHON_VERSION)"),v2) > +ifneq ($(PYTHON2),y) > $(TESTS_VENV_DIR): $(TESTS_VENV_REQ) > $(call quiet-command, \ > $(PYTHON) -m venv --system-site-packages $@, \ > -- > 2.21.0 > > Reviewed-by: Tony Nguyen

[Qemu-devel] [PATCH 18/19] hw/timer: Declare device little or big endian

2019-08-26 Thread Tony Nguyen
-off-by: Tony Nguyen --- hw/timer/a9gtimer.c | 4 ++-- hw/timer/arm_mptimer.c | 4 ++-- hw/timer/arm_timer.c| 4 ++-- hw/timer/armv7m_systick.c | 2 +- hw/timer/aspeed_rtc.c | 2 +- hw/timer/cadence_ttc.c | 2 +- hw/timer/grlib_gptimer.c| 2 +- hw/timer/hpet.c

[Qemu-devel] [PATCH 15/19] hw/pci-host: Declare device little or big endian

2019-08-26 Thread Tony Nguyen
-off-by: Tony Nguyen --- hw/pci-host/bonito.c| 2 +- hw/pci-host/q35.c | 2 +- hw/pci-host/versatile.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c index ceee463a11..c4bb9239b0 100644 --- a/hw/pci-host/bonito.c +++ b

[Qemu-devel] [PATCH 17/19] hw/ssi: Declare device little or big endian

2019-08-26 Thread Tony Nguyen
-off-by: Tony Nguyen --- hw/ssi/mss-spi.c | 2 +- hw/ssi/pl022.c | 2 +- hw/ssi/stm32f2xx_spi.c | 2 +- hw/ssi/xilinx_spips.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/ssi/mss-spi.c b/hw/ssi/mss-spi.c index 3050fabb69..914f90f3ad 100644 --- a/hw/ssi

[Qemu-devel] [PATCH 14/19] hw/net: Declare device little or big endian

2019-08-26 Thread Tony Nguyen
-off-by: Tony Nguyen --- hw/net/allwinner_emac.c | 2 +- hw/net/imx_fec.c| 2 +- hw/net/lan9118.c| 4 ++-- hw/net/lance.c | 2 +- hw/net/smc91c111.c | 2 +- hw/net/stellaris_enet.c | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hw/net

[Qemu-devel] [PATCH 16/19] hw/sd: Declare device little or big endian

2019-08-26 Thread Tony Nguyen
-off-by: Tony Nguyen --- hw/sd/pl181.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/sd/pl181.c b/hw/sd/pl181.c index 8033fe455d..f19d8764e8 100644 --- a/hw/sd/pl181.c +++ b/hw/sd/pl181.c @@ -451,7 +451,7 @@ static void pl181_write(void *opaque, hwaddr offset, static

[Qemu-devel] [PATCH 13/19] hw/misc: Declare device little or big endian

2019-08-26 Thread Tony Nguyen
-off-by: Tony Nguyen --- hw/misc/a9scu.c| 2 +- hw/misc/applesmc.c | 6 +++--- hw/misc/arm11scu.c | 2 +- hw/misc/arm_integrator_debug.c | 2 +- hw/misc/arm_l2x0.c | 2 +- hw/misc/edu.c | 2 +- hw/misc/mos6522.c | 2

[Qemu-devel] [PATCH 10/19] hw/intc: Declare device little or big endian

2019-08-26 Thread Tony Nguyen
-off-by: Tony Nguyen --- hw/intc/arm_gic.c | 12 ++-- hw/intc/arm_gicv3.c| 4 ++-- hw/intc/arm_gicv3_its_common.c | 2 +- hw/intc/etraxfs_pic.c | 2 +- hw/intc/imx_avic.c | 2 +- hw/intc/imx_gpcv2.c| 2 +- hw/intc/pl190.c

[Qemu-devel] [PATCH 09/19] hw/input: Declare device little or big endian

2019-08-26 Thread Tony Nguyen
-off-by: Tony Nguyen --- hw/input/pl050.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/input/pl050.c b/hw/input/pl050.c index 1123037b38..873f44abad 100644 --- a/hw/input/pl050.c +++ b/hw/input/pl050.c @@ -139,7 +139,7 @@ static void pl050_write(void *opaque, hwaddr

[Qemu-devel] [PATCH 19/19] build: Correct non-common common-obj-* to obj-*

2019-08-26 Thread Tony Nguyen
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 compile. Signed-off-by: Tony Nguyen --- hw/block

[Qemu-devel] [PATCH 11/19] hw/ipack: Declare device little or big endian

2019-08-26 Thread Tony Nguyen
-off-by: Tony Nguyen --- hw/ipack/tpci200.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/ipack/tpci200.c b/hw/ipack/tpci200.c index f931d4df62..c90fabab7c 100644 --- a/hw/ipack/tpci200.c +++ b/hw/ipack/tpci200.c @@ -526,7 +526,7 @@ static void tpci200_write_las3

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

2019-08-26 Thread Tony Nguyen
-off-by: Tony Nguyen --- hw/dma/bcm2835_dma.c | 4 ++-- hw/dma/etraxfs_dma.c | 14 +++--- hw/dma/i8257.c | 4 ++-- hw/dma/pl080.c | 2 +- hw/dma/pl330.c | 2 +- hw/dma/puv3_dma.c| 2 +- hw/dma/sparc32_dma.c | 2 +- 7 files changed, 15 insertions(+), 15 deletions

[Qemu-devel] [PATCH 07/19] hw/gpio: Declare device little or big endian

2019-08-26 Thread Tony Nguyen
-off-by: Tony Nguyen --- hw/gpio/pl061.c | 2 +- hw/gpio/puv3_gpio.c | 2 +- hw/gpio/zaurus.c| 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/gpio/pl061.c b/hw/gpio/pl061.c index 2a828260bd..25371d6c5a 100644 --- a/hw/gpio/pl061.c +++ b/hw/gpio/pl061.c @@ -341,7

[Qemu-devel] [PATCH 12/19] hw/isa: Declare device little or big endian

2019-08-26 Thread Tony Nguyen
-off-by: Tony Nguyen --- hw/isa/vt82c686.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c index 50bd28fa82..400f2b3c87 100644 --- a/hw/isa/vt82c686.c +++ b/hw/isa/vt82c686.c @@ -109,7 +109,7 @@ static uint64_t superio_ioport_readb(void

[Qemu-devel] [PATCH 04/19] hw/core: Declare device little or big endian

2019-08-26 Thread Tony Nguyen
-off-by: Tony Nguyen --- hw/core/empty_slot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/core/empty_slot.c b/hw/core/empty_slot.c index 3ba450e1ca..2785b6acf9 100644 --- a/hw/core/empty_slot.c +++ b/hw/core/empty_slot.c @@ -49,7 +49,7 @@ static void empty_slot_write(void

[Qemu-devel] [PATCH 05/19] hw/display: Declare device little or big endian

2019-08-26 Thread Tony Nguyen
-off-by: Tony Nguyen --- hw/display/exynos4210_fimd.c | 2 +- hw/display/jazz_led.c| 2 +- hw/display/pl110.c | 2 +- hw/display/tc6393xb.c| 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/display/exynos4210_fimd.c b/hw/display/exynos4210_fimd.c

[Qemu-devel] [PATCH 03/19] hw/char: Declare device little or big endian

2019-08-26 Thread Tony Nguyen
-off-by: Tony Nguyen --- hw/char/cadence_uart.c | 2 +- hw/char/escc.c | 2 +- hw/char/etraxfs_ser.c| 2 +- hw/char/grlib_apbuart.c | 2 +- hw/char/imx_serial.c | 2 +- hw/char/lm32_uart.c | 2 +- hw/char/milkymist-uart.c | 2 +- hw/char/pl011.c | 2 +- 8 files

[Qemu-devel] [PATCH 08/19] hw/i2c: Declare device little or big endian

2019-08-26 Thread Tony Nguyen
-off-by: Tony Nguyen Acked-by: David Gibson --- hw/i2c/exynos4210_i2c.c | 2 +- hw/i2c/imx_i2c.c| 2 +- hw/i2c/mpc_i2c.c| 2 +- hw/i2c/versatile_i2c.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/i2c/exynos4210_i2c.c b/hw/i2c/exynos4210_i2c.c index

[Qemu-devel] [PATCH 00/19] Declare device little or big endian

2019-08-26 Thread Tony Nguyen
- if just a bit bucket, re-declare as DEVICE_HOST_ENDIAN - if PCI, re-declare as DEVICE_LITTLE_ENDIAN. - if for {ARM|unicore32} only, re-declare as DEVICE_LITTLE_ENDIAN. - if for SPARC only, re-declare as DEVICE_BIG_ENDIAN. Likely still not %100 correct, but I think more than before. Since RFC: - A

[Qemu-devel] [PATCH 02/19] hw/block: Declare device little or big endian

2019-08-26 Thread Tony Nguyen
-off-by: Tony Nguyen --- hw/block/fdc.c | 4 ++-- hw/block/onenand.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/block/fdc.c b/hw/block/fdc.c index ac5d31e8c1..2745586982 100644 --- a/hw/block/fdc.c +++ b/hw/block/fdc.c @@ -984,13 +984,13 @@ static void

[Qemu-devel] [PATCH 01/19] hw/audio: Declare device little or big endian

2019-08-26 Thread Tony Nguyen
-off-by: Tony Nguyen --- hw/audio/cs4231.c | 2 +- hw/audio/intel-hda.c | 2 +- hw/audio/marvell_88w8618.c | 2 +- hw/audio/milkymist-ac97.c | 2 +- hw/audio/pl041.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/audio/cs4231.c b/hw/audio/cs4231

[Qemu-devel] [PATCH 6/9] memory: Delete devend_memop

2019-08-23 Thread Tony Nguyen
device_endian has been made redundant by MemOp. Signed-off-by: Tony Nguyen --- include/exec/memory.h | 3 --- memory.c | 19 +-- memory_ldst.inc.c | 18 ++ 3 files changed, 7 insertions(+), 33 deletions(-) diff --git a/include/exec/memory.h b

[Qemu-devel] [PATCH 9/9] memory: Delete memory_region_big_endian

2019-08-23 Thread Tony Nguyen
memory_region_big_endian is no longer useful now we are consistently using MemOp for endianness. Signed-off-by: Tony Nguyen --- memory.c | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/memory.c b/memory.c index ee7559a18c..b647a8d3dd 100644 --- a/memory.c +++ b

[Qemu-devel] [PATCH 8/9] exec: Delete DEVICE_HOST_ENDIAN

2019-08-23 Thread Tony Nguyen
Simplify code with MemOp short hand for host endianness, 0. typedef enum MemOp { /* snip */ #ifdef HOST_WORDS_BIGENDIAN MO_LE= MO_BSWAP, MO_BE= 0, #else MO_LE= 0, MO_BE= MO_BSWAP, #endif /* snip */ }; Signed-off-by: Tony Nguyen --- include

[Qemu-devel] [PATCH 2/9] exec: Replace DEVICE_NATIVE_ENDIAN with MO_TE

2019-08-23 Thread Tony Nguyen
Simplify endianness comparisons with consistent use of the more expressive MemOp. Suggested-by: Richard Henderson Signed-off-by: Tony Nguyen Reviewed-by: Richard Henderson Acked-by: David Gibson --- exec.c | 8 +++ hw/adc/stm32f2xx_adc.c | 2 +- hw/arm

[Qemu-devel] [PATCH 4/9] exec: Replace DEVICE_BIG_ENDIAN with MO_BE

2019-08-23 Thread Tony Nguyen
Simplify endianness comparisons with consistent use of the more expressive MemOp. Suggested-by: Richard Henderson Signed-off-by: Tony Nguyen Reviewed-by: Richard Henderson Acked-by: David Gibson --- hw/audio/cs4231.c | 2 +- hw/audio/milkymist-ac97.c | 2 +- hw/char/escc.c

[Qemu-devel] [PATCH 7/9] exec: Delete device_endian

2019-08-23 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 01a29ba571..7eeb78c48b 100644 --- a

[Qemu-devel] [PATCH 5/9] exec: Replace enum device_endian with MemOp

2019-08-23 Thread Tony Nguyen
Simplify endianness comparisons with consistent use of the more expressive MemOp. Suggested-by: Richard Henderson Signed-off-by: Tony Nguyen Reviewed-by: Richard Henderson Acked-by: David Gibson --- hw/char/serial.c | 2 +- include/exec/memory.h| 6 +++--- include/hw/char

[Qemu-devel] [PATCH 1/9] exec: Map device_endian onto MemOp

2019-08-23 Thread Tony Nguyen
will then delete unused device_endian. Signed-off-by: Tony Nguyen Reviewed-by: Richard Henderson --- hw/char/serial.c | 18 ++ include/exec/cpu-common.h | 10 +++--- memory.c | 1 - 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a

[Qemu-devel] [PATCH 0/9] Delete enum device_endian

2019-08-23 Thread Tony Nguyen
bit in SPARCv9 MMU TTE Based-on: [RFC PATCH 00/17] Declare device little or big endian Tony Nguyen (9): exec: Map device_endian onto MemOp exec: Replace DEVICE_NATIVE_ENDIAN with MO_TE exec: Replace DEVICE_LITTLE_ENDIAN with MO_LE exec: Replace DEVICE_BIG_ENDIAN with MO_BE exec

[Qemu-devel] [RFC PATCH 16/17] hw/timer: Declare device little or big endian

2019-08-23 Thread Tony Nguyen
=) Signed-off-by: Tony Nguyen --- hw/timer/a9gtimer.c | 4 ++-- hw/timer/arm_mptimer.c | 4 ++-- hw/timer/arm_timer.c| 4 ++-- hw/timer/armv7m_systick.c | 2 +- hw/timer/aspeed_rtc.c | 2 +- hw/timer/cadence_ttc.c | 2 +- hw/timer/grlib_gptimer.c| 2 +- hw/timer

[Qemu-devel] [RFC PATCH 15/17] hw/ssi: Declare device little or big endian

2019-08-23 Thread Tony Nguyen
=) Signed-off-by: Tony Nguyen --- hw/ssi/mss-spi.c | 2 +- hw/ssi/pl022.c | 2 +- hw/ssi/stm32f2xx_spi.c | 2 +- hw/ssi/xilinx_spips.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/ssi/mss-spi.c b/hw/ssi/mss-spi.c index 3050fabb69..914f90f3ad 100644 --- a/hw/ssi

[Qemu-devel] [RFC PATCH 13/17] hw/pci-host: Declare device little or big endian

2019-08-23 Thread Tony Nguyen
=) Signed-off-by: Tony Nguyen --- hw/pci-host/q35.c | 2 +- hw/pci-host/versatile.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c index 158d270b9f..485e2a02af 100644 --- a/hw/pci-host/q35.c +++ b/hw/pci-host/q35.c @@ -289,7 +289,7

[Qemu-devel] [RFC PATCH 14/17] hw/sd: Declare device little or big endian

2019-08-23 Thread Tony Nguyen
=) Signed-off-by: Tony Nguyen --- hw/sd/pl181.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/sd/pl181.c b/hw/sd/pl181.c index 8033fe455d..f19d8764e8 100644 --- a/hw/sd/pl181.c +++ b/hw/sd/pl181.c @@ -451,7 +451,7 @@ static void pl181_write(void *opaque, hwaddr offset, static

[Qemu-devel] [RFC PATCH 12/17] hw/net: Declare device little or big endian

2019-08-23 Thread Tony Nguyen
=) Signed-off-by: Tony Nguyen --- hw/net/allwinner_emac.c | 2 +- hw/net/imx_fec.c| 2 +- hw/net/lan9118.c| 4 ++-- hw/net/lance.c | 2 +- hw/net/smc91c111.c | 2 +- hw/net/stellaris_enet.c | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hw/net

[Qemu-devel] [RFC PATCH 10/17] hw/isa: Declare device little or big endian

2019-08-23 Thread Tony Nguyen
=) Signed-off-by: Tony Nguyen --- hw/isa/vt82c686.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c index 50bd28fa82..400f2b3c87 100644 --- a/hw/isa/vt82c686.c +++ b/hw/isa/vt82c686.c @@ -109,7 +109,7 @@ static uint64_t superio_ioport_readb(void

[Qemu-devel] [RFC PATCH 09/17] hw/intc: Declare device little or big endian

2019-08-23 Thread Tony Nguyen
=) Signed-off-by: Tony Nguyen --- hw/intc/arm_gic.c | 12 ++-- hw/intc/arm_gicv3.c | 4 ++-- hw/intc/etraxfs_pic.c | 2 +- hw/intc/imx_avic.c| 2 +- hw/intc/imx_gpcv2.c | 2 +- hw/intc/pl190.c | 2 +- hw/intc/puv3_intc.c | 2 +- 7 files changed, 13 insertions(+), 13

[Qemu-devel] [RFC PATCH 01/17] hw/audio: Declare device little or big endian

2019-08-23 Thread Tony Nguyen
=) Signed-off-by: Tony Nguyen --- hw/audio/cs4231.c | 2 +- hw/audio/marvell_88w8618.c | 2 +- hw/audio/milkymist-ac97.c | 2 +- hw/audio/pl041.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/audio/cs4231.c b/hw/audio/cs4231.c index b5d3e895ce..1ff9093efa

[Qemu-devel] [RFC PATCH 00/17] Declare device little or big endian

2019-08-23 Thread Tony Nguyen
enuinely native endian devices being incorrectly declared as little or big endian, but should not introduce regressions for current targets. Please help spot devices which are genuinely native endian. Thanks! Tony Nguyen (17): hw/audio: Declare device little or big endian hw/block: Declare device

[Qemu-devel] [RFC PATCH 07/17] hw/i2c: Declare device little or big endian

2019-08-23 Thread Tony Nguyen
=) Signed-off-by: Tony Nguyen --- hw/i2c/imx_i2c.c | 2 +- hw/i2c/mpc_i2c.c | 2 +- hw/i2c/versatile_i2c.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/i2c/imx_i2c.c b/hw/i2c/imx_i2c.c index 30b9aea247..cc2689d967 100644 --- a/hw/i2c/imx_i2c.c +++ b/hw/i2c

[Qemu-devel] [RFC PATCH 17/17] build: Correct non-common common-obj-* to obj-*

2019-08-23 Thread Tony Nguyen
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 compile. Signed-off-by: Tony Nguyen --- hw/audio

[Qemu-devel] [RFC PATCH 06/17] hw/gpio: Declare device little or big endian

2019-08-23 Thread Tony Nguyen
=) Signed-off-by: Tony Nguyen --- hw/gpio/pl061.c | 2 +- hw/gpio/zaurus.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/gpio/pl061.c b/hw/gpio/pl061.c index 2a828260bd..25371d6c5a 100644 --- a/hw/gpio/pl061.c +++ b/hw/gpio/pl061.c @@ -341,7 +341,7 @@ static void

[Qemu-devel] [RFC PATCH 11/17] hw/misc: Declare device little or big endian

2019-08-23 Thread Tony Nguyen
=) Signed-off-by: Tony Nguyen --- hw/misc/a9scu.c| 2 +- hw/misc/applesmc.c | 6 +++--- hw/misc/arm11scu.c | 2 +- hw/misc/arm_l2x0.c | 2 +- hw/misc/puv3_pm.c | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hw/misc/a9scu.c b/hw/misc/a9scu.c index 45c91db303..59335ca72f 100644

[Qemu-devel] [RFC PATCH 05/17] hw/dma: Declare device little or big endian

2019-08-23 Thread Tony Nguyen
=) Signed-off-by: Tony Nguyen --- hw/dma/bcm2835_dma.c | 4 ++-- hw/dma/etraxfs_dma.c | 2 +- hw/dma/pl080.c | 2 +- hw/dma/pl330.c | 2 +- hw/dma/puv3_dma.c| 2 +- hw/dma/sparc32_dma.c | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hw/dma/bcm2835_dma.c b/hw/dma

[Qemu-devel] [RFC PATCH 08/17] hw/input: Declare device little or big endian

2019-08-23 Thread Tony Nguyen
=) Signed-off-by: Tony Nguyen --- hw/input/pl050.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/input/pl050.c b/hw/input/pl050.c index 1123037b38..873f44abad 100644 --- a/hw/input/pl050.c +++ b/hw/input/pl050.c @@ -139,7 +139,7 @@ static void pl050_write(void *opaque, hwaddr

[Qemu-devel] [RFC PATCH 04/17] hw/display: Declare device little or big endian

2019-08-23 Thread Tony Nguyen
=) Signed-off-by: Tony Nguyen --- hw/display/pl110.c| 2 +- hw/display/tc6393xb.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/display/pl110.c b/hw/display/pl110.c index c2991a28d2..3831505165 100644 --- a/hw/display/pl110.c +++ b/hw/display/pl110.c @@ -473,7 +473,7

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

2019-08-23 Thread Tony Nguyen
=) Signed-off-by: Tony Nguyen --- hw/char/cadence_uart.c | 2 +- hw/char/escc.c | 2 +- hw/char/etraxfs_ser.c| 2 +- hw/char/grlib_apbuart.c | 2 +- hw/char/imx_serial.c | 2 +- hw/char/lm32_uart.c | 2 +- hw/char/milkymist-uart.c | 2 +- hw/char/pl011.c | 2 +- 8 files

[Qemu-devel] [RFC PATCH 02/17] hw/block: Declare device little or big endian

2019-08-23 Thread Tony Nguyen
=) Signed-off-by: Tony Nguyen --- hw/block/onenand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/block/onenand.c b/hw/block/onenand.c index fcc5a69b90..95fc0443d3 100644 --- a/hw/block/onenand.c +++ b/hw/block/onenand.c @@ -771,7 +771,7 @@ static void onenand_write(void *opaque

[Qemu-devel] [PATCH v9 19/20] target/sparc: Add TLB entry with attributes

2019-08-23 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 a/target

[Qemu-devel] [PATCH v9 20/20] target/sparc: sun4u Invert Endian TTE bit

2019-08-23 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 v9 18/20] cputlb: Byte swap memory transaction attribute

2019-08-23 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 v9 17/20] cpu: TLB_FLAGS_MASK bit to force memory slow path

2019-08-23 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 v9 16/20] memory: Single byte swap along the I/O path

2019-08-23 Thread Tony Nguyen
. SPARC64 Invert Endian TTE bit, with redundant byte swaps cancelling out. Suggested-by: Richard Henderson Signed-off-by: Tony Nguyen --- accel/tcg/cputlb.c | 42 ++-- exec.c | 17 +++- hw/virtio/virtio-pci.c | 10 +++ memory.c | 33

[Qemu-devel] [PATCH v9 14/20] memory: Access MemoryRegion with endianness

2019-08-23 Thread Tony Nguyen
handle the endianness. Once it does handle endianness, callers with byte swaps can collapse them into adjust_endianness. Signed-off-by: Tony Nguyen --- accel/tcg/cputlb.c | 8 ++-- exec.c | 13 +++-- hw/intc/armv7m_nvic.c| 15 --- hw/s390x/s390-

[Qemu-devel] [PATCH v9 13/20] exec: Hard code size with MO_{8|16|32|64}

2019-08-23 Thread Tony Nguyen
alls. Signed-off-by: Tony Nguyen Reviewed-by: Richard Henderson --- memory_ldst.inc.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/memory_ldst.inc.c b/memory_ldst.inc.c index 1e8a2fc3ba..de658c40c4 100644 --- a/memory_ldst.inc.c +++ b/memory_ldst.inc.c @@ -

[Qemu-devel] [PATCH v9 12/20] target/mips: Hard code size with MO_{8|16|32|64}

2019-08-23 Thread Tony Nguyen
alls. Signed-off-by: Tony Nguyen Reviewed-by: Richard Henderson Reviewed-by: Aleksandar Markovic --- target/mips/op_helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/mips/op_helper.c b/target/mips/op_helper.c index 1f0e88364a..34bcc8d884 100644 --- a/target/mi

[Qemu-devel] [PATCH v9 10/20] memory: Access MemoryRegion with MemOp

2019-08-23 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 +--

[Qemu-devel] [PATCH v9 09/20] cputlb: Access MemoryRegion with MemOp

2019-08-23 Thread Tony Nguyen
ot;unsigned size" will be converted into a "MemOp op". As size_memop is a no-op, this patch does not change any behaviour. Signed-off-by: Tony Nguyen Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- accel/tcg/cputlb.c | 8 1 file changed, 4 insertions(+)

[Qemu-devel] [PATCH v9 11/20] hw/s390x: Hard code size with MO_{8|16|32|64}

2019-08-23 Thread Tony Nguyen
alls. Signed-off-by: Tony Nguyen Reviewed-by: Richard Henderson Reviewed-by: Cornelia Huck --- hw/s390x/s390-pci-inst.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/s390x/s390-pci-inst.c b/hw/s390x/s390-pci-inst.c index 0c958fc391..0e92a372ca 100644 --- a/hw/s390x/s390

[Qemu-devel] [PATCH v9 08/20] exec: Access MemoryRegion with MemOp

2019-08-23 Thread Tony Nguyen
ot;unsigned size" will be converted into a "MemOp op". As size_memop is a no-op, this patch does not change any behaviour. Signed-off-by: Tony Nguyen Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- exec.c| 6 -- memory_ldst.inc.c | 18 +-

[Qemu-devel] [PATCH v9 07/20] hw/vfio: Access MemoryRegion with MemOp

2019-08-23 Thread Tony Nguyen
ot;unsigned size" will be converted into a "MemOp op". As size_memop is a no-op, this patch does not change any behaviour. Signed-off-by: Tony Nguyen Reviewed-by: Richard Henderson Reviewed-by: Cornelia Huck --- hw/vfio/pci-quirks.c | 6 -- 1 file changed, 4 insertions(+),

[Qemu-devel] [PATCH v9 06/20] hw/virtio: Access MemoryRegion with MemOp

2019-08-23 Thread Tony Nguyen
ot;unsigned size" will be converted into a "MemOp op". As size_memop is a no-op, this patch does not change any behaviour. Signed-off-by: Tony Nguyen Reviewed-by: Richard Henderson Reviewed-by: Cornelia Huck --- hw/virtio/virtio-pci.c | 7 +-- 1 file changed, 5 insertions(+)

[Qemu-devel] [PATCH v9 15/20] cputlb: Replace size and endian operands for MemOp

2019-08-23 Thread Tony Nguyen
Preparation for collapsing the two byte swaps adjust_endianness and handle_bswap into the former. Signed-off-by: Tony Nguyen Reviewed-by: Richard Henderson --- accel/tcg/cputlb.c | 170 +-- include/exec/memop.h | 6 ++ 2 files changed, 87 insertions

[Qemu-devel] [PATCH v9 04/20] hw/s390x: Access MemoryRegion with MemOp

2019-08-23 Thread Tony Nguyen
ot;unsigned size" will be converted into a "MemOp op". As size_memop is a no-op, this patch does not change any behaviour. Signed-off-by: Tony Nguyen Reviewed-by: Richard Henderson Reviewed-by: Cornelia Huck --- hw/s390x/s390-pci-inst.c | 8 +--- 1 file changed, 5 insertions(+

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

2019-08-23 Thread Tony Nguyen
ot;unsigned size" will be converted into a "MemOp op". As size_memop is a no-op, this patch does not change any behaviour. Signed-off-by: Tony Nguyen Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/intc/armv7m_nvic.c | 12 1 file changed, 8 ins

[Qemu-devel] [PATCH v9 03/20] target/mips: Access MemoryRegion with MemOp

2019-08-23 Thread Tony Nguyen
ot;unsigned size" will be converted into a "MemOp op". As size_memop is a no-op, this patch does not change any behaviour. Signed-off-by: Tony Nguyen Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Aleksandar Markovic --- target/mips/op_helper.c | 5 +

[Qemu-devel] [PATCH v9 02/20] memory: Introduce size_memop

2019-08-23 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.

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

2019-08-23 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 v9 00/20] Invert Endian bit in SPARCv9 MMU TTE

2019-08-22 Thread Tony Nguyen
From: 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

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

2019-08-21 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 v8 17/21] memory: Single byte swap along the I/O path

2019-08-21 Thread Tony Nguyen
. SPARC64 Invert Endian TTE bit, with redundant byte swaps cancelling out. Suggested-by: Richard Henderson Signed-off-by: Tony Nguyen --- accel/tcg/cputlb.c | 42 ++-- exec.c | 17 +++- hw/virtio/virtio-pci.c | 10 +++ memory.c | 33

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

2019-08-21 Thread Tony Nguyen
alls. Signed-off-by: Tony Nguyen Reviewed-by: Richard Henderson --- memory_ldst.inc.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/memory_ldst.inc.c b/memory_ldst.inc.c index 1e8a2fc3ba..de658c40c4 100644 --- a/memory_ldst.inc.c +++ b/memory_ldst.inc.c @@ -

[Qemu-devel] [PATCH v8 21/21] target/sparc: sun4u Invert Endian TTE bit

2019-08-21 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 v8 13/21] target/mips: Hard code size with MO_{8|16|32|64}

2019-08-21 Thread Tony Nguyen
alls. Signed-off-by: Tony Nguyen Reviewed-by: Richard Henderson --- target/mips/op_helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/mips/op_helper.c b/target/mips/op_helper.c index 1f0e88364a..34bcc8d884 100644 --- a/target/mips/op_helper.c +++ b/target/mips/op_

[Qemu-devel] [PATCH v8 20/21] target/sparc: Add TLB entry with attributes

2019-08-21 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 a/target

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

2019-08-21 Thread Tony Nguyen
alls. Signed-off-by: Tony Nguyen Reviewed-by: Richard Henderson Reviewed-by: Cornelia Huck --- hw/s390x/s390-pci-inst.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/s390x/s390-pci-inst.c b/hw/s390x/s390-pci-inst.c index 0c958fc391..0e92a372ca 100644 --- a/hw/s390x/s390

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

2019-08-21 Thread Tony Nguyen
Preparation for collapsing the two byte swaps adjust_endianness and handle_bswap into the former. Signed-off-by: Tony Nguyen Reviewed-by: Richard Henderson --- accel/tcg/cputlb.c | 170 +-- include/exec/memop.h | 6 ++ 2 files changed, 87 insertions

[Qemu-devel] [PATCH v8 08/21] hw/vfio: Access MemoryRegion with MemOp

2019-08-21 Thread Tony Nguyen
ot;unsigned size" will be converted into a "MemOp op". As size_memop is a no-op, this patch does not change any behaviour. Signed-off-by: Tony Nguyen Reviewed-by: Richard Henderson Reviewed-by: Cornelia Huck --- hw/vfio/pci-quirks.c | 6 -- 1 file changed, 4 insertions(+),

[Qemu-devel] [PATCH v8 18/21] cpu: TLB_FLAGS_MASK bit to force memory slow path

2019-08-21 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 v8 11/21] memory: Access MemoryRegion with MemOp

2019-08-21 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 +--

[Qemu-devel] [PATCH v8 07/21] hw/virtio: Access MemoryRegion with MemOp

2019-08-21 Thread Tony Nguyen
ot;unsigned size" will be converted into a "MemOp op". As size_memop is a no-op, this patch does not change any behaviour. Signed-off-by: Tony Nguyen Reviewed-by: Richard Henderson Reviewed-by: Cornelia Huck --- hw/virtio/virtio-pci.c | 7 +-- 1 file changed, 5 insertions(+)

[Qemu-devel] [PATCH v8 19/21] cputlb: Byte swap memory transaction attribute

2019-08-21 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 v8 05/21] hw/s390x: Access MemoryRegion with MemOp

2019-08-21 Thread Tony Nguyen
ot;unsigned size" will be converted into a "MemOp op". As size_memop is a no-op, this patch does not change any behaviour. Signed-off-by: Tony Nguyen Reviewed-by: Richard Henderson Reviewed-by: Cornelia Huck --- hw/s390x/s390-pci-inst.c | 8 +--- 1 file changed, 5 insertions(+

[Qemu-devel] [PATCH v8 09/21] exec: Access MemoryRegion with MemOp

2019-08-21 Thread Tony Nguyen
ot;unsigned size" will be converted into a "MemOp op". As size_memop is a no-op, this patch does not change any behaviour. Signed-off-by: Tony Nguyen Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- exec.c| 6 -- memory_ldst.inc.c | 18 +-

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

2019-08-21 Thread Tony Nguyen
ot;unsigned size" will be converted into a "MemOp op". As size_memop is a no-op, this patch does not change any behaviour. Signed-off-by: Tony Nguyen Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/intc/armv7m_nvic.c | 12 1 file changed, 8 ins

[Qemu-devel] [PATCH v8 10/21] cputlb: Access MemoryRegion with MemOp

2019-08-21 Thread Tony Nguyen
ot;unsigned size" will be converted into a "MemOp op". As size_memop is a no-op, this patch does not change any behaviour. Signed-off-by: Tony Nguyen Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- accel/tcg/cputlb.c | 8 1 file changed, 4 insertions(+)

[Qemu-devel] [PATCH v8 03/21] memory: Introduce size_memop

2019-08-21 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.

[Qemu-devel] [PATCH v8 04/21] target/mips: Access MemoryRegion with MemOp

2019-08-21 Thread Tony Nguyen
ot;unsigned size" will be converted into a "MemOp op". As size_memop is a no-op, this patch does not change any behaviour. Signed-off-by: Tony Nguyen Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- target/mips/op_helper.c | 5 +++-- 1 file changed, 3 insertions

[Qemu-devel] [PATCH v8 01/21] configure: Define TARGET_ALIGNED_ONLY in configure

2019-08-21 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