Re: [PATCH] tools/ebpf: Fix IPv4 fragmentation identify

2023-04-28 Thread Andrew Melnichenko
Hi all, I don't think that checking DF flag is a case for figuring out that the packet is a fragment of some big datagram. For nonfragmented packets, DF may not be set. We need to check that the fragment offset is 0. Actually, it's a good idea to check that MF flag is not set too. So we can find th

[PATCH] test-aio-multithread: simplify test_multi_co_schedule

2023-04-28 Thread Paolo Bonzini
Instead of using qatomic_mb_{read,set} mindlessly, just use a per-coroutine flag that requires no synchronization. Signed-off-by: Paolo Bonzini --- tests/unit/test-aio-multithread.c | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/tests/unit/test-aio-multit

Re: [PATCH 01/17] docs/devel/qapi-code-gen: Clean up use of quotes a bit

2023-04-28 Thread Juan Quintela
Markus Armbruster wrote: > Section "Definition documentation" uses both single and double quotes > around doc text snippets. Stick to double quotes. > > Signed-off-by: Markus Armbruster Reviewed-by: Juan Quintela

Re: [PATCH for-8.0 v2 1/2] qtest/migration-test.c: Add tests with compress enabled

2023-04-28 Thread Juan Quintela
Lukas Straub wrote: > There has never been tests for migration with compress enabled. > > Add suitable tests, testing with compress-wait-thread = false > too. > > Signed-off-by: Lukas Straub Reviewed-by: Juan Quintela queued.

Re: [PATCH v4 3/5] parallels: Add checking and repairing duplicate offsets in BAT

2023-04-28 Thread Alexander Ivanov
On 4/27/23 15:46, Mike Maslenkin wrote: Sorry for the noise again , but I have another note No, you don't need to apologize. You help me make code better. On Mon, Apr 24, 2023 at 12:44 PM Alexander Ivanov wrote: Cluster offsets must be unique among all the BAT entries. Find duplicate offs

Re: [PATCH v2 04/13] ram.c: Reset result after sending queued data

2023-04-28 Thread Juan Quintela
Lukas Straub wrote: > And take the param->mutex lock for the whole section to ensure > thread-safety. > Now, it is explicitly clear if there is no queued data to send. > Before, this was handled by param->file stream being empty and thus > qemu_put_qemu_file() not sending anything. > > This will b

Re: [PATCH v2 05/13] ram.c: Do not call save_page_header() from compress threads

2023-04-28 Thread Juan Quintela
Lukas Straub wrote: > save_page_header() accesses several global variables, so calling it > from multiple threads is pretty ugly. > > Instead, call save_page_header() before writing out the compressed > data from the compress buffer to the migration stream. > > This also makes the core compress co

Re: [PULL 02/18] tests/avocado: use the new snapshots for testing

2023-04-28 Thread Thomas Huth
On 27/04/2023 17.44, Alex Bennée wrote: The tuxboot images now have a stable snapshot URL so we can enable the checksums and remove the avocado warnings. We will have to update as old snapshots retire but that won't be too frequent. Signed-off-by: Alex Bennée Acked-by: Thomas Huth Message-Id:

Re: [PATCH v2 06/13] ram.c: Call update_compress_thread_counts from compress_send_queued_data

2023-04-28 Thread Juan Quintela
Lukas Straub wrote: > This makes the core compress code more independend from ram.c. > > Signed-off-by: Lukas Straub Reviewed-by: Juan Quintela I haven't looked all the series yet > @@ -1575,15 +1577,8 @@ static void flush_compressed_data(RAMState *rs) > qemu_mutex_lock(&comp_param[i

Re: [PATCH] tools/ebpf: Fix IPv4 fragmentation identify

2023-04-28 Thread Andrew Melnichenko
Hi all, Also, for those changes to have an effect, a new eBPF skeleton must be generated. On Fri, Apr 28, 2023 at 1:58 PM Andrew Melnichenko wrote: > > Hi all, > I don't think that checking DF flag is a case for figuring out that > the packet is a fragment of some big datagram. > For nonfragmente

Re: [PATCH v2 07/13] ram.c: Remove last ram.c dependency from the core compress code

2023-04-28 Thread Juan Quintela
Lukas Straub wrote: > Make compression interfaces take send_queued_data() as an argument. > Remove save_page_use_compression() from flush_compressed_data(). > > This removes the last ram.c dependency from the core compress code. > > Signed-off-by: Lukas Straub Reviewed-by: Juan Quintela

Re: [PATCH v6 1/1] util/async-teardown: wire up query-command-line-options

2023-04-28 Thread Thomas Huth
On 28/04/2023 13.12, Claudio Imbrenda wrote: Add new -run-with option with an async-teardown=on|off parameter. It is visible in the output of query-command-line-options QMP command, so it can be discovered and used by libvirt. The option -async-teardown is now redundant, deprecate it. Reported-

Re: QMP (without OOB) function running in thread different from the main thread as part of aio_poll

2023-04-28 Thread Kevin Wolf
Am 28.04.2023 um 10:38 hat Juan Quintela geschrieben: > Kevin Wolf wrote: > >> I am perhaps a bit ingenuous here, but it is there a way to convince > >> qemu that snapshot_save_job_bh *HAS* to run on the main thread? > > > > I believe we're talking about a technicality here. I asked another more >

Re: [PATCH v20 01/21] s390x/cpu topology: add s390 specifics to CPU topology

2023-04-28 Thread Pierre Morel
On 4/27/23 10:04, Thomas Huth wrote: On 25/04/2023 18.14, Pierre Morel wrote: S390 adds two new SMP levels, drawers and books to the CPU topology. The S390 CPU have specific topology features like dedication and entitlement to give to the guest indications on the host vCPUs scheduling and help

[PULL 01/17] block/block-common: add zoned device structs

2023-04-28 Thread Stefan Hajnoczi
From: Sam Li Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Reviewed-by: Damien Le Moal Reviewed-by: Hannes Reinecke Reviewed-by: Dmitry Fomichev Acked-by: Kevin Wolf Signed-off-by: Stefan Hajnoczi Message-id: 20230427172019.3345-2-faithilike...@gmail.com Message-id: 20230324090605.283

[PULL 03/17] block/block-backend: add block layer APIs resembling Linux ZonedBlockDevice ioctls

2023-04-28 Thread Stefan Hajnoczi
From: Sam Li Add zoned device option to host_device BlockDriver. It will be presented only for zoned host block devices. By adding zone management operations to the host_block_device BlockDriver, users can use the new block layer APIs including Report Zone and four zone management operations (ope

[PULL 12/17] block: add some trace events for zone append

2023-04-28 Thread Stefan Hajnoczi
From: Sam Li Signed-off-by: Sam Li Reviewed-by: Dmitry Fomichev Reviewed-by: Stefan Hajnoczi Message-id: 20230427172339.3709-5-faithilike...@gmail.com Signed-off-by: Stefan Hajnoczi --- block/file-posix.c | 3 +++ block/trace-events | 2 ++ 2 files changed, 5 insertions(+) diff --git a/bloc

[PULL 06/17] iotests: test new zone operations

2023-04-28 Thread Stefan Hajnoczi
From: Sam Li The new block layer APIs of zoned block devices can be tested by: $ tests/qemu-iotests/check zoned Run each zone operation on a newly created null_blk device and see whether it outputs the same zone information. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Acked-by: Kevin Wo

[PULL 11/17] qemu-iotests: test zone append operation

2023-04-28 Thread Stefan Hajnoczi
From: Sam Li The patch tests zone append writes by reporting the zone wp after the completion of the call. "zap -p" option can print the sector offset value after completion, which should be the start sector where the append write begins. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Mess

[PULL 02/17] block/file-posix: introduce helper functions for sysfs attributes

2023-04-28 Thread Stefan Hajnoczi
From: Sam Li Use get_sysfs_str_val() to get the string value of device zoned model. Then get_sysfs_zoned_model() can convert it to BlockZoneModel type of QEMU. Use get_sysfs_long_val() to get the long value of zoned device information. Signed-off-by: Sam Li Reviewed-by: Hannes Reinecke Review

[PULL 05/17] block: add zoned BlockDriver check to block layer

2023-04-28 Thread Stefan Hajnoczi
From: Sam Li Putting zoned/non-zoned BlockDrivers on top of each other is not allowed. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Reviewed-by: Hannes Reinecke Reviewed-by: Dmitry Fomichev Acked-by: Kevin Wolf Signed-off-by: Stefan Hajnoczi Message-id: 20230427172019.3345-6-faithili

[PULL 16/17] virtio-blk: add some trace events for zoned emulation

2023-04-28 Thread Stefan Hajnoczi
From: Sam Li Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Signed-off-by: Stefan Hajnoczi Message-Id: <20230407082528.18841-5-faithilike...@gmail.com> --- hw/block/virtio-blk.c | 12 hw/block/trace-events | 7 +++ 2 files changed, 19 insertions(+) diff --git a/hw/block

[PULL 14/17] virtio-blk: add zoned storage emulation for zoned devices

2023-04-28 Thread Stefan Hajnoczi
From: Sam Li This patch extends virtio-blk emulation to handle zoned device commands by calling the new block layer APIs to perform zoned device I/O on behalf of the guest. It supports Report Zone, four zone oparations (open, close, finish, reset), and Append Zone. The VIRTIO_BLK_F_ZONED feature

[PULL 17/17] docs/zoned-storage:add zoned emulation use case

2023-04-28 Thread Stefan Hajnoczi
From: Sam Li Add the documentation about the example of using virtio-blk driver to pass the zoned block devices through to the guest. Signed-off-by: Sam Li Signed-off-by: Stefan Hajnoczi [Fix rST syntax --Stefan] Message-Id: <20230407082528.18841-6-faithilike...@gmail.com> --- docs/devel/zone

[PULL 15/17] block: add accounting for zone append operation

2023-04-28 Thread Stefan Hajnoczi
From: Sam Li Taking account of the new zone append write operation for zoned devices, BLOCK_ACCT_ZONE_APPEND enum is introduced as other I/O request type (read, write, flush). Signed-off-by: Sam Li Signed-off-by: Stefan Hajnoczi Message-Id: <20230407082528.18841-4-faithilike...@gmail.com> ---

[PULL 13/17] include: update virtio_blk headers to v6.3-rc1

2023-04-28 Thread Stefan Hajnoczi
From: Sam Li Use scripts/update-linux-headers.sh to update headers to 6.3-rc1. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Reviewed-by: Dmitry Fomichev Signed-off-by: Stefan Hajnoczi [Reran scripts/update-linux-headers.sh on Linux v6.3. The only change was the use of __virtioXX types

[PULL 10/17] block: introduce zone append write for zoned devices

2023-04-28 Thread Stefan Hajnoczi
From: Sam Li A zone append command is a write operation that specifies the first logical block of a zone as the write position. When writing to a zoned block device using zone append, the byte offset of the call may point at any position within the zone to which the data is being appended. Upon c

Re: [PATCH v10 0/4] Add zone append write for zoned device

2023-04-28 Thread Stefan Hajnoczi
On Fri, Apr 28, 2023 at 01:23:35AM +0800, Sam Li wrote: > This patch series add zone append operation based on the previous > zoned device support part. The file-posix driver is modified to > add zone append emulation using regular writes. > > v9: > - address review comments [Stefan] > * fix get

[PULL 04/17] block/raw-format: add zone operations to pass through requests

2023-04-28 Thread Stefan Hajnoczi
From: Sam Li raw-format driver usually sits on top of file-posix driver. It needs to pass through requests of zone commands. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Reviewed-by: Damien Le Moal Reviewed-by: Hannes Reinecke Reviewed-by: Dmitry Fomichev Acked-by: Kevin Wolf Signed-

[PULL 07/17] block: add some trace events for new block layer APIs

2023-04-28 Thread Stefan Hajnoczi
From: Sam Li Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Reviewed-by: Dmitry Fomichev Acked-by: Kevin Wolf Signed-off-by: Stefan Hajnoczi Message-id: 20230427172019.3345-8-faithilike...@gmail.com Message-id: 20230324090605.28361-8-faithilike...@gmail.com Signed-off-by: Stefan Hajnoczi

Re: [PATCH v6 1/1] util/async-teardown: wire up query-command-line-options

2023-04-28 Thread Claudio Imbrenda
On Fri, 28 Apr 2023 14:16:42 +0200 Thomas Huth wrote: > On 28/04/2023 13.12, Claudio Imbrenda wrote: > > Add new -run-with option with an async-teardown=on|off parameter. It is > > visible in the output of query-command-line-options QMP command, so it > > can be discovered and used by libvirt. >

Re: [PATCH v19 0/8] Add support for zoned device

2023-04-28 Thread Stefan Hajnoczi
On Fri, Apr 28, 2023 at 01:20:11AM +0800, Sam Li wrote: > Zoned Block Devices (ZBDs) devide the LBA space to block regions called zones > that are larger than the LBA size. It can only allow sequential writes, which > reduces write amplification in SSD, leading to higher throughput and increased >

[PULL 00/17] Block patches

2023-04-28 Thread Stefan Hajnoczi
The following changes since commit 05d50ba2d4668d43a835c5a502efdec9b92646e6: Merge tag 'migration-20230427-pull-request' of https://gitlab.com/juan.quintela/qemu into staging (2023-04-28 08:35:06 +0100) are available in the Git repository at: https://gitlab.com/stefanha/qemu.git tags/block-

Re: [PATCH 07/17] qapi: Tidy up a slightly awkward TODO comment

2023-04-28 Thread Ani Sinha
On Fri, Apr 28, 2023 at 4:24 PM Markus Armbruster wrote: > MigrateSetParameters has a TODO comment sitting right behind its doc > comment. I wrote it this way to keep it out of the manual, but that > reason is not obvious. > > The previous commit (sphinx/qapidoc: Do not emit TODO sections into >

[PATCH 0/9] misc AHCI cleanups

2023-04-28 Thread Niklas Cassel
From: Niklas Cassel Hello John, Here comes some misc AHCI cleanups. Most are related to error handling. Please review. (I'm also working on a second series which will add support for READ LOG EXT and READ LOG DMA EXT, but I will send that one out once it is ready.) Kind regards, Niklas Ni

[PATCH 8/9] hw/ide/ahci: fix ahci_write_fis_sdb()

2023-04-28 Thread Niklas Cassel
From: Niklas Cassel When there is an error, we need to raise a TFES error irq, see AHCI 1.3.1, 5.3.13.1 SDB:Entry. If ERR_STAT is set, we jump to state ERR:FatalTaskfile, which will raise a TFES IRQ unconditionally, regardless if the I bit is set in the FIS or not. Thus, we should never raise a

Re: [PATCH 06/17] sphinx/qapidoc: Do not emit TODO sections into user manuals

2023-04-28 Thread Ani Sinha
On Fri, Apr 28, 2023 at 4:24 PM Markus Armbruster wrote: > QAPI doc comments are for QMP users: they go into the "QEMU QMP > Reference Manual" and the "QEMU Storage Daemon QMP Reference Manual". > > The doc comment TODO sections are for somebody else, namely for the > people who can do: developer

[PATCH 3/9] hw/ide/ahci: write D2H FIS on when processing NCQ command

2023-04-28 Thread Niklas Cassel
From: Niklas Cassel The way that BUSY + PxCI is cleared for NCQ (FPDMA QUEUED) commands is described in SATA 3.5a Gold: 11.15 FPDMA QUEUED command protocol DFPDMAQ2: ClearInterfaceBsy "Transmit Register Device to Host FIS with the BSY bit cleared to zero and the DRQ bit cleared to zero and Inter

[PATCH 1/9] hw/ide/ahci: remove stray backslash

2023-04-28 Thread Niklas Cassel
From: Niklas Cassel This backslash obviously does not belong here, so remove it. Signed-off-by: Niklas Cassel --- hw/ide/ahci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index 55902e1df7..a36e3fb77c 100644 --- a/hw/ide/ahci.c +++ b/hw/ide

[PATCH 4/9] hw/ide/ahci: simplify and document PxCI handling

2023-04-28 Thread Niklas Cassel
From: Niklas Cassel The AHCI spec states that: For NCQ, PxCI is cleared on command queued successfully. For non-NCQ, PxCI is cleared on command completed successfully. (A non-NCQ command that completes with error does not clear PxCI.) The current QEMU implementation either clears PxCI in check_

[PATCH 5/9] hw/ide/ahci: PxCI should not get cleared when ERR_STAT is set

2023-04-28 Thread Niklas Cassel
From: Niklas Cassel For NCQ, PxCI is cleared on command queued successfully. For non-NCQ, PxCI is cleared on command completed successfully. Successfully means ERR_STAT, BUSY and DRQ are all cleared. A command that has ERR_STAT set, does not get to clear PxCI. See AHCI 1.3.1, section 5.3.8, stat

[PATCH 6/9] hw/ide/ahci: PxSACT and PxCI is cleared when PxCMD.ST is cleared

2023-04-28 Thread Niklas Cassel
From: Niklas Cassel According to AHCI 1.3.1 definition of PxSACT: This field is cleared when PxCMD.ST is written from a '1' to a '0' by software. This field is not cleared by a COMRESET or a software reset. According to AHCI 1.3.1 definition of PxCI: This field is also cleared when PxCMD.ST is w

[PATCH 2/9] hw/ide/core: set ERR_STAT in unsupported command completion

2023-04-28 Thread Niklas Cassel
From: Niklas Cassel Currently, the first time sending an unsupported command (e.g. READ LOG DMA EXT) will not have ERR_STAT set in the completion. Sending the unsupported command again, will correctly have ERR_STAT set. When ide_cmd_permitted() returns false, it calls ide_abort_command(). ide_ab

[PATCH 7/9] hw/ide/ahci: trigger either error IRQ or regular IRQ, not both

2023-04-28 Thread Niklas Cassel
From: Niklas Cassel According to AHCI 1.3.1, 5.3.8.1 RegFIS:Entry, if ERR_STAT is set, we jump to state ERR:FatalTaskfile, which will raise a TFES IRQ unconditionally, regardless if the I bit is set in the FIS or not. Thus, we should never raise a normal IRQ after having sent an error IRQ. Sign

[PATCH 9/9] hw/ide/ahci: fix broken SError handling

2023-04-28 Thread Niklas Cassel
From: Niklas Cassel When encountering an NCQ error, you should not write the NCQ tag to the SError register. This is completely wrong. The SError register has a clear definition, where each bit represents a different error, see PxSERR definition in AHCI 1.3.1. If we write a random value (like t

[PATCH v2] Don't require libcap-ng for virtfs support

2023-04-28 Thread Peter Foley
It's only required for the proxy helper. Add a new option for the proxy helper rather than enabling it implicitly. Change-Id: I95b73fca625529e99d16b0a64e01c65c0c1d43f2 Signed-off-by: Peter Foley --- meson.build | 11 --- meson_options.txt | 2 ++ scripts/m

Re: [PATCH v11 06/13] tests/qtest: Adjust and document query-cpu-model-expansion test for arm

2023-04-28 Thread Fabiano Rosas
Richard Henderson writes: > On 4/27/23 14:16, Fabiano Rosas wrote: >> Richard Henderson writes: >> >>> On 4/26/23 19:00, Fabiano Rosas wrote: We're about to move the 32-bit CPUs under CONFIG_TCG, so adjust the query-cpu-model-expansion test to check against the cortex-a7, which i

[PULL 09/17] file-posix: add tracking of the zone write pointers

2023-04-28 Thread Stefan Hajnoczi
From: Sam Li Since Linux doesn't have a user API to issue zone append operations to zoned devices from user space, the file-posix driver is modified to add zone append emulation using regular writes. To do this, the file-posix driver tracks the wp location of all zones of the device. It uses an a

[PULL 08/17] docs/zoned-storage: add zoned device documentation

2023-04-28 Thread Stefan Hajnoczi
From: Sam Li Add the documentation about the zoned device support to virtio-blk emulation. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Reviewed-by: Damien Le Moal Reviewed-by: Dmitry Fomichev Acked-by: Kevin Wolf Signed-off-by: Stefan Hajnoczi Message-id: 20230427172019.3345-9-faith

RE: [PATCH v3 1/2] igb: RX descriptors handling cleanup

2023-04-28 Thread Tomasz Dzieciol/VIM Integration (NC) /SRPOL/Engineer/Samsung Electronics
> Please don't ignore comments in reviews, and if you have a question with them > or you don't agree with them, please write so in a reply. You don't have to > post a new version quickly so take time to address all problems pointed out. I assumed that comments referred only to places pointed in

Re: [PATCH v20 03/21] target/s390x/cpu topology: handle STSI(15) and build the SYSIB

2023-04-28 Thread Pierre Morel
On 4/27/23 19:01, Thomas Huth wrote: On 25/04/2023 18.14, Pierre Morel wrote: On interception of STSI(15.1.x) the System Information Block (SYSIB) is built from the list of pre-ordered topology entries. Signed-off-by: Pierre Morel ---   MAINTAINERS |   1 +   include/hw/s3

Re: [PATCH] tests: virtio-9p-client: Rreaddir fields are all mandatory

2023-04-28 Thread Christian Schoenebeck
On Thursday, April 27, 2023 3:10:23 PM CEST Paolo Bonzini wrote: > If rreaddir.entries is NULL, the resulting dirent list is leaked. > Check that the rreaddir case is filled correctly in the caller > when treaddir succeeds; this then makes it possible to remove > the conditionals is v9fs_rreaddir.

Re: [PATCH v4 04/20] virtio-scsi: stop using aio_disable_external() during unplug

2023-04-28 Thread Kevin Wolf
Am 25.04.2023 um 19:27 hat Stefan Hajnoczi geschrieben: > This patch is part of an effort to remove the aio_disable_external() > API because it does not fit in a multi-queue block layer world where > many AioContexts may be submitting requests to the same disk. > > The SCSI emulation code is alrea

Re: [PATCH v20 02/21] s390x/cpu topology: add topology entries on CPU hotplug

2023-04-28 Thread Pierre Morel
On 4/27/23 15:38, Thomas Huth wrote: On 25/04/2023 18.14, Pierre Morel wrote: The topology information are attributes of the CPU and are specified during the CPU device creation. On hot plug we: - calculate the default values for the topology for drawers,    books and sockets in the case they

RE: [PATCH v3 1/2] igb: RX descriptors handling cleanup

2023-04-28 Thread Tomasz Dzieciol/VIM Integration (NC) /SRPOL/Engineer/Samsung Electronics
> Please don't ignore comments in reviews, and if you have a question with them > or you don't agree with them, please write so in a reply. You don't have to > post a new version quickly so take time to address all problems pointed out. I assumed that comments referred only to places pointed in

Re: [PATCH] async: Suppress GCC13 false positive in aio_bh_poll()

2023-04-28 Thread Paolo Bonzini
Il mar 25 apr 2023, 15:31 Daniel P. Berrangé ha scritto: > > > -BHListSlice slice; > > > +/* > > > + * gcc13 complains about putting a local variable > > > + * in a global list, so put it on the heap. > > > + */ > > > +g_autofree BHListSlice *slice = g_new(BHListSlice, 1);

Re: [PATCH] target: ppc: Correctly initialize HILE in HID-0 for book3s processors

2023-04-28 Thread Fabiano Rosas
Vaibhav Jain writes: > Hi Fabiano, > > Thanks for looking into this patch and apologies for the delayed reponse. > Fabiano Rosas writes: > >> Narayana Murty N writes: >> >>> On PPC64 the HILE(Hypervisor Interrupt Little Endian) bit in HID-0 >>> register needs to be initialized as per isa 3.0b[1

[PATCH v5 00/13] target/riscv: Fix PMP related problem

2023-04-28 Thread Weiwei Li
This patchset tries to fix the PMP bypass problem issue https://gitlab.com/qemu-project/qemu/-/issues/1542: TLB will be cached if the matched PMP entry cover the whole page. However PMP entries with higher priority may cover part of the page (but not match the access address), which means diff

[PATCH v5 05/13] target/riscv: Make RLB/MML/MMWP bits writable only when Smepmp is enabled

2023-04-28 Thread Weiwei Li
RLB/MML/MMWP bits in mseccfg CSR are introduced by Smepmp extension. So they can only be writable and set to 1s when cfg.epmp is true. Then we also need't check on epmp in pmp_hart_has_privs_default(). Signed-off-by: Weiwei Li Signed-off-by: Junqiang Wang --- target/riscv/pmp.c | 50 +++

[PATCH v5 01/13] target/riscv: Update pmp_get_tlb_size()

2023-04-28 Thread Weiwei Li
PMP entries before the matched PMP entry (including the matched PMP entry) may only cover partial of the TLB page, which may make different regions in that page allow different RWX privs. Such as for PMP0 (0x8008~0x800F, R) and PMP1 (0x8000~0x8FFF, RWX), write access to 0x8000 w

[PATCH v5 04/13] target/riscv: Change the return type of pmp_hart_has_privs() to bool

2023-04-28 Thread Weiwei Li
We no longer need the pmp_index for matched PMP entry now. Signed-off-by: Weiwei Li Signed-off-by: Junqiang Wang --- target/riscv/cpu_helper.c | 8 target/riscv/pmp.c| 32 +--- target/riscv/pmp.h| 8 3 files changed, 21 insertions(

[PATCH v5 08/13] target/riscv: Update the next rule addr in pmpaddr_csr_write()

2023-04-28 Thread Weiwei Li
Currently only the rule addr of the same index of pmpaddr is updated when pmpaddr CSR is modified. However, the rule addr of next PMP entry may also be affected if its A field is PMP_AMATCH_TOR. So we should also update it in this case. Write to pmpaddr CSR will not affect the rule nums, So we nee

[PATCH v5 11/13] accel/tcg: Uncache the host address for instruction fetch when tlb size < 1

2023-04-28 Thread Weiwei Li
When PMP entry overlap part of the page, we'll set the tlb_size to 1, which will make the address in tlb entry set with TLB_INVALID_MASK, and the next access will again go through tlb_fill.However, this way will not work in tb_gen_code() => get_page_addr_code_hostp(): the TLB host address will be c

[PATCH v5 03/13] target/riscv: Make the short cut really work in pmp_hart_has_privs

2023-04-28 Thread Weiwei Li
Return the result directly for short cut, since We needn't do the following check on the PMP entries if there is no PMP rules. Signed-off-by: Weiwei Li Signed-off-by: Junqiang Wang --- target/riscv/pmp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/riscv/pmp.c b/target/riscv/pmp.c

[PATCH v5 06/13] target/riscv: Remove unused paramters in pmp_hart_has_privs_default()

2023-04-28 Thread Weiwei Li
The addr and size parameters in pmp_hart_has_privs_default() are unused. Signed-off-by: Weiwei Li Signed-off-by: Junqiang Wang --- target/riscv/pmp.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/target/riscv/pmp.c b/target/riscv/pmp.c index e745842973..d2d8429277

[PATCH v5 12/13] target/riscv: Separate pmp_update_rule() in pmpcfg_csr_write

2023-04-28 Thread Weiwei Li
Use pmp_update_rule_addr() and pmp_update_rule_nums() separately to update rule nums only once for each pmpcfg_csr_write. Then remove pmp_update_rule() since it become unused. Signed-off-by: Weiwei Li Signed-off-by: Junqiang Wang --- target/riscv/pmp.c | 16 ++-- 1 file changed, 2 i

[PATCH v5 13/13] target/riscv: Deny access if access is partially inside the PMP entry

2023-04-28 Thread Weiwei Li
Access will fails if access is partially inside the PMP entry. However,only set ret = false doesn't really mean pmp violation since pmp_hart_has_privs_default() may return true at the end of pmp_hart_has_privs(). Signed-off-by: Weiwei Li Signed-off-by: Junqiang Wang --- target/riscv/pmp.c | 4 +

[PATCH v5 07/13] target/riscv: Flush TLB when MMWP or MML bits are changed

2023-04-28 Thread Weiwei Li
MMWP and MML bits may affect the allowed privs of PMP entries and the default privs, both of which may change the allowed privs of exsited TLB entries. So we need flush TLB when they are changed. Signed-off-by: Weiwei Li Signed-off-by: Junqiang Wang --- target/riscv/pmp.c | 3 +++ 1 file change

[PATCH v5 02/13] target/riscv: Move pmp_get_tlb_size apart from get_physical_address_pmp

2023-04-28 Thread Weiwei Li
pmp_get_tlb_size can be separated from get_physical_address_pmp and is only needed when ret == TRANSLATE_SUCCESS. Signed-off-by: Weiwei Li Signed-off-by: Junqiang Wang Reviewed-by: LIU Zhiwei --- target/riscv/cpu_helper.c | 16 ++-- 1 file changed, 6 insertions(+), 10 deletions(-)

[PATCH v5 10/13] target/riscv: Flush TLB only when pmpcfg/pmpaddr really changes

2023-04-28 Thread Weiwei Li
TLB needn't be flushed when pmpcfg/pmpaddr don't changes. Signed-off-by: Weiwei Li Signed-off-by: Junqiang Wang Reviewed-by: Alistair Francis Reviewed-by: LIU Zhiwei --- target/riscv/pmp.c | 28 ++-- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/targe

[PATCH v3 02/19] target/riscv: Refactor vector-vector translation macro

2023-04-28 Thread Lawrence Hunter
From: Kiran Ostrolenk Refactor the non SEW-specific stuff out of `GEN_OPIVV_TRANS` into function `opivv_trans` (similar to `opivi_trans`). `opivv_trans` will be used in proceeding vector-crypto commits. Signed-off-by: Kiran Ostrolenk Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis

[PATCH v3 00/19] Add RISC-V vector cryptographic instruction set support

2023-04-28 Thread Lawrence Hunter
This patchset provides an implementation for Zvbb, Zvbc, Zvkned, Zvknh, Zvksh, Zvkg, and Zvksed of the draft RISC-V vector cryptography extensions as per the v20230425 version of the specification(1) (6a7ae7f2). This is an update to the patchset submitted to qemu-devel on Monday, 17 Apr 2023 14:

[PATCH v3] meson: Pass -j option to sphinx

2023-04-28 Thread Fabiano Rosas
Save a bit of build time by passing the number of jobs option to sphinx. We cannot use the -j option from make because meson does not support setting build time parameters for custom targets. Use nproc instead or the equivalent sphinx option "-j auto", if that is available. Also make sure our plu

Re: [PATCH v3] meson: Pass -j option to sphinx

2023-04-28 Thread Daniel P . Berrangé
On Fri, Apr 28, 2023 at 12:01:02PM -0300, Fabiano Rosas wrote: > Save a bit of build time by passing the number of jobs option to > sphinx. > > We cannot use the -j option from make because meson does not support > setting build time parameters for custom targets. Use nproc instead or > the equiva

[PATCH v3 17/19] crypto: Add SM4 constant parameter CK

2023-04-28 Thread Lawrence Hunter
From: Max Chou Adds sm4_ck constant for use in sm4 cryptography across different targets. Signed-off-by: Max Chou Reviewed-by: Frank Chang --- crypto/sm4.c | 10 ++ include/crypto/sm4.h | 1 + 2 files changed, 11 insertions(+) diff --git a/crypto/sm4.c b/crypto/sm4.c index 9

[PATCH v3 10/19] qemu/host-utils.h: Add clz and ctz functions for lower-bit integers

2023-04-28 Thread Lawrence Hunter
From: Kiran Ostrolenk This is for use in the RISC-V vclz and vctz instructions (implemented in proceeding commit). Signed-off-by: Kiran Ostrolenk Reviewed-by: Richard Henderson --- include/qemu/host-utils.h | 54 +++ 1 file changed, 54 insertions(+) diff -

[PATCH v3 16/19] crypto: Create sm4_subword

2023-04-28 Thread Lawrence Hunter
From: Max Chou Allows sharing of sm4_subword between different targets. Signed-off-by: Max Chou Reviewed-by: Frank Chang Reviewed-by: Richard Henderson --- include/crypto/sm4.h | 8 target/arm/tcg/crypto_helper.c | 10 ++ 2 files changed, 10 insertions(+), 8 delet

[PATCH v3 05/19] target/riscv: Move vector translation checks

2023-04-28 Thread Lawrence Hunter
From: Nazar Kazakov Move the checks out of `do_opiv{v,x,i}_gvec{,_shift}` functions and into the corresponding macros. This enables the functions to be reused in proceeding commits without check duplication. Signed-off-by: Nazar Kazakov Reviewed-by: Richard Henderson --- target/riscv/insn_tra

[PATCH v3 19/19] target/riscv: Expose Zvk* and Zvb[b, c] cpu properties

2023-04-28 Thread Lawrence Hunter
From: Nazar Kazakov Exposes earlier CPU flags allowing the use of the vector cryptography extensions. Signed-off-by: Nazar Kazakov --- target/riscv/cpu.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 3b754d7e13b..2f71d612725 1006

[PATCH v3 11/19] target/riscv: Add Zvbb ISA extension support

2023-04-28 Thread Lawrence Hunter
From: Dickon Hood This commit adds support for the Zvbb vector-crypto extension, which consists of the following instructions: * vrol.[vv,vx] * vror.[vv,vx,vi] * vbrev8.v * vrev8.v * vandn.[vv,vx] * vbrev.v * vclz.v * vctz.v * vcpop.v * vwsll.[vv,vx,vi] Translation functions are defined in `tar

[PATCH v3 12/19] target/riscv: Add Zvkned ISA extension support

2023-04-28 Thread Lawrence Hunter
From: Nazar Kazakov This commit adds support for the Zvkned vector-crypto extension, which consists of the following instructions: * vaesef.[vv,vs] * vaesdf.[vv,vs] * vaesdm.[vv,vs] * vaesz.vs * vaesem.[vv,vs] * vaeskf1.vi * vaeskf2.vi Translation functions are defined in `target/riscv/insn_tra

[PATCH] tests/qtest: Disable the spice test of readconfig-test on FreeBSD

2023-04-28 Thread Thomas Huth
The spice test is currently hanging on FreeBSD. It likely was never working before, since in the past, our configure script was failing to detect this feature due to a bug in the spice package there (it just got enabled recently by the commit https://cgit.freebsd.org/ports/commit/?id=cf16b1c9063351

Re: [PATCH] tests/qtest: Disable the spice test of readconfig-test on FreeBSD

2023-04-28 Thread Marc-André Lureau
On Fri, Apr 28, 2023 at 7:14 PM Thomas Huth wrote: > The spice test is currently hanging on FreeBSD. It likely was > never working before, since in the past, our configure script > was failing to detect this feature due to a bug in the spice > package there (it just got enabled recently by the co

Re: [PATCH] tests/qtest: Disable the spice test of readconfig-test on FreeBSD

2023-04-28 Thread Daniel P . Berrangé
On Fri, Apr 28, 2023 at 05:13:51PM +0200, Thomas Huth wrote: > The spice test is currently hanging on FreeBSD. It likely was > never working before, since in the past, our configure script > was failing to detect this feature due to a bug in the spice > package there (it just got enabled recently b

[PATCH v3 09/19] tcg: Add andcs and rotrs tcg gvec ops

2023-04-28 Thread Lawrence Hunter
From: Nazar Kazakov This commit adds helper functions and tcg operation definitions for the andcs and rotrs instructions Signed-off-by: Nazar Kazakov --- accel/tcg/tcg-runtime-gvec.c | 11 +++ accel/tcg/tcg-runtime.h | 1 + include/tcg/tcg-op-gvec.h| 4 tcg/tcg-op-gvec

[PATCH v3 03/19] target/riscv: Remove redundant "cpu_vl == 0" checks

2023-04-28 Thread Lawrence Hunter
From: Nazar Kazakov Remove the redundant "vl == 0" check which is already included within the vstart >= vl check, when vl == 0. Signed-off-by: Nazar Kazakov --- target/riscv/insn_trans/trans_rvv.c.inc | 31 + 1 file changed, 1 insertion(+), 30 deletions(-) diff --git

[PATCH v3 01/19] target/riscv: Refactor some of the generic vector functionality

2023-04-28 Thread Lawrence Hunter
From: Kiran Ostrolenk Take some functions/macros out of `vector_helper` and put them in a new module called `vector_internals`. This ensures they can be used by both vector and vector-crypto helpers (latter implemented in proceeding commits). Signed-off-by: Kiran Ostrolenk --- target/riscv/mes

[PATCH v3 15/19] target/riscv: Add Zvkg ISA extension support

2023-04-28 Thread Lawrence Hunter
From: Nazar Kazakov This commit adds support for the Zvkg vector-crypto extension, which consists of the following instructions: * vgmul.vv * vghsh.vv Translation functions are defined in `target/riscv/insn_trans/trans_rvvk.c.inc` and helpers are defined in `target/riscv/vcrypto_helper.c`. Co-

[PATCH v3 04/19] target/riscv: Add Zvbc ISA extension support

2023-04-28 Thread Lawrence Hunter
This commit adds support for the Zvbc vector-crypto extension, which consists of the following instructions: * vclmulh.[vx,vv] * vclmul.[vx,vv] Translation functions are defined in `target/riscv/insn_trans/trans_rvvk.c.inc` and helpers are defined in `target/riscv/vcrypto_helper.c`. Co-authored-

[PATCH v5 09/13] target/riscv: Flush TLB when pmpaddr is updated

2023-04-28 Thread Weiwei Li
TLB should be flushed not only for pmpcfg csr changes, but also for pmpaddr csr changes. Signed-off-by: Weiwei Li Signed-off-by: Junqiang Wang Reviewed-by: Alistair Francis Reviewed-by: LIU Zhiwei --- target/riscv/pmp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/riscv/pmp.c b/

[PATCH v3 06/19] target/riscv: Refactor translation of vector-widening instruction

2023-04-28 Thread Lawrence Hunter
From: Dickon Hood Zvbb (implemented in later commit) has a widening instruction, which requires an extra check on the enabled extensions. Refactor GEN_OPIVX_WIDEN_TRANS() to take a check function to avoid reimplementing it. Signed-off-by: Dickon Hood Reviewed-by: Richard Henderson --- target

[PATCH v3 07/19] target/riscv: Refactor some of the generic vector functionality

2023-04-28 Thread Lawrence Hunter
From: Kiran Ostrolenk Move some macros out of `vector_helper` and into `vector_internals`. This ensures they can be used by both vector and vector-crypto helpers (latter implemented in proceeding commits). Signed-off-by: Kiran Ostrolenk --- target/riscv/vector_helper.c| 42

[PATCH v3 08/19] qemu/bitops.h: Limit rotate amounts

2023-04-28 Thread Lawrence Hunter
From: Dickon Hood Rotates have been fixed up to only allow for reasonable rotate amounts (ie, no rotates >7 on an 8b value etc.) This fixes a problem with riscv vector rotate instructions. Signed-off-by: Dickon Hood Reviewed-by: Richard Henderson --- include/qemu/bitops.h | 24 ++

[PATCH v3 18/19] target/riscv: Add Zvksed ISA extension support

2023-04-28 Thread Lawrence Hunter
From: Max Chou This commit adds support for the Zvksed vector-crypto extension, which consists of the following instructions: * vsm4k.vi * vsm4r.[vv,vs] Translation functions are defined in `target/riscv/insn_trans/trans_rvvk.c.inc` and helpers are defined in `target/riscv/vcrypto_helper.c`. S

[PATCH v3 13/19] target/riscv: Add Zvknh ISA extension support

2023-04-28 Thread Lawrence Hunter
From: Kiran Ostrolenk This commit adds support for the Zvknh vector-crypto extension, which consists of the following instructions: * vsha2ms.vv * vsha2c[hl].vv Translation functions are defined in `target/riscv/insn_trans/trans_rvvk.c.inc` and helpers are defined in `target/riscv/vcrypto_helpe

[PATCH v3 14/19] target/riscv: Add Zvksh ISA extension support

2023-04-28 Thread Lawrence Hunter
This commit adds support for the Zvksh vector-crypto extension, which consists of the following instructions: * vsm3me.vv * vsm3c.vi Translation functions are defined in `target/riscv/insn_trans/trans_rvvk.c.inc` and helpers are defined in `target/riscv/vcrypto_helper.c`. Co-authored-by: Kiran O

[PATCH] ui: return NULL when getting cursor without a console

2023-04-28 Thread marcandre . lureau
From: Marc-André Lureau VNC may try to get the current cursor even when there are no consoles and crashes. Simple reproducer is qemu with -nodefaults. Fixes: (again) https://gitlab.com/qemu-project/qemu/-/issues/1548 Fixes: commit 385ac97f8 ("ui: keep current cursor with QemuConsole") Signed-of

Re: [PATCH 10/13] hw/ide/piix: Reuse PCIIDEState::{cmd,data}_ops

2023-04-28 Thread Bernhard Beschow
Am 27. April 2023 18:15:24 UTC schrieb Bernhard Beschow : > > >Am 27. April 2023 10:52:17 UTC schrieb Mark Cave-Ayland >: >>On 26/04/2023 21:14, Bernhard Beschow wrote: >> >>> Am 26. April 2023 18:18:35 UTC schrieb Bernhard Beschow : Am 26. April 2023 11:37:48 UTC schrieb Mark

Re: [PATCH v3 03/18] hw/i386/pc_piix: Wire PIIX3 IDE ouput IRQs to ISA bus IRQs 14/15

2023-04-28 Thread Bernhard Beschow
Am 27. April 2023 13:04:15 UTC schrieb BALATON Zoltan : >On Thu, 27 Apr 2023, Mark Cave-Ayland wrote: >> On 27/04/2023 08:58, Bernhard Beschow wrote: >>> Am 26. April 2023 12:50:08 UTC schrieb Mark Cave-Ayland >>> : On 02/03/2023 22:40, Philippe Mathieu-Daudé wrote: > Since pc_in

Re: [PATCH v2 08/13] ram.c: Introduce whitespace (squash with next patch)

2023-04-28 Thread Juan Quintela
Lukas Straub wrote: > Introduce whitespace to make it easier to reroll the series. > > Signed-off-by: Lukas Straub obviously skipped.

<    1   2   3   4   >