[PATCH v6 00/14] target/arm: Implement FEAT_HAFDBS

2022-10-23 Thread Richard Henderson
Changes for v6: * Fix rebase error wrt xn bit extract. Changes for v5: * Rebase, including 12 patches. * Add regime_is_stage2, which I should have done ages ago. * Reorg attribute extraction/merging vs descriptor modifications. Patches lacking review:

Re: [PATCH v4] m68k: write bootinfo as rom section and re-randomize on reboot

2022-10-23 Thread Jason A. Donenfeld
On Sat, Oct 22, 2022 at 8:41 AM Richard Henderson wrote: > > On Sat, 22 Oct 2022, 08:33 Laurent Vivier, wrote: >> >> Le 17/10/2022 à 22:29, Jason A. Donenfeld a écrit : >> >> >> Notes: >> - don't send your patch as a reply to a previous version >> - add an history: >> >> v4: replace (void

Re: [PATCH v2 34/43] hw/isa/piix4: Rename reset control operations to match PIIX3

2022-10-23 Thread Philippe Mathieu-Daudé
On 22/10/22 17:04, Bernhard Beschow wrote: Both implementations are the same and will be shared upon merging. Signed-off-by: Bernhard Beschow --- hw/isa/piix4.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

[PATCH 10/16] hw/9pfs: Update the local fs driver to support Windows

2022-10-23 Thread Bin Meng
From: Guohuai Shi At present there is no Windows support for 9p file system. This commit adds initial Windows support for 9p file system. 'local' file system backend driver is supported on Windows, including open, read, write, close, rename, remove, etc. All security models are supported. The

[PATCH v6 4/7] hw/arm/virt: Introduce virt_get_high_memmap_enabled() helper

2022-10-23 Thread Gavin Shan
This introduces virt_get_high_memmap_enabled() helper, which returns the pointer to vms->highmem_{redists, ecam, mmio}. The pointer will be used in the subsequent patches. No functional change intended. Signed-off-by: Gavin Shan Reviewed-by: Eric Auger Reviewed-by: Cornelia Huck Tested-by:

Re: [PATCH v2 24/43] hw/isa/piix3: Rename typedef PIIX3State to PIIXState

2022-10-23 Thread Philippe Mathieu-Daudé
On 22/10/22 17:04, Bernhard Beschow wrote: This commit marks the finalization of the PIIX3 preparations to be merged with PIIX4. In particular, PIIXState is prepared to be reused in piix4.c. Signed-off-by: Bernhard Beschow --- hw/isa/piix3.c| 58

Re: [PATCH v3 0/2] implement `FIELDx_1CLEAR() macro

2022-10-23 Thread Alistair Francis
On Mon, Oct 17, 2022 at 3:52 PM Wilfred Mallawa wrote: > > From: Wilfred Mallawa > > This patch series implements a `FIELDx_1CLEAR()` macro and implements it > in the `hw/ssi/ibex_spi.c` model. > > *** Changelog *** > Since v2: > - change the macro arguments name to

Re: [PATCH v4 0/7] ppc/e500: Add support for two types of flash, cleanup

2022-10-23 Thread Bernhard Beschow
Am 18. Oktober 2022 21:01:39 UTC schrieb Bernhard Beschow : >Cover letter: > >~ > > > >This series adds support for -pflash and direct SD card access to the > >PPC e500 boards. The idea is to increase compatibility with "real" firmware > >images where only the bare minimum of drivers

Re: [PATCH 3/3] Drop more useless casts from void * to pointer

2022-10-23 Thread Laurent Vivier
Le 23/09/2022 à 14:00, Markus Armbruster a écrit : Signed-off-by: Markus Armbruster --- bsd-user/elfload.c | 2 +- contrib/plugins/cache.c | 8 contrib/vhost-user-blk/vhost-user-blk.c | 2 +- hw/core/qdev-clock.c| 2 +-

[PATCH v2 41/43] hw/isa/piix: Share PIIX3 base class with PIIX4

2022-10-23 Thread Bernhard Beschow
Having a common base class allows for substituting PIIX3 with PIIX4 and vice versa. Moreover, it makes PIIX4 implement the acpi-dev-aml-interface. Signed-off-by: Bernhard Beschow --- hw/isa/piix.c | 53 +++ 1 file changed, 24 insertions(+), 29

[PATCH v6 0/7] hw/arm/virt: Improve address assignment for high memory regions

2022-10-23 Thread Gavin Shan
There are three high memory regions, which are VIRT_HIGH_REDIST2, VIRT_HIGH_PCIE_ECAM and VIRT_HIGH_PCIE_MMIO. Their base addresses are floating on highest RAM address. However, they can be disabled in several cases. (1) One specific high memory region is disabled by developer by toggling

[PATCH v4 1/2] Refactoring: refactor TFR() macro to RETRY_ON_EINTR()

2022-10-23 Thread Nikita Ivanov
Rename macro name to more transparent one and refactor it to expression. Signed-off-by: Nikita Ivanov --- chardev/char-fd.c | 2 +- chardev/char-pipe.c| 8 +--- include/qemu/osdep.h | 8 +++- net/tap-bsd.c | 6 +++--- net/tap-linux.c| 2 +- net/tap-solaris.c

[PATCH v6 09/14] target/arm: Don't shift attrs in get_phys_addr_lpae

2022-10-23 Thread Richard Henderson
Leave the upper and lower attributes in the place they originate from in the descriptor. Shifting them around is confusing, since one cannot read the bit numbers out of the manual. Also, new attributes have been added which would alter the shifts. Reviewed-by: Peter Maydell Signed-off-by:

Re: [RFC PATCH v2 6/8] vdpa: handle VIRTIO_NET_CTRL_ANNOUNCE in vhost_vdpa_net_handle_ctrl_avail

2022-10-23 Thread Jason Wang
On Fri, Oct 21, 2022 at 5:05 PM Eugenio Perez Martin wrote: > > On Fri, Oct 21, 2022 at 5:02 AM Jason Wang wrote: > > > > On Thu, Oct 20, 2022 at 3:01 PM Eugenio Perez Martin > > wrote: > > > > > > On Thu, Oct 20, 2022 at 6:35 AM Jason Wang wrote: > > > > > > > > On Wed, Oct 19, 2022 at 8:52

[PATCH 13/16] fsdev: Disable proxy fs driver on Windows

2022-10-23 Thread Bin Meng
From: Guohuai Shi We don't plan to support 'proxy' file system driver for 9pfs on Windows. Disable it for Windows build. Signed-off-by: Guohuai Shi Signed-off-by: Bin Meng --- fsdev/qemu-fsdev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fsdev/qemu-fsdev.c b/fsdev/qemu-fsdev.c

[PATCH v6 02/14] target/arm: Add ptw_idx to S1Translate

2022-10-23 Thread Richard Henderson
Hoist the computation of the mmu_idx for the ptw up to get_phys_addr_with_struct and get_phys_addr_twostage. This removes the duplicate check for stage2 disabled from the middle of the walk, performing it only once. Signed-off-by: Richard Henderson --- target/arm/ptw.c | 71

[PATCH 04/16] hw/9pfs: Introduce an opaque type 9P_FILE_ID

2022-10-23 Thread Bin Meng
Introduce an opaque type to represent a file in the 9pfs. This is file descriptor on POSIX systems. In the upcoming patches, we can extend it to support Windows. With this new opaque type, it significantly reduces the number of deviated code paths when adding Windows support. Signed-off-by: Bin

Re: [PATCH v2 25/43] hw/mips/malta: Reuse dev variable

2022-10-23 Thread Philippe Mathieu-Daudé
On 22/10/22 17:04, Bernhard Beschow wrote: While at it, move the assignments closer to where they are used. Signed-off-by: Bernhard Beschow --- hw/mips/malta.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

[PATCH 00/16] hw/9pfs: Add 9pfs support for Windows

2022-10-23 Thread Bin Meng
At present there is no Windows support for 9p file system. This series adds initial Windows support for 9p file system. 'local' file system backend driver is supported on Windows, including open, read, write, close, rename, remove, etc. All security models are supported. The mapped (mapped-xattr)

[PATCH 07/16] hw/9pfs: Implement Windows specific utilities functions for 9pfs

2022-10-23 Thread Bin Meng
From: Guohuai Shi Windows POSIX API and MinGW library do not provide the NO_FOLLOW flag, and do not allow opening a directory by POSIX open(). This causes all xxx_at() functions cannot work directly. However, we can provide Windows handle based functions to emulate xxx_at() functions (e.g.:

[PATCH v6 1/7] hw/arm/virt: Introduce virt_set_high_memmap() helper

2022-10-23 Thread Gavin Shan
This introduces virt_set_high_memmap() helper. The logic of high memory region address assignment is moved to the helper. The intention is to make the subsequent optimization for high memory region address assignment easier. No functional change intended. Signed-off-by: Gavin Shan Reviewed-by:

[OUTREACHY] Asking about contribution ideas

2022-10-23 Thread NSENGIYUMVA WILBERFORCE
Hi team, I am an outreachy applicant and I would like to know how I can make my first contribution and what the contribution should be. Best Regards, Wilberforce

[PATCH 16/16] meson.build: Turn on virtfs for Windows

2022-10-23 Thread Bin Meng
From: Guohuai Shi Enable virtfs configuration option for Windows host. Signed-off-by: Guohuai Shi Signed-off-by: Bin Meng --- meson.build | 10 +- fsdev/meson.build | 1 + hw/9pfs/meson.build | 8 +--- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git

[PATCH 05/16] hw/9pfs: Update P9_FILE_ID to support Windows

2022-10-23 Thread Bin Meng
On Windows P9_FILE_ID points to a file handle. Signed-off-by: Bin Meng --- hw/9pfs/9p-file-id.h | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/hw/9pfs/9p-file-id.h b/hw/9pfs/9p-file-id.h index 60cbfbf4dd..00903048e6 100644 --- a/hw/9pfs/9p-file-id.h +++

[PATCH v4 0/2] Refactoring: expand usage of TFR() macro

2022-10-23 Thread Nikita Ivanov
At the moment, TFR() macro has a vague name and is not used where it possibly could be. In order to make it more transparent and useful, it was decided to refactor it to make it closer to the similar one in glibc: TEMP_FAILURE_RETRY(). Now, macro evaluates into an expression and is named

[PATCH v6 5/7] hw/arm/virt: Improve high memory region address assignment

2022-10-23 Thread Gavin Shan
There are three high memory regions, which are VIRT_HIGH_REDIST2, VIRT_HIGH_PCIE_ECAM and VIRT_HIGH_PCIE_MMIO. Their base addresses are floating on highest RAM address. However, they can be disabled in several cases. (1) One specific high memory region is likely to be disabled by code by

Re: [PATCH v12 6/7] qemu-iotests: test new zone operations

2022-10-23 Thread Dmitry Fomichev
On Tue, 2022-10-18 at 16:41 +0800, Sam Li wrote: > Dmitry Fomichev 于2022年10月17日周一 08:57写道: > > > > On Sun, 2022-10-16 at 22:51 +0800, Sam Li wrote: > > > We have added new block layer APIs of zoned block devices. > > > Test it with: > > > Create a null_blk device, run each zone operation on it

Re: [PATCH] target/riscv: Fix PMP propagation for tlb

2022-10-23 Thread Alistair Francis
On Wed, Oct 12, 2022 at 4:01 PM LIU Zhiwei wrote: > > Only the pmp index that be checked by pmp_hart_has_privs can be used > by pmp_get_tlb_size to avoid an error pmp index. > > Before modification, we may use an error pmp index. For example, > we check address 0x4fc, and the size 0x4 in

Re: [PATCH v2] vhost-vdpa: add support for vIOMMU

2022-10-23 Thread Jason Wang
On Sun, Oct 23, 2022 at 10:46 PM Cindy Lu wrote: > > On Thu, 20 Oct 2022 at 10:15, Jason Wang wrote: > > > > On Wed, Oct 19, 2022 at 2:39 PM Cindy Lu wrote: > > > > > > Add support for vIOMMU. Register a memory listener to dma_as in > > > dev_start > > > - during region_add register a specific

Re: [PATCH v6 00/10] Introduce new acpi/smbios avocado tests using biosbits

2022-10-23 Thread Ani Sinha
On Sat, Oct 22, 2022 at 22:15 Michael S. Tsirkin wrote: > On Fri, Oct 21, 2022 at 09:47:04PM +0530, Ani Sinha wrote: > > > > > > On Fri, Oct 21, 2022 at 21:36 Alex Bennée > wrote: > > > > > > Ani Sinha writes: > > > > > > > > > > We have added a mirror of biosbits to the QEMU

Re: [PATCH v7 1/8] ppc440_uc.c: Move DDR2 SDRAM controller model to ppc4xx_sdram.c

2022-10-23 Thread Daniel Henrique Barboza
On 10/21/22 21:09, BALATON Zoltan wrote: On Fri, 21 Oct 2022, Daniel Henrique Barboza wrote: diff --git a/hw/ppc/ppc4xx_sdram.c b/hw/ppc/ppc4xx_sdram.c new file mode 100644 index 00..b49a7ed60a --- /dev/null +++ b/hw/ppc/ppc4xx_sdram.c @@ -0,0 +1,348 @@ +/* + * DDR2 SDRAM controller:

[PATCH v5] m68k: write bootinfo as rom section and re-randomize on reboot

2022-10-23 Thread Jason A. Donenfeld
Rather than poking directly into RAM, add the bootinfo block as a proper ROM, so that it's restored when rebooting the system. This way, if the guest corrupts any of the bootinfo items, but then tries to reboot, it'll still be restored back to normal as expected. Then, since the RNG seed needs to

[PATCH v2 08/43] hw/ide/piix: Introduce TYPE_ macros for PIIX IDE controllers

2022-10-23 Thread Bernhard Beschow
Suggested-by: Mark Cave-Ayland Signed-off-by: Bernhard Beschow --- hw/i386/pc_piix.c | 3 ++- hw/ide/piix.c | 5 +++-- hw/isa/piix4.c| 3 ++- include/hw/ide/piix.h | 7 +++ 4 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 include/hw/ide/piix.h diff

Re: [PATCH v4 1/7] target/arm: Don't add all MIDR aliases for cores that immplement PMSA

2022-10-23 Thread Richard Henderson
On 10/24/22 01:36, tobias.roeh...@rwth-aachen.de wrote: From: Tobias Röhmel Typo "implement" in subject. @@ -8038,6 +8035,11 @@ void register_cp_regs_for_features(ARMCPU *cpu) .accessfn = access_aa64_tid1, .type = ARM_CP_CONST, .resetvalue = cpu->revidr },

Re: [PATCH v3 2/2] hw/ssi/ibex_spi: implement `FIELD32_1CLEAR` macro

2022-10-23 Thread Alistair Francis
On Mon, Oct 17, 2022 at 3:55 PM Wilfred Mallawa wrote: > > From: Wilfred Mallawa > > use the `FIELD32_1CLEAR` macro to implement register > `rw1c` functionality to `ibex_spi`. > > This change was tested by running the `SPI_HOST` from TockOS. > > Signed-off-by: Wilfred Mallawa Reviewed-by:

[PATCH] tests/tcg/nios2: Tweak 10m50-ghrd.ld

2022-10-23 Thread Richard Henderson
More closely follow the default linker script for nios2. This magically fixes a problem resolving .got relocs from the toolchain's libgcc.a. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1258 Signed-off-by: Richard Henderson --- tests/tcg/nios2/10m50-ghrd.ld | 14 +- 1

Re: [PATCH v2 1/2] tests/qtest: migration-test: Fix [-Werror=format-overflow=] build warning

2022-10-23 Thread Laurent Vivier
Le 17/10/2022 à 15:20, Bin Meng a écrit : From: Bin Meng When tmpfs is NULL, a build warning is seen with GCC 9.3.0. It's strange that GCC 11.2.0 on Ubuntu 22.04 does not catch this, neither did the QEMU CI. While we are here, improve the error message as well. Reported-by: Shengjiang Wu

[PATCH v2 15/43] hw/isa/piix3: Create ISA PIC in host device

2022-10-23 Thread Bernhard Beschow
Use the newly introduced i8259 proxy "isa-pic" which allows for wiring up devices in the southbridge where the virtualization technology used (KVM, TCG, Xen) is not yet known. Signed-off-by: Bernhard Beschow --- hw/i386/pc_piix.c | 15 +-- hw/isa/Kconfig|

Re: [PATCH v2] target/i386: Fix caculation of LOCK NEG eflags

2022-10-23 Thread Philippe Mathieu-Daudé
Typo "calculation" in subject. On 22/10/22 08:12, Qi Hu wrote: In sequence: --- lock negl -0x14(%rbp) pushf pop%rax --- %rax will obtain the wrong value becasue the "lock neg" caculates the wrong eflags. The "s->T0" is updated by the wrong value. You can use this to do some test: ---

[PATCH v2] hw/mem/nvdimm: fix error message for 'unarmed' flag

2022-10-23 Thread Julia Suvorova
In the ACPI specification [1], the 'unarmed' bit is set when a device cannot accept a persistent write. This means that when a memdev is read-only, the 'unarmed' flag must be turned on. The logic is correct, just changing the error message. [1] ACPI NFIT NVDIMM Region Mapping Structure "NVDIMM

Re: [PATCH] target/riscv: Fix PMP propagation for tlb

2022-10-23 Thread Alistair Francis
On Wed, Oct 12, 2022 at 4:01 PM LIU Zhiwei wrote: > > Only the pmp index that be checked by pmp_hart_has_privs can be used > by pmp_get_tlb_size to avoid an error pmp index. > > Before modification, we may use an error pmp index. For example, > we check address 0x4fc, and the size 0x4 in

[PATCH v6 7/7] hw/arm/virt: Add properties to disable high memory regions

2022-10-23 Thread Gavin Shan
These 3 high memory regions are usually enabled by default, but they may be not used. For example, VIRT_HIGH_GIC_REDIST2 isn't needed by GICv2. This leads to waste in the PA space. Add properties to allow users selectively disable them if needed: "highmem-redists", "highmem-ecam", "highmem-mmio".

Re: [PATCH v6 00/10] Introduce new acpi/smbios avocado tests using biosbits

2022-10-23 Thread Ani Sinha
On Sat, Oct 22, 2022 at 22:11 Michael S. Tsirkin wrote: > On Fri, Oct 21, 2022 at 05:12:07PM +0530, Ani Sinha wrote: > > > > > > On Fri, Oct 21, 2022 at 13:50 Michael S. Tsirkin wrote: > > > > On Fri, Oct 21, 2022 at 05:10:43AM +0530, Ani Sinha wrote: > > > > > > > > > On Fri,

[PATCH v2 02/43] hw/i386/pc_piix: Allow for setting properties before realizing PIIX3 south bridge

2022-10-23 Thread Bernhard Beschow
The next patches will need to take advantage of it. Signed-off-by: Bernhard Beschow Reviewed-by: Peter Maydell --- hw/i386/pc_piix.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 7a55b9ca8e..5caef9bfc9 100644 ---

Re: [PATCH v6 00/10] Introduce new acpi/smbios avocado tests using biosbits

2022-10-23 Thread Ani Sinha
On Sat, Oct 22, 2022 at 22:05 Michael S. Tsirkin wrote: > On Sat, Oct 22, 2022 at 06:28:32AM +0530, Ani Sinha wrote: > > > > > > On Fri, Oct 21, 2022 at 21:32 Alex Bennée > wrote: > > > > > > Ani Sinha writes: > > > > > On Fri, 21 Oct, 2022, 5:52 pm Ani Sinha, wrote: > > > > >

Re: [PATCH 2/4] vhost: toggle device callbacks using used event idx

2022-10-23 Thread Jason Wang
On Fri, Oct 21, 2022 at 4:15 PM Michael S. Tsirkin wrote: > > On Fri, Oct 21, 2022 at 09:45:14AM +0200, Eugenio Perez Martin wrote: > > On Fri, Oct 21, 2022 at 5:40 AM Jason Wang wrote: > > > > > > On Thu, Oct 20, 2022 at 11:53 PM Eugenio Pérez > > > wrote: > > > > > > > > Actually use the new

Re: [PATCH v4 0/3] PowerPC interrupt rework

2022-10-23 Thread Daniel Henrique Barboza
Queued in gitlab.com/danielhb/qemu/tree/ppc-next. Thanks, Daniel On 10/21/22 11:21, Matheus Ferst wrote: This version fixes the problems found by Daniel with e500 tests and rebases on ppc-next. Based-on: https://gitlab.com/danielhb/qemu/-/tree/ppc-next Matheus Ferst (3): target/ppc:

[PATCH v4 2/2] error handling: Use RETRY_ON_EINTR() macro where applicable

2022-10-23 Thread Nikita Ivanov
There is a defined RETRY_ON_EINTR() macro in qemu/osdep.h which handles the same while loop. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/415 Signed-off-by: Nikita Ivanov --- block/file-posix.c| 37 - chardev/char-pty.c| 4 +---

Re: [PATCH 0/3] Drop useless casts from void * to pointer

2022-10-23 Thread Laurent Vivier
Le 20/10/2022 à 14:12, Markus Armbruster a écrit : Could this go via qemu-trivial now? Yes, sorry for the delay. I think there is a problem with PATCH 3. Thanks, Laurent

[PATCH v2 33/43] hw/isa/piix4: Reuse struct PIIXState from PIIX3

2022-10-23 Thread Bernhard Beschow
Now that PIIX4 also uses the "isa-pic" proxy, both implementations can share the same struct. Signed-off-by: Bernhard Beschow --- hw/isa/piix4.c | 61 -- 1 file changed, 19 insertions(+), 42 deletions(-) diff --git a/hw/isa/piix4.c

[PATCH v2 34/43] hw/isa/piix4: Rename reset control operations to match PIIX3

2022-10-23 Thread Bernhard Beschow
Both implementations are the same and will be shared upon merging. Signed-off-by: Bernhard Beschow --- hw/isa/piix4.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index a7d52c5294..2f5b6fc934 100644 --- a/hw/isa/piix4.c +++

[PATCH v2 32/43] hw/isa/piix4: Use ISA PIC device

2022-10-23 Thread Bernhard Beschow
Aligns the code with PIIX3 such that PIIXState can be used in PIIX4, too. Signed-off-by: Bernhard Beschow --- hw/isa/piix4.c | 28 ++-- hw/mips/malta.c | 11 +-- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c

[PATCH v2 29/43] hw/isa/piix4: Make PIIX4's ACPI and USB functions optional

2022-10-23 Thread Bernhard Beschow
This aligns PIIX4 with PIIX3. Signed-off-by: Bernhard Beschow --- hw/isa/piix4.c | 44 hw/mips/malta.c | 6 -- 2 files changed, 36 insertions(+), 14 deletions(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index a7389ff193..fc698c23be 100644

[PATCH v4 2/7] target/arm: Make RVBAR available for all ARMv8 CPUs

2022-10-23 Thread tobias.roehmel
From: Tobias Röhmel RVBAR shadows RVBAR_ELx where x is the highest exception level if the highest EL is not EL3. This patch also allows ARMv8 CPUs to change the reset address with the rvbar property. Signed-off-by: Tobias Röhmel --- target/arm/cpu.c| 6 +- target/arm/helper.c | 23

Re: [PATCH v6 00/10] Introduce new acpi/smbios avocado tests using biosbits

2022-10-23 Thread Michael S. Tsirkin
On Fri, Oct 21, 2022 at 09:47:04PM +0530, Ani Sinha wrote: > > > On Fri, Oct 21, 2022 at 21:36 Alex Bennée wrote: > > > Ani Sinha writes: > > > > > >  We have added a mirror of biosbits to the QEMU project so there is no > >  reason why we can't track changes and

[PATCH] tcg/riscv: Fix base register for user-only qemu_ld/st

2022-10-23 Thread Richard Henderson
When guest_base != 0, we were not coordinating the usage of TCG_REG_TMP0 as base properly, leading to a previous zero-extend of the input address being discarded. Shuffle the alignment check to the front, because that does not depend on the zero-extend, and it keeps the register usage clear. Set

[PATCH v2 03/43] hw/isa/piix3: Remove extra ';' outside of functions

2022-10-23 Thread Bernhard Beschow
Fixes the "extra-semi" clang-tidy check. Signed-off-by: Bernhard Beschow Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé --- hw/isa/piix3.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/isa/piix3.c b/hw/isa/piix3.c index 44a9998752..04895ce2e5

[PATCH v2 22/43] hw/isa/piix3: Rename piix3_reset() for sharing with PIIX4

2022-10-23 Thread Bernhard Beschow
Signed-off-by: Bernhard Beschow --- hw/isa/piix3.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/isa/piix3.c b/hw/isa/piix3.c index 8dbf22eaab..5214a75891 100644 --- a/hw/isa/piix3.c +++ b/hw/isa/piix3.c @@ -156,7 +156,7 @@ static void

Re: [PATCH v2 18/43] hw/isa/piix3: Remove unused include

2022-10-23 Thread Philippe Mathieu-Daudé
On 22/10/22 17:04, Bernhard Beschow wrote: Ammends commit 988fb613215993dd0ce642b89ca8182c479d39dd. Signed-off-by: Bernhard Beschow --- hw/isa/piix3.c | 1 - 1 file changed, 1 deletion(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH] vmstate-static-checker:remove this redundant return

2022-10-23 Thread Laurent Vivier
Le 28/09/2022 à 11:03, dinglimin a écrit : Jump statements, such as return and continue let you change the default flow of program execution, but jump statements that direct the control flow to the original direction are just a waste of keystrokes. Signed-off-by: dinglimin ---

Re: [RFC PATCH] contrib/plugins: enable debug on CONFIG_DEBUG_TCG

2022-10-23 Thread Philippe Mathieu-Daudé
On 21/10/22 17:51, Alex Bennée wrote: We used to rely on QEMU_CFLAGS to expose the debug flags but now this is synthesised by meson and only available to the main build. Add our own flags if we detect the build has been enabled with CONFIG_DEBUG_TCG (which is the default for --enable-debug

[PATCH v2 20/43] hw/isa/piix3: Resolve redundant PIIX_NUM_PIC_IRQS

2022-10-23 Thread Bernhard Beschow
PIIX_NUM_PIC_IRQS is assumed to be the same as ISA_NUM_IRQS, otherwise inconsistencies can occur. Signed-off-by: Bernhard Beschow --- hw/isa/piix3.c| 8 include/hw/southbridge/piix.h | 5 ++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git

Re: [RFC v3 2/2] virtio-blk: add zoned storage emulation for zoned devices

2022-10-23 Thread Sam Li
Dmitry Fomichev 于2022年10月23日周日 10:08写道: > > On Tue, 2022-10-18 at 16:56 +0800, Sam Li wrote: > > Dmitry Fomichev 于2022年10月17日周一 09:01写道: > > > > > > On Sun, 2022-10-16 at 23:05 +0800, Sam Li wrote: > > > > This patch extends virtio-blk emulation to handle zoned device commands > > > > by calling

[PATCH] avocado: use sha1 for fc31 imgs to avoid first time re-download

2022-10-23 Thread Daniel Henrique Barboza
'make check-avocado' will download any images that aren't present in the cache via 'get-vm-images' in tests/Makefile.include. The target that downloads fedora 31 images, get-vm-image-fedora-31, will use 'avocado vmimage get --distro=fedora --distro-version=31 --arch=(...)' to download the image

Re: [PATCH v2] Properly sign extend BBIT branch offset during calculation

2022-10-23 Thread Christopher Wrogg
I agree. Here is the corrected patch. Signed-off-by: Christopher Wrogg Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1251 --- target/mips/tcg/octeon.decode | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/mips/tcg/octeon.decode b/target/mips/tcg/octeon.decode

[PATCH v2 24/43] hw/isa/piix3: Rename typedef PIIX3State to PIIXState

2022-10-23 Thread Bernhard Beschow
This commit marks the finalization of the PIIX3 preparations to be merged with PIIX4. In particular, PIIXState is prepared to be reused in piix4.c. Signed-off-by: Bernhard Beschow --- hw/isa/piix3.c| 58 +-- include/hw/southbridge/piix.h | 4 +--

Re: [PATCH 1/1] tcg/riscv: Fix base regsiter for qemu_ld/st

2022-10-23 Thread Richard Henderson
On 10/23/22 22:41, LIU Zhiwei wrote: if (TCG_TARGET_REG_BITS > TARGET_LONG_BITS) { -tcg_out_ext32u(s, base, addr_regl); -addr_regl = base; +tcg_out_ext32u(s, addr_regl, addr_regl); } Incorrect. You may not modify input registers. r~

[PATCH v2 14/43] hw/intc/i8259: Introduce i8259 proxy "isa-pic"

2022-10-23 Thread Bernhard Beschow
Having an i8259 proxy allows for ISA PICs to be created and wired up in southbridges. This is especially interesting for PIIX3 for two reasons: First, the southbridge doesn't need to care about the virtualization technology used (KVM, TCG, Xen) due to in-IRQs (where devices get attached) and

[PATCH v2 18/43] hw/isa/piix3: Remove unused include

2022-10-23 Thread Bernhard Beschow
Ammends commit 988fb613215993dd0ce642b89ca8182c479d39dd. Signed-off-by: Bernhard Beschow --- hw/isa/piix3.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/isa/piix3.c b/hw/isa/piix3.c index 59599558a1..aa32f43e4a 100644 --- a/hw/isa/piix3.c +++ b/hw/isa/piix3.c @@ -32,7 +32,6 @@

Re: [PATCH v3 2/2] error handling: Use RETRY_ON_EINTR() macro where applicable

2022-10-23 Thread Nikita Ivanov
Hi! Thanks for clarification! Corrected it in v4. On Wed, Oct 19, 2022 at 6:24 PM Christian Schoenebeck < qemu_...@crudebyte.com> wrote: > On Tuesday, October 18, 2022 10:43:41 AM CEST Nikita Ivanov wrote: > > There is a defined RETRY_ON_EINTR() macro in qemu/osdep.h > > which handles the same

[PATCH v2 05/43] hw/isa/piix3: Modernize reset handling

2022-10-23 Thread Bernhard Beschow
Rather than registering the reset handler via a function which appends the handler to a global list, prefer to implement it as a virtual method - PIIX4 does the same already. Note that this means that piix3_reset can now also be called writing to the relevant configuration space register on a PCI

Re: [PATCH] Revert "accel/tcg: Init TCG cflags in vCPU thread handler"

2022-10-23 Thread Philippe Mathieu-Daudé
On 21/10/22 18:34, Peter Maydell wrote: Commit a82fd5a4ec24d was intended to be a code cleanup, but unfortunately it has a bug. It moves the initialization of the TCG cflags from the "start a new vcpu" function to the thread handler; this is fine when each vcpu has its own thread, but when we

[PATCH] tests/qtest/ac97-test: add up-/downsampling tests

2022-10-23 Thread Volker Rümelin
Test if the audio subsystem can handle extreme up- and down- sampling ratios like 44100/1 and 1/44100. For some time these used to trigger QEMU aborts. The test was taken from https://gitlab.com/qemu-project/qemu/-/issues/71 where it was used to demonstrate a very different issue. Suggested-by:

[PATCH v2 35/43] hw/isa/piix4: Prefix pci_slot_get_pirq() with "piix4_"

2022-10-23 Thread Bernhard Beschow
Prefixing with "piix4_" makes the method distinguishable from its PIIX3 counterpart upon merging and also complies more with QEMU conventions. Signed-off-by: Bernhard Beschow --- hw/isa/piix4.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/isa/piix4.c

[PATCH v2 43/43] hw/i386/acpi-build: Resolve PIIX ISA bridge rather than ACPI controller

2022-10-23 Thread Bernhard Beschow
Resolving the PIIX ISA bridge rather than the PIIX ACPI controller mirrors the ICH9 code one line below. Signed-off-by: Bernhard Beschow --- hw/i386/acpi-build.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index

[PATCH v2 39/43] hw/isa/piix: Rename functions to be shared for interrupt triggering

2022-10-23 Thread Bernhard Beschow
PIIX4 will get the same optimizations which are already implemented for PIIX3. Signed-off-by: Bernhard Beschow --- hw/isa/piix.c | 56 +-- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/hw/isa/piix.c b/hw/isa/piix.c index

[PATCH v2 31/43] hw/isa/piix4: Remove unused code

2022-10-23 Thread Bernhard Beschow
The Malta board, which is the only user of PIIX4, doesn't connect to the exported interrupt lines. Signed-off-by: Bernhard Beschow --- hw/isa/piix4.c | 8 1 file changed, 8 deletions(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index 57b0b98bef..d65f486008 100644 ---

[PATCH v2 21/43] hw/isa/piix3: Rename pci_piix3_props for sharing with PIIX4

2022-10-23 Thread Bernhard Beschow
Signed-off-by: Bernhard Beschow --- hw/isa/piix3.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/isa/piix3.c b/hw/isa/piix3.c index 9de7287589..8dbf22eaab 100644 --- a/hw/isa/piix3.c +++ b/hw/isa/piix3.c @@ -381,7 +381,7 @@ static void pci_piix3_init(Object *obj)

[PATCH v2 36/43] hw/isa/piix3: Merge hw/isa/piix4.c

2022-10-23 Thread Bernhard Beschow
Now that the PIIX3 and PIIX4 device models are sufficiently consolidated Signed-off-by: Bernhard Beschow --- MAINTAINERS | 6 +- configs/devices/mips-softmmu/common.mak | 2 +- hw/i386/Kconfig | 2 +- hw/isa/Kconfig

[PATCH v2 40/43] hw/isa/piix: Consolidate IRQ triggering

2022-10-23 Thread Bernhard Beschow
Speeds up PIIX4 which resolves an old TODO. Signed-off-by: Bernhard Beschow --- hw/isa/piix.c | 26 +++--- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/hw/isa/piix.c b/hw/isa/piix.c index 446105a7a1..4ced9995f9 100644 --- a/hw/isa/piix.c +++ b/hw/isa/piix.c

Re: [PATCH 1/3] hw/core: Tidy up unnecessary casting away of const

2022-10-23 Thread Laurent Vivier
Le 23/09/2022 à 14:00, Markus Armbruster a écrit : Signed-off-by: Markus Armbruster --- hw/core/sysbus-fdt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/core/sysbus-fdt.c b/hw/core/sysbus-fdt.c index edb0c49b19..eebcd28f9a 100644 --- a/hw/core/sysbus-fdt.c +++

[PATCH v2 27/43] hw/isa/piix4: Add missing initialization

2022-10-23 Thread Bernhard Beschow
PIIX3 clears its reset control register, so do the same in PIIX4. Signed-off-by: Bernhard Beschow --- hw/isa/piix4.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index 83b50c3a9b..4b8dece257 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -140,6

[PATCH v2 26/43] meson: Fix dependencies of piix4 southbridge

2022-10-23 Thread Bernhard Beschow
Signed-off-by: Bernhard Beschow --- configs/devices/mips-softmmu/common.mak | 1 - hw/isa/Kconfig | 6 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/configs/devices/mips-softmmu/common.mak b/configs/devices/mips-softmmu/common.mak index

[PATCH v4 6/7] target/arm: Add PMSAv8r functionality

2022-10-23 Thread tobias.roehmel
From: Tobias Röhmel Add PMSAv8r translation. Signed-off-by: Tobias Röhmel --- target/arm/ptw.c | 130 +++ 1 file changed, 110 insertions(+), 20 deletions(-) diff --git a/target/arm/ptw.c b/target/arm/ptw.c index 4bd7389fa9..a5d890c09a 100644 ---

[PATCH v4 3/7] target/arm: Make stage_2_format for cache attributes optional

2022-10-23 Thread tobias.roehmel
From: Tobias Röhmel The v8R PMSAv8 has a two-stage MPU translation process, but, unlike VMSAv8, the stage 2 attributes are in the same format as the stage 1 attributes (8-bit MAIR format). Rather than converting the MAIR format to the format used for VMSA stage 2 (bits [5:2] of a VMSA stage 2

[PATCH] tests/vm: update openbsd to release 7.2

2022-10-23 Thread Brad Smith
tests/vm: update openbsd to release 7.2 Signed-off-by: Brad Smith --- tests/vm/openbsd | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/vm/openbsd b/tests/vm/openbsd index 6f1b6f5b98..eaeb201e91 100755 --- a/tests/vm/openbsd +++ b/tests/vm/openbsd @@ -22,8 +22,8

[PATCH v2 00/43] Consolidate PIIX south bridges

2022-10-23 Thread Bernhard Beschow
This series consolidates the implementations of the PIIX3 and PIIX4 south bridges and is an extended version of [1]. The motivation is to share as much code as possible and to bring both device models to feature parity such that perhaps PIIX4 can become a drop-in-replacement for PIIX3 in the pc

Re: [PATCH 2/3] Drop useless casts from g_malloc() & friends to pointer

2022-10-23 Thread Laurent Vivier
Le 23/09/2022 à 14:00, Markus Armbruster a écrit : These memory allocation functions return void *, and casting to another pointer type is useless clutter. Drop these casts. If you really want another pointer type, consider g_new(). Signed-off-by: Markus Armbruster --- hw/arm/nseries.c

Re: [PATCH v3 1/2] Refactoring: refactor TFR() macro to RETRY_ON_EINTR()

2022-10-23 Thread Nikita Ivanov
Hi! Thanks for mentioning the issue. Corrected it in v4. On Wed, Oct 19, 2022 at 6:40 PM Christian Schoenebeck < qemu_...@crudebyte.com> wrote: > On Dienstag, 18. Oktober 2022 10:43:40 CEST Nikita Ivanov wrote: > > Rename macro name to more transparent one and refactor > > it to expression. > >

Re: [RFC v3 2/2] virtio-blk: add zoned storage emulation for zoned devices

2022-10-23 Thread Dmitry Fomichev
On Tue, 2022-10-18 at 16:56 +0800, Sam Li wrote: > Dmitry Fomichev 于2022年10月17日周一 09:01写道: > > > > On Sun, 2022-10-16 at 23:05 +0800, Sam Li wrote: > > > This patch extends virtio-blk emulation to handle zoned device commands > > > by calling the new block layer APIs to perform zoned device I/O

Re: [PATCH v2 2/2] tests/qtest: vhost-user-test: Fix [-Werror=format-overflow=] build warning

2022-10-23 Thread Laurent Vivier
Le 17/10/2022 à 15:20, Bin Meng a écrit : From: Bin Meng When tmpfs is NULL, a build warning is seen with GCC 9.3.0. It's strange that GCC 11.2.0 on Ubuntu 22.04 does not catch this, neither did the QEMU CI. While we are here, improve the error message as well. Reported-by: Shengjiang Wu

Re: [PATCH] tcg/riscv: Fix range matched by TCG_CT_CONST_M12

2022-10-23 Thread LIU Zhiwei
On 2022/10/22 17:58, Richard Henderson wrote: We were matching a signed 13-bit range, not a 12-bit range. Expand the commentary within the function and be explicit about all of the ranges. Reported-by: LIU Zhiwei Signed-off-by: Richard Henderson Reviewed-by: LIU Zhiwei ---

[PATCH v2 30/43] hw/isa/piix4: Allow board to provide PCI interrupt routes

2022-10-23 Thread Bernhard Beschow
PIIX3 initializes the PIRQx route control registers to the default values as described in the 82371AB PCI-TO-ISA/IDE XCELERATOR (PIIX4) April 1997 manual. PIIX4, however, initializes the routes according to the Malta™ User’s Manual, ch 6.6, which are IRQs 10 and 11. In order to allow the reset

[PATCH v2 11/43] hw/i386/pc: No need for rtc_state to be an out-parameter

2022-10-23 Thread Bernhard Beschow
Now that the RTC is created as part of the southbridges it doesn't need to be an out-parameter any longer. Signed-off-by: Bernhard Beschow Reviewed-by: Peter Maydell --- hw/i386/pc.c | 12 ++-- hw/i386/pc_piix.c| 2 +- hw/i386/pc_q35.c | 2 +- include/hw/i386/pc.h |

[PATCH v2 10/43] hw/i386/pc: Create RTC controllers in south bridges

2022-10-23 Thread Bernhard Beschow
Just like in the real hardware (and in PIIX4), create the RTC controllers in the south bridges. Signed-off-by: Bernhard Beschow --- hw/i386/pc.c | 12 +++- hw/i386/pc_piix.c | 8 hw/i386/pc_q35.c | 1 + hw/isa/Kconfig|

[PATCH v2 04/43] hw/isa/piix3: Add size constraints to rcr_ops

2022-10-23 Thread Bernhard Beschow
According to the PIIX3 datasheet, the reset control register is one byte in size. Moreover, PIIX4 has it, so add it to PIIX3 as well. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé --- hw/isa/piix3.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git

[PATCH v2 12/43] hw/isa/piix3: Create USB controller in host device

2022-10-23 Thread Bernhard Beschow
The USB controller is an integral part of PIIX3 (function 2). So create it as part of the south bridge. Note that the USB function is optional in QEMU. This is why it gets object_initialize_child()'ed in realize rather than in instance_init. Signed-off-by: Bernhard Beschow ---

[PATCH v2 37/43] hw/isa/piix: Harmonize names of reset control memory regions

2022-10-23 Thread Bernhard Beschow
There is no need for having different names here. Having the same name further allows code to be shared between PIIX3 and PIIX4. Signed-off-by: Bernhard Beschow --- hw/isa/piix.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/isa/piix.c b/hw/isa/piix.c index

[PATCH v2 25/43] hw/mips/malta: Reuse dev variable

2022-10-23 Thread Bernhard Beschow
While at it, move the assignments closer to where they are used. Signed-off-by: Bernhard Beschow --- hw/mips/malta.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/mips/malta.c b/hw/mips/malta.c index 0e932988e0..0ec2ac2eaf 100644 --- a/hw/mips/malta.c +++

Re: [PATCH RESEND] elf2dmp: free memory in failure

2022-10-23 Thread Laurent Vivier
Le 07/10/2022 à 04:01, luzhipeng a écrit : From: lu zhipeng The 'kdgb' is allocating memory in get_kdbg(), but it is not freed in error path. So fix that. Signed-off-by: lu zhipeng --- contrib/elf2dmp/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/elf2dmp/main.c

  1   2   >