Re: [PATCH v2 00/14] PPC440 devices misc clean up

2023-07-06 Thread Daniel Henrique Barboza
On 7/5/23 22:09, BALATON Zoltan wrote: On Wed, 5 Jul 2023, Daniel Henrique Barboza wrote: Zoltan, Patches 1-9 are queued. Don't need to re-send those. Thanks, the last two patches are also reviewed and they don't depend on the ones before so you could queue those too. Just queued patch

Re: [PATCH v1 0/4] virtio-mem: Support "x-ignore-shared" migration

2023-07-06 Thread David Hildenbrand
On 06.07.23 07:59, Mario Casquero wrote: This series has been tested successfully by QE. Start a VM with a 8G virtio-mem device and start memtester on it. Enable x-ignore-shared capability and then do migration. Migration was successful and virtio-mem can be resized as usual. Tested-by: Mario Ca

Re: [PATCH v2 0/2] ppc/pnv: Set P10 core xscom region size to match hardware

2023-07-06 Thread Cédric Le Goater
On 7/6/23 07:39, Nicholas Piggin wrote: Sorry about the paper bag bug in the first version of the patch - I broke powernv8 and 9. This adds a xsom_size core class field to change the P10 size without changing the others. Also added a P10 xscom test, and passes make check. Reviewed-by: Cédric

Re: [PATCH v3] linux-user/syscall: Implement execve without execveat

2023-07-06 Thread Pierrick Bouvier
On 7/5/23 17:46, Richard Henderson wrote: On 7/5/23 14:10, Pierrick Bouvier wrote: Support for execveat syscall was implemented in 55bbe4 and is available since QEMU 8.0.0. It relies on host execveat, which is widely available on most of Linux kernels today. However, this change breaks qemu-use

Re: [PATCH v3] target/ppc: Machine check on invalid real address access on POWER9/10

2023-07-06 Thread Nicholas Piggin
On Mon Jul 3, 2023 at 10:03 PM AEST, Nicholas Piggin wrote: > ppc currently silently accepts invalid real address access. Catch > these and turn them into machine checks on POWER9/10 machines. Would there be any objections to merging this and the checkstop patch? We could disable this one before r

Re: [PATCH v2 1/1] pcie: Add hotplug detect state register to cmask

2023-07-06 Thread Juan Quintela
Leonardo Bras wrote: > When trying to migrate a machine type pc-q35-6.0 or lower, with this > cmdline options, > > -device > driver=pcie-root-port,port=18,chassis=19,id=pcie-root-port18,bus=pcie.0,addr=0x12 > \ > -device > driver=nec-usb-xhci,p2=4,p3=4,id=nex-usb-xhci0,bus=pcie-root-port18,addr

Re: [PATCH v3] target/ppc: Machine check on invalid real address access on POWER9/10

2023-07-06 Thread Cédric Le Goater
On 7/6/23 09:32, Nicholas Piggin wrote: On Mon Jul 3, 2023 at 10:03 PM AEST, Nicholas Piggin wrote: ppc currently silently accepts invalid real address access. Catch these and turn them into machine checks on POWER9/10 machines. Would there be any objections to merging this and the checkstop p

Re: [PATCH 1/4] QGA VSS: Add wrapper to send log to debugger and stderr

2023-07-06 Thread Konstantin Kostiuk
Hi Philippe, On Wed, Jul 5, 2023 at 11:35 PM Philippe Mathieu-Daudé wrote: > Hi Konstantin, > > On 5/7/23 16:12, Konstantin Kostiuk wrote: > > Signed-off-by: Konstantin Kostiuk > > --- > > qga/vss-win32/vss-debug.h | 31 +++ > > 1 file changed, 31 insertions(+) >

[PATCH v2 0/4] virtio-mem: Support "x-ignore-shared" migration

2023-07-06 Thread David Hildenbrand
If there is no further feedback, I'll queue this myself shortly. Stumbling over "x-ignore-shared" migration support for virtio-mem on my todo list, I remember talking to Dave G. a while ago about how ram_block_discard_range() in MAP_PIRVATE file mappings is possibly harmful when the file is used s

[PATCH v2 1/4] softmmu/physmem: Warn with ram_block_discard_range() on MAP_PRIVATE file mapping

2023-07-06 Thread David Hildenbrand
ram_block_discard_range() cannot possibly do the right thing in MAP_PRIVATE file mappings in the general case. To achieve the documented semantics, we also have to punch a hole into the file, possibly messing with other MAP_PRIVATE/MAP_SHARED mappings of such a file. For example, using VM templat

[PATCH v2 4/4] virtio-mem: Support "x-ignore-shared" migration

2023-07-06 Thread David Hildenbrand
To achieve desired "x-ignore-shared" functionality, we should not discard all RAM when realizing the device and not mess with preallocation/postcopy when loading device state. In essence, we should not touch RAM content. As "x-ignore-shared" gets set after realizing the device, we cannot rely on t

[PATCH v2 2/4] virtio-mem: Skip most of virtio_mem_unplug_all() without plugged memory

2023-07-06 Thread David Hildenbrand
Already when starting QEMU we perform one system reset that ends up triggering virtio_mem_unplug_all() with no actual memory plugged yet. That, in turn will trigger ram_block_discard_range() and perform some other actions that are not required in that case. Let's optimize virtio_mem_unplug_all() f

[PATCH v2 3/4] migration/ram: Expose ramblock_is_ignored() as migrate_ram_is_ignored()

2023-07-06 Thread David Hildenbrand
virtio-mem wants to know whether it should not mess with the RAMBlock content (e.g., discard RAM, preallocate memory) on incoming migration. So let's expose that function as migrate_ram_is_ignored() in migration/misc.h Acked-by: Peter Xu Tested-by: Mario Casquero Signed-off-by: David Hildenbran

Re: [PATCH v3] linux-user/syscall: Implement execve without execveat

2023-07-06 Thread Richard Henderson
On 7/6/23 08:30, Pierrick Bouvier wrote: I guess we'll quickly get a build-time error if there's no host execve syscall (which looks to be, eventually, compat-only). Out of curiosity, is there any plan for deprecation (or removal) of execve on a specific architecture? I thought it had to stay

Re: [PATCH v2 1/4] softmmu/physmem: Warn with ram_block_discard_range() on MAP_PRIVATE file mapping

2023-07-06 Thread Juan Quintela
David Hildenbrand wrote: > ram_block_discard_range() cannot possibly do the right thing in > MAP_PRIVATE file mappings in the general case. > > To achieve the documented semantics, we also have to punch a hole into > the file, possibly messing with other MAP_PRIVATE/MAP_SHARED mappings > of such a

Re: [PATCH v2 2/4] virtio-mem: Skip most of virtio_mem_unplug_all() without plugged memory

2023-07-06 Thread Juan Quintela
David Hildenbrand wrote: > Already when starting QEMU we perform one system reset that ends up > triggering virtio_mem_unplug_all() with no actual memory plugged yet. > That, in turn will trigger ram_block_discard_range() and perform some > other actions that are not required in that case. > > Let

Re: [RFC PATCH 4/5] target/arm: enable feature ARM_FEATURE_EL2 if EL2 is supported

2023-07-06 Thread Eric Auger
Hi Miguel, On 2/27/23 17:37, Miguel Luis wrote: > From: Haibo Xu > > KVM_CAP_ARM_EL2 must be supported by the cpu to enable ARM_FEATURE_EL2. > EL2 bits on ID_AA64PFR0 state unsupported on the value 0b. > > Ref: > https://lore.kernel.org/qemu-devel/b7c2626e6c720ccc43e57197dff3dac72d613640.1

Re: [PATCH v2 3/4] migration/ram: Expose ramblock_is_ignored() as migrate_ram_is_ignored()

2023-07-06 Thread Juan Quintela
David Hildenbrand wrote: > virtio-mem wants to know whether it should not mess with the RAMBlock > content (e.g., discard RAM, preallocate memory) on incoming migration. > > So let's expose that function as migrate_ram_is_ignored() in > migration/misc.h Reviewed-by: Juan Quintela

Re: [PATCH v2 10/46] target/loongarch: Implement xvaddw/xvsubw

2023-07-06 Thread Richard Henderson
On 6/30/23 08:58, Song Gao wrote: -for (i = 0; i < LSX_LEN/BIT; i++) { \ + \ +len = (simd_oprsz(v) == 16) ? LSX_LEN : LASX_LEN;\ +for (i = 0; i < len / BIT; i++

Re: [PATCH v2 11/46] target/loongarch: Implement xavg/xvagr

2023-07-06 Thread Richard Henderson
On 6/30/23 08:58, Song Gao wrote: +len = (simd_oprsz(v) == 16) ? LSX_LEN : LASX_LEN; \ +for (i = 0; i < len / BIT; i++) { \ Likewise. r~

Re: [PATCH v2 12/46] target/loongarch: Implement xvabsd

2023-07-06 Thread Richard Henderson
On 6/30/23 08:58, Song Gao wrote: This patch includes: - XVABSD.{B/H/W/D}[U]. Signed-off-by: Song Gao --- target/loongarch/disas.c | 9 + target/loongarch/insn_trans/trans_lasx.c.inc | 9 + target/loongarch/insns.decode| 9 + targe

Re: [PATCH v2 13/46] target/loongarch: Implement xvadda

2023-07-06 Thread Richard Henderson
On 6/30/23 08:58, Song Gao wrote: +len = (simd_oprsz(v) == 16) ? LSX_LEN : LASX_LEN; \ +for (i = 0; i < len / BIT; i++) { \ Likewise. r~

Re: [PATCH v2 14/46] target/loongarch: Implement xvmax/xvmin

2023-07-06 Thread Richard Henderson
On 6/30/23 08:58, Song Gao wrote: +len = (simd_oprsz(v) == 16) ? LSX_LEN : LASX_LEN; \ +for (i = 0; i < len / BIT; i++) { \ Likewise. r~

[PATCH 3/3] qga: Add tests for --allow-rpcs option

2023-07-06 Thread Konstantin Kostiuk
Signed-off-by: Konstantin Kostiuk --- tests/unit/test-qga.c | 31 +++ 1 file changed, 31 insertions(+) diff --git a/tests/unit/test-qga.c b/tests/unit/test-qga.c index 360b4cab23..671e83cb86 100644 --- a/tests/unit/test-qga.c +++ b/tests/unit/test-qga.c @@ -665,6 +665

[PATCH 0/3] qga: Add new option --allow-rpcs

2023-07-06 Thread Konstantin Kostiuk
The allow-rpcs option accepts a comma-separated list of RPCs to enable. This option is opposite to --block-rpcs. Using --block-rpcs and --allow-rpcs at the same time is not allowed. resolves: https://gitlab.com/qemu-project/qemu/-/issues/1505 Konstantin Kostiuk (3): qga: Rename ga_disable_not_a

[PATCH 2/3] qga: Add new option --allow-rpcs

2023-07-06 Thread Konstantin Kostiuk
The allow-rpcs option accepts a comma-separated list of RPCs to enable. This option is opposite to --block-rpcs. Using --block-rpcs and --allow-rpcs at the same time is not allowed. resolves: https://gitlab.com/qemu-project/qemu/-/issues/1505 Signed-off-by: Konstantin Kostiuk --- docs/interop/q

[PATCH 1/3] qga: Rename ga_disable_not_allowed -> ga_disable_not_allowed_freeze

2023-07-06 Thread Konstantin Kostiuk
Signed-off-by: Konstantin Kostiuk --- qga/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qga/main.c b/qga/main.c index 2b992a55b3..121ff7a748 100644 --- a/qga/main.c +++ b/qga/main.c @@ -395,7 +395,7 @@ static gint ga_strcmp(gconstpointer str1, gconstpointer str

Re: [PATCH v2 1/4] softmmu/physmem: Warn with ram_block_discard_range() on MAP_PRIVATE file mapping

2023-07-06 Thread David Hildenbrand
On 06.07.23 10:10, Juan Quintela wrote: David Hildenbrand wrote: ram_block_discard_range() cannot possibly do the right thing in MAP_PRIVATE file mappings in the general case. To achieve the documented semantics, we also have to punch a hole into the file, possibly messing with other MAP_PRIVA

Re: [PATCH] meson.build: Remove the logic to link C code with the C++ linker

2023-07-06 Thread Paolo Bonzini
On 7/6/23 08:47, Thomas Huth wrote: We are not mixing C++ with C code anymore, the only remaining C++ code in qga/vss-win32/ is used for a plain C++ executable. Thus we can remove the hacks for linking C code with the C++ linker now to simplify meson.build a little bit, and also to avoid that som

Re: [PATCH 2/4] QGA VSS: Replace 'fprintf(stderr' with PRINT_DEBUG

2023-07-06 Thread Konstantin Kostiuk
On Wed, Jul 5, 2023 at 11:36 PM Philippe Mathieu-Daudé wrote: > On 5/7/23 16:12, Konstantin Kostiuk wrote: > > Signed-off-by: Konstantin Kostiuk > > --- > > qga/vss-win32/install.cpp | 13 +++-- > > qga/vss-win32/requester.cpp | 9 + > > 2 files changed, 12 insertions(+),

Re: [PATCH v2 2/4] virtio-mem: Skip most of virtio_mem_unplug_all() without plugged memory

2023-07-06 Thread David Hildenbrand
On 06.07.23 10:15, Juan Quintela wrote: David Hildenbrand wrote: Already when starting QEMU we perform one system reset that ends up triggering virtio_mem_unplug_all() with no actual memory plugged yet. That, in turn will trigger ram_block_discard_range() and perform some other actions that are

Re: [PATCH v2 2/5] migration: migrate 'inc' command option is deprecated.

2023-07-06 Thread Thomas Huth
On 22/06/2023 21.50, Juan Quintela wrote: Set the 'block_incremental' migration parameter to 'true' instead. Signed-off-by: Juan Quintela --- docs/about/deprecated.rst | 7 +++ qapi/migration.json | 12 ++-- migration/migration.c | 6 ++ 3 files changed, 23 inse

Re: [PATCH v8 14/20] target/riscv/kvm.c: add multi-letter extension KVM properties

2023-07-06 Thread Andrew Jones
On Wed, Jul 05, 2023 at 06:39:49PM -0300, Daniel Henrique Barboza wrote: > Let's add KVM user properties for the multi-letter extensions that KVM > currently supports: zicbom, zicboz, zihintpause, zbb, ssaia, sstc, > svinval and svpbmt. > > As with MISA extensions, we're using the KVMCPUConfig typ

Re: [PATCH v4 1/2] migration: switchover-hold parameter

2023-07-06 Thread Avihai Horon
Hi Peter, On 05/07/2023 19:31, Peter Xu wrote: External email: Use caution opening links or attachments Add a new migration parameter switchover-hold which can block src qemu migration from switching over to dest from running. One can set this flag to true so src qemu will keep iterating the

Re: [PATCH v2 3/5] migration: migrate 'blk' command option is deprecated.

2023-07-06 Thread Thomas Huth
On 22/06/2023 21.50, Juan Quintela wrote: Set the 'block' migration capability to 'true' instead. Signed-off-by: Juan Quintela --- docs/about/deprecated.rst | 7 +++ qapi/migration.json | 10 +++--- migration/migration.c | 5 + 3 files changed, 19 insertions(+), 3 d

Re: [PATCH v2 1/4] softmmu/physmem: Warn with ram_block_discard_range() on MAP_PRIVATE file mapping

2023-07-06 Thread David Hildenbrand
#ifdef CONFIG_FALLOCATE_PUNCH_HOLE +/* + * We'll discard data from the actual file, even though we only + * have a MAP_PRIVATE mapping, possibly messing with other + * MAP_PRIVATE/MAP_SHARED mappings. There is no easy way to + * change

Re: [PATCH] meson.build: Remove the logic to link C code with the C++ linker

2023-07-06 Thread Philippe Mathieu-Daudé
On 6/7/23 08:47, Thomas Huth wrote: We are not mixing C++ with C code anymore, the only remaining C++ code in qga/vss-win32/ is used for a plain C++ executable. Thus we can remove the hacks for linking C code with the C++ linker now to simplify meson.build a little bit, and also to avoid that som

Re: [PATCH v2] riscv: Generate devicetree only after machine initialization is complete

2023-07-06 Thread Philippe Mathieu-Daudé
On 6/7/23 05:59, Guenter Roeck wrote: If the devicetree is created before machine initialization is complete, it misses dynamic devices. Specifically, the tpm device is not added to the devicetree file and is therefore not instantiated in Linux. Load/create devicetree in virt_machine_done() to so

Re: [PATCH] ppc/pnv: Log all unimp warnings with similar message

2023-07-06 Thread Philippe Mathieu-Daudé
On 6/7/23 04:45, Joel Stanley wrote: Add the function name so there's an indication as to where the message is coming from. Change all prints to use the offset instead of the address. Signed-off-by: Joel Stanley --- Happy to use the address instead of the offset (or print both), but I like the

RE: [PATCH 2/2] virtio-iommu: Rework the trace in virtio_iommu_set_page_size_mask()

2023-07-06 Thread Duan, Zhenzhong
Hi Eric, >-Original Message- >From: Eric Auger >Sent: Wednesday, July 5, 2023 9:17 PM >Subject: Re: [PATCH 2/2] virtio-iommu: Rework the trace in >virtio_iommu_set_page_size_mask() > >Hi Zhenghong, > >On 7/5/23 10:17, Duan, Zhenzhong wrote: >> >>> -Original Message- >>> From: Duan,

RE: [PATCH 1/2] virtio-iommu: Fix 64kB host page size VFIO device assignment

2023-07-06 Thread Duan, Zhenzhong
>-Original Message- >From: Jean-Philippe Brucker >Sent: Wednesday, July 5, 2023 7:33 PM >Subject: Re: [PATCH 1/2] virtio-iommu: Fix 64kB host page size VFIO device >assignment > >On Wed, Jul 05, 2023 at 10:13:11AM +, Duan, Zhenzhong wrote: >> >-Original Message- >> >From: Je

Re: [PATCH] meson.build: Remove the logic to link C code with the C++ linker

2023-07-06 Thread Konstantin Kostiuk
Reviewed-by: Konstantin Kostiuk On Thu, Jul 6, 2023 at 9:47 AM Thomas Huth wrote: > We are not mixing C++ with C code anymore, the only remaining > C++ code in qga/vss-win32/ is used for a plain C++ executable. > Thus we can remove the hacks for linking C code with the C++ linker > now to simpl

RE: [PATCH v2 1/2] virtio-iommu: Fix 64kB host page size VFIO device assignment

2023-07-06 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Sent: Thursday, July 6, 2023 12:51 AM >Subject: [PATCH v2 1/2] virtio-iommu: Fix 64kB host page size VFIO device >assignment > >When running on a 64kB page size host and protecting a VFIO device with the >virtio-iommu, qemu crashes with this kind of m

Re: [PATCH v3] kconfig: Add PCIe devices to s390x machines

2023-07-06 Thread Paolo Bonzini
On 7/5/23 17:23, Cédric Le Goater wrote: +imply E1000E_PCI_EXPRESS +imply IGB_PCI_EXPRESS +imply USB_XHCI_PCI "imply" should only be used whenever the device can be created with the front-end/back-end combo command line options, and as far as I can see this is not the case here.

Re: [PATCH v8 14/20] target/riscv/kvm.c: add multi-letter extension KVM properties

2023-07-06 Thread Andrew Jones
On Thu, Jul 06, 2023 at 10:45:04AM +0200, Andrew Jones wrote: ... > 1. Audit KVM to ensure using EINVAL for get-one-reg's "register not > present" is currently safe, and keep our eye on KVM to make sure > it remains safe until get-reg-list lands. I just did the audit and it looks fine. Th

[PULL 1/2] 9pfs: deprecate 'proxy' backend

2023-07-06 Thread Christian Schoenebeck
As recent CVE-2023-2861 (fixed by f6b0de53fb) once again showed, the 9p 'proxy' fs driver is in bad shape. Using the 'proxy' backend was already discouraged for safety reasons before and we recommended to use the 'local' backend (preferably in conjunction with its 'mapped' security model) instead,

Re: [PATCH 1/4] QGA VSS: Add wrapper to send log to debugger and stderr

2023-07-06 Thread Philippe Mathieu-Daudé
On 6/7/23 09:54, Konstantin Kostiuk wrote: Hi Philippe, On Wed, Jul 5, 2023 at 11:35 PM Philippe Mathieu-Daudé mailto:phi...@linaro.org>> wrote: Hi Konstantin, On 5/7/23 16:12, Konstantin Kostiuk wrote: > Signed-off-by: Konstantin Kostiuk mailto:kkost...@redhat.com>> > ---

[PULL 2/2] MAINTAINERS: raise status of 9p to 'Maintained'

2023-07-06 Thread Christian Schoenebeck
Change status of 9p from 'Odd Fixes' to 'Maintained', as this better reflects current situation. I already take care of 9p patches for a while, which included new features as well. Based-on: Signed-off-by: Christian Schoenebeck Reviewed-by: Greg Kurz Reviewed-by: Philippe Mathieu-Daudé Message

[PULL 0/2] 9p queue 2023-07-06

2023-07-06 Thread Christian Schoenebeck
The following changes since commit 0618e72d64e434dd6f1bc38b107670474c49fb86: Merge tag 'block-pull-request' of https://gitlab.com/stefanha/qemu into staging (2023-07-04 18:40:13 +0200) are available in the Git repository at: https://github.com/cschoenebeck/qemu.git tags/pull-9

Re: [PATCH v3] kconfig: Add PCIe devices to s390x machines

2023-07-06 Thread Philippe Mathieu-Daudé
On 6/7/23 11:38, Paolo Bonzini wrote: On 7/5/23 17:23, Cédric Le Goater wrote: +    imply E1000E_PCI_EXPRESS +    imply IGB_PCI_EXPRESS +    imply USB_XHCI_PCI "imply" should only be used whenever the device can be created with the front-end/back-end combo command line options, and as far as

Re: [PATCH 11/21] swim: add trace events for IWM and ISM registers

2023-07-06 Thread Philippe Mathieu-Daudé
On 5/7/23 21:40, Mark Cave-Ayland wrote: On 03/07/2023 09:26, Philippe Mathieu-Daudé wrote: On 2/7/23 17:48, Mark Cave-Ayland wrote: Signed-off-by: Mark Cave-Ayland ---   hw/block/swim.c   | 14 ++   hw/block/trace-events |  7 +++   2 files changed, 21 insertions(+) @@ -

Re: [PATCH 14/21] mac_via: work around underflow in TimeDBRA timing loop in SETUPTIMEK

2023-07-06 Thread Philippe Mathieu-Daudé
On 5/7/23 21:49, Mark Cave-Ayland wrote: On 03/07/2023 09:30, Philippe Mathieu-Daudé wrote: On 2/7/23 17:48, Mark Cave-Ayland wrote: The MacOS toolbox ROM calculates the number of branches that can be executed per millisecond as part of its timer calibration. Since modern hosts are considerab

Re: [PATCH] docs/migration: Update postcopy bits

2023-07-06 Thread Laszlo Ersek
On 6/27/23 22:02, Peter Xu wrote: > We have postcopy recovery but not reflected in the document, do an update > for that. > > Add a very small section on postcopy preempt. > > Touch up the pagemap section, dropping the unsent map because it's already > been dropped in the source code in commit 1e

[PATCH v9 00/20] target/riscv, KVM: fixes and enhancements

2023-07-06 Thread Daniel Henrique Barboza
7;re adding the first version of the KVM specific capabilities. We'll switch later on for get-reg-list when it's available, but for now we're stuck with EINVAL. Drew provided a detailed explanation here: https://lore.kernel.org/qemu-devel/20230706-3

[PATCH v9 01/20] target/riscv: skip features setup for KVM CPUs

2023-07-06 Thread Daniel Henrique Barboza
As it is today it's not possible to use '-cpu host' if the RISC-V host has RVH enabled. This is the resulting error: $ ./qemu/build/qemu-system-riscv64 \ -machine virt,accel=kvm -m 2G -smp 1 \ -nographic -snapshot -kernel ./guest_imgs/Image \ -initrd ./guest_imgs/rootfs_kvm_riscv64.im

[PATCH v9 06/20] target/riscv: use KVM scratch CPUs to init KVM properties

2023-07-06 Thread Daniel Henrique Barboza
Certain validations, such as the validations done for the machine IDs (mvendorid/marchid/mimpid), are done before starting the CPU. Non-dynamic (named) CPUs tries to match user input with a preset default. As it is today we can't prefetch a KVM default for these cases because we're only able to rea

[PATCH v9 02/20] hw/riscv/virt.c: skip 'mmu-type' FDT if satp mode not set

2023-07-06 Thread Daniel Henrique Barboza
The absence of a satp mode in riscv_host_cpu_init() is causing the following error: $ ./qemu/build/qemu-system-riscv64 -machine virt,accel=kvm \ -m 2G -smp 1 -nographic -snapshot \ -kernel ./guest_imgs/Image \ -initrd ./guest_imgs/rootfs_kvm_riscv64.img \ -append "earlycon=sbi ro

[PATCH v9 03/20] target/riscv/cpu.c: restrict 'mvendorid' value

2023-07-06 Thread Daniel Henrique Barboza
We're going to change the handling of mvendorid/marchid/mimpid by the KVM driver. Since these are always present in all CPUs let's put the same validation for everyone. It doesn't make sense to allow 'mvendorid' to be different than it is already set in named (vendor) CPUs. Generic (dynamic) CPUs

[PATCH v9 11/20] target/riscv/cpu: add misa_ext_info_arr[]

2023-07-06 Thread Daniel Henrique Barboza
Next patch will add KVM specific user properties for both MISA and multi-letter extensions. For MISA extensions we want to make use of what is already available in misa_ext_cfgs[] to avoid code repetition. misa_ext_info_arr[] array will hold name and description for each MISA extension that misa_e

[PATCH v9 19/20] target/riscv/kvm.c: add kvmconfig_get_cfg_addr() helper

2023-07-06 Thread Daniel Henrique Barboza
There are 2 places in which we need to get a pointer to a certain property of the cpu->cfg struct based on property offset. Next patch will add a couple more. Create a helper to avoid repeating this code over and over. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Andrew Jones --- target

[PATCH v9 04/20] target/riscv/cpu.c: restrict 'mimpid' value

2023-07-06 Thread Daniel Henrique Barboza
Following the same logic used with 'mvendorid' let's also restrict 'mimpid' for named CPUs. Generic CPUs keep setting the value freely. Note that we're getting rid of the default RISCV_CPU_MARCHID value. The reason is that this is not a good default since it's dynamic, changing with with every QEM

[PATCH v9 10/20] target/riscv/kvm.c: init 'misa_ext_mask' with scratch CPU

2023-07-06 Thread Daniel Henrique Barboza
At this moment we're retrieving env->misa_ext during kvm_arch_init_cpu(), leaving env->misa_ext_mask behind. We want to set env->misa_ext_mask, and we want to set it as early as possible. The reason is that we're going to use it in the validation process of the KVM MISA properties we're going to a

[PATCH v9 17/20] target/riscv/cpu.c: create KVM mock properties

2023-07-06 Thread Daniel Henrique Barboza
KVM-specific properties are being created inside target/riscv/kvm.c. But at this moment we're gathering all the remaining properties from TCG and adding them as is when running KVM. This creates a situation where non-KVM properties are setting flags to 'true' due to its default settings (e.g. Zawr

[PATCH v9 18/20] target/riscv: update multi-letter extension KVM properties

2023-07-06 Thread Daniel Henrique Barboza
We're now ready to update the multi-letter extensions status for KVM. kvm_riscv_update_cpu_cfg_isa_ext() is called called during vcpu creation time to verify which user options changes host defaults (via the 'user_set' flag) and tries to write them back to KVM. Failure to commit a change to KVM i

[PATCH v9 14/20] target/riscv/kvm.c: add multi-letter extension KVM properties

2023-07-06 Thread Daniel Henrique Barboza
Let's add KVM user properties for the multi-letter extensions that KVM currently supports: zicbom, zicboz, zihintpause, zbb, ssaia, sstc, svinval and svpbmt. As with MISA extensions, we're using the KVMCPUConfig type to hold information about the state of each extension. However, multi-letter exte

[PATCH v9 13/20] target/riscv/kvm.c: update KVM MISA bits

2023-07-06 Thread Daniel Henrique Barboza
Our design philosophy with KVM properties can be resumed in two main decisions based on KVM interface availability and what the user wants to do: - if the user disables an extension that the host KVM module doesn't know about (i.e. it doesn't implement the kvm_get_one_reg() interface), keep bootin

[PATCH v9 16/20] target/riscv/cpu.c: remove priv_ver check from riscv_isa_string_ext()

2023-07-06 Thread Daniel Henrique Barboza
riscv_isa_string_ext() is being used by riscv_isa_string(), which is then used by boards to retrieve the 'riscv,isa' string to be written in the FDT. All this happens after riscv_cpu_realize(), meaning that we're already past riscv_cpu_validate_set_extensions() and, more important, riscv_cpu_disabl

[PATCH v9 20/20] target/riscv/kvm.c: read/write (cbom|cboz)_blocksize in KVM

2023-07-06 Thread Daniel Henrique Barboza
If we don't set a proper cbom_blocksize|cboz_blocksize in the FDT the Linux Kernel will fail to detect the availability of the CBOM/CBOZ extensions, regardless of the contents of the 'riscv,isa' DT prop. The FDT is being written using the cpu->cfg.cbom|z_blocksize attributes, so let's expose them

[PATCH v9 15/20] target/riscv/cpu.c: add satp_mode properties earlier

2023-07-06 Thread Daniel Henrique Barboza
riscv_cpu_add_user_properties() ended up with an excess of "#ifndef CONFIG_USER_ONLY" blocks after changes that added KVM properties handling. KVM specific properties are required to be created earlier than their TCG counterparts, but the remaining props can be created at any order. Move riscv_add

[PATCH v9 07/20] target/riscv: read marchid/mimpid in kvm_riscv_init_machine_ids()

2023-07-06 Thread Daniel Henrique Barboza
Allow 'marchid' and 'mimpid' to also be initialized in kvm_riscv_init_machine_ids(). After this change, the handling of mvendorid/marchid/mimpid for the 'host' CPU type will be equal to what we already have for TCG named CPUs, i.e. the user is not able to set these values to a different val than t

[PATCH v9 08/20] target/riscv: handle mvendorid/marchid/mimpid for KVM CPUs

2023-07-06 Thread Daniel Henrique Barboza
After changing user validation for mvendorid/marchid/mimpid to guarantee that the value is validated on user input time, coupled with the work in fetching KVM default values for them by using a scratch CPU, we're certain that the values in cpu->cfg.(mvendorid|marchid|mimpid) are already good to be

[PATCH v9 12/20] target/riscv: add KVM specific MISA properties

2023-07-06 Thread Daniel Henrique Barboza
Using all TCG user properties in KVM is tricky. First because KVM supports only a small subset of what TCG provides, so most of the cpu->cfg flags do nothing for KVM. Second, and more important, we don't have a way of telling if any given value is an user input or not. For TCG this has a small imp

[PATCH v9 09/20] linux-headers: Update to v6.4-rc1

2023-07-06 Thread Daniel Henrique Barboza
Update to commit ac9a78681b92 ("Linux 6.4-rc1"). Signed-off-by: Daniel Henrique Barboza Acked-by: Alistair Francis --- include/standard-headers/linux/const.h| 2 +- include/standard-headers/linux/virtio_blk.h | 18 +++ .../standard-headers/linux/virtio_config.h| 6 +++ inclu

[PATCH v9 05/20] target/riscv/cpu.c: restrict 'marchid' value

2023-07-06 Thread Daniel Henrique Barboza
'marchid' shouldn't be set to a different value as previously set for named CPUs. For all other CPUs it shouldn't be freely set either - the spec requires that 'marchid' can't have the MSB (most significant bit) set and every other bit set to zero, i.e. 0x8000 is an invalid 'marchid' value for

Re: [PATCH] target/arm: Avoid over-length shift in arm_cpu_sve_finalize() error case

2023-07-06 Thread Philippe Mathieu-Daudé
On 5/7/23 16:45, Richard Henderson wrote: On 7/4/23 18:00, Alex Bennée wrote: Peter Maydell writes: If you build QEMU with the clang sanitizer enabled, you can see it fire when running the arm-cpu-features test: $ QTEST_QEMU_BINARY=./build/arm-clang/qemu-system-aarch64 ./build/arm-clang/te

[PATCH 2/2] migration: unexport migrate_fd_error()

2023-07-06 Thread Laszlo Ersek
The only migrate_fd_error() call sites are in "migration/migration.c", which is also where we define migrate_fd_error(). Make the function static, and remove its declaration from "migration/migration.h". Cc: Juan Quintela (maintainer:Migration) Cc: Leonardo Bras (reviewer:Migration) Cc: Peter Xu

[PATCH 0/2] migration: trivialities

2023-07-06 Thread Laszlo Ersek
SSIA; originally for RHBZ#2018404 (hence the links in the commit messages). Cc: Juan Quintela (maintainer:Migration) Cc: Leonardo Bras (reviewer:Migration) Cc: Peter Xu (reviewer:Migration) Cc: qemu-triv...@nongnu.org Laszlo Ersek (2): migration: factor out "resume_requested" in qmp_migrate(

[PATCH 1/2] migration: factor out "resume_requested" in qmp_migrate()

2023-07-06 Thread Laszlo Ersek
It cuts back on those awkward, duplicated !(has_resume && resume) expressions. Cc: Juan Quintela (maintainer:Migration) Cc: Leonardo Bras (reviewer:Migration) Cc: Peter Xu (reviewer:Migration) Cc: qemu-triv...@nongnu.org Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2018404 Signed-off-b

Re: [PATCH 14/21] mac_via: work around underflow in TimeDBRA timing loop in SETUPTIMEK

2023-07-06 Thread Mark Cave-Ayland
On 06/07/2023 11:10, Philippe Mathieu-Daudé wrote: On 5/7/23 21:49, Mark Cave-Ayland wrote: On 03/07/2023 09:30, Philippe Mathieu-Daudé wrote: On 2/7/23 17:48, Mark Cave-Ayland wrote: The MacOS toolbox ROM calculates the number of branches that can be executed per millisecond as part of its

[PATCH] target/riscv: Fix LMUL check to use minimum SEW

2023-07-06 Thread Rob Bradford
The previous check was failing with: ELEN = 64 SEW = 16 and LMUL = 1/8 (encoded as 5) which is a valid combination. Fix the check to correctly match the specification by using minimum SEW rather than the active SEW. >From the specification: "In general, the requirement is to support LMUL ≥ SEWM

Re: [PATCH 1/4] QGA VSS: Add wrapper to send log to debugger and stderr

2023-07-06 Thread Konstantin Kostiuk
On Thu, Jul 6, 2023 at 1:01 PM Philippe Mathieu-Daudé wrote: > On 6/7/23 09:54, Konstantin Kostiuk wrote: > > Hi Philippe, > > > > On Wed, Jul 5, 2023 at 11:35 PM Philippe Mathieu-Daudé > > mailto:phi...@linaro.org>> wrote: > > > > Hi Konstantin, > > > > On 5/7/23 16:12, Konstantin Kostiu

Re: [PATCH v3 0/3] vdpa: Return -EIO if device ack is VIRTIO_NET_ERR

2023-07-06 Thread Lei Yang
On Wed, Jul 5, 2023 at 7:03 PM Hawkins Jiawei wrote: > > On 2023/7/5 15:59, Lei Yang wrote: > > Hello Hawkins > > > > QE can help test this series before it is merged into master, I would > > like to know what test steps can cover this series related scenario? > > > > Hi, I would like to suggest

Re: [PATCH v2 4/4] virtio-mem: Support "x-ignore-shared" migration

2023-07-06 Thread Juan Quintela
David Hildenbrand wrote: > To achieve desired "x-ignore-shared" functionality, we should not > discard all RAM when realizing the device and not mess with > preallocation/postcopy when loading device state. In essence, we should > not touch RAM content. > > As "x-ignore-shared" gets set after real

[PATCH v3 0/4] PPC440 devices misc clean up

2023-07-06 Thread BALATON Zoltan
These are some small misc clean ups to PPC440 related device models which is all I have ready for now. v3: - rebased on ppc-next moving already reviewed patch to front v2: - Added R-b tags from Philippe - Addressed review comments - Added new patch to rename parent field of PPC460EXPCIEState to p

[PATCH v3 2/4] ppc4xx_pci: Rename QOM type name define

2023-07-06 Thread BALATON Zoltan
Rename the TYPE_PPC4xx_PCI_HOST_BRIDGE define and its string value to match each other and other similar types and to avoid confusion with "ppc4xx-host-bridge" type defined in same file. Signed-off-by: BALATON Zoltan --- hw/ppc/ppc440_bamboo.c | 3 +-- hw/ppc/ppc4xx_pci.c | 6 +++--- includ

[PATCH v3 4/4] ppc440_pcix: Rename QOM type define abd move it to common header

2023-07-06 Thread BALATON Zoltan
Rename TYPE_PPC440_PCIX_HOST_BRIDGE to better match its string value, move it to common header and use it also in sam460ex to replace hard coded type name. Signed-off-by: BALATON Zoltan --- hw/ppc/ppc440_pcix.c| 9 - hw/ppc/sam460ex.c | 2 +- include/hw/ppc/ppc4xx.h | 1 + 3 fi

[PATCH v3 3/4] ppc4xx_pci: Add define for ppc4xx-host-bridge type name

2023-07-06 Thread BALATON Zoltan
Add a QOM type name define for ppc4xx-host-bridge in the common header and replace direct use of the string name with the constant. Signed-off-by: BALATON Zoltan --- hw/ppc/ppc440_pcix.c| 3 ++- hw/ppc/ppc4xx_pci.c | 4 ++-- include/hw/ppc/ppc4xx.h | 1 + 3 files changed, 5 insertions(+)

[PATCH v3 1/4] ppc440_pcix: Stop using system io region for PCI bus

2023-07-06 Thread BALATON Zoltan
Reduce the iomem region to 64K and use it for the PCI io space and map it directly from the board without an intermediate alias that is not really needed. Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daudé --- hw/ppc/ppc440_pcix.c | 9 ++--- hw/ppc/sam460ex.c| 6 +- 2

Re: [PATCH v2 00/14] PPC440 devices misc clean up

2023-07-06 Thread BALATON Zoltan
On Thu, 6 Jul 2023, Daniel Henrique Barboza wrote: On 7/5/23 22:09, BALATON Zoltan wrote: On Wed, 5 Jul 2023, Daniel Henrique Barboza wrote: Zoltan, Patches 1-9 are queued. Don't need to re-send those. Thanks, the last two patches are also reviewed and they don't depend on the ones before s

Re: [PATCH v2] Hexagon: move GETPC() calls to top level helpers

2023-07-06 Thread Matheus Tavares Bernardino
> ltaylorsimp...@gmail.com wrote: > > > -Original Message- > > From: Matheus Tavares Bernardino > > Sent: Wednesday, July 5, 2023 12:35 PM > > To: qemu-devel@nongnu.org > > Cc: quic_mathb...@quicinc.com; bc...@quicinc.com; > > ltaylorsimp...@gmail.com; quic_mlie...@quicinc.com; > > richa

Re: [PATCH v2 4/4] virtio-mem: Support "x-ignore-shared" migration

2023-07-06 Thread David Hildenbrand
On 06.07.23 13:06, Juan Quintela wrote: David Hildenbrand wrote: To achieve desired "x-ignore-shared" functionality, we should not discard all RAM when realizing the device and not mess with preallocation/postcopy when loading device state. In essence, we should not touch RAM content. As "x-ig

Re: [PATCH v3] target/ppc: Make checkstop actually stop the system

2023-07-06 Thread BALATON Zoltan
On Wed, 5 Jul 2023, Nicholas Piggin wrote: On Tue Jul 4, 2023 at 1:06 AM AEST, BALATON Zoltan wrote: On Mon, 3 Jul 2023, Nicholas Piggin wrote: On Mon Jul 3, 2023 at 10:26 PM AEST, BALATON Zoltan wrote: On Mon, 3 Jul 2023, Nicholas Piggin wrote: checkstop state does not halt the system, inter

[PATCH] linux-user: make sure brk(0) returns a page-aligned value

2023-07-06 Thread Andreas Schwab
Fixes: 86f04735ac ("linux-user: Fix brk() to release pages") Signed-off-by: Andreas Schwab --- linux-user/syscall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 08162cc966..e8a17377f5 100644 --- a/linux-user/syscall.c +++ b/

Re: [PULL 00/11] target-arm queue

2023-07-06 Thread Peter Maydell
On Wed, 5 Jul 2023 at 06:04, Richard Henderson wrote: > > On 7/5/23 06:57, Richard Henderson wrote: > > https://gitlab.com/qemu-project/qemu/-/jobs/4592433432#L3723 > > > >> /tmp/ccASXpLo.s: Assembler messages: > >> /tmp/ccASXpLo.s:782: Error: selected processor does not support system > >> regis

Re: [PATCH 1/2] migration: factor out "resume_requested" in qmp_migrate()

2023-07-06 Thread Juan Quintela
Laszlo Ersek wrote: > It cuts back on those awkward, duplicated !(has_resume && resume) > expressions. > > Cc: Juan Quintela (maintainer:Migration) > Cc: Leonardo Bras (reviewer:Migration) > Cc: Peter Xu (reviewer:Migration) > Cc: qemu-triv...@nongnu.org > Bugzilla: https://bugzilla.redhat.com/

Re: [PATCH 2/2] migration: unexport migrate_fd_error()

2023-07-06 Thread Juan Quintela
Laszlo Ersek wrote: > The only migrate_fd_error() call sites are in "migration/migration.c", > which is also where we define migrate_fd_error(). Make the function > static, and remove its declaration from "migration/migration.h". > > Cc: Juan Quintela (maintainer:Migration) > Cc: Leonardo Bras (

Re: [PATCH v3] target/ppc: Machine check on invalid real address access on POWER9/10

2023-07-06 Thread BALATON Zoltan
On Thu, 6 Jul 2023, Cédric Le Goater wrote: On 7/6/23 09:32, Nicholas Piggin wrote: On Mon Jul 3, 2023 at 10:03 PM AEST, Nicholas Piggin wrote: ppc currently silently accepts invalid real address access. Catch these and turn them into machine checks on POWER9/10 machines. Would there be any o

Re: [PATCH] target/riscv: Fix LMUL check to use minimum SEW

2023-07-06 Thread Daniel Henrique Barboza
On 7/6/23 07:44, Rob Bradford wrote: The previous check was failing with: ELEN = 64 SEW = 16 and LMUL = 1/8 (encoded as 5) which is a valid combination. Fix the check to correctly match the specification by using minimum SEW rather than the active SEW. From the specification: "In general,

Re: [PATCH] docs/migration: Update postcopy bits

2023-07-06 Thread Peter Xu
On Thu, Jul 06, 2023 at 12:15:47PM +0200, Laszlo Ersek wrote: > One suggestion, to squash in: > > diff --git a/docs/devel/migration.rst b/docs/devel/migration.rst > index 6f65c23b47dc..3294679936b2 100644 > --- a/docs/devel/migration.rst > +++ b/docs/devel/migration.rst > @@ -594,8 +594,7 @@ Postc

[PATCH v2] docs/migration: Update postcopy bits

2023-07-06 Thread Peter Xu
We have postcopy recovery but not reflected in the document, do an update for that. Add a very small section on postcopy preempt. Touch up the pagemap section, dropping the unsent map because it's already been dropped in the source code in commit 1e7cf8c323 ("migration/postcopy: unsentmap is not

  1   2   3   >