[PATCH v7 18/51] i386/xen: implement HYPERVISOR_hvm_op

2023-01-16 Thread David Woodhouse
From: Joao Martins This is when guest queries for support for HVMOP_pagetable_dying. Signed-off-by: Joao Martins Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- target/i386/kvm/xen-emu.c | 17 + 1 file changed, 17 insertions(+) diff --git

[PATCH v7 23/51] i386/xen: implement HYPERVISOR_event_channel_op

2023-01-16 Thread David Woodhouse
From: Joao Martins Additionally set XEN_INTERFACE_VERSION to most recent in order to exercise the "new" event_channel_op. Signed-off-by: Joao Martins [dwmw2: Ditch event_channel_op_compat which was never available to HVM guests] Signed-off-by: David Woodhouse --- target/i386/kvm/xen-emu.c |

[PATCH v7 44/51] i386/xen: Implement HYPERVISOR_grant_table_op and GNTTABOP_[gs]et_verson

2023-01-16 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse --- hw/i386/kvm/xen_gnttab.c | 31 hw/i386/kvm/xen_gnttab.h | 5 target/i386/kvm/xen-emu.c | 60 +++ 3 files changed, 96 insertions(+) diff --git a/hw/i386/kvm/xen_gnttab.c

[PATCH v7 34/51] hw/xen: Implement EVTCHNOP_alloc_unbound

2023-01-16 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse --- hw/i386/kvm/xen_evtchn.c | 32 hw/i386/kvm/xen_evtchn.h | 2 ++ target/i386/kvm/xen-emu.c | 15 +++ 3 files changed, 49 insertions(+) diff --git a/hw/i386/kvm/xen_evtchn.c

[PATCH v7 21/51] i386/xen: handle VCPUOP_register_vcpu_time_info

2023-01-16 Thread David Woodhouse
From: Joao Martins In order to support Linux vdso in Xen. Signed-off-by: Joao Martins Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- target/i386/cpu.h | 1 + target/i386/kvm/xen-emu.c | 100 +- target/i386/machine.c | 1 + 3

[PATCH v7 07/51] xen-platform: exclude vfio-pci from the PCI platform unplug

2023-01-16 Thread David Woodhouse
From: Joao Martins Such that PCI passthrough devices work for Xen emulated guests. Signed-off-by: Joao Martins Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- hw/i386/xen/xen_platform.c | 18 +++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git

[PATCH v7 35/51] hw/xen: Implement EVTCHNOP_bind_interdomain

2023-01-16 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse --- hw/i386/kvm/xen_evtchn.c | 78 +++ hw/i386/kvm/xen_evtchn.h | 2 + target/i386/kvm/xen-emu.c | 16 3 files changed, 96 insertions(+) diff --git a/hw/i386/kvm/xen_evtchn.c

[PATCH v7 47/51] i386/xen: Reserve Xen special pages for console, xenstore rings

2023-01-16 Thread David Woodhouse
From: David Woodhouse Xen has eight frames at 0xfeff8000 for this; we only really need two for now and KVM puts the identity map at 0xfeffc000, so limit ourselves to four. Signed-off-by: David Woodhouse --- include/sysemu/kvm_xen.h | 8 target/i386/kvm/xen-emu.c | 10 ++ 2

[PATCH v7 08/51] xen-platform: allow its creation with XEN_EMULATE mode

2023-01-16 Thread David Woodhouse
From: Joao Martins The only thing we need to handle on KVM side is to change the pfn from R/W to R/O. Signed-off-by: Joao Martins Signed-off-by: David Woodhouse --- hw/i386/xen/meson.build| 5 - hw/i386/xen/xen_platform.c | 39 +- 2 files changed,

[PATCH v7 39/51] hw/xen: Support HVM_PARAM_CALLBACK_TYPE_GSI callback

2023-01-16 Thread David Woodhouse
From: David Woodhouse The GSI callback (and later PCI_INTX) is a level triggered interrupt. It is asserted when an event channel is delivered to vCPU0, and is supposed to be cleared when the vcpu_info->evtchn_upcall_pending field for vCPU0 is cleared again. Thankfully, Xen does *not* assert the

Re: [PATCH] scsi/lsi53c895a: restrict DMA engine to memory regions (CVE-2023-0330)

2023-01-16 Thread Mauro Matteo Cascella
On Mon, Jan 16, 2023 at 9:42 PM Mauro Matteo Cascella wrote: > > This prevents the well known DMA-MMIO reentrancy problem (upstream issue #556) > leading to memory corruption bugs like stack overflow or use-after-free. > > Fixes: CVE-2023-0330 > Signed-off-by: Mauro Matteo Cascella >

Re: completion timeouts with pin-based interrupts in QEMU hw/nvme

2023-01-16 Thread Klaus Jensen
On Jan 12 14:10, Klaus Jensen wrote: > Hi all (linux-nvme, qemu-devel, maintainers), > > On QEMU riscv64, which does not use MSI/MSI-X and thus relies on > pin-based interrupts, I'm seeing occasional completion timeouts, i.e. > > nvme nvme0: I/O 333 QID 1 timeout, completion polled > > To

Re: [PATCH v14 08/11] qapi/s390/cpu topology: change-topology monitor command

2023-01-16 Thread Nina Schoetterl-Glausch
On Thu, 2023-01-05 at 15:53 +0100, Pierre Morel wrote: > The modification of the CPU attributes are done through a monitor > commands. > > It allows to move the core inside the topology tree to optimise > the cache usage in the case the host's hypervizor previously > moved the CPU. > > The same

Re: [RFC PATCH for 8.0 10/13] virtio-net: Migrate vhost inflight descriptors

2023-01-16 Thread Michael S. Tsirkin
On Wed, Dec 07, 2022 at 09:56:20AM +0100, Eugenio Perez Martin wrote: > > A dumb question, any reason we need bother with virtio-net? It looks > > to me it's not a must and would complicate migration compatibility. > > > > I guess virtio-blk is the better place. > > > > I'm fine to start with

Re: [RFC PATCH for 8.0 10/13] virtio-net: Migrate vhost inflight descriptors

2023-01-16 Thread Michael S. Tsirkin
On Wed, Jan 11, 2023 at 01:51:06PM +0800, Jason Wang wrote: > On Wed, Jan 11, 2023 at 12:40 PM Parav Pandit wrote: > > > > > > > From: Jason Wang > > > Sent: Tuesday, January 10, 2023 11:35 PM > > > > > > On Tue, Jan 10, 2023 at 11:02 AM Parav Pandit wrote: > > > > > > > > Hi Jason, > > > > > >

[PATCH] scsi/lsi53c895a: restrict DMA engine to memory regions (CVE-2023-0330)

2023-01-16 Thread Mauro Matteo Cascella
This prevents the well known DMA-MMIO reentrancy problem (upstream issue #556) leading to memory corruption bugs like stack overflow or use-after-free. Fixes: CVE-2023-0330 Signed-off-by: Mauro Matteo Cascella Reported-by: Zheyu Ma --- hw/scsi/lsi53c895a.c | 14 +

Re: [PATCH v14 01/11] s390x/cpu topology: adding s390 specificities to CPU topology

2023-01-16 Thread Nina Schoetterl-Glausch
On Mon, 2023-01-16 at 18:28 +0100, Pierre Morel wrote: > > On 1/13/23 17:58, Nina Schoetterl-Glausch wrote: > > On Thu, 2023-01-05 at 15:53 +0100, Pierre Morel wrote: > > > S390 adds two new SMP levels, drawers and books to the CPU > > > topology. > > > The S390 CPU have specific toplogy features

Re: [RFC PATCH] tests/tcg: skip the vma-pthread test on CI

2023-01-16 Thread Alex Bennée
I did consider it but it would involve messing about with filter to remove the test from the wildcards. This way we don't forget about it when looking through the logs. I've not been able to get this to fail on any other machine though. It's been rock solid over several thousand runs. On Mon, 16

Re: [PATCH 0/1] hw/ide: share bmdma read and write functions

2023-01-16 Thread John Snow
On Fri, Jan 13, 2023 at 9:10 AM Liav Albani wrote: > > > On 1/11/23 01:07, Bernhard Beschow wrote: > > Am 9. Januar 2023 19:24:16 UTC schrieb John Snow : > > On Tue, Sep 6, 2022 at 10:27 AM Bernhard Beschow wrote: > > Am 19. Februar 2022 08:08:17 UTC schrieb Liav Albani : > > This is a

Re: [PATCH 0/2] target/arm: Look up ARMCPRegInfo at runtime

2023-01-16 Thread Richard Henderson
Ping. r~ On 1/6/23 09:44, Richard Henderson wrote: Here's a short-to-medium term alternative to moving all of the ARMCPU cp_regs hash table to the ARMCPUClass, so that we're no longer leaving dangling pointers to freed objects encoded in the compiled TranslationBlocks. (I still think we ought

Re: [PATCH 1/1] Fix some typos

2023-01-16 Thread John Snow
On Mon, Jan 16, 2023 at 1:11 PM Laurent Vivier wrote: > > Le 30/11/2022 à 09:29, Philippe Mathieu-Daudé a écrit : > > On 30/11/22 02:53, Dongdong Zhang wrote: > >> Fix some typos in 'python' directory. > >> > >> Signed-off-by: Dongdong Zhang > > > > Reviewed-by: Philippe Mathieu-Daudé > > > >>

RE: [RFC PATCH for 8.0 10/13] virtio-net: Migrate vhost inflight descriptors

2023-01-16 Thread Parav Pandit
> From: Jason Wang > Sent: Wednesday, January 11, 2023 12:51 AM > > On Wed, Jan 11, 2023 at 12:40 PM Parav Pandit wrote: > > > > > > > From: Jason Wang > > > Sent: Tuesday, January 10, 2023 11:35 PM > > > > > > On Tue, Jan 10, 2023 at 11:02 AM Parav Pandit wrote: > > > > > > > > Hi Jason, >

Re: [PATCH v6 23/51] i386/xen: implement HYPERVISOR_event_channel_op

2023-01-16 Thread David Woodhouse
On Mon, 2023-01-16 at 17:59 +, Paul Durrant wrote: > > + > > +    switch (cmd) { > > +    case EVTCHNOP_init_control: > > +    err = -ENOSYS; > > +    break; > > The commit comment doesn't explain why the above op is singled out for > this treatment. I assume it is because there is

Re: [PATCH v6 14/51] i386/xen: add pc_machine_kvm_type to initialize XEN_EMULATE mode

2023-01-16 Thread David Woodhouse
On Mon, 2023-01-16 at 17:17 +, Paul Durrant wrote: > ASS(oc); \ > >    optsfn(mc); \ > >    mc->init = initfn; \ > > +    mc->kvm_type = pc_machine_kvm_type; \ > > Given that it does nothing in the non-Xen-emulate case, would it not be > neater to simply wrap the above

Re: [RFC PATCH] tests/tcg: skip the vma-pthread test on CI

2023-01-16 Thread Richard Henderson
On 1/16/23 07:32, Alex Bennée wrote: diff --git a/tests/tcg/multiarch/Makefile.target b/tests/tcg/multiarch/Makefile.target index e7213af492..ae8b3d7268 100644 --- a/tests/tcg/multiarch/Makefile.target +++ b/tests/tcg/multiarch/Makefile.target @@ -42,6 +42,15 @@ munmap-pthread:

Re: [PATCH 4/4] tests/tcg/multiarch: add vma-pthread.c

2023-01-16 Thread Richard Henderson
On 1/16/23 06:27, Alex Bennée wrote: Although looking at the test I'm beginning to wonder what the sync point is between the mutator and the read/write threads? What do you mean? There is no explicit sync, because the mutator always leaves each page with the (one) permission that the

Re: [PATCH trivial for 7.2 2/2] hw/virtio/virtio.c: spelling: suppoted

2023-01-16 Thread Laurent Vivier
Le 05/11/2022 à 12:48, Michael Tokarev a écrit : Fixes: f3034ad71fcd0a6a58bc37830f182b307f089159 Signed-off-by: Michael Tokarev --- hw/virtio/virtio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 808446b4c9..e76218bdd5

Re: [PATCH trivial for 7.2] hw/ssi/sifive_spi.c: spelling: reigster

2023-01-16 Thread Laurent Vivier
Le 05/11/2022 à 12:53, Michael Tokarev a écrit : Fixes: 0694dabe9763847f3010b54ab3ec7d367d2f0ff0 Signed-off-by: Michael Tokarev --- hw/ssi/sifive_spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ssi/sifive_spi.c b/hw/ssi/sifive_spi.c index 03540cf5ca..1b4a401ca1

Re: [PATCH v14 06/11] s390x/cpu topology: interception of PTF instruction

2023-01-16 Thread Nina Schoetterl-Glausch
On Thu, 2023-01-05 at 15:53 +0100, Pierre Morel wrote: > When the host supports the CPU topology facility, the PTF > instruction with function code 2 is interpreted by the SIE, > provided that the userland hypervizor activates the interpretation > by using the KVM_CAP_S390_CPU_TOPOLOGY KVM

Re: [PATCH v14 02/11] s390x/cpu topology: add topology entries on CPU hotplug

2023-01-16 Thread Pierre Morel
On 1/10/23 14:00, Thomas Huth wrote: On 05/01/2023 15.53, Pierre Morel wrote: The topology information are attributes of the CPU and are specified during the CPU device creation. On hot plug, we gather the topology information on the core, creates a list of topology entries, each entry

Re: [PATCH] hw/cxl/cxl-host: Fix an error message typo

2023-01-16 Thread Laurent Vivier
Le 27/11/2022 à 04:22, Hoa Nguyen a écrit : Signed-off-by: Hoa Nguyen --- hw/cxl/cxl-host.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/cxl/cxl-host.c b/hw/cxl/cxl-host.c index 1adf61231a..3c1ec8732a 100644 --- a/hw/cxl/cxl-host.c +++ b/hw/cxl/cxl-host.c @@ -47,7

Re: [PATCH] ui/vnc.c: Allow websocket connections over AF_UNIX sockets

2023-01-16 Thread Laurent Vivier
Hi Gerd, If this patch is correct I can queue it via trivial branch. Thanks, Laurent Le 02/12/2022 à 16:12, Pierre-Yves Ritschard a écrit : Hi, The provided patch allows the VNC websocket server of a qemu process to be provided over AF_UNIX as it is already possible for standard TCP VNC

Re: [PATCH 1/1] Fix some typos

2023-01-16 Thread Laurent Vivier
Le 30/11/2022 à 09:29, Philippe Mathieu-Daudé a écrit : On 30/11/22 02:53, Dongdong Zhang wrote: Fix some typos in 'python' directory. Signed-off-by: Dongdong Zhang Reviewed-by: Philippe Mathieu-Daudé ---   python/qemu/machine/console_socket.py | 2 +-   python/qemu/machine/qtest.py   

Re: [PATCH v8] xen/pt: reserve PCI slot 2 for Intel igd-passthru

2023-01-16 Thread Chuck Zmudzinski
On 1/16/23 10:33, Igor Mammedov wrote: > On Fri, 13 Jan 2023 16:31:26 -0500 > Chuck Zmudzinski wrote: > >> On 1/13/23 4:33 AM, Igor Mammedov wrote: >> > On Thu, 12 Jan 2023 23:14:26 -0500 >> > Chuck Zmudzinski wrote: >> > >> >> On 1/12/23 6:03 PM, Michael S. Tsirkin wrote: >> >> > On Thu,

Re: [PATCH v6 25/51] i386/xen: implement HVMOP_set_param

2023-01-16 Thread Paul Durrant
On 10/01/2023 12:20, David Woodhouse wrote: From: Ankur Arora This is the hook for adding the HVM_PARAM_CALLBACK_IRQ parameter in a subsequent commit. Signed-off-by: Ankur Arora Signed-off-by: Joao Martins [dwmw2: Split out from another commit] Signed-off-by: David Woodhouse Reviewed-by:

Re: [PATCH v6 23/51] i386/xen: implement HYPERVISOR_event_channel_op

2023-01-16 Thread Paul Durrant
On 10/01/2023 12:20, David Woodhouse wrote: From: Joao Martins Additionally set XEN_INTERFACE_VERSION to most recent in order to exercise the "new" event_channel_op. Signed-off-by: Joao Martins [dwmw2: Ditch event_channel_op_compat which was never available to HVM guests] Signed-off-by:

Re: [PATCH v6 09/51] i386/xen: handle guest hypercalls

2023-01-16 Thread David Woodhouse
On Mon, 2023-01-16 at 16:24 +, Paul Durrant wrote: > > +    trace_kvm_xen_hypercall(CPU(cpu)->cpu_index, exit->u.hcall.cpl, > > +    exit->u.hcall.input, exit->u.hcall.params[0], > > +    exit->u.hcall.params[1], > > exit->u.hcall.params[2], > >

Re: [PATCH Trivial] hw/cxl/cxl-cdat.c: spelling: missmatch

2023-01-16 Thread Laurent Vivier
Le 15/12/2022 à 13:37, Michael Tokarev a écrit : Introduced by: aba578bdace5303a441f8a37aad781b5cb06f38c Signed-off-by: Michael Tokarev --- hw/cxl/cxl-cdat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/cxl/cxl-cdat.c b/hw/cxl/cxl-cdat.c index

Re: [PATCH v6 08/51] xen-platform: allow its creation with XEN_EMULATE mode

2023-01-16 Thread David Woodhouse
On Mon, 2023-01-16 at 16:20 +, Paul Durrant wrote: > > +    case 0: /* Platform flags */ > > +    if (xen_mode == XEN_EMULATE) { > > +    /* XX: Use i440gx/q35 PAM setup to do this? */ > >    s->flags = val & PFFLAG_ROM_LOCK; > > Given that this is not RFC, do you have

Re: [PATCH v6 22/51] i386/xen: handle VCPUOP_register_runstate_memory_area

2023-01-16 Thread Paul Durrant
On 10/01/2023 12:20, David Woodhouse wrote: From: Joao Martins Allow guest to setup the vcpu runstates which is used as steal clock. Signed-off-by: Joao Martins Signed-off-by: David Woodhouse --- target/i386/cpu.h | 1 + target/i386/kvm/xen-emu.c | 57

Re: [PATCH v6 21/51] i386/xen: handle VCPUOP_register_vcpu_time_info

2023-01-16 Thread Paul Durrant
On 10/01/2023 12:20, David Woodhouse wrote: From: Joao Martins In order to support Linux vdso in Xen. Signed-off-by: Joao Martins Signed-off-by: David Woodhouse --- target/i386/cpu.h | 1 + target/i386/kvm/xen-emu.c | 100 +-

Re: [PATCH v3] hw/pvrdma: Protect against buggy or malicious guest driver

2023-01-16 Thread Laurent Vivier
Le 28/12/2022 à 20:32, Thomas Huth a écrit : On 19/12/2022 12.21, Marcel Apfelbaum wrote: On Mon, Dec 19, 2022 at 10:57 AM Yuval Shaia wrote: Can anyone else pick this one? Adding Thomas, I dropped the ball with this one, I am sorry about that, maybe it doesn't worth a Pull Request only

Re: [PATCH 01/10] ccid-card-emulated: fix cast warning/error

2023-01-16 Thread Laurent Vivier
Le 03/01/2023 à 12:08, marcandre.lur...@redhat.com a écrit : From: Marc-André Lureau ../hw/usb/ccid-card-emulated.c: In function 'handle_apdu_thread': ../hw/usb/ccid-card-emulated.c:251:24: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] 251 |

[PATCH v3 3/3] s390x/pv: Move check on hugepage under s390_pv_guest_check()

2023-01-16 Thread Cédric Le Goater
From: Cédric Le Goater Such conditions on Protected Virtualization can now be checked at init time. This is possible because Protected Virtualization is initialized after memory where the page size is set. Reviewed-by: Thomas Huth Signed-off-by: Cédric Le Goater --- hw/s390x/pv.c | 13

[PATCH v3 1/3] s390x/pv: Implement a CGS check helper

2023-01-16 Thread Cédric Le Goater
From: Cédric Le Goater When a protected VM is started with the maximum number of CPUs (248), the service call providing information on the CPUs requires more buffer space than allocated and QEMU disgracefully aborts : LOADPARM=[] Using virtio-blk. Using SCSI scheme.

[PATCH v3 0/3]s390x/pv: Improve error reporting of protected VMs

2023-01-16 Thread Cédric Le Goater
Hello, Here is a little series improving error reporting of protected VMs. Thanks, C. Changes in v3: - dropped 's390x/pv: Check for support on the host'. This is already covered by the KVM capability. - in s390_pv_check() (patch 2) drop the call to s390_pv_guest_check() since init

Re: [PATCH v6 20/51] i386/xen: handle VCPUOP_register_vcpu_info

2023-01-16 Thread Paul Durrant
On 10/01/2023 12:20, David Woodhouse wrote: From: Joao Martins Handle the hypercall to set a per vcpu info, and also wire up the default vcpu_info in the shared_info page for the first 32 vCPUs. To avoid deadlock within KVM a vCPU thread must set its *own* vcpu_info rather than it being set

[PATCH v3 2/3] s390x/pv: Introduce a s390_pv_check() helper for runtime

2023-01-16 Thread Cédric Le Goater
From: Cédric Le Goater If a secure kernel is started in a non-protected VM, the OS will hang during boot without giving a proper error message to the user. Perform the checks on Confidential Guest support at runtime with an helper called from the service call switching the guest to protected

Re: [PATCH v2] hw/i386/pc: Remove unused 'owner' argument from pc_pci_as_mapping_init

2023-01-16 Thread Laurent Vivier
Le 05/01/2023 à 18:38, Philippe Mathieu-Daudé a écrit : This argument was added 9 years ago in commit 83d08f2673 ("pc: map PCI address space as catchall region for not mapped addresses") and has never been used since, so remove it. Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/pc.c

Re: [PATCH v6 19/51] i386/xen: implement HYPERVISOR_vcpu_op

2023-01-16 Thread Paul Durrant
On 10/01/2023 12:20, David Woodhouse wrote: From: Joao Martins This is simply when guest tries to register a vcpu_info and since vcpu_info placement is optional in the minimum ABI therefore we can just fail with -ENOSYS Signed-off-by: Joao Martins Signed-off-by: David Woodhouse ---

Re: [PATCH v6 18/51] i386/xen: implement HYPERVISOR_hvm_op

2023-01-16 Thread Paul Durrant
On 10/01/2023 12:20, David Woodhouse wrote: From: Joao Martins This is when guest queries for support for HVMOP_pagetable_dying. Signed-off-by: Joao Martins Signed-off-by: David Woodhouse --- target/i386/kvm/xen-emu.c | 17 + 1 file changed, 17 insertions(+)

Re: [PATCH] tests/qtest/test-hmp: Improve the check for verbose mode

2023-01-16 Thread Laurent Vivier
Le 09/01/2023 à 11:13, Thomas Huth a écrit : Running the test-hmp with V=2 up to V=9 runs the test in verbose mode, but running for example with V=10 falls back to non-verbose mode ... Improve this oddity by properly treating the argument as a number. Signed-off-by: Thomas Huth ---

Re: [PATCH v6 17/51] i386/xen: implement XENMEM_add_to_physmap_batch

2023-01-16 Thread Paul Durrant
On 10/01/2023 12:20, David Woodhouse wrote: From: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant

Re: [PATCH-for-8.0] block/nbd: Add missing include

2023-01-16 Thread Laurent Vivier
Le 12/01/2023 à 13:00, Philippe Mathieu-Daudé a écrit : Hi, can this reviewed patch get merged via a block tree? I can take this via trivial. Thanks, Laurent On 25/11/22 18:53, Philippe Mathieu-Daudé wrote: The inlined nbd_readXX() functions call beXX_to_cpu(), themselves declared in .

[PATCH v2 5/6] hw/riscv/virt.c: rename MachineState 'mc' pointers to 'ms'

2023-01-16 Thread Daniel Henrique Barboza
We have a convention in other QEMU boards/archs to name MachineState pointers as either 'machine' or 'ms'. MachineClass pointers are usually called 'mc'. The 'virt' RISC-V machine has a lot of instances where MachineState pointers are named 'mc'. There is nothing wrong with that, but we gain more

[PATCH v2 4/6] hw/riscv/virt.c: calculate socket count once in create_fdt_imsic()

2023-01-16 Thread Daniel Henrique Barboza
riscv_socket_count() returns either ms->numa_state->num_nodes or 1 depending on NUMA support. In any case the value can be retrieved only once and used in the rest of the function. This will also alleviate the rename we're going to do next by reducing the instances of MachineState 'mc' inside

[PATCH v2 0/6] riscv: fdt related cleanups

2023-01-16 Thread Daniel Henrique Barboza
Hi, In this version I included a rework in riscv_load_fdt() to separate the fdt address calculation from the fdt load process. Having both in the same function doesn't give us much and can lead to confusion due to how other archs handle their respective load_fdt() functions. Patches are based on

[PATCH v2 2/6] hw/riscv: split fdt address calculation from fdt load

2023-01-16 Thread Daniel Henrique Barboza
A common trend in other archs is to calculate the fdt address, which is usually straightforward, and then calling a function that loads the fdt/dtb by using that address. riscv_load_fdt() is doing a bit too much in comparison. It's calculating the fdt address via an elaborated heuristic to put

[PATCH v2 1/6] hw/riscv/boot.c: calculate fdt size after fdt_pack()

2023-01-16 Thread Daniel Henrique Barboza
fdt_pack() can change the fdt size, meaning that fdt_totalsize() can contain a now deprecated (bigger) value. Signed-off-by: Daniel Henrique Barboza --- hw/riscv/boot.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hw/riscv/boot.c b/hw/riscv/boot.c index

[PATCH v2 3/6] hw/riscv: simplify riscv_compute_fdt_addr()

2023-01-16 Thread Daniel Henrique Barboza
All callers are using attributes from the MachineState object. Use a pointer to it instead of passing dram_size (which is always machine->ram_size) and fdt (always machine->fdt). Signed-off-by: Daniel Henrique Barboza --- hw/riscv/boot.c| 6 +++--- hw/riscv/microchip_pfsoc.c | 4

[PATCH v2 6/6] hw/riscv/spike.c: rename MachineState 'mc' pointers to' ms'

2023-01-16 Thread Daniel Henrique Barboza
Follow the QEMU convention of naming MachineState pointers as 'ms' by renaming the instances where we're calling it 'mc'. Suggested-by: Philippe Mathieu-Daudé Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Daniel Henrique Barboza --- hw/riscv/spike.c | 18 +- 1 file

[RFC PATCH] tests/tcg: skip the vma-pthread test on CI

2023-01-16 Thread Alex Bennée
We are getting a lot of failures that are not related to changes so this could be a flaky test. Signed-off-by: Alex Bennée Cc: Richard Henderson --- tests/tcg/multiarch/Makefile.target | 9 + 1 file changed, 9 insertions(+) diff --git a/tests/tcg/multiarch/Makefile.target

Re: [PATCH v3 0/5] hw/i2c/bitbang_i2c: Housekeeping

2023-01-16 Thread Laurent Vivier
Le 11/01/2023 à 09:50, Philippe Mathieu-Daudé a écrit : Series fully reviewed. Since v2: - Use array of const pointers to const (Richard) Since v1: - Fixed overwritten RECEIVING_BIT7 entry (Richard) - Picked R-b tags - Remove unused dummy MemoryRegion - Convert DPRINTF() to using trace events

Re: [PATCH v6 16/51] i386/xen: implement HYPERVISOR_memory_op

2023-01-16 Thread Paul Durrant
On 10/01/2023 12:20, David Woodhouse wrote: From: Joao Martins Specifically XENMEM_add_to_physmap with space XENMAPSPACE_shared_info to allow the guest to set its shared_info page. Signed-off-by: Joao Martins [dwmw2: Use the xen_overlay device, add compat support] Signed-off-by: David

Re: [PATCH v14 01/11] s390x/cpu topology: adding s390 specificities to CPU topology

2023-01-16 Thread Pierre Morel
On 1/13/23 17:58, Nina Schoetterl-Glausch wrote: On Thu, 2023-01-05 at 15:53 +0100, Pierre Morel wrote: S390 adds two new SMP levels, drawers and books to the CPU topology. The S390 CPU have specific toplogy features like dedication and polarity to give to the guest indications on the host

Re: [PATCH 00/12] More cleanups and fixes for drain

2023-01-16 Thread Kevin Wolf
Am 12.12.2022 um 13:59 hat Paolo Bonzini geschrieben: > There are a few more lines of code that can be removed around draining > code, but especially the logic can be simplified by removing unnecessary > parameters. > > Due to the failure of the block-next branch, the first three patches > drop

Re: [PATCH 6/6] hw/arm/aspeed: Init fby35 BMC FRUID EEPROM

2023-01-16 Thread Peter Delevoryas
On Mon, Jan 16, 2023 at 01:30:19PM +0100, Philippe Mathieu-Daudé wrote: > On 14/1/23 18:01, Peter Delevoryas wrote: > > Signed-off-by: Peter Delevoryas > > --- > > hw/arm/aspeed.c | 49 + > > 1 file changed, 49 insertions(+) > > > > diff --git

Re: [PATCH 2/6] hw/arm/aspeed: Remove local copy of at24c_eeprom_init

2023-01-16 Thread Peter Delevoryas
On Mon, Jan 16, 2023 at 01:24:36PM +0100, Philippe Mathieu-Daudé wrote: > On 14/1/23 18:01, Peter Delevoryas wrote: > > Signed-off-by: Peter Delevoryas > > --- > > hw/arm/aspeed.c | 10 +- > > 1 file changed, 1 insertion(+), 9 deletions(-) > > > -static void at24c_eeprom_init(I2CBus

Re: [PATCH 1/6] hw/nvram/eeprom_at24c: Add header w/ init helper

2023-01-16 Thread Peter Delevoryas
On Mon, Jan 16, 2023 at 01:23:01PM +0100, Philippe Mathieu-Daudé wrote: > On 14/1/23 18:01, Peter Delevoryas wrote: > > Signed-off-by: Peter Delevoryas > > --- > > hw/nvram/eeprom_at24c.c | 10 ++ > > include/hw/nvram/eeprom_at24c.h | 10 ++ > > 2 files changed, 20

Re: [PATCH v6 15/51] i386/xen: manage and save/restore Xen guest long_mode setting

2023-01-16 Thread Paul Durrant
On 10/01/2023 12:20, David Woodhouse wrote: From: David Woodhouse Xen will "latch" the guest's 32-bit or 64-bit ("long mode") setting when the guest writes the MSR to fill in the hypercall page, or when the guest sets the event channel callback in HVM_PARAM_CALLBACK_IRQ. KVM handles the

Re: [PATCH 6/6] hw/arm/aspeed: Init fby35 BMC FRUID EEPROM

2023-01-16 Thread Peter Delevoryas
On Mon, Jan 16, 2023 at 01:42:48PM +0100, Cédric Le Goater wrote: > On 1/14/23 18:01, Peter Delevoryas wrote: > > Signed-off-by: Peter Delevoryas > > --- > > hw/arm/aspeed.c | 49 + > > 1 file changed, 49 insertions(+) > > > > diff --git

Re: [PATCH v6 14/51] i386/xen: add pc_machine_kvm_type to initialize XEN_EMULATE mode

2023-01-16 Thread Paul Durrant
On 10/01/2023 12:20, David Woodhouse wrote: From: David Woodhouse The xen_overlay device (and later similar devices for event channels and grant tables) need to be instantiated. Do this from a kvm_type method on the PC machine derivatives, since KVM is only way to support Xen emulation for

Re: [PATCH 4/4] tests/tcg/multiarch: add vma-pthread.c

2023-01-16 Thread Alex Bennée
Peter Maydell writes: > On Mon, 16 Jan 2023 at 16:33, Alex Bennée wrote: >> >> >> Peter Maydell writes: >> >> > On Mon, 16 Jan 2023 at 12:40, Philippe Mathieu-Daudé >> > wrote: >> >> >> >> On 13/1/23 18:10, Alex Bennée wrote: >> > Yep. Could somebody write a patch to disable this test

Re: [PATCH 0/7] Trivial: Mark some more files as target-independant

2023-01-16 Thread Laurent Vivier
Le 12/01/2023 à 14:49, Thomas Huth a écrit : Here's a collection of low-hanging fruits to mark some more files as target-independent (so that they do not have to be compiled twice, once for qemu-system-arm and once for qemu-system-aarch64). Philippe's patches have been on the list before, but I

Re: [PATCH v6 13/51] hw/xen: Add xen_overlay device for emulating shared xenheap pages

2023-01-16 Thread Paul Durrant
On 10/01/2023 12:20, David Woodhouse wrote: From: David Woodhouse For the shared info page and for grant tables, Xen shares its own pages from the "Xen heap" to the guest. The guest requests that a given page from a certain address space (XENMAPSPACE_shared_info, etc.) be mapped to a given GPA

Re: [PATCH 11/15] block-backend: make queued_requests thread-safe

2023-01-16 Thread Kevin Wolf
Am 12.12.2022 um 13:59 hat Paolo Bonzini geschrieben: > Protect quiesce_counter and queued_requests with a QemuMutex, so that > they are protected from concurrent access in the main thread (for example > blk_root_drained_end() reached from bdrv_drain_all()) and in the iothread > (where any I/O

Re: [PATCH v2] tests/qtest/qom-test: Do not print tested properties by default

2023-01-16 Thread Peter Maydell
On Thu, 15 Dec 2022 at 15:30, Thomas Huth wrote: > > We're still running into the problem that some logs are cut in the > gitlab-CI since they got too big. The biggest part of the log is > still the output of the qom-test. Let's stop printing the properties > by default to get to a saner size

Re: [PATCH 10/15] block-backend: always wait for drain before starting operation

2023-01-16 Thread Kevin Wolf
Am 12.12.2022 um 13:59 hat Paolo Bonzini geschrieben: > All I/O operations call blk_wait_while_drained() immediately after > blk_inc_in_flight(), except for blk_abort_aio_request() where it > does not hurt to add such a call. Merge the two functions into one, > and add a note about a disturbing

Re: [PATCH 4/4] tests/tcg/multiarch: add vma-pthread.c

2023-01-16 Thread Peter Maydell
On Mon, 16 Jan 2023 at 16:33, Alex Bennée wrote: > > > Peter Maydell writes: > > > On Mon, 16 Jan 2023 at 12:40, Philippe Mathieu-Daudé > > wrote: > >> > >> On 13/1/23 18:10, Alex Bennée wrote: > > Yep. Could somebody write a patch to disable this test while > > we figure out why it's flaky,

Re: [PATCH v3 5/7] hw/i386/acpi-build: Remove unused attributes

2023-01-16 Thread Igor Mammedov
On Mon, 16 Jan 2023 16:29:06 +0100 Bernhard Beschow wrote: > Ammends commit 3db119da7915 'pc: acpi: switch to AML API composed DSDT'. > > Signed-off-by: Bernhard Beschow > Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Igor Mammedov > --- > hw/i386/acpi-build.c | 2 -- > 1 file changed,

Re: Call qemu_socketpair() instead of socketpair() when possible

2023-01-16 Thread Laurent Vivier
Le 16/01/2023 à 05:56, Guoyi Tu a écrit : As qemu_socketpair() was introduced in commit 3c63b4e9 ("oslib-posix: Introduce qemu_socketpair()"), it's time to replace the other existing socketpair() calls with qemu_socketpair() if possible Signed-off-by: Guoyi Tu ---  backends/tpm/tpm_emulator.c 

Re: [PATCH v2] semihosting: add O_BINARY flag in host_open for NT compatibility

2023-01-16 Thread Peter Maydell
On Mon, 16 Jan 2023 at 15:56, wrote: > > > > On 1/6/23 7:58 PM, Peter Maydell wrote: > > On Fri, 6 Jan 2023 at 18:22, Evgeny Iakovlev > > wrote: > > > > > > > > > On 1/6/2023 17:28, Peter Maydell wrote: > > >> On Fri, 6 Jan 2023 at 15:44, Alex Bennée wrote: > > >>> Peter Maydell writes: > >

Re: [PATCH v3 1/7] hw/acpi/acpi_dev_interface: Remove unused parameter from AcpiDeviceIfClass::madt_cpu

2023-01-16 Thread Igor Mammedov
On Mon, 16 Jan 2023 16:29:02 +0100 Bernhard Beschow wrote: > The only function ever assigned to AcpiDeviceIfClass::madt_cpu is > pc_madt_cpu_entry() which doesn't use the AcpiDeviceIf parameter. > > Signed-off-by: Bernhard Beschow Reviewed-by: Igor Mammedov > --- >

Re: [PATCH v6 12/51] i386/xen: Implement SCHEDOP_poll and SCHEDOP_yield

2023-01-16 Thread Paul Durrant
On 10/01/2023 12:20, David Woodhouse wrote: From: David Woodhouse They both do the same thing and just call sched_yield. This is enough to stop the Linux guest panicking when running on a host kernel which doesn't intercept SCHEDOP_poll and lets it reach userspace. Signed-off-by: David

Re: [PATCH 4/4] tests/tcg/multiarch: add vma-pthread.c

2023-01-16 Thread Alex Bennée
Peter Maydell writes: > On Mon, 16 Jan 2023 at 12:40, Philippe Mathieu-Daudé > wrote: >> >> On 13/1/23 18:10, Alex Bennée wrote: >> > >> > Peter Maydell writes: >> > >> >> On Sat, 24 Dec 2022 at 15:19, Richard Henderson >> >> wrote: >> >>> >> >>> From: Ilya Leoshkevich >> >>> >> >>> Add a

Re: [PATCH v14 01/11] s390x/cpu topology: adding s390 specificities to CPU topology

2023-01-16 Thread Pierre Morel
On 1/10/23 12:37, Thomas Huth wrote: On 05/01/2023 15.53, Pierre Morel wrote: S390 adds two new SMP levels, drawers and books to the CPU topology. The S390 CPU have specific toplogy features like dedication and polarity to give to the guest indications on the host vCPUs scheduling and help

Re: [PATCH v3 2/7] hw/acpi/acpi_dev_interface: Resolve AcpiDeviceIfClass::madt_cpu

2023-01-16 Thread Igor Mammedov
On Mon, 16 Jan 2023 16:29:03 +0100 Bernhard Beschow wrote: > This class attribute was always set to pc_madt_cpu_entry(). > pc_madt_cpu_entry() is architecture dependent and was assigned to the > attribute even in architecture agnostic code such as in hw/acpi/piix4.c > and hw/isa/lpc_ich9. Not

Re: [PATCH v6 11/51] i386/xen: implement HYPERVISOR_sched_op, SCHEDOP_shutdown

2023-01-16 Thread Paul Durrant
On 10/01/2023 12:20, David Woodhouse wrote: From: Joao Martins It allows to shutdown itself via hypercall with any of the 3 reasons: 1) self-reboot 2) shutdown 3) crash Implementing SCHEDOP_shutdown sub op let us handle crashes gracefully rather than leading to triple faults if it

Re: [PATCH v2] semihosting: add O_BINARY flag in host_open for NT compatibility

2023-01-16 Thread Alex Bennée
eiakov...@linux.microsoft.com writes: > On 1/6/23 7:58 PM, Peter Maydell wrote: >> On Fri, 6 Jan 2023 at 18:22, Evgeny Iakovlev >> wrote: >> > >> > >> > On 1/6/2023 17:28, Peter Maydell wrote: >> >> On Fri, 6 Jan 2023 at 15:44, Alex Bennée wrote: >> >>> Peter Maydell writes: >> >> I think

Re: [PATCH v6 09/51] i386/xen: handle guest hypercalls

2023-01-16 Thread Paul Durrant
On 10/01/2023 12:20, David Woodhouse wrote: From: Joao Martins This means handling the new exit reason for Xen but still crashing on purpose. As we implement each of the hypercalls we will then return the right return code. Signed-off-by: Joao Martins [dwmw2: Add CPL to hypercall tracing,

Re: [PATCH v6 08/51] xen-platform: allow its creation with XEN_EMULATE mode

2023-01-16 Thread Paul Durrant
On 10/01/2023 12:19, David Woodhouse wrote: From: Joao Martins The only thing we need to handle on KVM side is to change the pfn from R/W to R/O. Signed-off-by: Joao Martins Signed-off-by: David Woodhouse --- hw/i386/xen/meson.build| 5 - hw/i386/xen/xen_platform.c | 39

Re: [RFC v2 08/13] vdpa: Negotiate _F_SUSPEND feature

2023-01-16 Thread Eugenio Perez Martin
On Mon, Jan 16, 2023 at 7:48 AM Jason Wang wrote: > > > 在 2023/1/13 16:45, Eugenio Perez Martin 写道: > > On Fri, Jan 13, 2023 at 5:39 AM Jason Wang wrote: > >> On Fri, Jan 13, 2023 at 1:25 AM Eugenio Pérez wrote: > >>> This is needed for qemu to know it can suspend the device to retrieve > >>>

Re: [RFC v2 06/13] vhost: delay set_vring_ready after DRIVER_OK

2023-01-16 Thread Eugenio Perez Martin
On Mon, Jan 16, 2023 at 7:37 AM Jason Wang wrote: > > > 在 2023/1/13 16:19, Eugenio Perez Martin 写道: > > On Fri, Jan 13, 2023 at 5:36 AM Jason Wang wrote: > >> On Fri, Jan 13, 2023 at 1:25 AM Eugenio Pérez wrote: > >>> To restore the device at the destination of a live migration we send the >

Re: [QUESTION] About virtio and eventloop

2023-01-16 Thread Stefan Hajnoczi
On Mon, 16 Jan 2023 at 03:20, zhukeqian via wrote: > And if IO operation is blocked, is vCPU thread will blocked when do > deactivate? Yes, blk_drain() is a synchronous function. It blocks until in-flight I/O has finished. The vcpu thread will be blocked in virtio_pci_common_write(). Stefan

Re: [PATCH 07/15] block-backend: enter aio coroutine only after drain

2023-01-16 Thread Kevin Wolf
Am 12.12.2022 um 13:59 hat Paolo Bonzini geschrieben: > When called from within (another) coroutine, aio_co_enter will not > enter a coroutine immediately; instead the new coroutine is scheduled > to run after qemu_coroutine_yield(). This however might cause the > currently-running coroutine to

Re: [PATCH v2] semihosting: add O_BINARY flag in host_open for NT compatibility

2023-01-16 Thread eiakovlev
On 1/6/23 7:58 PM, Peter Maydell wrote: On Fri, 6 Jan 2023 at 18:22, Evgeny Iakovlev wrote: > > > On 1/6/2023 17:28, Peter Maydell wrote: >> On Fri, 6 Jan 2023 at 15:44, Alex Bennée wrote: >>> Peter Maydell writes: >> I think the theory when the semihosting API was originally designed >>

Re: [PATCH 00/12] More cleanups and fixes for drain

2023-01-16 Thread Kevin Wolf
Am 12.12.2022 um 13:59 hat Paolo Bonzini geschrieben: > There are a few more lines of code that can be removed around draining > code, but especially the logic can be simplified by removing unnecessary > parameters. > > Due to the failure of the block-next branch, the first three patches > drop

Re: [PATCH 2/7] hw/acpi/acpi_dev_interface: Remove unused parameter from AcpiDeviceIfClass::madt_cpu

2023-01-16 Thread Igor Mammedov
On Sat, 14 Jan 2023 23:27:33 +0100 Bernhard Beschow wrote: > The only function ever assigned to AcpiDeviceIfClass::madt_cpu is > pc_madt_cpu_entry() which doesn't use the AcpiDeviceIf parameter. intent for AcpiDeviceIfClass::madt_cpu is to make cpu hotplug AML reusable (so it's not x86,

[PATCH] usb-ccid: make ids and descriptor configurable

2023-01-16 Thread Ripke, Klaus
Signed-off-by: Klaus Ripke hw/usb/dev-smartcard-reader.c: Set some static values from ccid_properties. ---  hw/usb/dev-smartcard-reader.c | 35 ++-  1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/hw/usb/dev-smartcard-reader.c

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

2023-01-16 Thread Pierre Morel
On 1/16/23 14:11, Nina Schoetterl-Glausch wrote: On Thu, 2023-01-05 at 15:53 +0100, 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 ---

<    1   2   3   4   >