Re: [RFC PATCH v9 20/23] vdpa: Buffer CVQ support on shadow virtqueue

2022-07-13 Thread Eugenio Perez Martin
> > > +static void vhost_vdpa_net_handle_ctrl_used(VhostShadowVirtqueue *svq, > > > +void *vq_elem_opaque, > > > +uint32_t dev_written) > > > +{ > > > +g_autoptr(CVQElement) cvq_elem = vq_elem_opaque; > > >

Re: [PATCH] vdpa: Clean vhost_vdpa_dev_start(dev, false)

2022-07-13 Thread Jason Wang
On Tue, Jul 12, 2022 at 3:15 PM Eugenio Pérez wrote: > > Return value is never checked and is a clean path, so assume success > > Signed-off-by: Eugenio Pérez > --- Acked-by: Jason Wang > hw/virtio/vhost-vdpa.c | 33 ++--- > 1 file changed, 10 insertions(+), 23 del

Re: Internal MAC addresses list (mac_table) usage

2022-07-13 Thread Jason Wang
On Tue, Jul 12, 2022 at 4:43 PM Ovchinnikov, Vitalii wrote: > > Hi folks, > > While developing an Ethernet NIC model I noticed that QEMU maintains the > following internal array which marks used/free MAC addresses in net/net.c: > > static int mac_table[256] = {0}; > > with three private (static)

Re: [PATCH v3 00/14] scsi: add quirks and features to support m68k Macs

2022-07-13 Thread Mark Cave-Ayland
On 12/07/2022 15:48, Paolo Bonzini wrote: Queued, thanks (I was on vacation last week). I am a bit scared about the mode_select_truncated quirk. My reading of the code is that the MODE SELECT would fail anyway because the page length does not match in scsi_disk_check_mode_select: len = m

[PATCH v2] target/i386: Restore TSX features with taa-no

2022-07-13 Thread Zhenzhong Duan
On ICX-2S2 host, when run L2 guest with both L1/L2 using Icelake-Server-v3 or above, we got below warning: "warning: host doesn't support requested feature: MSR(10AH).taa-no [bit 8]" This is because L1 KVM doesn't expose taa-no to L2 if RTM is disabled, then starting L2 qemu triggers the warning.

Re: [PATCH 00/12] hw/nvme: misc fixes and updates

2022-07-13 Thread Klaus Jensen
On Jun 23 23:18, Klaus Jensen wrote: > From: Klaus Jensen > > This series includes a couple of misc fixes as well as some cleanup > pertaining to the aio handling in flush, dsm, copy and zone reset. As > Jinhao gets around to iothread stuff, it might come in handy to have > this stuff cleaned up

Re: [PATCH v4] hw/nvme: Use ioeventfd to handle doorbell updates

2022-07-13 Thread Klaus Jensen
On Jul 12 14:23, Klaus Jensen wrote: > On Jul 9 11:06, Jinhao Fan wrote: > > at 10:24 PM, Jinhao Fan wrote: > > > > > @@ -5793,6 +5891,7 @@ static uint16_t nvme_dbbuf_config(NvmeCtrl *n, > > > const NvmeRequest *req) > > > uint64_t dbs_addr = le64_to_cpu(req->cmd.dptr.prp1); > > > uint6

[PATCH] hw/nvme: add trace events for ioeventfd

2022-07-13 Thread Klaus Jensen
From: Klaus Jensen While testing Jinhaos ioeventfd patch I found it useful with a couple of additional trace events since we no longer see the mmio events. Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 8 hw/nvme/trace-events | 4 2 files changed, 12 insertions(+) diff

Re: [PATCH v7 00/14] KVM: mm: fd-based approach for supporting KVM guest private memory

2022-07-13 Thread Gupta, Pankaj
This is the v7 of this series which tries to implement the fd-based KVM guest private memory. The patches are based on latest kvm/queue branch commit: b9b71f43683a (kvm/queue) KVM: x86/mmu: Buffer nested MMU split_desc_cache only by default capacity Introduction In general t

Re: [PATCH v7 00/14] KVM: mm: fd-based approach for supporting KVM guest private memory

2022-07-13 Thread Gupta, Pankaj
This is the v7 of this series which tries to implement the fd-based KVM guest private memory. The patches are based on latest kvm/queue branch commit: b9b71f43683a (kvm/queue) KVM: x86/mmu: Buffer nested MMU split_desc_cache only by default capacity Introduction In general

Re: [PATCH v7 00/14] KVM: mm: fd-based approach for supporting KVM guest private memory

2022-07-13 Thread Gupta, Pankaj
This is the v7 of this series which tries to implement the fd-based KVM guest private memory. The patches are based on latest kvm/queue branch commit: b9b71f43683a (kvm/queue) KVM: x86/mmu: Buffer nested MMU split_desc_cache only by default capacity Introduction In general t

Re: [PATCH v7 00/14] KVM: mm: fd-based approach for supporting KVM guest private memory

2022-07-13 Thread Andy Lutomirski
On Wed, Jul 13, 2022, at 3:35 AM, Gupta, Pankaj wrote: This is the v7 of this series which tries to implement the fd-based KVM guest private memory. The patches are based on latest kvm/queue branch commit: b9b71f43683a (kvm/queue) KVM: x86/mmu: Buffer nested MMU

Re: [PATCH v7 04/14] mm/shmem: Support memfile_notifier

2022-07-13 Thread Gupta, Pankaj
+#ifdef CONFIG_MIGRATION +static int shmem_migrate_page(struct address_space *mapping, + struct page *newpage, struct page *page, + enum migrate_mode mode) +{ + struct inode *inode = mapping->host; + struct shmem_inode_info *in

Re: [RFC] hw/nvme: Use irqfd to send interrupts

2022-07-13 Thread Klaus Jensen
On Jul 12 14:26, Klaus Jensen wrote: > On Jul 9 12:35, Jinhao Fan wrote: > > Use irqfd to directly notify KVM to inject interrupts. This is done by > > registering a virtual IRQ(virq) in KVM and associate the virq with an > > irqfd, so that KVM can directly inject the interrupt when it receives >

Re: [PATCH] qtest/machine-none: Add LoongArch support

2022-07-13 Thread Richard Henderson
On 7/13/22 07:32, Song Gao wrote: Update the cpu_maps[] to support the LoongArch target. Signed-off-by: Song Gao --- tests/qtest/machine-none-test.c | 1 + 1 file changed, 1 insertion(+) Reviewed-by: Richard Henderson r~

Re: [PATCH v2 3/3] tests/tcg/s390x: test signed vfmin/vfmax

2022-07-13 Thread Richard Henderson
On 7/13/22 23:56, Ilya Leoshkevich wrote: Add a test to prevent regressions. Try all floating point value sizes and all combinations of floating point value classes. Verify the results against PoP tables, which are represented as close to the original as possible - this produces a lot of checkpat

Re: [PATCH v7 00/14] KVM: mm: fd-based approach for supporting KVM guest private memory

2022-07-13 Thread Chao Peng
On Wed, Jul 13, 2022 at 12:35:56PM +0200, Gupta, Pankaj wrote: > > > > > This is the v7 of this series which tries to implement the fd-based KVM > > > > guest private memory. The patches are based on latest kvm/queue branch > > > > commit: > > > > > > > > b9b71f43683a (kvm/queue) KVM: x86/mmu

Re: [PATCH v7 04/14] mm/shmem: Support memfile_notifier

2022-07-13 Thread Chao Peng
On Wed, Jul 13, 2022 at 12:01:13PM +0200, Gupta, Pankaj wrote: > > > > > +#ifdef CONFIG_MIGRATION > > > > +static int shmem_migrate_page(struct address_space *mapping, > > > > + struct page *newpage, struct page *page, > > > > + enum migrate_

Re: [PULL 00/35] Block patches

2022-07-13 Thread Peter Maydell
On Tue, 12 Jul 2022 at 19:10, Hanna Reitz wrote: > > The following changes since commit 9548cbed4253e38570d29b8cff0bf77c998f: > > iotests/copy-before-write: specify required_fmts (2022-07-12 13:21:02 +0530) > > are available in the Git repository at: > > https://gitlab.com/hreitz/qemu.git

[PATCH 4/7] pci: designware: ignore new bits in ATU CR1

2022-07-13 Thread Ben Dooks
In version 4 and anver ATU CR1 has more bits in it than just the viewport type. Make a guess at masking these out to avoid issues where Linux writes these bits and fails to enable memory ATUs. Signed-off-by: Ben Dooks --- hw/pci-host/designware.c | 4 ++-- 1 file changed, 2 insertions(+), 2 dele

[PATCH 5/7] pci: designware: move msi to entry 5

2022-07-13 Thread Ben Dooks
The driver should leave irq[0..3] for INT[A..D] but seems to put the MSI IRQ at entry 3 which should also be INT_D. Extend the irqs[] array to 5 entires and put the MSI at entry irqs[4]. Signed-off-by: Ben Dooks --- hw/pci-host/designware.c | 2 +- include/hw/pci-host/designware.h | 2 +-

[PATCH 1/7] pci: designware: add 64-bit viewport limit

2022-07-13 Thread Ben Dooks
Versions 4 and above add support for 64-bit viewport limit. Add support for the DESIGNWARE_PCIE_ATU_UPPER_LIMIT regiser where supported. Signed-off-by: Ben Dooks --- hw/pci-host/designware.c | 22 +- include/hw/pci-host/designware.h | 2 +- 2 files changed, 18 insert

[PATCH 2/7] pci: designware: fix DESIGNWARE_PCIE_ATU_UPPER_TARGET

2022-07-13 Thread Ben Dooks
By inspection DESIGNWARE_PCIE_ATU_UPPER_TARGET should be writing to the upper 32-bits of viewport->target, so fix this by shifting the 32-bit value before the or. Signed-off-by: Ben Dooks --- hw/pci-host/designware.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/pci-host

[PATCH 3/7] pci: designware: clamp viewport index

2022-07-13 Thread Ben Dooks
The current Linux driver for this assumes it can write the 255 into this register and then read back the value to work out how many viewports are supported. Clamp the value so that the probe works and does not cause memory corruption as the value is not well clamped elsewhere in the driver. Signe

updates for designware pci-host

2022-07-13 Thread Ben Dooks
As part of a project we have been looking at using the DesignWare PCIe host. We found a few issues of missing features or small bugs when using this with a recent Linux kernel (v5.17.x) Whilst doing this we also made a start on some tracing events.

[PATCH 6/7] pci: designware: correct host's class_id

2022-07-13 Thread Ben Dooks
This is a host to pcie bridge, so use PCI_CLASS_BRIDGE_HOST for the class. Signed-off-by: Ben Dooks --- hw/pci-host/designware.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/pci-host/designware.c b/hw/pci-host/designware.c index b5d5b2b8a5..a47ae48071 100644 --- a/hw/pc

[PATCH 7/7] pci: designware: add initial tracing events

2022-07-13 Thread Ben Dooks
Add a couple of tracing events for internal driver updates Signed-off-by: Ben Dooks --- hw/pci-host/designware.c | 4 hw/pci-host/trace-events | 4 2 files changed, 8 insertions(+) diff --git a/hw/pci-host/designware.c b/hw/pci-host/designware.c index a47ae48071..489959513f 100644 ---

[PATCH] gpio: designware gpio driver

2022-07-13 Thread Ben Dooks
A model for the DesignWare GPIO (v1) block. Signed-off-by: Ben Dooks --- hw/gpio/Kconfig | 3 + hw/gpio/designware_gpio.c | 327 ++ hw/gpio/meson.build | 1 + hw/gpio/trace-events | 7 + include/hw/gpio/design

Re: [PATCH 2/9] target/ppc: add errp to kvmppc_read_int_cpu_dt()

2022-07-13 Thread Mark Cave-Ayland
On 12/07/2022 15:54, BALATON Zoltan wrote: On Tue, 12 Jul 2022, Mark Cave-Ayland wrote: On 11/07/2022 08:42, Cédric Le Goater wrote: Anything special I should know ? As I don't have access to a G5 I've never tried that, however the qemu-system-ppc64 mac99 is wired differently to the qemu-sy

Re: [PATCH 6/6] target/ppc: fix exception error code in spr_write_excp_vector

2022-07-13 Thread Daniel Henrique Barboza
On 6/27/22 11:11, Matheus Ferst wrote: The 'error' argument of gen_inval_exception will be or-ed with POWERPC_EXCP_INVAL, so it should always be a constant prefixed with POWERPC_EXCP_INVAL_. No functional change is intended, spr_write_excp_vector is only used by register_BookE_sprs, and powerp

Re: [PATCH 4/6] target/ppc: fix exception error code in helper_{load,store}_dcr

2022-07-13 Thread Daniel Henrique Barboza
On 6/27/22 11:11, Matheus Ferst wrote: POWERPC_EXCP_INVAL should only be or-ed with other constants prefixed with POWERPC_EXCP_INVAL_. Also, take the opportunity to move both helpers under #if !defined(CONFIG_USER_ONLY) as the instructions that use them are privileged. No functional change is

Re: [PATCH 2/6] target/ppc: fix exception error value in slbfee

2022-07-13 Thread Daniel Henrique Barboza
On 6/27/22 11:11, Matheus Ferst wrote: Testing on a POWER9 DD2.3, we observed that the Linux kernel delivers a signal with si_code ILL_PRVOPC (5) when a userspace application tries to use slbfee. To obtain this behavior on linux-user, we should use POWERPC_EXCP_PRIV with POWERPC_EXCP_PRIV_OPC.

Re: [PATCH v4 2/2] ui/gtk: a new array param monitor to specify the target displays

2022-07-13 Thread Dongwon Kim
On Tue, Jul 12, 2022 at 08:11:08AM +0200, Markus Armbruster wrote: > Dongwon Kim writes: > > > New integer array parameter, 'monitor' is for specifying the target > > monitors where individual GTK windows are placed upon launching. > > > > Monitor numbers in the array are associated with virtual

Re: [PATCH] hw/nvme: Add options to override hardcoded values

2022-07-13 Thread Keith Busch
On Wed, Jul 13, 2022 at 09:11:41PM +0200, Mauricio Sandt wrote: > On 13/07/2022 20:48, Keith Busch wrote: > > I guess I'm missing the bigger picture here. You are supposed to be able to > > retrieve these fields with ioctl's, so not sure what this has to do with > > malware. Why does the firmware r

Re: [PATCH] hw/nvme: Add options to override hardcoded values

2022-07-13 Thread Mauricio Sandt
On 13/07/2022 20:48, Keith Busch wrote: I guess I'm missing the bigger picture here. You are supposed to be able to retrieve these fields with ioctl's, so not sure what this has to do with malware. Why does the firmware revision matter to this program? Oh I'm sorry, I forgot to explain properly.

Re: [PATCH] hw/nvme: Add options to override hardcoded values

2022-07-13 Thread Keith Busch
On Wed, Jul 13, 2022 at 08:06:26PM +0200, Mauricio Sandt wrote: > My specific use case that required this patch is a piece of malware that used > several IOCTLs to read model, firmware, and nqn from the NVMe attached to the > VM. Modifying that info at the hypervisor level was a much better approac

[PATCH v2] target/ppc: check tb_env != 0 before printing TBU/TBL/DECR

2022-07-13 Thread Matheus Ferst
When using "-machine none", env->tb_env is not allocated, causing the segmentation fault reported in issue #85 (launchpad bug #811683). To avoid this problem, check if the pointer != NULL before calling the methods to print TBU/TBL/DECR. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/85 S

[PATCH v2 3/3] tests/tcg/s390x: test signed vfmin/vfmax

2022-07-13 Thread Ilya Leoshkevich
Add a test to prevent regressions. Try all floating point value sizes and all combinations of floating point value classes. Verify the results against PoP tables, which are represented as close to the original as possible - this produces a lot of checkpatch complaints, but it seems to be justified

Re: [RFC PATCH] target/ppc: don't print TB in ppc_cpu_dump_state if it's not initialized

2022-07-13 Thread Matheus K. Ferst
On 12/07/2022 23:21, David Gibson wrote: On Tue, Jul 12, 2022 at 06:13:44PM -0300, Daniel Henrique Barboza wrote: On 7/12/22 16:25, Matheus Ferst wrote: When using "-machine none", env->tb_env is not allocated, causing the segmentation fault reported in issue #85 (launchpad bug #811683). To a

[PATCH v2 0/3] target/s390x: vfmin/vfmax fixes

2022-07-13 Thread Ilya Leoshkevich
Hi, Uli has found an issue with finding maximum of different kinds of 0s; I wrote a test and found another one with finding maximum of different kinds of NaNs. Patches 1 and 2 fix those issues, patch 3 adds a vfmin/vfmax test. Best regards, Ilya v1: https://lists.gnu.org/archive/html/qemu-devel

[PATCH v2 2/3] target/s390x: fix NaN propagation rules

2022-07-13 Thread Ilya Leoshkevich
s390x has the same NaN propagation rules as ARM, and not as x86. Signed-off-by: Ilya Leoshkevich Reviewed-by: Richard Henderson Reviewed-by: David Hildenbrand --- fpu/softfloat-specialize.c.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fpu/softfloat-specialize.c.inc

[PATCH v2 1/3] target/s390x: fix handling of zeroes in vfmin/vfmax

2022-07-13 Thread Ilya Leoshkevich
vfmin_res() / vfmax_res() are trying to check whether a and b are both zeroes, but in reality they check that they are the same kind of zero. This causes incorrect results when comparing positive and negative zeroes. Fixes: da4807527f3b ("s390x/tcg: Implement VECTOR FP (MAXIMUM|MINIMUM)") Co-devel

Re: [PATCH] hw/nvme: Add options to override hardcoded values

2022-07-13 Thread Mauricio Sandt
I want to argue the other way around. Why shouldn't those values be tunable by the user? You are right; if misconfigured, it could potentially break stuff on the driver side, but unless you manually set values for model and firmware, the default is used (just like it is now), so this patch would

Re: [PATCH v7 10/13] migration: Export ram_release_page()

2022-07-13 Thread Dr. David Alan Gilbert
* Juan Quintela (quint...@redhat.com) wrote: > Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert > --- > migration/ram.h | 1 + > migration/ram.c | 2 +- > 2 files changed, 2 insertions(+), 1 deletion(-) > > diff --git a/migration/ram.h b/migration/ram.h > index 7b641adc55..aee

Re: [PATCH] hw/ppc: pass random seed to fdt

2022-07-13 Thread Jason A. Donenfeld
Hi Daniel, On Wed, Jul 13, 2022 at 7:37 PM Daniel Henrique Barboza wrote: > > > > On 7/13/22 14:30, Jason A. Donenfeld wrote: > > Hi Daniel, > > > > On Tue, Jul 12, 2022 at 05:31:27PM -0300, Daniel Henrique Barboza wrote: > >> CCing qemu-ppc and Cedric for awareness since I forgot to do so in > >

Re: [PATCH] hw/ppc: pass random seed to fdt

2022-07-13 Thread Daniel Henrique Barboza
On 7/13/22 14:30, Jason A. Donenfeld wrote: Hi Daniel, On Tue, Jul 12, 2022 at 05:31:27PM -0300, Daniel Henrique Barboza wrote: CCing qemu-ppc and Cedric for awareness since I forgot to do so in my reply (⌒_⌒;) Reviewed-by: Daniel Henrique Barboza Thanks for the review and for forwarding

Re: [PATCH v2] memory: prevent dma-reentracy issues

2022-07-13 Thread Stefan Hajnoczi
On Wed, 13 Jul 2022 at 16:51, Alexander Bulekov wrote: > > On 220712 1034, Stefan Hajnoczi wrote: > > On Tue, Jun 21, 2022 at 11:53:06AM -0400, Alexander Bulekov wrote: > > > On 220621 1630, Peter Maydell wrote: > > > > On Thu, 9 Jun 2022 at 14:59, Alexander Bulekov wrote: > > > > > diff --git a/

Re: [PATCH] hw/ppc: pass random seed to fdt

2022-07-13 Thread Jason A. Donenfeld
Hi Daniel, On Tue, Jul 12, 2022 at 05:31:27PM -0300, Daniel Henrique Barboza wrote: > CCing qemu-ppc and Cedric for awareness since I forgot to do so in > my reply (⌒_⌒;) > > Reviewed-by: Daniel Henrique Barboza Thanks for the review and for forwarding this to qemu-ppc. What's the route this pat

Re: [PATCH] hw/riscv: virt: pass random seed to fdt

2022-07-13 Thread Jason A. Donenfeld
Hi again, On Mon, Jul 11, 2022 at 06:45:42PM +0200, Jason A. Donenfeld wrote: > I've reproduced the problem and determined the root cause. This is a > generic issue with the mmio get_cycles() implementation before 5.9 on > no-MMU configs, which was fixed during the 5.9 cycle. I don't believe > tha

Re: [PATCH v6 12/13] qemu-sockets: update socket_uri() to be consistent with socket_parse()

2022-07-13 Thread Daniel P . Berrangé
On Wed, Jul 13, 2022 at 06:46:17PM +0200, Laurent Vivier wrote: > On 12/07/2022 14:05, Dr. David Alan Gilbert wrote: > > * Laurent Vivier (lviv...@redhat.com) wrote: > > > Remove 'tcp:' prefix for inet type (because inet can be 'tcp' or 'udp' > > > and socket_parse() doesn't recognize it), the form

Re: [PATCH] hw/nvme: Add options to override hardcoded values

2022-07-13 Thread Keith Busch
On Sun, Jun 12, 2022 at 12:35:09AM +0200, Mauricio Sandt wrote: > This small patch is the result of some recent malware research I did > in a QEMU VM. The malware used multiple ways of querying info from > the VM disk and I needed a clean way to change those values from the > hypervisor. > > I bel

[RFC PATCH v3 3/3] target/ppc: Implement hashstp and hashchkp

2022-07-13 Thread Víctor Colombo
Implementation for instructions hashstp and hashchkp, the privileged versions of hashst and hashchk, which were added in Power ISA 3.1B. Signed-off-by: Víctor Colombo --- target/ppc/cpu.h | 1 + target/ppc/cpu_init.c | 3 +++ target/ppc/excp_helper.

[RFC PATCH v3 2/3] target/ppc: Implement hashst and hashchk

2022-07-13 Thread Víctor Colombo
Implementation for instructions hashst and hashchk, which were added in Power ISA 3.1B. It was decided to implement the hash algorithm from ground up in this patch exactly as described in Power ISA. Signed-off-by: Víctor Colombo --- target/ppc/cpu.h | 1 + target/ppc/

[RFC PATCH v3 1/3] linux-headers/asm-powerpc/kvm.h: Add HASHKEYR and HASHPKEYR in headers

2022-07-13 Thread Víctor Colombo
Linux KVM currently does not export these registers. Create placeholders for them to allow implementing hashchk(p) and hashst(p) instructions from PowerISA 3.1B. Signed-off-by: Víctor Colombo --- linux-headers/asm-powerpc/kvm.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/linux-headers

[RFC PATCH v3 0/3] Implement Power ISA 3.1B hash insns

2022-07-13 Thread Víctor Colombo
This patch series implements the 4 instructions added in Power ISA 3.1B: - hashchk - hashst - hashchkp - hashstp To build it, you need to apply the following patches on top of master: <20220701133507.740619-2-lucas.couti...@eldorado.org.br> <20220701133507.740619-3-lucas.couti...@eldorado.org.br>

Ping: [PATCH] hw/nvme: Add options to override hardcoded values

2022-07-13 Thread Mauricio Sandt
https://patchew.org/QEMU/20220611223509.32280-1-mauri...@mailbox.org/ https://lore.kernel.org/qemu-devel/20220611223509.32280-1-mauri...@mailbox.org/ On 12/06/2022 00:35, Mauricio Sandt wrote: This small patch is the result of some recent malware research I did in a QEMU VM. The malware used mul

Re: [PATCH v6 12/13] qemu-sockets: update socket_uri() to be consistent with socket_parse()

2022-07-13 Thread Laurent Vivier
On 12/07/2022 14:05, Dr. David Alan Gilbert wrote: * Laurent Vivier (lviv...@redhat.com) wrote: Remove 'tcp:' prefix for inet type (because inet can be 'tcp' or 'udp' and socket_parse() doesn't recognize it), the format is 'host:port'. I don't think I understand why tests/qtest/migration-test.

Re: [PATCH 3/3] tests/tcg/s390x: test signed vfmin/vfmax

2022-07-13 Thread Ilya Leoshkevich
On Wed, 2022-07-13 at 21:14 +0530, Richard Henderson wrote: > On 7/12/22 18:02, Ilya Leoshkevich wrote: > > > This works, of course.  It could be simpler using EXECUTE, to > > > store > > > just the one > > > instruction and not worry about an executable mapped page, but I > > > guess it doesn't ma

Re: [PATCH 2/5] hw/intc/loongarch_pch_pic: Fix coverity errors in update irq

2022-07-13 Thread Richard Henderson
On 7/13/22 15:20, Xiaojuan Yang wrote: Fix coverity errors: 1. In find_first_bit function, the 'size' argument need 'unsigned long' type, so we change the 'size' to unsigned long type when use the function. 2. In expression 1ULL << irq, left shifting by more than 63 bits has undefined behavior. A

Re: [PATCH 5/5] target/loongarch/op_helper: Fix coverity cond_at_most error

2022-07-13 Thread Richard Henderson
On 7/13/22 15:20, Xiaojuan Yang wrote: The boundary size of cpucfg array should be 0 to 20. So, using index bigger than 20 to access cpucfg[] must be forbidden. You must update the comment to match the code, which no longer mentions "20" at all. With that change, Reviewed-by: Richard Henderso

Re: [PATCH v2 07/11] linux header sync

2022-07-13 Thread Marc-André Lureau
On Wed, Jul 13, 2022 at 5:07 PM Janosch Frank wrote: > > Signed-off-by: Janosch Frank Please tell which version this update come from. Otherwise, it should be fine Reviewed-by: Marc-André Lureau > --- > linux-headers/linux/kvm.h | 55 +++ > 1 file changed,

Re: [PATCH v2 06/11] dump/dump: Add arch section support

2022-07-13 Thread Marc-André Lureau
Hi On Wed, Jul 13, 2022 at 5:07 PM Janosch Frank wrote: > > Add hooks which architectures can use to add arbitrary data to custom > sections. > > Signed-off-by: Janosch Frank > --- > dump/dump.c| 21 ++--- > include/sysemu/dump-arch.h | 27 +++

Re: [PATCH 3/5] target/loongarch/cpu: Fix coverity errors about excp_names

2022-07-13 Thread Richard Henderson
On 7/13/22 15:20, Xiaojuan Yang wrote: Fix out-of-bounds errors when access excp_names[] array. the valid boundary size of excp_names should be 0 to ARRAY_SIZE(excp_names)-1. However, the general code do not consider the max boundary. Fix coverity CID: 1489758 Signed-off-by: Xiaojuan Yang ---

Re: [PATCH 1/5] target/loongarch/cpu: Fix cpu_class_by_name function

2022-07-13 Thread Richard Henderson
On 7/13/22 15:20, Xiaojuan Yang wrote: In loongarch_cpu_class_by_name(char *cpu_model) function, the argument cpu_model already has the suffix '-loongarch-cpu', so we should remove the LOONGARCH_CPU_TYPE_NAME(cpu_model) macro. And add the assertion that 'cpu_model' resolves to a class of the appr

Re: [PATCH 4/5] target/loongarch/tlb_helper: Fix coverity integer overflow error

2022-07-13 Thread Richard Henderson
On 7/13/22 15:20, Xiaojuan Yang wrote: Replace '1 << shift' with 'MAKE_64BIT_MASK(shift, 1)' to fix unintentional integer overflow errors in tlb_helper file. Fix coverity CID: 1489759 1489762 Signed-off-by: Xiaojuan Yang --- target/loongarch/tlb_helper.c | 4 ++-- 1 file changed, 2 insertion

Re: [PATCH v2 05/11] dump/dump: Add section string table support

2022-07-13 Thread Marc-André Lureau
Hi On Wed, Jul 13, 2022 at 5:07 PM Janosch Frank wrote: > > Time to add a bit more descriptiveness to the dumps. Please add some more description & motivation to the patch (supposedly necessary for next patches), and explain that it currently doesn't change the dump (afaict). > > Signed-off-by:

Re: [PATCH v2] memory: prevent dma-reentracy issues

2022-07-13 Thread Alexander Bulekov
On 220712 1034, Stefan Hajnoczi wrote: > On Tue, Jun 21, 2022 at 11:53:06AM -0400, Alexander Bulekov wrote: > > On 220621 1630, Peter Maydell wrote: > > > On Thu, 9 Jun 2022 at 14:59, Alexander Bulekov wrote: > > > > diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h > > > > index 44dacfa224

Re: [PATCH v2 04/11] dump: Reorder struct DumpState

2022-07-13 Thread Marc-André Lureau
On Wed, Jul 13, 2022 at 5:07 PM Janosch Frank wrote: > > Let's move ELF related members into one block and guest memory related > ones into another to improve readability. > > Signed-off-by: Janosch Frank > Reviewed-by: Richard Henderson Reviewed-by: Marc-André Lureau > --- > include/sysemu/

Re: [PATCH 3/3] tests/tcg/s390x: test signed vfmin/vfmax

2022-07-13 Thread Richard Henderson
On 7/12/22 18:02, Ilya Leoshkevich wrote: This works, of course.  It could be simpler using EXECUTE, to store just the one instruction and not worry about an executable mapped page, but I guess it doesn't matter. I thought about this too, but EX/EXRL operate only on the second byte, and I need

Re: [PATCH v3] multifd: Copy pages before compressing them with zlib

2022-07-13 Thread Dr. David Alan Gilbert
* Ilya Leoshkevich (i...@linux.ibm.com) wrote: > zlib_send_prepare() compresses pages of a running VM. zlib does not > make any thread-safety guarantees with respect to changing deflate() > input concurrently with deflate() [1]. > > One can observe problems due to this with the IBM zEnterprise Dat

Re: [PATCH v2 01/11] dump: Cleanup memblock usage

2022-07-13 Thread Marc-André Lureau
Hi On Wed, Jul 13, 2022 at 7:30 PM Janosch Frank wrote: > > On 7/13/22 17:09, Marc-André Lureau wrote: > > Hi > > > > On Wed, Jul 13, 2022 at 5:07 PM Janosch Frank wrote: > >> > >> The iteration over the memblocks is hard to understand so it's about > >> time to clean it up. > >> > >> struct Dum

Re: [PATCH v2 03/11] dump: Split write of section headers and data and add a prepare step

2022-07-13 Thread Marc-André Lureau
Hi On Wed, Jul 13, 2022 at 5:07 PM Janosch Frank wrote: > > By splitting the writing of the section headers and (future) section > data we prepare for the addition of a string table section and > architecture sections. > > Signed-off-by: Janosch Frank > --- > dump/dump.c | 116 +++

Re: [PATCH v2 01/11] dump: Cleanup memblock usage

2022-07-13 Thread Janosch Frank
On 7/13/22 17:09, Marc-André Lureau wrote: Hi On Wed, Jul 13, 2022 at 5:07 PM Janosch Frank wrote: The iteration over the memblocks is hard to understand so it's about time to clean it up. struct DumpState's next_block and start members can and should be local variables within the iterator.

Re: [PATCH v2 02/11] dump: Allocate header

2022-07-13 Thread Marc-André Lureau
On Wed, Jul 13, 2022 at 5:07 PM Janosch Frank wrote: > > Allocating the header lets us write it at a later time and hence also > allows us to change section and segment table offsets until we > finally write it. > > Signed-off-by: Janosch Frank Reviewed-by: Marc-André Lureau > --- > dump/dum

Re: [PATCH v2 01/11] dump: Cleanup memblock usage

2022-07-13 Thread Marc-André Lureau
Hi On Wed, Jul 13, 2022 at 5:07 PM Janosch Frank wrote: > > The iteration over the memblocks is hard to understand so it's about > time to clean it up. > > struct DumpState's next_block and start members can and should be > local variables within the iterator. > > Instead of manually grabbing the

Re: [PATCH v8 02/12] s390x/cpu_topology: CPU topology objects and structures

2022-07-13 Thread Pierre Morel
On 7/12/22 17:40, Janis Schoetterl-Glausch wrote: On 6/20/22 16:03, Pierre Morel wrote: We use new objects to have a dynamic administration of the CPU topology. The highest level object in this implementation is the s390 book and in this first implementation of CPU topology for S390 we have a

Re: [PATCH 2/4] Adding multi-interface support for multi-FD on destination side

2022-07-13 Thread Het Gala
On 17/06/22 12:10 am, Dr. David Alan Gilbert wrote: * Het Gala (het.g...@nutanix.com) wrote: i) Modified the format of qemu monitor command: ‘migrate-incoming’ by adding a list, each element in the list is to open listeners with a given number of multiFD channels. ii) Qemu starts with

Re: [RFC v3 3/8] block: pass size to bdrv_unregister_buf()

2022-07-13 Thread Hanna Reitz
On 08.07.22 06:17, Stefan Hajnoczi wrote: The only implementor of bdrv_register_buf() is block/nvme.c, where the size is not needed when unregistering a buffer. This is because util/vfio-helpers.c can look up mappings by address. Future block drivers that implement bdrv_register_buf() may not be

[PATCH] MAINTAINERS: Add myself as Guest Agent co-maintainer

2022-07-13 Thread Konstantin Kostiuk
Signed-off-by: Konstantin Kostiuk --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 450abd0252..22a4ffe0a2 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2880,6 +2880,7 @@ T: git https://repo.or.cz/qemu/armbru.git qapi-next QEMU Guest Agent M:

[PATCH v2 09/11] s390x: Introduce PV query interface

2022-07-13 Thread Janosch Frank
Introduce an interface over which we can get information about UV data. Signed-off-by: Janosch Frank --- hw/s390x/pv.c | 61 ++ hw/s390x/s390-virtio-ccw.c | 5 include/hw/s390x/pv.h | 10 +++ 3 files changed, 76 insertions(+) diff

[PATCH v2 00/11] dump: Add arch section and s390x PV dump

2022-07-13 Thread Janosch Frank
Previously this series was two separate series: * Arch section support Adds the possibility for arch code to add custom section data. * s390 PV dump support Adds PV dump data to the custom arch sections. I've chosen to merge them so it's easier to understand why the arch section support h

[PATCH v2 08/11] s390x: Add protected dump cap

2022-07-13 Thread Janosch Frank
Add a protected dump capability for later feature checking. Signed-off-by: Janosch Frank --- target/s390x/kvm/kvm.c | 7 +++ target/s390x/kvm/kvm_s390x.h | 1 + 2 files changed, 8 insertions(+) diff --git a/target/s390x/kvm/kvm.c b/target/s390x/kvm/kvm.c index 7bd8db0e7b..cbd8c91424 1

[PATCH v2 04/11] dump: Reorder struct DumpState

2022-07-13 Thread Janosch Frank
Let's move ELF related members into one block and guest memory related ones into another to improve readability. Signed-off-by: Janosch Frank Reviewed-by: Richard Henderson --- include/sysemu/dump.h | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/include/s

[PATCH v2 10/11] s390x: Add KVM PV dump interface

2022-07-13 Thread Janosch Frank
Let's add a few bits of code which hide the new KVM PV dump API from us via new functions. Signed-off-by: Janosch Frank --- hw/s390x/pv.c | 51 +++ include/hw/s390x/pv.h | 8 +++ 2 files changed, 59 insertions(+) diff --git a/hw/s390x/pv.c b/

[PATCH v2 07/11] linux header sync

2022-07-13 Thread Janosch Frank
Signed-off-by: Janosch Frank --- linux-headers/linux/kvm.h | 55 +++ 1 file changed, 55 insertions(+) diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h index 0d05d02ee4..ae5db2e44c 100644 --- a/linux-headers/linux/kvm.h +++ b/linux-headers/lin

[PATCH v2 05/11] dump/dump: Add section string table support

2022-07-13 Thread Janosch Frank
Time to add a bit more descriptiveness to the dumps. Signed-off-by: Janosch Frank Reviewed-by: Richard Henderson --- dump/dump.c | 106 -- include/sysemu/dump.h | 1 + 2 files changed, 94 insertions(+), 13 deletions(-) diff --git a/dump/dump.

[PATCH v2 06/11] dump/dump: Add arch section support

2022-07-13 Thread Janosch Frank
Add hooks which architectures can use to add arbitrary data to custom sections. Signed-off-by: Janosch Frank --- dump/dump.c| 21 ++--- include/sysemu/dump-arch.h | 27 +++ 2 files changed, 45 insertions(+), 3 deletions(-) diff --git a/dum

[PATCH v2 11/11] s390x: pv: Add dump support

2022-07-13 Thread Janosch Frank
Sometimes dumping a guest from the outside is the only way to get the data that is needed. This can be the case if a dumping mechanism like KDUMP hasn't been configured or data needs to be fetched at a specific point. Dumping a protected guest from the outside without help from fw/hw doesn't yield

[PATCH v2 03/11] dump: Split write of section headers and data and add a prepare step

2022-07-13 Thread Janosch Frank
By splitting the writing of the section headers and (future) section data we prepare for the addition of a string table section and architecture sections. Signed-off-by: Janosch Frank --- dump/dump.c | 116 -- include/sysemu/dump.h | 4 ++ 2 fi

[PATCH v2 01/11] dump: Cleanup memblock usage

2022-07-13 Thread Janosch Frank
The iteration over the memblocks is hard to understand so it's about time to clean it up. struct DumpState's next_block and start members can and should be local variables within the iterator. Instead of manually grabbing the next memblock we can use QTAILQ_FOREACH to iterate over all memblocks.

[PATCH v2 02/11] dump: Allocate header

2022-07-13 Thread Janosch Frank
Allocating the header lets us write it at a later time and hence also allows us to change section and segment table offsets until we finally write it. Signed-off-by: Janosch Frank --- dump/dump.c | 127 +- include/sysemu/dump.h | 1 + 2 files c

Re: [PATCH 1/4] Modifying ‘migrate’ qmp command to add multi-FD socket on particular source and destination pair

2022-07-13 Thread Claudio Fontana
On 6/16/22 19:26, Dr. David Alan Gilbert wrote: > * Het Gala (het.g...@nutanix.com) wrote: >> i) Modified the format of the qemu monitor command : 'migrate' by adding a >> list, >>each element in the list consists of multi-FD connection parameters: >> source >>and destination uris and of

[PATCH] pc-bios/s390-ccw: add -Wno-array-bounds

2022-07-13 Thread Paolo Bonzini
The option generates a lot of warnings for integers casted to pointers, for example: /home/pbonzini/work/upstream/qemu/pc-bios/s390-ccw/dasd-ipl.c:174:19: warning: array subscript 0 is outside array bounds of ‘CcwSeekData[0]’ [-Warray-bounds] 174 | seekData->cyl = 0x00; |

[PATCH] scsi/lsi53c895a: really fix use-after-free in lsi_do_msgout (CVE-2022-0216)

2022-07-13 Thread Paolo Bonzini
From: Mauro Matteo Cascella Set current_req to NULL, not current_req->req, to prevent reusing a free'd buffer in case of repeated SCSI cancel requests. Also apply the fix to CLEAR QUEUE and BUS DEVICE RESET messages as well, since they also cancel the request. Thanks to Alexander Bulekov for pr

Re: [PULL 1/3] MAINTAINERS: Add myself as Guest Agent reviewer

2022-07-13 Thread Konstantin Kostiuk
On Wed, Jul 13, 2022 at 2:55 PM Daniel P. Berrangé wrote: > On Wed, Jul 13, 2022 at 02:31:08PM +0300, Konstantin Kostiuk wrote: > > On Wed, Jul 13, 2022 at 1:38 PM Daniel P. Berrangé > > wrote: > > > > > On Wed, Jul 13, 2022 at 01:19:06PM +0300, Konstantin Kostiuk wrote: > > > > Signed-off-by: K

Re: [RFC v3 1/8] blkio: add io_uring block driver using libblkio

2022-07-13 Thread Hanna Reitz
On 08.07.22 06:17, Stefan Hajnoczi wrote: libblkio (https://gitlab.com/libblkio/libblkio/) is a library for high-performance disk I/O. It currently supports io_uring and virtio-blk-vhost-vdpa with additional drivers under development. One of the reasons for developing libblkio is that other appl

Re: [PULL 1/3] MAINTAINERS: Add myself as Guest Agent reviewer

2022-07-13 Thread Daniel P . Berrangé
On Wed, Jul 13, 2022 at 02:31:08PM +0300, Konstantin Kostiuk wrote: > On Wed, Jul 13, 2022 at 1:38 PM Daniel P. Berrangé > wrote: > > > On Wed, Jul 13, 2022 at 01:19:06PM +0300, Konstantin Kostiuk wrote: > > > Signed-off-by: Konstantin Kostiuk > > > Message-Id: <20220712092715.2136898-1-kkost...

Re: [PULL 1/3] MAINTAINERS: Add myself as Guest Agent reviewer

2022-07-13 Thread Konstantin Kostiuk
On Wed, Jul 13, 2022 at 1:38 PM Daniel P. Berrangé wrote: > On Wed, Jul 13, 2022 at 01:19:06PM +0300, Konstantin Kostiuk wrote: > > Signed-off-by: Konstantin Kostiuk > > Message-Id: <20220712092715.2136898-1-kkost...@redhat.com> > > Reviewed-by: Philippe Mathieu-Daudé > > Signed-off-by: Konstan

Re: [PATCH v9 12/14] tests: Add postcopy tls migration test

2022-07-13 Thread Dr. David Alan Gilbert
* Peter Xu (pet...@redhat.com) wrote: > We just added TLS tests for precopy but not postcopy. Add the > corresponding test for vanilla postcopy. > > Rename the vanilla postcopy to "postcopy/plain" because all postcopy tests > will only use unix sockets as channel. > > Signed-off-by: Peter Xu R

Re: [PULL 1/3] MAINTAINERS: Add myself as Guest Agent reviewer

2022-07-13 Thread Daniel P . Berrangé
On Wed, Jul 13, 2022 at 01:19:06PM +0300, Konstantin Kostiuk wrote: > Signed-off-by: Konstantin Kostiuk > Message-Id: <20220712092715.2136898-1-kkost...@redhat.com> > Reviewed-by: Philippe Mathieu-Daudé > Signed-off-by: Konstantin Kostiuk > --- > MAINTAINERS | 1 + > 1 file changed, 1 insertion

  1   2   >