Re: [PATCH v2 04/17] intel_iommu: Flush stage-2 cache in PASID-selective PASID-based iotlb invalidation

2024-08-05 Thread CLEMENT MATHIEU--DRIF
On 05/08/2024 08:27, Zhenzhong Duan wrote: > Caution: External email. Do not open attachments or click links, unless this > email comes from a known sender and you know the content is safe. > > > Per spec 6.5.2.4, PADID-selective PASID-based iotlb invalidation will > flush stage-2 iotlb entries

Re: [PATCH v2 03/17] intel_iommu: Add a placeholder variable for scalable modern mode

2024-08-05 Thread CLEMENT MATHIEU--DRIF
On 05/08/2024 08:27, Zhenzhong Duan wrote: > Caution: External email. Do not open attachments or click links, unless this > email comes from a known sender and you know the content is safe. > > > Add an new element scalable_mode in IntelIOMMUState to mark scalable > modern mode, this element wil

Re: [PATCH v2 14/17] intel_iommu: Set default aw_bits to 48 in scalable modren mode

2024-08-05 Thread CLEMENT MATHIEU--DRIF
Typo in the title : s/modren/modern Reviewed-by: Clément Mathieu--Drif On 05/08/2024 08:27, Zhenzhong Duan wrote: > Caution: External email. Do not open attachments or click links, unless this > email comes from a known sender and you know the content is safe. > > > According to VTD spec, stage

Re: [PATCH v2 15/17] intel_iommu: Modify x-scalable-mode to be string option to expose scalable modern mode

2024-08-05 Thread CLEMENT MATHIEU--DRIF
On 05/08/2024 08:27, Zhenzhong Duan wrote: Caution: External email. Do not open attachments or click links, unless this email comes from a known sender and you know the content is safe. From: Yi Liu Intel VT-d 3.0 introduces scalable mode, and it has a bunch of ca

Re: [PATCH v2 16/17] intel_iommu: Introduce a property to control FS1GP cap bit setting

2024-08-05 Thread CLEMENT MATHIEU--DRIF
Reviewed-by: Clément Mathieu--Drif On 05/08/2024 08:27, Zhenzhong Duan wrote: > Caution: External email. Do not open attachments or click links, unless this > email comes from a known sender and you know the content is safe. > > > When host IOMMU doesn't support FS1GP but vIOMMU does, host IOMM

[PULL 3/5] target/riscv: Relax fld alignment requirement

2024-08-05 Thread Alistair Francis
From: LIU Zhiwei According to the risc-v specification: "FLD and FSD are only guaranteed to execute atomically if the effective address is naturally aligned and XLEN≥64." We currently implement fld as MO_ATOM_IFALIGN when XLEN < 64, which does not violate the rules. But it will hide some problem

[PULL 5/5] roms/opensbi: Update to v1.5.1

2024-08-05 Thread Alistair Francis
From: Daniel Henrique Barboza A new minor version of OpenSBI was just released after our bump to OpenSBI 1.5. It contains significant bug fixes that it's worth doing a new update for QEMU 9.1. Submodule roms/opensbi 455de672dd..43cace6c36: > lib: sbi: check result of pmp_get() in is_pmp_entry_

[PULL 4/5] target/riscv: Add asserts for out-of-bound access

2024-08-05 Thread Alistair Francis
From: Atish Patra Coverity complained about the possible out-of-bounds access with counter_virt/counter_virt_prev because these two arrays are accessed with privilege mode. However, these two arrays are accessed only when virt is enabled. Thus, the privilege mode can't be M mode. Add the asserts

[PULL 0/5] riscv-to-apply queue

2024-08-05 Thread Alistair Francis
The following changes since commit e7207a9971dd41618b407030902b0b2256deb664: Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging (2024-08-06 08:02:34 +1000) are available in the Git repository at: https://github.com/alistair23/qemu.git tags/pull-riscv-to-apply-20240806-

[PULL 1/5] target/riscv: Remove redundant insn length check for zama16b

2024-08-05 Thread Alistair Francis
From: LIU Zhiwei Compressed encodings also applies to zama16b. https://github.com/riscv/riscv-isa-manual/pull/1557 Suggested-by: Alistair Francis Signed-off-by: LIU Zhiwei Reviewed-by: Alistair Francis Reviewed-by: Richard Henderson Message-ID: <20240802072417.659-2-zhiwei_...@linux.alibaba.

[PULL 2/5] target/riscv: Add MXLEN check for F/D/Q applies to zama16b

2024-08-05 Thread Alistair Francis
From: LIU Zhiwei Zama16b loads and stores of no more than MXLEN bits defined in the F, D, and Q extensions. Signed-off-by: LIU Zhiwei Reviewed-by: Alistair Francis Reviewed-by: Richard Henderson Message-ID: <20240802072417.659-3-zhiwei_...@linux.alibaba.com> Signed-off-by: Alistair Francis -

Re: [PATCH v5 4/7] acpi/ghes: Support GPIO error source

2024-08-05 Thread Mauro Carvalho Chehab
Em Mon, 5 Aug 2024 17:56:17 +0100 Jonathan Cameron escreveu: > On Fri, 2 Aug 2024 23:43:59 +0200 > Mauro Carvalho Chehab wrote: > > > From: Jonathan Cameron > > > > Add error notification to GHES v2 using the GPIO source. > > The gpio / external interrupt follows through. True. As sessio

Re: [PATCH v5 3/7] arm/virt: Wire up GPIO error source for ACPI / GHES

2024-08-05 Thread Mauro Carvalho Chehab
Em Mon, 5 Aug 2024 17:54:00 +0100 Jonathan Cameron escreveu: > On Fri, 2 Aug 2024 23:43:58 +0200 > Mauro Carvalho Chehab wrote: > > Do we need to rename this now there is a GED involved? > Is it even technically a GPIO any more? > Spec says in 18.3.2.7 > HW-reduced ACPI platforms signal the e

Re: [PATCH v5 2/7] acpi/generic_event_device: add an APEI error device

2024-08-05 Thread Mauro Carvalho Chehab
Em Mon, 5 Aug 2024 17:39:46 +0100 Jonathan Cameron escreveu: > On Fri, 2 Aug 2024 23:43:57 +0200 > Mauro Carvalho Chehab wrote: > > > Adds a Generic Event Device to handle generic hardware error > > events, supporting General Purpose Event (GPE) as specified at > > ACPI 6.5 specification at 18

Re: [PATCH] Add vhost-user-spi and vhost-user-spi-pci devices

2024-08-05 Thread Haixu Cui
Hi, Can anyone please review the patch? Thank you so much. Best Regards Haixu Cui On 7/12/2024 11:42 AM, Haixu Cui wrote: This work is based on the virtio-spi spec, virtio-spi driver introduced by the following patch series: - https://github.com/oasis-tcs/virtio-spec/tree/virtio-1.4/device

Re: [PATCH 3/3] virtio_net: remove the unnecessary check in get_config

2024-08-05 Thread Jason Wang
On Tue, Aug 6, 2024 at 8:58 AM Cindy Lu wrote: > > The vdpa device with MAC address 0 should not boot. > So remove the check here > > Signed-off-by: Cindy Lu Please describe what issues you've seen, and how it is fixed by this commit. Thanks > --- > hw/net/virtio-net.c | 13 - > 1

Re: [PATCH 2/3] virtio_net: Add the check for vdpa mac address

2024-08-05 Thread Jason Wang
On Tue, Aug 6, 2024 at 8:58 AM Cindy Lu wrote: > > When using a VDPA device, this is another acceptable situations > The hardware MAC address is not 0, and the MAC address in the QEMU command > line is 0. > This is also acceptable > > Signed-off-by: Cindy Lu > --- > hw/net/virtio-net.c | 13 +++

Re: [PATCH 1/3] virtio_net: Add the check for vdpa's mac address

2024-08-05 Thread Jason Wang
On Tue, Aug 6, 2024 at 8:58 AM Cindy Lu wrote: > > When using a VDPA device, it is important to ensure that > the MAC address in the hardware matches the MAC address > from the QEMU command line. > This will allow the device to boot. > > Signed-off-by: Cindy Lu > --- > hw/net/virtio-net.c | 33 +

Ping: Re: [PATCH v9 09/10] hw/nvme: add reservation protocal command

2024-08-05 Thread 卢长奇
Hi; Klaus, Does the test method in the above email work properly? On 2024/7/26 17:53, 卢长奇 wrote: > Hi; > > You can test it in spdk. > First start spdk and execute the following command. > > ``` > dd if=/dev/zero of=test.img bs=1G count=10 > RPC=/root/source/spdk/spdk/scripts/rpc.py > FILE=/root/t

Re: [PATCH v3 2/2] nbd: Clean up clients more efficiently

2024-08-05 Thread Eric Blake
On Mon, Aug 05, 2024 at 09:21:36PM GMT, Eric Blake wrote: > Since an NBD server may be long-living, serving clients that > repeatedly connect and disconnect, it can be more efficient to clean > up after each client disconnects, rather than storing a list of > resources to clean up when the server e

Re: [PATCH v2 1/3] nbd: CVE-XXX: Use cookie to track generation of nbd-server

2024-08-05 Thread Eric Blake
On Fri, Aug 02, 2024 at 06:00:32PM GMT, Vladimir Sementsov-Ogievskiy wrote: > > -static void nbd_blockdev_client_closed(NBDClient *client, bool ignored) > > +static void nbd_blockdev_client_closed(NBDClient *client, uint32_t cookie, > > + bool ignored) > > {

[PATCH for-9.1 v3 0/2] NBD CVE-2024-7409

2024-08-05 Thread Eric Blake
v2 was here: https://lists.gnu.org/archive/html/qemu-devel/2024-08/msg00253.html Since then: - CVE number assigned - drop old patch 1. Instead of tracking nbd_server generation, the code now ensures that nbd_server can't be set to NULL until all clients have disconnected - rewrite to forc

[PATCH v3 1/2] nbd: CVE-2024-7409: Close stray client sockets at server shutdown

2024-08-05 Thread Eric Blake
A malicious client can attempt to connect to an NBD server, and then intentionally delay progress in the handshake, including if it does not know the TLS secrets. Although this behavior can be bounded by the max-connections parameter, the QMP nbd-server-start currently defaults to unlimited incomi

[PATCH v3 2/2] nbd: Clean up clients more efficiently

2024-08-05 Thread Eric Blake
Since an NBD server may be long-living, serving clients that repeatedly connect and disconnect, it can be more efficient to clean up after each client disconnects, rather than storing a list of resources to clean up when the server exits. Rewrite the list of known clients to be double-linked so th

Re: [PATCH v2 10/13] target/riscv: Enable sscofpmf for bare cpu by default

2024-08-05 Thread Alistair Francis
On Wed, Jul 24, 2024 at 9:33 AM Atish Patra wrote: > > Sscofpmf has been supported on virt machine for a long time. It is > required to enable profiling on virt machines. Let's enable it > by default for ease of usage. > > Signed-off-by: Atish Patra > --- > target/riscv/cpu.c | 1 + > 1 file cha

Re: [PATCH v2 12/13] target/riscv: Add a preferred ISA extension rule

2024-08-05 Thread Alistair Francis
On Wed, Jul 24, 2024 at 9:32 AM Atish Patra wrote: > > In addition to the implied rule, a preferred rule will be useful > where an ISA extension may require a list of ISA extension to be > enabled to use all the features defined in that extension. All > these extensions may not be implied in the I

Re: [PATCH v2 09/13] target/riscv: Invoke pmu init after feature enable

2024-08-05 Thread Alistair Francis
On Wed, Jul 24, 2024 at 9:32 AM Atish Patra wrote: > > The dependant ISA features are enabled at the end of cpu_realize > in finalize_features. Thus, PMU init should be invoked after that > only. Move the init invocation to riscv_tcg_cpu_finalize_features. > > Signed-off-by: Atish Patra Reviewed

Re: [PATCH v2 08/13] target/riscv: Add configuration for S[m|s]csrind, Smcdeleg/Ssccfg

2024-08-05 Thread Alistair Francis
On Wed, Jul 24, 2024 at 9:33 AM Atish Patra wrote: > > Add configuration options so that they can be enabled/disabld from > qemu commandline. > > Signed-off-by: Atish Patra Acked-by: Alistair Francis Alistair > --- > target/riscv/cpu.c | 4 > 1 file changed, 4 insertions(+) > > diff --g

Re: [PATCH v2 07/13] target/riscv: Add counter delegation/configuration support

2024-08-05 Thread Alistair Francis
On Wed, Jul 24, 2024 at 9:32 AM Atish Patra wrote: > > From: Kaiwen Xue > > The Smcdeleg/Ssccfg adds the support for counter delegation via > S*indcsr and Ssccfg. > > It also adds a new shadow CSR scountinhibit and menvcfg enable bit (CDE) > to enable this extension and scountovf virtualization.

Re: [PATCH] vhost: Add VIRTIO_NET_F_RSC_EXT to vhost feature bits

2024-08-05 Thread Jason Wang
On Fri, Aug 2, 2024 at 1:38 PM Akihiko Odaki wrote: > > VIRTIO_NET_F_RSC_EXT is implemented in the rx data path, which vhost > implements, so vhost needs to support the feature if it is ever to be > enabled with vhost. The feature must be disabled otherwise. > > Fixes: 2974e916df87 ("virtio-net: s

[PATCH v4] chardev: add path option for pty backend

2024-08-05 Thread Octavian Purdila
Add path option to the pty char backend which will create a symbolic link to the given path that points to the allocated PTY. This avoids having to make QMP or HMP monitor queries to find out what the new PTY device path is. Based on patch from Paulo Neves: https://patchew.org/QEMU/1548509635-15

[PATCH 1/3] virtio_net: Add the check for vdpa's mac address

2024-08-05 Thread Cindy Lu
When using a VDPA device, it is important to ensure that the MAC address in the hardware matches the MAC address from the QEMU command line. This will allow the device to boot. Signed-off-by: Cindy Lu --- hw/net/virtio-net.c | 33 + 1 file changed, 29 insertions(+

[PATCH 3/3] virtio_net: remove the unnecessary check in get_config

2024-08-05 Thread Cindy Lu
The vdpa device with MAC address 0 should not boot. So remove the check here Signed-off-by: Cindy Lu --- hw/net/virtio-net.c | 13 - 1 file changed, 13 deletions(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index c144ae2e78..8a7c743ad3 100644 --- a/hw/net/virtio-net.c +

[PATCH 2/3] virtio_net: Add the check for vdpa mac address

2024-08-05 Thread Cindy Lu
When using a VDPA device, this is another acceptable situations The hardware MAC address is not 0, and the MAC address in the QEMU command line is 0. This is also acceptable Signed-off-by: Cindy Lu --- hw/net/virtio-net.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff

Re: [PATCH v2 06/13] target/riscv: Add select value range check for counter delegation

2024-08-05 Thread Alistair Francis
On Wed, Jul 24, 2024 at 9:31 AM Atish Patra wrote: > > From: Kaiwen Xue > > This adds checks in ops performed on xireg and xireg2-xireg6 so that the > counter delegation function will receive a valid xiselect value with the > proper extensions enabled. > > Co-developed-by: Atish Patra > Signed-o

Re: [PATCH v2 05/13] target/riscv: Add counter delegation definitions

2024-08-05 Thread Alistair Francis
On Wed, Jul 24, 2024 at 9:33 AM Atish Patra wrote: > > From: Kaiwen Xue > > This adds definitions for counter delegation, including the new > scountinhibit register and the mstateen.CD bit. > > Signed-off-by: Atish Patra > Signed-off-by: Kaiwen Xue Reviewed-by: Alistair Francis Alistair > -

Re: [PATCH] hw/ufs: add basic info of query response upiu

2024-08-05 Thread Jeuk Kim
On 8/4/2024 9:44 AM, Minwoo Im wrote: On 08/02, Kyoungrul Kim wrote: Modify to fill the opcode, idn, index, selector information of all Query Response UPIU. because attr and flag operation of query response upiu need these information too. Signed-off-by: KyoungrulKim Reviewed-by: Minwoo Im

Re: [PATCH v2 04/13] target/riscv: Support generic CSR indirect access

2024-08-05 Thread Alistair Francis
On Wed, Jul 24, 2024 at 9:32 AM Atish Patra wrote: > > From: Kaiwen Xue > > This adds the indirect access registers required by sscsrind/smcsrind > and the operations on them. Note that xiselect and xireg are used for > both AIA and sxcsrind, and the behavior of accessing them depends on > whethe

Re: [PATCH v2 03/13] target/riscv: Enable S*stateen bits for AIA

2024-08-05 Thread Alistair Francis
On Wed, Jul 24, 2024 at 9:31 AM Atish Patra wrote: > > As per the ratified AIA spec v1.0, three stateen bits control AIA CSR > access. > > Bit 60 controls the indirect CSRs > Bit 59 controls the most AIA CSR state > Bit 58 controls the IMSIC state such as stopei and vstopei > > Enable the correspo

Re: [PATCH v2 02/13] target/riscv: Decouple AIA processing from xiselect and xireg

2024-08-05 Thread Alistair Francis
On Wed, Jul 24, 2024 at 9:32 AM Atish Patra wrote: > > From: Kaiwen Xue > > Since xiselect and xireg also will be of use in sxcsrind, AIA should > have its own separated interface when those CSRs are accessed. > > Signed-off-by: Atish Patra > Signed-off-by: Kaiwen Xue Reviewed-by: Alistair Fra

Re: [PULL 0/2] target/i386 fixes for QEMU 9.1

2024-08-05 Thread Richard Henderson
On 8/5/24 22:16, Paolo Bonzini wrote: The following changes since commit c4d242501a61093a8b80ee8f6dd071c5110a100c: Merge tag 'net-pull-request' ofhttps://github.com/jasowang/qemu into staging (2024-08-02 15:53:54 +1000) are available in the Git repository at: https://gitlab.com/bonzini/

Re: [PULL 0/2] QAPI patches patches for 2024-08-05

2024-08-05 Thread Richard Henderson
On 8/5/24 17:59, Markus Armbruster wrote: The following changes since commit f9851d2ffef59b3a7f39513469263ab3b019480f: Merge tag 'migration-20240802-pull-request' ofhttps://gitlab.com/farosas/qemu into staging (2024-08-03 07:26:26 +1000) are available in the Git repository at: https://r

Re: [PATCH for-9.2 v6 02/12] hw/riscv: add riscv-iommu-bits.h

2024-08-05 Thread Alistair Francis
On Tue, Aug 6, 2024 at 4:25 AM Daniel Henrique Barboza wrote: > > > > On 8/4/24 8:04 PM, Alistair Francis wrote: > > On Fri, Aug 2, 2024 at 1:45 AM Daniel Henrique Barboza > > wrote: > >> > >> From: Tomasz Jeznach > >> > >> This header will be used by the RISC-V IOMMU emulation to be added > >>

Re: [PATCH for-9.1 0/1] roms/opensbi: update to v1.5.1

2024-08-05 Thread Alistair Francis
On Mon, Aug 5, 2024 at 10:04 PM Daniel Henrique Barboza wrote: > > Hi, > > OpenSBI v1.5.1, a bug fix release launched shortly after v1.5, contains > several bug fixes that we ended up missing in our refresh to v1.5 a > couple of weeks ago. > > It's a purely bug fix update from what we already have

Re: [PATCH for-9.1 1/1] roms/opensbi: Update to v1.5.1

2024-08-05 Thread Alistair Francis
On Mon, Aug 5, 2024 at 10:05 PM Daniel Henrique Barboza wrote: > > A new minor version of OpenSBI was just released after our bump to > OpenSBI 1.5. It contains significant bug fixes that it's worth doing > a new update for QEMU 9.1. > > Submodule roms/opensbi 455de672dd..43cace6c36: > > lib: sb

[PATCH 2/2] tests/avocado: Mark ppc_hv_tests.py as non-flaky after fixed console interaction

2024-08-05 Thread Nicholas Piggin
Now that exec_command doesn't incorrectly consume console output, and guest time is set correctly, ppc_hv_tests.py is working more reliably. Try marking it non-flaky. Signed-off-by: Nicholas Piggin --- tests/avocado/ppc_hv_tests.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/avocado

[PATCH 0/2] tests/avocado: Fix exec_command and enable ppc_hv_tests.py

2024-08-05 Thread Nicholas Piggin
This fixes an issue with exec_command eating console output and causing the ppc_hv_tests.py to fail. A few other tests also use exec_command but I didn't see any that subsequently checked console output. Thanks, Nick Nicholas Piggin (2): tests/avocado: exec_command should not consume console ou

[PATCH 1/2] tests/avocado: exec_command should not consume console output

2024-08-05 Thread Nicholas Piggin
_console_interaction reads data from the console even when there is only an input string to send, and no output data to wait on. This can cause lines to be missed by wait_for_console_pattern calls that follows an exec_command. Fix this by not reading the console if there is no pattern to wait for.

Re: [PATCH-for-9.1 v2] hw/ide/pci.c: Remove dead code from bmdma_prepare_buf()

2024-08-05 Thread Richard Henderson
On 8/6/24 04:24, Philippe Mathieu-Daudé wrote: From: Peter Maydell Coverity notes that the code at the end of the loop in bmdma_prepare_buf() is unreachable. This is because in commit 9fbf0fa81fca8f527 ("ide: remove hardcoded 2GiB transactional limit") we removed the only codepath in the loop w

Re: [PATCH v3 20/24] tests/functional: Convert the ppc_hv avocado test into a standalone test

2024-08-05 Thread Nicholas Piggin
Thanks for doing this. I have a fix for this problem, it's a bug with the test harness code but was not merged yet. I'll re-send it. Thanks, Nick On Wed Jul 31, 2024 at 3:03 AM AEST, Daniel P. Berrangé wrote: > From: Thomas Huth > > Note: The original Avocado test seems currently to be broken,

Re: u-boot-sam460ex fixes

2024-08-05 Thread Nicholas Piggin
On Sat Aug 3, 2024 at 6:40 PM AEST, Michael Tokarev wrote: > Hi! > > It's been a long time since everyone's fighting with u-boot-sam460ex code > which is > very bad, suffers from countless issues. > > For one, it does not compile for quite a long time with current compilers. > > For example, here

Re: [PULL 0/8] Net patches

2024-08-05 Thread Richard Henderson
On 8/5/24 12:38, Jason Wang wrote: Hi Richard: On Fri, Aug 2, 2024 at 5:48 PM Richard Henderson wrote: On 8/2/24 13:19, Jason Wang wrote: The following changes since commit 31669121a01a14732f57c49400bc239cf9fd505f: Merge tag 'pull-target-arm-20240801' ofhttps://git.linaro.org/people/pm

Re: [PULL 0/6] misc patch queue

2024-08-05 Thread Richard Henderson
https://gitlab.com/rth7680/qemu.git tags/pull-misc-20240805 for you to fetch changes up to 9996a35c6433c0e019a1c05791299db5e63a5db7: net/tap: Use qemu_close_all_open_fd() (2024-08-05 08:33:36 +1000) linux-user/elfload: Fix pr_

[PULL 11/13] vvfat: Fix reading files with non-continuous clusters

2024-08-05 Thread Kevin Wolf
From: Amjad Alsharafi When reading with `read_cluster` we get the `mapping` with `find_mapping_for_cluster` and then we call `open_file` for this mapping. The issue appear when its the same file, but a second cluster that is not immediately after it, imagine clusters `500 -> 503`, this will give

[PULL 07/13] scsi-disk: Always report RESERVATION_CONFLICT to guest

2024-08-05 Thread Kevin Wolf
In the case of scsi-block, RESERVATION_CONFLICT is not a backend error, but indicates that the guest tried to make a request that it isn't allowed to execute. Pass the error to the guest so that it can decide what to do with it. Without this, if we stop the VM in response to a RESERVATION_CONFLICT

[PULL 13/13] iotests/024: exclude 'backing file format' field from the output

2024-08-05 Thread Kevin Wolf
From: Andrey Drobyshev Apparently 'qemu-img info' doesn't report the backing file format field for qed (as it does for qcow2): $ qemu-img create -f qed base.qed 1M && qemu-img create -f qed -b base.qed -F qed top.qed 1M $ qemu-img create -f qcow2 base.qcow2 1M && qemu-img create -f qcow2 -b ba

[PULL 10/13] vvfat: Fix wrong checks for cluster mappings invariant

2024-08-05 Thread Kevin Wolf
From: Amjad Alsharafi How this `abort` was intended to check for was: - if the `mapping->first_mapping_index` is not the same as `first_mapping_index`, which **should** happen only in one case, when we are handling the first mapping, in that case `mapping->first_mapping_index == -1`, in all

[PULL 03/13] block/graph-lock: Make WITH_GRAPH_RDLOCK_GUARD() fully checked

2024-08-05 Thread Kevin Wolf
Upstream clang 18 (and backports to clang 17 in Fedora and RHEL) implemented support for __attribute__((cleanup())) in its Thread Safety Analysis, so we can now actually have a proper implementation of WITH_GRAPH_RDLOCK_GUARD() that understands when we acquire and when we release the lock. -Wthrea

[PULL 06/13] scsi-disk: Add warning comments that host_status errors take a shortcut

2024-08-05 Thread Kevin Wolf
scsi_block_sgio_complete() has surprising behaviour in that there are error cases in which it directly completes the request and never calls the passed callback. In the current state of the code, this doesn't seem to result in bugs, but with future code changes, we must be careful to never rely on

[PULL 08/13] vvfat: Fix bug in writing to middle of file

2024-08-05 Thread Kevin Wolf
From: Amjad Alsharafi Before this commit, the behavior when calling `commit_one_file` for example with `offset=0x2000` (second cluster), what will happen is that we won't fetch the next cluster from the fat, and instead use the first cluster for the read operation. This is due to off-by-one erro

[PULL 12/13] iotests: Add `vvfat` tests

2024-08-05 Thread Kevin Wolf
From: Amjad Alsharafi Added several tests to verify the implementation of the vvfat driver. We needed a way to interact with it, so created a basic `fat16.py` driver that handled writing correct sectors for us. Added `vvfat` to the non-generic formats, as its not a normal image format. Signed-

[PULL 09/13] vvfat: Fix usage of `info.file.offset`

2024-08-05 Thread Kevin Wolf
From: Amjad Alsharafi The field is marked as "the offset in the file (in clusters)", but it was being used like this `cluster_size*(nums)+mapping->info.file.offset`, which is incorrect. Signed-off-by: Amjad Alsharafi Reviewed-by: Kevin Wolf Message-ID: <72f19a7903886dda1aa78bcae0e17702ee93926

[PULL 05/13] scsi-block: Don't skip callback for sgio error status/driver_status

2024-08-05 Thread Kevin Wolf
Instead of calling into scsi_handle_rw_error() directly from scsi_block_sgio_complete() and skipping the normal callback, go through the normal cleanup path by calling the callback with a positive error value. The important difference here is not only that the code path is cleaner, but that the ca

[PULL 02/13] block-copy: Fix missing graph lock

2024-08-05 Thread Kevin Wolf
The graph lock needs to be held when calling bdrv_co_pdiscard(). Fix block_copy_task_entry() to take it for the call. WITH_GRAPH_RDLOCK_GUARD() was implemented in a weak way because of limitations in clang's Thread Safety Analysis at the time, so that it only asserts that the lock is held (which a

[PULL 00/13] Block layer patches

2024-08-05 Thread Kevin Wolf
The following changes since commit f9851d2ffef59b3a7f39513469263ab3b019480f: Merge tag 'migration-20240802-pull-request' of https://gitlab.com/farosas/qemu into staging (2024-08-03 07:26:26 +1000) are available in the Git repository at: https://repo.or.cz/qemu/kevin.git tags/for-upstream f

[PULL 04/13] scsi-disk: Use positive return value for status in dma_readv/writev

2024-08-05 Thread Kevin Wolf
In some error cases, scsi_block_sgio_complete() never calls the passed callback, but directly completes the request. This leads to bugs because its error paths are not exact copies of what the callback would normally do. In preparation to fix this, allow passing positive return values to the callb

[PULL 01/13] qapi-block-core: Clean up blockdev-snapshot-internal-sync doc

2024-08-05 Thread Kevin Wolf
From: Markus Armbruster BlockdevSnapshotInternal is the arguments type of command blockdev-snapshot-internal-sync. Its doc comment contains this note: # .. note:: In a transaction, if @name is empty or any snapshot matching #@name exists, the operation will fail. Only some image fo

[PATCH v3 0/1] Add support for generating OpenSBI domains in the device tree

2024-08-05 Thread Gregor Haas
This patch series adds support for specifying OpenSBI domains on the QEMU command line. A simple example of what this looks like is below, including mapping the board's UART into the secondary domain: qemu-system-riscv64 -machine virt -bios fw_jump.bin -cpu max -smp 2 -m 4G -nographic \ -

[PATCH v3 1/1] Add support for generating OpenSBI domains in the device tree

2024-08-05 Thread Gregor Haas
OpenSBI has support for domains, which are partitions of CPUs and memory into isolated compartments. Domains can be specified in the device tree according to a standardized format [1], which OpenSBI parses at boot time to initialize all system domains. This patch enables simply specifying domains (

Re: SRSO mitigation in microcode not passed through to VMs

2024-08-05 Thread Fabiano Rosas
Dario Faggioli writes: > Hello, > > So, even if SRSO is fully mitigated on the host, we still see as not > completely patched inside of the VMs running on Zen 3 and 4 hosts > (e.g., AMD EPYC 7713) > > We can see an example of that here: > https://bugzilla.suse.com/show_bug.cgi?id=1228079 > > This

[PATCH] target/i386: Expose IBPB-BRTYPE and SBPB CPUID bits to the guest

2024-08-05 Thread Fabiano Rosas
According to AMD's Speculative Return Stack Overflow whitepaper (link below), the hypervisor should synthesize the value of IBPB_BRTYPE and SBPB CPUID bits to the guest. Support for this is already present in the kernel with commit e47d86083c66 ("KVM: x86: Add SBPB support") and commit 6f0f23ef76b

[RFC PATCH 15/23] hw/ssi: add support for flexcomm spi

2024-08-05 Thread Octavian Purdila
From: Sebastian Ene From: Sebastian Ene Add support for NXP's flexcomm spi. It supports FIFO access, interrupts and master mode only. It does not support DMA. Signed-off-by: Sebastian Ene Signed-off-by: Octavian Purdila --- hw/arm/svd/meson.build| 4 + hw/misc/flexcomm.c

[RFC PATCH 23/23] hw/arm: add RT595-EVK board

2024-08-05 Thread Octavian Purdila
Add basic support for the RT595-EVK board, enough to be able to run the NXP's microXpresso SDK hello world example. Signed-off-by: Octavian Purdila --- hw/arm/Kconfig | 5 hw/arm/meson.build | 1 + hw/arm/rt595-evk.c | 64 ++ 3 files changed

[RFC PATCH 07/23] tests/unit: add system bus mock

2024-08-05 Thread Octavian Purdila
From: Valentin Ghita From: Valentin Ghita Add a system bus mock and the necessary memory access functions to be able to create unit tests for device models. Signed-off-by: Valentin Ghita Signed-off-by: Octavian Purdila --- tests/unit/sysbus-mock.c | 314 +

[RFC PATCH 18/23] hw/misc: add support for RT500's clock controller

2024-08-05 Thread Octavian Purdila
It supports system and audio PLL initialization and SYSTICK and OSTIMER clock source selection. Signed-off-by: Octavian Purdila --- hw/arm/svd/meson.build| 8 + hw/misc/Kconfig | 6 + hw/misc/meson.build | 2 + hw/misc/rt500_clkctl0.c |

[RFC PATCH 14/23] test/unit: add unit tests for flexcomm i2c

2024-08-05 Thread Octavian Purdila
Add master mode tests for flexcomm i2c. Signed-off-by: Octavian Purdila --- tests/unit/meson.build | 10 ++ tests/unit/test-flexcomm-i2c.c | 209 + 2 files changed, 219 insertions(+) create mode 100644 tests/unit/test-flexcomm-i2c.c diff --git a/tests/u

[RFC PATCH 12/23] hw/i2c: add support for flexcomm i2c

2024-08-05 Thread Octavian Purdila
Add support for NXP's flexcomm i2c. It does not support slave mode or DMA. Signed-off-by: Octavian Purdila --- hw/arm/svd/meson.build| 4 + hw/i2c/flexcomm_i2c.c | 224 ++ hw/i2c/meson.build| 1 + hw/i2c/trace-events | 10

[RFC PATCH 19/23] test/unit: add unit tests for RT500's clock controller

2024-08-05 Thread Octavian Purdila
Add test to exercise clocks set and clear, system PLL initialization, audio PLL initialization, systick and ostimer clock source selection. Signed-off-by: Octavian Purdila --- tests/unit/meson.build | 7 + tests/unit/test-rt500-clkctl.c | 270 + 2 files

[RFC PATCH 06/23] hw/misc: add basic flexcomm device model

2024-08-05 Thread Octavian Purdila
Add support for NXP's FLEXCOMM device model. It uses the NXP RT595 SVD file to generate the register structure. FLEXCOMM is a generic serial communication module which support multiple functions: UART, SPI and I2C. These are configurable at runtime. This patch adds the infrastructure to support a

[RFC PATCH 13/23] test/unit: add i2c-tester

2024-08-05 Thread Octavian Purdila
Add a simple i2c peripheral to be used for testing I2C device models. The peripheral has a fixed number of registers that can be read and written. Signed-off-by: Octavian Purdila --- tests/unit/i2c_tester.c | 111 tests/unit/i2c_tester.h | 34 +++

[RFC PATCH 08/23] test/unit: add register access macros and functions

2024-08-05 Thread Octavian Purdila
Add register access macros for devices models that use SVD generated registers. This allows accessing register or register bit fields in unit tests, e.g.: REG32_WRITE(f->dev, FLEXCOMM, PSELID, persel); g_assert(REG32_READ_FIELD(f->dev, FLEXCOMM, PSELID, PERSEL) == persel); Also add support fo

[RFC PATCH 03/23] scripts: add script to generate C header files from SVD XML files

2024-08-05 Thread Octavian Purdila
From: Stefan Stanacar From: Stefan Stanacar The CMSIS System View Description format(CMSIS-SVD) is an XML based description of Arm Cortex-M microcontrollers provided and maintained by sillicon vendors. It includes details such as peripherals registers (down to bitfields), peripheral register bl

[RFC PATCH 21/23] hw/misc: add support for RT500 reset controller

2024-08-05 Thread Octavian Purdila
The RT500 reset controller has two instances that have the same register layout but with different fields for some registers. The model only provides set and clear functionality for the various reset lines which is common for both instances. Because of that only one type is implemented for both co

[RFC PATCH 16/23] test/unit: add spi-tester

2024-08-05 Thread Octavian Purdila
Add a simple SPI peripheral that echoes back received data. Useful for testing SPI controllers. Signed-off-by: Octavian Purdila --- tests/unit/spi_tester.c | 60 + tests/unit/spi_tester.h | 32 ++ 2 files changed, 92 insertions(+) crea

[RFC PATCH 20/23] hw/ssi: add support for flexspi

2024-08-05 Thread Octavian Purdila
This is mostly a stub which completes SPI transactions as noops by masking out the error interrupts and never clearing the IPCMDDONE interrupt. Although incomplete, this allows software that uses NXP's mcuxpresso SDK to run the SDK board initialization functions. It also supports AHB memory acces

[RFC PATCH 02/23] tests/unit: add fifo test

2024-08-05 Thread Octavian Purdila
Add a simple FIFO unit test that test wrap around and push, pop and peek for both fifo8 and fifo32. Signed-off-by: Octavian Purdila --- tests/unit/meson.build | 1 + tests/unit/test-fifo.c | 98 ++ 2 files changed, 99 insertions(+) create mode 100644 tes

[RFC PATCH 01/23] fifo32: add peek function

2024-08-05 Thread Octavian Purdila
Add fifo32_peek() that returns the first element from the queue without popping it. Signed-off-by: Octavian Purdila --- include/qemu/fifo32.h | 29 + 1 file changed, 29 insertions(+) diff --git a/include/qemu/fifo32.h b/include/qemu/fifo32.h index 4e9fd1b5ef..c9befc4

[RFC PATCH 04/23] hw/arm: add SVD file for NXP i.MX RT595

2024-08-05 Thread Octavian Purdila
Picked from: https://github.com/nxp-mcuxpresso/mcux-soc-svd/blob/main/MIMXRT595S/MIMXRT595S_cm33.xml NOTE: the file is truncated to keep the email size reasonable. Please use the link above and download the full file if you want to try out the patch. Signed-off-by: Octavian Purdila --- hw/arm/

[RFC PATCH 09/23] test/unit: add flexcomm unit test

2024-08-05 Thread Octavian Purdila
Add flexcomm function selection unit tests. Signed-off-by: Octavian Purdila --- tests/unit/meson.build | 8 +- tests/unit/test-flexcomm.c | 215 + 2 files changed, 222 insertions(+), 1 deletion(-) create mode 100644 tests/unit/test-flexcomm.c diff --gi

[RFC PATCH 11/23] test/unit: add flexcomm usart unit test

2024-08-05 Thread Octavian Purdila
Add polling and irq unit tests for the flexcomm usart device model. Signed-off-by: Octavian Purdila --- tests/unit/meson.build | 7 + tests/unit/test-flexcomm-usart.c | 321 +++ 2 files changed, 328 insertions(+) create mode 100644 tests/unit/test-flexcom

[RFC PATCH 22/23] hw/arm: add basic support for the RT500 SoC

2024-08-05 Thread Octavian Purdila
Add basic support for the RT500 SoC. It supports enough peripherals to run the NXP's microXpresso SDK hello world example. Signed-off-by: Octavian Purdila --- hw/arm/Kconfig | 8 + hw/arm/meson.build | 1 + hw/arm/rt500.c | 348 + h

[RFC PATCH 17/23] test/unit: add unit tests for flexcomm spi

2024-08-05 Thread Octavian Purdila
From: Sebastian Ene From: Sebastian Ene Add master and loopback tests for flexcomm spi. Signed-off-by: Sebastian Ene Signed-off-by: Octavian Purdila --- tests/unit/meson.build | 11 ++ tests/unit/test-flexcomm-spi.c | 204 + 2 files changed, 215 inse

[RFC PATCH 00/23] NXP i.MX RT595, ARM SVD and device model unit tests

2024-08-05 Thread Octavian Purdila
This patch set adds support for NXP's RT500 MCU [1] and the RT595 EVK[2]. More RT500 device models will be submitted in future patch sets. The goal of this first patch set is to provide a minimal set that allows running the NXP MCU SDK hello world example[4] and to get feedback on a couple of new

[RFC PATCH 10/23] hw/char: add support for flexcomm usart

2024-08-05 Thread Octavian Purdila
Add support for NXP's flexcomm usart. It supports interupts and FIFO access but no DMA. Signed-off-by: Octavian Purdila --- hw/arm/svd/meson.build | 4 + hw/char/flexcomm_usart.c | 302 +++ hw/char/meson.build | 1 + hw/char/trace-ev

[RFC PATCH 05/23] hw: add register access utility functions

2024-08-05 Thread Octavian Purdila
Add register access utility functions for device models, like checking aligned access and reading and writing to a register backstore. Signed-off-by: Octavian Purdila --- include/hw/regs.h | 89 +++ 1 file changed, 89 insertions(+) create mode 100644

Re: [PATCH v2 1/1] Add support for generating OpenSBI domains in the device tree

2024-08-05 Thread Gregor Haas
Hi Daniel, Thanks for your review! I apologize for the incorrect command line -- the "size" parameter was indeed from my internal branch, building off of a patch series [1] submitted to OpenSBI. I will include a correct command line with my v3 patch. For my v3 patch, I'll also make sure to specif

Re: [PATCH for-9.1 0/2] NBD: don't print raw server error text to terminal

2024-08-05 Thread Richard W.M. Jones
On Mon, Aug 05, 2024 at 01:48:12PM -0500, Eric Blake wrote: > On Fri, Aug 02, 2024 at 02:26:04PM GMT, Eric Blake wrote: > > I've requested a CVE from Red Hat, and hope to have an assigned number > > soon. Meanwhile, we can get review started, to make sure this is > > ready to include in 9.1. 'qem

Re: [RFC V1 1/6] migration: SCM_RIGHTS for QEMUFile

2024-08-05 Thread Steven Sistare
On 8/2/2024 4:20 AM, Euan Turner wrote: On 30/06/2024 20:44, Steve Sistare wrote: Define functions to put/get file descriptors to/from a QEMUFile, for qio channels that support SCM_RIGHTS.  Maintain ordering such that    put(A), put(fd), put(B) followed by    get(A), get(fd), get(B) always succe

Re: [PATCH for-9.1 0/2] NBD: don't print raw server error text to terminal

2024-08-05 Thread Eric Blake
On Fri, Aug 02, 2024 at 02:26:04PM GMT, Eric Blake wrote: > I've requested a CVE from Red Hat, and hope to have an assigned number > soon. Meanwhile, we can get review started, to make sure this is > ready to include in 9.1. 'qemu-img info' should never print untrusted > data in a way that might

Re: [PATCH for-9.2 v6 02/12] hw/riscv: add riscv-iommu-bits.h

2024-08-05 Thread Daniel Henrique Barboza
On 8/4/24 8:04 PM, Alistair Francis wrote: On Fri, Aug 2, 2024 at 1:45 AM Daniel Henrique Barboza wrote: From: Tomasz Jeznach This header will be used by the RISC-V IOMMU emulation to be added in the next patch. Due to its size it's being sent in separate for an easier review. One thing

  1   2   3   >