[PULL 03/15] hw/intc: Move some files out of the target-specific source set

2023-01-17 Thread Laurent Vivier
From: Philippe Mathieu-Daudé The Goldfish interrupt controller is not target specific. While the Exynos interrupt combiner is only used by the ARM targets, we can build this device once for all. Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20221209170042.71169-3-phi...@linaro.org>

[PULL 00/15] Trivial branch for 8.0 patches

2023-01-17 Thread Laurent Vivier
The following changes since commit a8d6abe1292e1db1ad9be5b2b124b9c01bcda094: Merge tag 'mips-20230113' of https://github.com/philmd/qemu into staging (2023-01-16 11:24:11 +) are available in the Git repository at: https://gitlab.com/laurent_vivier/qemu.git

[PULL 02/15] hw/display: Move omap_lcdc.c out of target-specific source set

2023-01-17 Thread Laurent Vivier
From: Philippe Mathieu-Daudé While only used by the ARM targets, this device can be built once for all. Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20221209170042.71169-2-phi...@linaro.org> Signed-off-by: Thomas Huth Reviewed-by: Richard Henderson Message-Id:

[PULL 04/15] hw/tpm: Move tpm_ppi.c out of target-specific source set

2023-01-17 Thread Laurent Vivier
From: Philippe Mathieu-Daudé The TPM Physical Presence Interface is not target specific. Build this file once for all targets. Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20221209170042.71169-4-phi...@linaro.org> [thuth: Drop the CONFIG_SOFTMMU statements, they are not needed here]

[PULL 06/15] hw/cpu: Mark arm11 and realview mpcore as target-independent code

2023-01-17 Thread Laurent Vivier
From: Thomas Huth Seems like there is nothing target-specific in here, so these files can be moved to softmmu_ss to avoid that they get compiled twice (once for qemu-system-arm and once for qemu-system-aarch64). Signed-off-by: Thomas Huth Reviewed-by: Richard Henderson Message-Id:

[PULL 10/15] hw/i386/pc: Remove unused 'owner' argument from pc_pci_as_mapping_init

2023-01-17 Thread Laurent Vivier
From: Philippe Mathieu-Daudé This argument was added 9 years ago in commit 83d08f2673 ("pc: map PCI address space as catchall region for not mapped addresses") and has never been used since, so remove it. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Bernhard Beschow Message-Id:

[PULL 11/15] ccid-card-emulated: fix cast warning/error

2023-01-17 Thread Laurent Vivier
From: Marc-André Lureau ../hw/usb/ccid-card-emulated.c: In function 'handle_apdu_thread': ../hw/usb/ccid-card-emulated.c:251:24: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] 251 | assert((unsigned long)event > 1000); Signed-off-by:

[PULL 05/15] hw/arm: Move various units to softmmu_ss[]

2023-01-17 Thread Laurent Vivier
From: Philippe Mathieu-Daudé arm_ss[] units are built twice: once for 32-bit word size and once for 64-bit. The following units don't require any word size knowledge and can be moved to softmmu_ss[] (where they are built once): - smmu-common.c - exynos4_boards.c - bcm2835_peripherals.c -

[PULL 12/15] hw/pvrdma: Protect against buggy or malicious guest driver

2023-01-17 Thread Laurent Vivier
From: Yuval Shaia Guest driver might execute HW commands when shared buffers are not yet allocated. This could happen on purpose (malicious guest) or because of some other guest/host address mapping error. We need to protect againts such case. Fixes: CVE-2022-1050 Reported-by: Raven

[PULL 13/15] hw/cxl/cxl-cdat.c: spelling: missmatch

2023-01-17 Thread Laurent Vivier
From: Michael Tokarev Introduced by: aba578bdace5303a441f8a37aad781b5cb06f38c Signed-off-by: Michael Tokarev Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20221215123749.1026775-1-...@msgid.tls.msk.ru> Signed-off-by: Laurent Vivier --- hw/cxl/cxl-cdat.c | 2 +- 1 file changed, 1

[PULL 09/15] tests/qtest/test-hmp: Improve the check for verbose mode

2023-01-17 Thread Laurent Vivier
From: Thomas Huth Running the test-hmp with V=2 up to V=9 runs the test in verbose mode, but running for example with V=10 falls back to non-verbose mode ... Improve this oddity by properly treating the argument as a number. Signed-off-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé

[PULL 01/15] Call qemu_socketpair() instead of socketpair() when possible

2023-01-17 Thread Laurent Vivier
From: Guoyi Tu As qemu_socketpair() was introduced in commit 3c63b4e9 ("oslib-posix: Introduce qemu_socketpair()"), it's time to replace the other existing socketpair() calls with qemu_socketpair() if possible Signed-off-by: Guoyi Tu Acked-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé

[PULL 08/15] hw/usb: Mark the XLNX_VERSAL-related files as target-independent

2023-01-17 Thread Laurent Vivier
From: Thomas Huth Seems like there is nothing target-specific in here, so these files can be moved to softmmu_ss to avoid that they get compiled twice (once for qemu-system-arm and once for qemu-system-aarch64). Signed-off-by: Thomas Huth Reviewed-by: Richard Henderson Message-Id:

[PULL 07/15] hw/intc: Mark more interrupt-controller files as target independent

2023-01-17 Thread Laurent Vivier
From: Thomas Huth Seems like there is also nothing target-specific in here, so these files can be moved to softmmu_ss to avoid that they get compiled twice (once for qemu-system-arm and once for qemu-system-aarch64). Signed-off-by: Thomas Huth Reviewed-by: Richard Henderson Message-Id:

[PULL 15/15] hw/ssi/sifive_spi.c: spelling: reigster

2023-01-17 Thread Laurent Vivier
From: Michael Tokarev Fixes: 0694dabe9763847f3010b54ab3ec7d367d2f0ff0 Signed-off-by: Michael Tokarev Reviewed-by: Alistair Francis Reviewed-by: Palmer Dabbelt Acked-by: Palmer Dabbelt Message-Id: <20221105115329.306527-1-...@msgid.tls.msk.ru> Signed-off-by: Laurent Vivier ---

[PULL 14/15] hw/cxl/cxl-host: Fix an error message typo

2023-01-17 Thread Laurent Vivier
From: Hoa Nguyen Signed-off-by: Hoa Nguyen Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20221127032220.2649-1-hoangu...@ucdavis.edu> Signed-off-by: Laurent Vivier --- hw/cxl/cxl-host.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/cxl/cxl-host.c

Re: [PATCH v2 04/11] hw/arm/aspeed: Use the IEC binary prefix definitions

2023-01-17 Thread Cédric Le Goater
On 1/18/23 07:53, Joel Stanley wrote: On Fri, 30 Dec 2022 at 11:35, Philippe Mathieu-Daudé wrote: IEC binary prefixes ease code review: the unit is explicit. I strongly prefer the existing code; it tells you the size without having to do maths. you mean that it matches better with the

Re: mips, nvme/pci boot regression (commit 145e2198d749)

2023-01-17 Thread Klaus Jensen
On Jan 17 15:25, Philippe Mathieu-Daudé wrote: > Hi Klaus, > > On 17/1/23 13:30, Klaus Jensen wrote: > > Hi Philippe, > > > > Commit 145e2198d749 ("hw/mips/gt64xxx_pci: Endian-swap using > > PCI_HOST_BRIDGE MemoryRegionOps") broke my mips64 nvme boot test > > (little-endian host, mips64 and nvme

Re: [PATCH] linux-user: fix strace build w/out munlockall

2023-01-17 Thread Philippe Mathieu-Daudé
On 18/1/23 00:30, Mike Frysinger wrote: Signed-off-by: Mike Frysinger --- linux-user/strace.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/linux-user/strace.c b/linux-user/strace.c index 9ae5a812cd71..f7912ad67f2b 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -1380,6

Re: [PATCH 4/4] hw/misc/macio: Return bool from functions taking errp

2023-01-17 Thread Philippe Mathieu-Daudé
On 18/1/23 01:32, BALATON Zoltan wrote: Use the convention to return bool from functions which take an error pointer which allows for callers to pass through their error pointer without needing a local. Signed-off-by: BALATON Zoltan --- hw/misc/macio/macio.c | 62

Re: [PATCH 3/4] hw/misc/macio: Remove some single use local variables

2023-01-17 Thread Philippe Mathieu-Daudé
On 18/1/23 01:32, BALATON Zoltan wrote: Drop some local variables that could just be substituted at the single place they were used. This makes the code shorter and simpler. Signed-off-by: BALATON Zoltan --- hw/misc/macio/macio.c | 13 + 1 file changed, 5 insertions(+), 8

Re: [PATCH 2/4] hw/misc/macio: Rename sysbus_dev to sbd for consistency and brevity

2023-01-17 Thread Philippe Mathieu-Daudé
On 18/1/23 01:32, BALATON Zoltan wrote: Some functions use sysbus_dev while others sbd name for local variable storing a sysbus device pointer. Standardise on the shorter name to be consistent and make the code easier to read as short name is less distracting and needs less line breaks.

Re: [PATCH 1/4] hw/misc/macio: Avoid some QOM casts

2023-01-17 Thread Philippe Mathieu-Daudé
On 18/1/23 01:32, BALATON Zoltan wrote: At several places we already have the object pointer with the right type so we don't need to cast it back and forth. Avoiding these casts improves readability. Signed-off-by: BALATON Zoltan --- hw/misc/macio/macio.c | 14 +++--- 1 file

Re: reverse-{debugging,continue} not working on v7.2.0, i386 guest

2023-01-17 Thread Pavel Dovgalyuk
As replay works well, the reverse debugging should be ok too. But for "going back" it needs a VM snapshot that can be used for reload. Snapshots are saved on qcow2 images connected to QEMU. Therefore you need to add an empty qcow2 to your command line with the following option: -drive

Re: [PATCH v2 04/11] hw/arm/aspeed: Use the IEC binary prefix definitions

2023-01-17 Thread Joel Stanley
On Fri, 30 Dec 2022 at 11:35, Philippe Mathieu-Daudé wrote: > > IEC binary prefixes ease code review: the unit is explicit. I strongly prefer the existing code; it tells you the size without having to do maths. > > Signed-off-by: Philippe Mathieu-Daudé > Reviewed-by: Peter Delevoryas > --- >

reverse-{debugging,continue} not working on v7.2.0, i386 guest

2023-01-17 Thread Hyeonggon Yoo
Hello QEMU folks. I was struggling to fix a recent heisenbug in the Linux kernel, and fortunately the bug was reproducible with TCG and -smp 1. I'm using qemu version 7.2.0, and guest architecture is i386. I tried to inspect the bug using record/replay and reverse-debugging feature in the QEMU.

Re: [PATCH 0/5] migration: Modified 'migrate' QAPI command for migration

2023-01-17 Thread Het Gala
On 17/01/23 4:22 pm, Claudio Fontana wrote: Hi, On 12/26/22 06:33, Het Gala wrote: Current QAPI 'migrate' command design (for initiating a migration stream) contains information regarding different migrate transport mechanism (tcp / unix / exec), dest-host IP address, and binding port number

Re: [PATCH 1/5] migration: Updated QAPI format for 'migrate' qemu monitor command

2023-01-17 Thread Het Gala
On 17/01/23 4:17 pm, Dr. David Alan Gilbert wrote: * Het Gala (het.g...@nutanix.com) wrote: From: Author Het Gala Existing 'migrate' QAPI design enforces transport mechanism, ip address of destination interface and corresponding port number in the form of a unified string 'uri' parameter.

Re: [PATCH 1/5] migration: Updated QAPI format for 'migrate' qemu monitor command

2023-01-17 Thread Het Gala
On 17/01/23 4:13 pm, Dr. David Alan Gilbert wrote: * Daniel P. Berrangé (berra...@redhat.com) wrote: On Mon, Dec 26, 2022 at 05:33:25AM +, Het Gala wrote: From: Author Het Gala Existing 'migrate' QAPI design enforces transport mechanism, ip address of destination interface and

Re: [PATCH v8] xen/pt: reserve PCI slot 2 for Intel igd-passthru

2023-01-17 Thread Alex Williamson
On Tue, 17 Jan 2023 19:15:57 -0500 Chuck Zmudzinski wrote: > On 1/17/2023 6:04 AM, Igor Mammedov wrote: > > On Mon, 16 Jan 2023 13:00:53 -0500 > > Chuck Zmudzinski wrote: > > > > > On 1/16/23 10:33, Igor Mammedov wrote: > > > > On Fri, 13 Jan 2023 16:31:26 -0500 > > > > Chuck Zmudzinski

Re: completion timeouts with pin-based interrupts in QEMU hw/nvme

2023-01-17 Thread Keith Busch
On Thu, Jan 12, 2023 at 02:10:51PM +0100, Klaus Jensen wrote: > Hi all (linux-nvme, qemu-devel, maintainers), > > On QEMU riscv64, which does not use MSI/MSI-X and thus relies on > pin-based interrupts, I'm seeing occasional completion timeouts, i.e. > > nvme nvme0: I/O 333 QID 1 timeout,

[PATCH v4 2/5] hw/arm/aspeed: Replace aspeed_eeprom_init with at24c_eeprom_init

2023-01-17 Thread Peter Delevoryas
aspeed_eeprom_init is an exact copy of at24c_eeprom_init, not needed. Signed-off-by: Peter Delevoryas Reviewed-by: Cédric Le Goater Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Joel Stanley --- hw/arm/aspeed.c | 95 ++--- 1 file changed, 43

[PATCH v4 1/5] hw/arm: Extract at24c_eeprom_init helper from Aspeed and Nuvoton boards

2023-01-17 Thread Peter Delevoryas
This helper is useful in board initialization because lets users initialize and realize an EEPROM on an I2C bus with a single function call. Signed-off-by: Peter Delevoryas Reviewed-by: Cédric Le Goater Reviewed-by: Joel Stanley --- hw/arm/aspeed.c | 10 +-

[PATCH v4 3/5] hw/nvram/eeprom_at24c: Add init_rom field and at24c_eeprom_init_rom helper

2023-01-17 Thread Peter Delevoryas
Allows users to specify binary data to initialize an EEPROM, allowing users to emulate data programmed at manufacturing time. - Added init_rom and init_rom_size attributes to TYPE_AT24C_EE - Added at24c_eeprom_init_rom helper function to initialize attributes - If -drive property is provided, it

[PATCH v4 5/5] hw/nvram/eeprom_at24c: Make reset behavior more like hardware

2023-01-17 Thread Peter Delevoryas
EEPROM's are a form of non-volatile memory. After power-cycling an EEPROM, I would expect the I2C state machine to be reset to default values, but I wouldn't really expect the memory to change at all. The current implementation of the at24c EEPROM resets its internal memory on reset. This matches

[PATCH v4 4/5] hw/arm/aspeed: Add aspeed_eeprom.c

2023-01-17 Thread Peter Delevoryas
- Create aspeed_eeprom.c and aspeed_eeprom.h - Include aspeed_eeprom.c in CONFIG_ASPEED meson source files - Include aspeed_eeprom.h in aspeed.c - Add fby35_bmc_fruid data - Use new at24c_eeprom_init_rom helper to initialize BMC FRUID EEPROM with data from aspeed_eeprom.c wget

[PATCH v4 0/5] hw/nvram/eeprom_at24c: Cleanup + FRUID EEPROM init example

2023-01-17 Thread Peter Delevoryas
v1: https://lore.kernel.org/qemu-devel/20230114170151.87833-1-pe...@pjd.dev/ v2: - Squashed 3 commits from original series into extract helper commit - Dropped last 2 commits from original series - Changed at24c_eeprom_init to return the I2CSlave object - Added commit to introduce

Re: [PATCH RESEND v3 08/10] migration: Implement dirty-limit convergence algo

2023-01-17 Thread Hyman Huang
在 2023/1/11 22:11, Markus Armbruster 写道: huang...@chinatelecom.cn writes: From: Hyman Huang(黄勇) Implement dirty-limit convergence algo for live migration, which is kind of like auto-converge algo but using dirty-limit instead of cpu throttle to make migration convergent. Enable dirty

Re: [PATCH RESEND v3 09/10] migration: Export dirty-limit time info for observation

2023-01-17 Thread Hyman Huang
在 2023/1/11 22:38, Markus Armbruster 写道: huang...@chinatelecom.cn writes: From: Hyman Huang(黄勇) Export dirty limit throttle time and estimated ring full time, through which we can observe if dirty limit take effect during live migration. Suggest something like "Extend query-migrate to

Re: [PATCH v3 3/5] hw/nvram/eeprom_at24c: Add init_rom field and at24c_eeprom_init_rom helper

2023-01-17 Thread Peter Delevoryas
On Wed, Jan 18, 2023 at 02:22:01AM +, Joel Stanley wrote: > On Tue, 17 Jan 2023 at 23:24, Peter Delevoryas wrote: > > > > Allows users to specify binary data to initialize an EEPROM, allowing users > > to > > emulate data programmed at manufacturing time. > > I like it. Is there somewhere

Re: [PATCH v3 5/5] hw/nvram/eeprom_at24c: Make reset behavior more like hardware

2023-01-17 Thread Joel Stanley
On Tue, 17 Jan 2023 at 23:24, Peter Delevoryas wrote: > > EEPROM's are a form of non-volatile memory. After power-cycling an EEPROM, > I would expect the I2C state machine to be reset to default values, but I > wouldn't really expect the memory to change at all. > > The current implementation of

Re: [PATCH v3 4/5] hw/arm/aspeed: Add aspeed_eeprom.c

2023-01-17 Thread Joel Stanley
On Tue, 17 Jan 2023 at 23:24, Peter Delevoryas wrote: > > - Create aspeed_eeprom.c and aspeed_eeprom.h > - Include aspeed_eeprom.c in CONFIG_ASPEED meson source files > - Include aspeed_eeprom.h in aspeed.c > - Add fby35_bmc_fruid data > - Use new at24c_eeprom_init_rom helper to initialize BMC

Re: [PATCH v3 3/5] hw/nvram/eeprom_at24c: Add init_rom field and at24c_eeprom_init_rom helper

2023-01-17 Thread Joel Stanley
On Tue, 17 Jan 2023 at 23:24, Peter Delevoryas wrote: > > Allows users to specify binary data to initialize an EEPROM, allowing users to > emulate data programmed at manufacturing time. I like it. Is there somewhere sensible to add a description to the code base? Perhaps as a comment to your new

Re: [PATCH v3 0/6] qemu/bswap: Use compiler __builtin_bswap()

2023-01-17 Thread Richard Henderson
On 1/16/23 22:24, Philippe Mathieu-Daudé wrote: On 13/1/23 08:05, Philippe Mathieu-Daudé wrote: On 13/1/23 02:05, Richard Henderson wrote: On 1/11/23 08:31, Philippe Mathieu-Daudé wrote: Implement Richard's suggestion to use __builtin_bswap(). Convert to __builtin_bswap() one patch per OS to

Re: [PATCH v3 1/5] hw/arm: Extract at24c_eeprom_init helper from Aspeed and Nuvoton boards

2023-01-17 Thread Joel Stanley
On Tue, 17 Jan 2023 at 23:24, Peter Delevoryas wrote: > > This helper is useful in board initialization because lets users initialize > and > realize an EEPROM on an I2C bus with a single function call. > > Signed-off-by: Peter Delevoryas > Reviewed-by: Cédric Le Goater Reviewed-by: Joel

Re: [PATCH v3 2/5] hw/arm/aspeed: Replace aspeed_eeprom_init with at24c_eeprom_init

2023-01-17 Thread Joel Stanley
On Tue, 17 Jan 2023 at 23:24, Peter Delevoryas wrote: > > aspeed_eeprom_init is an exact copy of at24c_eeprom_init, not needed. > > Signed-off-by: Peter Delevoryas > Reviewed-by: Cédric Le Goater > Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Joel Stanley > --- > hw/arm/aspeed.c | 95

[PATCH v2 06/10] tcg/loongarch64: Introduce tcg_out_addi

2023-01-17 Thread Richard Henderson
Adjust the constraints to allow any int32_t for immediate addition. Split immediate adds into addu16i + addi, which covers quite a lot of the immediate space. For the hole in the middle, load the constant into TMP0 instead. Signed-off-by: Richard Henderson ---

[PATCH v2 02/10] target/loongarch: Disassemble jirl properly

2023-01-17 Thread Richard Henderson
While jirl shares the same instruction format as bne etc, it is not assembled the same. In particular, rd is printed first not second and the immediate is not pc-relative. Decode into the arg_rr_i structure, which prints correctly. This changes the "offs" member to "imm", to update translate.

[PATCH v2 03/10] target/loongarch: Disassemble pcadd* addresses

2023-01-17 Thread Richard Henderson
Print both the raw field and the resolved pc-relative address, as we do for branches. Signed-off-by: Richard Henderson --- target/loongarch/disas.c | 37 + 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/target/loongarch/disas.c

[PATCH v2 07/10] tcg/loongarch64: Improve setcond expansion

2023-01-17 Thread Richard Henderson
Split out a helper function, tcg_out_setcond_int, which does not always produce the complete boolean result, but returns a set of flags to do so. Accept all int32_t as constant input, so that LE/GT can adjust the constant to LT. Signed-off-by: Richard Henderson ---

[PATCH v2 09/10] tcg/loongarch64: Use tcg_pcrel_diff in tcg_out_ldst

2023-01-17 Thread Richard Henderson
Take the w^x split into account when computing the pc-relative distance to an absolute pointer. Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target.c.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcg/loongarch64/tcg-target.c.inc

[PATCH v2 00/10] tcg/loongarch64: Reorg goto_tb and cleanups

2023-01-17 Thread Richard Henderson
Based-on: 20230117231051.35-1-richard.hender...@linaro.org ("[PULL 00/22] tcg patch queue") Includes: * Disassembler from target/loongarch/. * Improvements to movi by Rui Wang, with minor tweaks. * Improvements to setcond. * Implement movcond. * Fix the same goto_tb bug that

[PATCH v2 08/10] tcg/loongarch64: Implement movcond

2023-01-17 Thread Richard Henderson
Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target-con-set.h | 1 + tcg/loongarch64/tcg-target.h | 4 ++-- tcg/loongarch64/tcg-target.c.inc | 33 3 files changed, 36 insertions(+), 2 deletions(-) diff --git

[PATCH v2 05/10] tcg/loongarch64: Update tcg-insn-defs.c.inc

2023-01-17 Thread Richard Henderson
Regenerate with ADDU16I included: $ cd loongarch-opcodes/scripts/go $ go run ./genqemutcgdefs > $QEMU/tcg/loongarch64/tcg-insn-defs.c.inc Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-insn-defs.c.inc | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) mode change

[PATCH v2 10/10] tcg/loongarch64: Reorg goto_tb implementation

2023-01-17 Thread Richard Henderson
The old implementation replaces two insns, swapping between b nop and pcaddu18i tmp, jirl zero, tmp, & 0x There is a race condition in which a thread could be stopped at the jirl, i.e. with the top of the address loaded, and when restarted we

[PATCH v2 04/10] tcg/loongarch64: Optimize immediate loading

2023-01-17 Thread Richard Henderson
From: Rui Wang diff: Imm Before After addi.w rd, zero, 0 addi.w rd, zero, 0 lu52i.d rd, zero, 0 f800lu12i.w rd, -1 addi.w rd, zero, -2048 ori rd, rd, 2048

[PATCH v2 01/10] target/loongarch: Enable the disassembler for host tcg

2023-01-17 Thread Richard Henderson
Reuse the decodetree based disassembler from target/loongarch/ for tcg/loongarch64/. The generation of decode-insns.c.inc into ./libcommon.fa.p/ could eventually result in conflict, if any other host requires the same trick, but this is good enough for now. Signed-off-by: Richard Henderson ---

[PATCH 2/4] hw/misc/macio: Rename sysbus_dev to sbd for consistency and brevity

2023-01-17 Thread BALATON Zoltan
Some functions use sysbus_dev while others sbd name for local variable storing a sysbus device pointer. Standardise on the shorter name to be consistent and make the code easier to read as short name is less distracting and needs less line breaks. Signed-off-by: BALATON Zoltan ---

[PATCH 3/4] hw/misc/macio: Remove some single use local variables

2023-01-17 Thread BALATON Zoltan
Drop some local variables that could just be substituted at the single place they were used. This makes the code shorter and simpler. Signed-off-by: BALATON Zoltan --- hw/misc/macio/macio.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/hw/misc/macio/macio.c

[PATCH 0/4] Misc macio clean ups

2023-01-17 Thread BALATON Zoltan
Just some small trivial clean ups that I've found while looking at hw/misc/macio/macio.c Regards, BALATON Zoltan BALATON Zoltan (4): hw/misc/macio: Avoid some QOM casts hw/misc/macio: Rename sysbus_dev to sbd for consistency and brevity hw/misc/macio: Remove some single use local variables

[PATCH 1/4] hw/misc/macio: Avoid some QOM casts

2023-01-17 Thread BALATON Zoltan
At several places we already have the object pointer with the right type so we don't need to cast it back and forth. Avoiding these casts improves readability. Signed-off-by: BALATON Zoltan --- hw/misc/macio/macio.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff

[PATCH 4/4] hw/misc/macio: Return bool from functions taking errp

2023-01-17 Thread BALATON Zoltan
Use the convention to return bool from functions which take an error pointer which allows for callers to pass through their error pointer without needing a local. Signed-off-by: BALATON Zoltan --- hw/misc/macio/macio.c | 62 +-- 1 file changed, 25

Re: [PATCH v5 2/2] riscv: Allow user to set the satp mode

2023-01-17 Thread Alistair Francis
On Wed, Jan 18, 2023 at 2:32 AM Andrew Jones wrote: > > On Fri, Jan 13, 2023 at 11:34:53AM +0100, Alexandre Ghiti wrote: > > RISC-V specifies multiple sizes for addressable memory and Linux probes for > > the machine's support at startup via the satp CSR register (done in > > csr.c:validate_vm).

Re: [PATCH] tcg/riscv: Use tcg_pcrel_diff in tcg_out_ldst

2023-01-17 Thread Alistair Francis
On Wed, Jan 18, 2023 at 9:05 AM Richard Henderson wrote: > > We failed to update this with the w^x split, so misses the fact > that true pc-relative offsets are usually small. > > Signed-off-by: Richard Henderson Reviewed-by: Alistair Francis Alistair > --- > tcg/riscv/tcg-target.c.inc | 2

Re: [PATCH v8] xen/pt: reserve PCI slot 2 for Intel igd-passthru

2023-01-17 Thread Chuck Zmudzinski
On 1/17/2023 6:04 AM, Igor Mammedov wrote: > On Mon, 16 Jan 2023 13:00:53 -0500 > Chuck Zmudzinski wrote: > > > On 1/16/23 10:33, Igor Mammedov wrote: > > > On Fri, 13 Jan 2023 16:31:26 -0500 > > > Chuck Zmudzinski wrote: > > > > > >> On 1/13/23 4:33 AM, Igor Mammedov wrote: > > >> > On

[PATCH] configure: do not quote $PKG_CONFIG

2023-01-17 Thread Mike Frysinger
We should not quote the PKG_CONFIG setting as this deviates from the canonical upstream behavior that gets integrated with all other build systems, and deviates from how we treat all other toolchain variables that we get from the environment. Ultimately, the point is that it breaks passing custom

[PATCH] linux-user: fix strace build w/out munlockall

2023-01-17 Thread Mike Frysinger
Signed-off-by: Mike Frysinger --- linux-user/strace.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/linux-user/strace.c b/linux-user/strace.c index 9ae5a812cd71..f7912ad67f2b 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -1380,6 +1380,7 @@ UNUSED static struct flags

[PATCH v3 2/5] hw/arm/aspeed: Replace aspeed_eeprom_init with at24c_eeprom_init

2023-01-17 Thread Peter Delevoryas
aspeed_eeprom_init is an exact copy of at24c_eeprom_init, not needed. Signed-off-by: Peter Delevoryas Reviewed-by: Cédric Le Goater Reviewed-by: Philippe Mathieu-Daudé --- hw/arm/aspeed.c | 95 ++--- 1 file changed, 43 insertions(+), 52 deletions(-)

[PATCH v3 4/5] hw/arm/aspeed: Add aspeed_eeprom.c

2023-01-17 Thread Peter Delevoryas
- Create aspeed_eeprom.c and aspeed_eeprom.h - Include aspeed_eeprom.c in CONFIG_ASPEED meson source files - Include aspeed_eeprom.h in aspeed.c - Add fby35_bmc_fruid data - Use new at24c_eeprom_init_rom helper to initialize BMC FRUID EEPROM with data from aspeed_eeprom.c wget

[PATCH v3 5/5] hw/nvram/eeprom_at24c: Make reset behavior more like hardware

2023-01-17 Thread Peter Delevoryas
EEPROM's are a form of non-volatile memory. After power-cycling an EEPROM, I would expect the I2C state machine to be reset to default values, but I wouldn't really expect the memory to change at all. The current implementation of the at24c EEPROM resets its internal memory on reset. This matches

[PATCH v3 3/5] hw/nvram/eeprom_at24c: Add init_rom field and at24c_eeprom_init_rom helper

2023-01-17 Thread Peter Delevoryas
Allows users to specify binary data to initialize an EEPROM, allowing users to emulate data programmed at manufacturing time. - Added init_rom and init_rom_size attributes to TYPE_AT24C_EE - Added at24c_eeprom_init_rom helper function to initialize attributes - If -drive property is provided, it

[PATCH v3 0/5] hw/nvram/eeprom_at24c: Cleanup + FRUID EEPROM init example

2023-01-17 Thread Peter Delevoryas
v1: https://lore.kernel.org/qemu-devel/20230114170151.87833-1-pe...@pjd.dev/ v2: - Squashed 3 commits from original series into extract helper commit - Dropped last 2 commits from original series - Changed at24c_eeprom_init to return the I2CSlave object - Added commit to introduce

[PATCH v3 1/5] hw/arm: Extract at24c_eeprom_init helper from Aspeed and Nuvoton boards

2023-01-17 Thread Peter Delevoryas
This helper is useful in board initialization because lets users initialize and realize an EEPROM on an I2C bus with a single function call. Signed-off-by: Peter Delevoryas Reviewed-by: Cédric Le Goater --- hw/arm/aspeed.c | 10 +- hw/arm/npcm7xx_boards.c | 20

[PULL 19/22] tcg/sparc64: Reorg goto_tb implementation

2023-01-17 Thread Richard Henderson
The old sparc64 implementation may replace two insns, which leaves a race condition in which a thread could be stopped at a PC in the middle of the sequence, and when restarted does not see the complete address computation and branches to nowhere. The new implemetation replaces only one insn,

[PULL 10/22] tcg: Add gen_tb to TCGContext

2023-01-17 Thread Richard Henderson
This can replace four other variables that are references into the TranslationBlock structure. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 11 +++ accel/tcg/translate-all.c | 2 +- tcg/tcg-op.c | 14 +++--- tcg/tcg.c

[PULL 06/22] tcg: Introduce set_jmp_insn_offset

2023-01-17 Thread Richard Henderson
Similar to the existing set_jmp_reset_offset. Move any assert for TCG_TARGET_HAS_direct_jump into the new function (which now cannot be build-time). Will be unused if TCG_TARGET_HAS_direct_jump is constant 0, but we can't test for constant in the preprocessor, so just mark it G_GNUC_UNUSED.

[PULL 13/22] tcg: Move tb_target_set_jmp_target declaration to tcg.h

2023-01-17 Thread Richard Henderson
Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/tcg/tcg.h| 3 +++ tcg/aarch64/tcg-target.h | 4 tcg/arm/tcg-target.h | 5 - tcg/i386/tcg-target.h| 3 --- tcg/loongarch64/tcg-target.h | 3 ---

[PULL 04/22] tcg/sparc64: Remove unused goto_tb code for indirect jump

2023-01-17 Thread Richard Henderson
Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/sparc64/tcg-target.c.inc | 41 +++- 1 file changed, 12 insertions(+), 29 deletions(-) diff --git a/tcg/sparc64/tcg-target.c.inc b/tcg/sparc64/tcg-target.c.inc index d2d8b46815..26b00d1638 100644

[PULL 05/22] tcg: Replace asserts on tcg_jmp_insn_offset

2023-01-17 Thread Richard Henderson
Test TCG_TARGET_HAS_direct_jump instead of testing an implementation pointer. Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/aarch64/tcg-target.c.inc | 2 +- tcg/arm/tcg-target.c.inc | 2 +- tcg/loongarch64/tcg-target.c.inc |

[PULL 01/22] tcg: Split out tcg_out_exit_tb

2023-01-17 Thread Richard Henderson
The INDEX_op_exit_tb opcode needs no register allocation. Split out a dedicated helper function for it. Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/tcg.c| 4 tcg/aarch64/tcg-target.c.inc | 22

[PULL 03/22] tcg/ppc: Remove unused goto_tb code for indirect jump

2023-01-17 Thread Richard Henderson
Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target.c.inc | 32 +--- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc index a95e4001d3..b72e266990 100644 ---

[PULL 11/22] tcg: Add TranslationBlock.jmp_insn_offset

2023-01-17 Thread Richard Henderson
Stop overloading jmp_target_arg for both offset and address, depending on TCG_TARGET_HAS_direct_jump. Instead, add a new field to hold the jump insn offset and always set the target address in jmp_target_addr[]. This will allow a tcg backend to use either direct or indirect depending on

[PULL 21/22] tcg/riscv: Introduce OPC_NOP

2023-01-17 Thread Richard Henderson
Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/riscv/tcg-target.c.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tcg/riscv/tcg-target.c.inc b/tcg/riscv/tcg-target.c.inc index 136fe54d4b..82ca86431e 100644 ---

[PULL 09/22] tcg: Rename TB_JMP_RESET_OFFSET_INVALID to TB_JMP_OFFSET_INVALID

2023-01-17 Thread Richard Henderson
This will shortly be used for more than reset. Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/exec/exec-all.h | 2 +- accel/tcg/translate-all.c | 8 tcg/tcg.c | 4 ++-- 3 files changed, 7 insertions(+), 7

[PULL 15/22] tcg: Remove TCG_TARGET_HAS_direct_jump

2023-01-17 Thread Richard Henderson
We now have the option to generate direct or indirect goto_tb depending on the dynamic displacement, thus the define is no longer necessary or completely accurate. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/aarch64/tcg-target.h | 1 - tcg/arm/tcg-target.h |

[PULL 22/22] tcg/riscv: Implement direct branch for goto_tb

2023-01-17 Thread Richard Henderson
Now that tcg can handle direct and indirect goto_tb simultaneously, we can optimistically leave space for a direct branch and fall back to loading the pointer from the TB for an indirect branch. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/riscv/tcg-target.c.inc | 19

[PULL 16/22] tcg/aarch64: Reorg goto_tb implementation

2023-01-17 Thread Richard Henderson
The old implementation replaces two insns, swapping between b nop br x30 and adrpx30, addix30, x30, lo12: br x30 There is a race condition in which a thread could be stopped at the PC of the second insn, and when restarted

[PULL 18/22] tcg/sparc64: Remove USE_REG_TB

2023-01-17 Thread Richard Henderson
This is always true for sparc64, so this is dead since 3a5f6805c7ca. Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/sparc64/tcg-target.c.inc | 62 1 file changed, 21 insertions(+), 41 deletions(-)

[PULL 12/22] tcg: Change tb_target_set_jmp_target arguments

2023-01-17 Thread Richard Henderson
Replace 'tc_ptr' and 'addr' with 'tb' and 'n'. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/aarch64/tcg-target.h | 3 ++- tcg/arm/tcg-target.h | 3 ++- tcg/i386/tcg-target.h| 9 ++--- tcg/loongarch64/tcg-target.h | 3 ++-

[PULL 17/22] tcg/ppc: Reorg goto_tb implementation

2023-01-17 Thread Richard Henderson
The old ppc64 implementation replaces 2 or 4 insns, which leaves a race condition in which a thread could be stopped at a PC in the middle of the sequence, and when restarted does not see the complete address computation and branches to nowhere. The new implemetation replaces only one insn,

[PULL 00/22] tcg patch queue

2023-01-17 Thread Richard Henderson
repository at: https://gitlab.com/rth7680/qemu.git tags/pull-tcg-20230117 for you to fetch changes up to 493c9b19a7fb7f387c4fcf57d3836504d5242bf5: tcg/riscv: Implement direct branch for goto_tb (2023-01-17 22:36:17 +) tcg: Fix race

[PULL 20/22] tcg/arm: Implement direct branch for goto_tb

2023-01-17 Thread Richard Henderson
Now that tcg can handle direct and indirect goto_tb simultaneously, we can optimistically leave space for a direct branch and fall back to loading the pointer from the TB for an indirect branch. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/arm/tcg-target.c.inc | 52

[PULL 08/22] tcg: Split out tcg_out_goto_tb

2023-01-17 Thread Richard Henderson
The INDEX_op_goto_tb opcode needs no register allocation. Split out a dedicated helper function for it. Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/tcg.c| 4 ++ tcg/aarch64/tcg-target.c.inc | 40

[PULL 14/22] tcg: Always define tb_target_set_jmp_target

2023-01-17 Thread Richard Henderson
Install empty versions for !TCG_TARGET_HAS_direct_jump hosts. Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/arm/tcg-target.c.inc | 6 ++ tcg/mips/tcg-target.c.inc | 6 ++ tcg/riscv/tcg-target.c.inc | 6 ++

[PULL 07/22] tcg: Introduce get_jmp_target_addr

2023-01-17 Thread Richard Henderson
Similar to the existing set_jmp_reset_offset. Include the rw->rx address space conversion done by arm and s390x, and forgotten by mips and riscv. Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/tcg.c | 9 +

[PULL 02/22] tcg/i386: Remove unused goto_tb code for indirect jump

2023-01-17 Thread Richard Henderson
Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/i386/tcg-target.c.inc | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc index feb257db01..c4ff59e9ee 100644 --- a/tcg/i386/tcg-target.c.inc

[PATCH] tcg/riscv: Use tcg_pcrel_diff in tcg_out_ldst

2023-01-17 Thread Richard Henderson
We failed to update this with the w^x split, so misses the fact that true pc-relative offsets are usually small. Signed-off-by: Richard Henderson --- tcg/riscv/tcg-target.c.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcg/riscv/tcg-target.c.inc

Re: [PATCH v2 0/6] Resolve TYPE_PIIX3_XEN_DEVICE

2023-01-17 Thread Bernhard Beschow
Am 4. Januar 2023 14:44:31 UTC schrieb Bernhard Beschow : >This series first renders TYPE_PIIX3_XEN_DEVICE redundant and finally removes > >it. The motivation is to 1/ decouple PIIX from Xen and 2/ to make Xen in the PC > >machine agnostic to the precise southbridge being used. 2/ will become >

Re: [PATCH qemu v2 3/3] target/arm/gdbstub: Support reading M security extension registers from GDB

2023-01-17 Thread David Reiss
On 1/17/23 1:42 PM, Richard Henderson wrote: > Is there a reason why these are separate from m_systemreg? GDB puts these in a separate file, and J-Link puts them in a separate feature block. In general, I think it's nice to separate stuff related to the secure extension so folks not working with

Re: [PATCH qemu v2 2/3] target/arm/gdbstub: Support reading M system registers from GDB

2023-01-17 Thread David Reiss
On 1/17/23 1:40 PM, Richard Henderson wrote: >> diff --git a/target/arm/cpu.h b/target/arm/cpu.h >> index bf2bce046d..fdbb0d9107 100644 >> --- a/target/arm/cpu.h >> +++ b/target/arm/cpu.h >> @@ -856,6 +856,7 @@ struct ArchCPU { >>     DynamicGDBXMLInfo dyn_sysreg_xml; >>  

  1   2   3   4   >