[RFC v9 18/25] intel_iommu: bind/unbind guest page table to host

2020-07-27 Thread Liu Yi L
This patch captures the guest PASID table entry modifications and propagates the changes to host to setup dual stage DMA translation. The guest page table is configured as 1st level page table (GVA->GPA) whose translation result would further go through host VT-d 2nd level page table(GPA->HPA) unde

[PATCH] target/i386: Add PDCM feature bit when when CPU's pmu property is enabled

2020-07-27 Thread Gal Hammer
The PDCM feature bit is not enabled when adding the pmu property to a CPU without this capability (e.g. -cpu qemu64,pmu). Signed-off-by: Gal Hammer --- target/i386/cpu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 588f32e136..6e1c8b6019 10064

[RFC v9 19/25] intel_iommu: replay pasid binds after context cache invalidation

2020-07-27 Thread Liu Yi L
This patch replays guest pasid bindings after context cache invalidation. This is a behavior to ensure safety. Actually, programmer should issue pasid cache invalidation with proper granularity after issuing a context cache invalidation. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Yi Sun Cc:

Re: [PATCH 2/3] cirrus.yml: Compile macOS and FreeBSD with -Werror

2020-07-27 Thread Thomas Huth
On 27/07/2020 12.57, Daniel P. Berrangé wrote: > On Fri, Jul 24, 2020 at 05:50:47PM +0100, Peter Maydell wrote: >> On Fri, 24 Jul 2020 at 17:46, Philippe Mathieu-Daudé >> wrote: >>> I guess we were expecting the distrib to update the pkg. >> >> Apple's view is that you shouldn't be using the sasl

[RFC v9 07/25] vfio: check VFIO_TYPE1_NESTING_IOMMU support

2020-07-27 Thread Liu Yi L
VFIO needs to check VFIO_TYPE1_NESTING_IOMMU support with Kernel before further using it. e.g. requires to check IOMMU UAPI support. Referred patch from Eric Auger: https://patchwork.kernel.org/patch/11040499/ Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Eric Auger Cc: Yi Sun Cc: David Gibs

[RFC v9 15/25] intel_iommu: add PASID cache management infrastructure

2020-07-27 Thread Liu Yi L
This patch adds a PASID cache management infrastructure based on new added structure VTDPASIDAddressSpace, which is used to track the PASID usage and future PASID tagged DMA address translation support in vIOMMU. struct VTDPASIDAddressSpace { VTDBus *vtd_bus; uint8_t devfn;

[RFC v9 17/25] intel_iommu: sync IOMMU nesting cap info for assigned devices

2020-07-27 Thread Liu Yi L
For assigned devices, Intel vIOMMU which wants to build DMA protection based on physical IOMMU nesting paging should check the IOMMU nesting support in host side. The host will return IOMMU nesting cap info to user-space (e.g. VFIO returns IOMMU nesting cap info for nesting type IOMMU). vIOMMU need

[RFC v9 25/25] intel_iommu: modify x-scalable-mode to be string option

2020-07-27 Thread Liu Yi L
Intel VT-d 3.0 introduces scalable mode, and it has a bunch of capabilities related to scalable mode translation, thus there are multiple combinations. While this vIOMMU implementation wants simplify it for user by providing typical combinations. User could config it by "x-scalable-mode" option. Th

[RFC v9 22/25] intel_iommu: process PASID-based iotlb invalidation

2020-07-27 Thread Liu Yi L
This patch adds the basic PASID-based iotlb (piotlb) invalidation support. piotlb is used during walking Intel VT-d 1st level page table. This patch only adds the basic processing. Detailed handling will be added in next patch. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Yi Sun Cc: Paolo Bon

[RFC v9 23/25] intel_iommu: propagate PASID-based iotlb invalidation to host

2020-07-27 Thread Liu Yi L
This patch propagates PASID-based iotlb invalidation to host. Intel VT-d 3.0 supports nested translation in PASID granular. Guest SVA support could be implemented by configuring nested translation on specific PASID. This is also known as dual stage DMA translation. Under such configuration, guest

[RFC v9 08/25] hw/iommu: introduce HostIOMMUContext

2020-07-27 Thread Liu Yi L
Currently, many platform vendors provide the capability of dual stage DMA address translation in hardware. For example, nested translation on Intel VT-d scalable mode, nested stage translation on ARM SMMUv3, and etc. In dual stage DMA address translation, there are two stages address translation, s

[RFC v9 24/25] intel_iommu: process PASID-based Device-TLB invalidation

2020-07-27 Thread Liu Yi L
This patch adds an empty handling for PASID-based Device-TLB invalidation. For now it is enough as it is not necessary to propagate it to host for passthru device and also there is no emulated device has device tlb. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Yi Sun Cc: Paolo Bonzini Cc: Ri

[RFC v9 03/25] hw/pci: modify pci_setup_iommu() to set PCIIOMMUOps

2020-07-27 Thread Liu Yi L
This patch modifies pci_setup_iommu() to set PCIIOMMUOps instead of setting PCIIOMMUFunc. PCIIOMMUFunc is used to get an address space for a PCI device in vendor specific way. The PCIIOMMUOps still offers this functionality. But using PCIIOMMUOps leaves space to add more iommu related vendor specif

[RFC v9 20/25] intel_iommu: do not pass down pasid bind for PASID #0

2020-07-27 Thread Liu Yi L
RID_PASID field was introduced in VT-d 3.0 spec, it is used for DMA requests w/o PASID in scalable mode VT-d. It is also known as IOVA. And in VT-d 3.1 spec, there is definition on it: "Implementations not supporting RID_PASID capability (ECAP_REG.RPS is 0b), use a PASID value of 0 to perform addr

[RFC v9 21/25] vfio: add support for flush iommu stage-1 cache

2020-07-27 Thread Liu Yi L
This patch adds flush_stage1_cache() definition in HostIOMUContextClass. And adds corresponding implementation in VFIO. This is to expose a way for vIOMMU to flush stage-1 cache in host side since guest owns stage-1 translation structures in dual stage DMA translation configuration. Cc: Kevin Tian

[RFC v9 09/25] hw/pci: introduce pci_device_set/unset_iommu_context()

2020-07-27 Thread Liu Yi L
For nesting IOMMU translation capable platforms, vIOMMUs running on such system could be implemented upon physical IOMMU nested paging (VFIO case). vIOMMU advertises such implementation by "want_nested" attribute to PCIe devices (e.g. VFIO PCI). Once "want_nested" is satisfied, device (VFIO case) s

[RFC v9 05/25] intel_iommu: add get_iommu_attr() callback

2020-07-27 Thread Liu Yi L
Return vIOMMU attribute to caller. e.g. VFIO call via PCI layer. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Yi Sun Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Signed-off-by: Liu Yi L --- hw/i386/intel_iommu.c | 23 +++ 1 file changed, 23 insertions(+

[RFC v9 16/25] vfio: add bind stage-1 page table support

2020-07-27 Thread Liu Yi L
This patch adds bind_stage1_pgtbl() definition in HostIOMMUContextClass, also adds corresponding implementation in VFIO. This is to expose a way for vIOMMU to setup dual stage DMA translation for passthru devices on hardware. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Eric Auger Cc: Yi Sun

[RFC v9 13/25] intel_iommu: add virtual command capability support

2020-07-27 Thread Liu Yi L
This patch adds virtual command support to Intel vIOMMU per Intel VT-d 3.1 spec. And adds two virtual commands: allocate pasid and free pasid. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Yi Sun Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Reviewed-by: Peter Xu Signed-off-b

[RFC v9 10/25] intel_iommu: add set/unset_iommu_context callback

2020-07-27 Thread Liu Yi L
This patch adds set/unset_iommu_context() impelementation in Intel vIOMMU. PCIe devices (VFIO case) sets HostIOMMUContext to vIOMMU as an ack of vIOMMU's "want_nested" attribute. Thus vIOMMU could build DMA protection based on nested paging of host IOMMU. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter X

[RFC v9 14/25] intel_iommu: process PASID cache invalidation

2020-07-27 Thread Liu Yi L
This patch adds PASID cache invalidation handling. When guest enabled PASID usages (e.g. SVA), guest software should issue a proper PASID cache invalidation when caching-mode is exposed. This patch only adds the draft handling of pasid cache invalidation. Detailed handling will be added in subseque

[RFC v9 06/25] vfio: pass nesting requirement into vfio_get_group()

2020-07-27 Thread Liu Yi L
This patch passes the nesting requirement into vfio_get_group() to indicate whether VFIO_TYPE1_NESTING_IOMMU is required. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Eric Auger Cc: Yi Sun Cc: David Gibson Cc: Alex Williamson Signed-off-by: Liu Yi L --- hw/vfio/ap.c | 2

[RFC v9 12/25] vfio: init HostIOMMUContext per-container

2020-07-27 Thread Liu Yi L
In this patch, QEMU firstly gets iommu info from kernel to check the supported capabilities by a VFIO_IOMMU_TYPE1_NESTING iommu. And inits HostIOMMUContet instance. For vfio-pci devices, it could use pci_device_set/unset_iommu() to expose host iommu context to vIOMMU emulators. vIOMMU emulators co

[RFC v9 11/25] vfio/common: provide PASID alloc/free hooks

2020-07-27 Thread Liu Yi L
This patch defines vfio_host_iommu_context_info, implements the PASID alloc/free hooks defined in HostIOMMUContextClass. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Eric Auger Cc: Yi Sun Cc: David Gibson Cc: Alex Williamson Signed-off-by: Liu Yi L --- hw/vfio/common.c

[RFC v9 01/25] scripts/update-linux-headers: Import iommu.h

2020-07-27 Thread Liu Yi L
From: Eric Auger Update the script to import the new iommu.h uapi header. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Yi Sun Cc: Michael S. Tsirkin Cc: Cornelia Huck Cc: Paolo Bonzini Acked-by: Cornelia Huck Signed-off-by: Eric Auger --- scripts/update-linux-headers.sh | 2 +- 1 file

[RFC v9 02/25] header file update VFIO/IOMMU vSVA APIs kernel 5.8-rc6

2020-07-27 Thread Liu Yi L
The kernel uapi/linux/iommu.h header file includes the extensions for vSVA support. e.g. bind gpasid, iommu fault report related user structures and etc. This commit updates kernel headers from the below branch: https://github.com/luxis1999/linux-vsva.git: vsva-linux-5.8-rc6-v6 Note: this should

[RFC v9 00/25] intel_iommu: expose Shared Virtual Addressing to VMs

2020-07-27 Thread Liu Yi L
Shared Virtual Addressing (SVA), a.k.a, Shared Virtual Memory (SVM) on Intel platforms allows address space sharing between device DMA and applications. SVA can reduce programming complexity and enhance security. This QEMU series is intended to expose SVA usage to VMs. i.e. Sharing guest applicati

[RFC v9 04/25] hw/pci: introduce pci_device_get_iommu_attr()

2020-07-27 Thread Liu Yi L
This patch adds pci_device_get_iommu_attr() to get vIOMMU attributes. e.g. if nesting IOMMU wanted. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Eric Auger Cc: Yi Sun Cc: David Gibson Cc: Michael S. Tsirkin Signed-off-by: Liu Yi L --- hw/pci/pci.c | 35 +++

[Bug 1256122] Re: vfio bug with all no VGA card

2020-07-27 Thread Thomas Huth
Looking through old bug tickets... can you still reproduce this issue with the latest version of QEMU? Or could we close this ticket nowadays? ** Changed in: qemu Status: New => Incomplete -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribe

[PULL 1/4] virtio-pci: fix wrong index in virtio_pci_queue_enabled

2020-07-27 Thread Jason Wang
From: Yuri Benditovich https://bugzilla.redhat.com/show_bug.cgi?id=1702608 Fixes: f19bcdfedd53 ("virtio-pci: implement queue_enabled method") Signed-off-by: Yuri Benditovich Signed-off-by: Jason Wang --- hw/virtio/virtio-pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PULL 3/4] virtio-net: check the existence of peer before accessing vDPA config

2020-07-27 Thread Jason Wang
We try to check whether a peer is VDPA in order to get config from there - with no peer, this leads to a NULL pointer dereference. Add a check before trying to access the peer type. No peer means not VDPA. Fixes: 108a64818e69b ("vhost-vdpa: introduce vhost-vdpa backend") Cc: Cindy Lu Tested-by: C

[PULL 2/4] virtio-pci: fix virtio_pci_queue_enabled()

2020-07-27 Thread Jason Wang
From: Laurent Vivier In legacy mode, virtio_pci_queue_enabled() falls back to virtio_queue_enabled() to know if the queue is enabled. But virtio_queue_enabled() calls again virtio_pci_queue_enabled() if k->queue_enabled is set. This ends in a crash after a stack overflow. The problem can be rep

[PULL 4/4] net: forbid the reentrant RX

2020-07-27 Thread Jason Wang
The memory API allows DMA into NIC's MMIO area. This means the NIC's RX routine must be reentrant. Instead of auditing all the NIC, we can simply detect the reentrancy and return early. The queue->delivering is set and cleared by qemu_net_queue_deliver() for other queue helpers to know whether the

[PULL 0/4] Net patches

2020-07-27 Thread Jason Wang
The following changes since commit 9303ecb658a0194560d1eecde165a1511223c2d8: Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20200727' into staging (2020-07-27 17:25:06 +0100) are available in the git repository at: https://github.com/jasowang/qemu.git tags/net-pull-re

Re: [BUG] vhost-vdpa: qemu-system-s390x crashes with second virtio-net-ccw device

2020-07-27 Thread Jason Wang
On 2020/7/27 下午9:16, Michael S. Tsirkin wrote: On Mon, Jul 27, 2020 at 08:44:09PM +0800, Jason Wang wrote: On 2020/7/27 下午7:43, Michael S. Tsirkin wrote: On Mon, Jul 27, 2020 at 04:51:23PM +0800, Jason Wang wrote: On 2020/7/27 下午4:41, Cornelia Huck wrote: On Mon, 27 Jul 2020 15:38:12 +0800

Re: [PATCH 1/2] hw/net/net_tx_pkt: add function to check pkt->max_raw_frags

2020-07-27 Thread Jason Wang
On 2020/7/28 上午1:08, Mauro Matteo Cascella wrote: This patch introduces a new function in hw/net/net_tx_pkt.{c,h} to check the current data fragment against the maximum number of data fragments. I wonder whether it's better to do the check in net_tx_pkt_add_raw_fragment() and fail there.

Re: [PATCH 1/2] net: forbid the reentrant RX

2020-07-27 Thread Jason Wang
On 2020/7/22 下午4:57, Jason Wang wrote: The memory API allows DMA into NIC's MMIO area. This means the NIC's RX routine must be reentrant. Instead of auditing all the NIC, we can simply detect the reentrancy and return early. The queue->delivering is set and cleared by qemu_net_queue_deliver() f

Re: [PATCH] target/ppc: Fix TCG leak with the evmwsmiaa instruction

2020-07-27 Thread David Gibson
On Mon, Jul 27, 2020 at 10:21:14AM -0700, Matthieu Bucchianeri wrote: > Fix double-call to tcg_temp_new_i64(), where a temp is allocated both at > declaration time and further down the implementation of gen_evmwsmiaa(). > > Note that gen_evmwsmia() and gen_evmwsmiaa() are still not implemented > c

Re: [PATCH] virtio-pci: fix wrong index in virtio_pci_queue_enabled

2020-07-27 Thread Jason Wang
On 2020/7/27 下午10:38, Yuri Benditovich wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1702608 Signed-off-by: Yuri Benditovich Queued for rc2. Thanks --- hw/virtio/virtio-pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/

Re: [PATCH] virtio-pci: fix virtio_pci_queue_enabled()

2020-07-27 Thread Jason Wang
On 2020/7/27 下午11:33, Laurent Vivier wrote: In legacy mode, virtio_pci_queue_enabled() falls back to virtio_queue_enabled() to know if the queue is enabled. But virtio_queue_enabled() calls again virtio_pci_queue_enabled() if k->queue_enabled is set. This ends in a crash after a stack overflow

[PATCH v5] hw/pci-host: save/restore pci host config register for old ones

2020-07-27 Thread Hogan Wang
The i440fx and q35 machines integrate i440FX or MCH PCI device by default. Refer to i440FX and ICH9-LPC spcifications, there are some reserved configuration registers can used to save/restore PCIHostState.config_reg. It's nasty but friendly to old ones. Reproducer steps: step 1. Make modifications

Re: [PATCH v5 3/4] target/riscv: Fix the translation of physical address

2020-07-27 Thread Zong Li
On Tue, Jul 28, 2020 at 6:49 AM Alistair Francis wrote: > > On Sat, Jul 25, 2020 at 8:05 AM Zong Li wrote: > > > > The real physical address should add the 12 bits page offset. It also > > causes the PMP wrong checking due to the minimum granularity of PMP is > > 4 byte, but we always get the phy

Re: [RFC PATCH 1/2] hw/riscv: sifive_u: Add file-backed OTP. softmmu/vl: add otp-file to boot option

2020-07-27 Thread Green Wan
Hi Bin, Thanks for the reply. I think we can add property to sifive_u_otp_properties[] (something like below) and remove generic code dependency. What do you think of it? @@ -243,6 +245,7 @@ static const MemoryRegionOps sifive_u_otp_ops = { static Property sifive_u_otp_properties[] = { DE

[Bug 1390520] Re: virtual machine fails to start with connected audio cd

2020-07-27 Thread John Snow
Dropping from my queue due to capacity. ** Changed in: qemu Assignee: John Snow (jnsnow) => (unassigned) -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1390520 Title: virtual machine fails to

[Bug 1070762] Re: savevm fails with inserted CD, "Device '%s' is writable but does not support snapshots."

2020-07-27 Thread John Snow
Very old bug. If anyone sees this behavior, please re-file against a supported release (5.0 at time of writing, soon to be 5.1) and please paste a full command-line and steps to reproduce. (To my knowledge, this bug is not present in modern QEMU builds, but do not know when it would have changed.)

[Bug 1777315] Re: IDE short PRDT abort

2020-07-27 Thread John Snow
** Summary changed: - Denial of service + IDE short PRDT abort -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1777315 Title: IDE short PRDT abort Status in QEMU: In Progress Bug description:

Re: [PATCH] bugfix: irq: Avoid covering object refcount of qemu_irq

2020-07-27 Thread zhukeqian
Hi Peter, On 2020/7/27 22:41, Peter Maydell wrote: > On Mon, 27 Jul 2020 at 14:03, Keqian Zhu wrote: >> >> Avoid covering object refcount of qemu_irq, otherwise it may causes >> memory leak. >> >> Signed-off-by: Keqian Zhu >> --- >> hw/core/irq.c | 4 +++- >> 1 file changed, 3 insertions(+), 1

[Bug 1883739] Re: ide_dma_cb: Assertion `prep_size >= 0 && prep_size <= n * 512' failed.

2020-07-27 Thread John Snow
*** This bug is a duplicate of bug 1777315 *** https://bugs.launchpad.net/bugs/1777315 ** This bug has been marked a duplicate of bug 1777315 Denial of service -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launc

[Bug 1681439] Re: qemu-system-x86_64: hw/ide/core.c:685: ide_cancel_dma_sync: Assertion `s->bus->dma->aiocb == NULL' failed.

2020-07-27 Thread John Snow
** Changed in: qemu Status: Confirmed => In Progress -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1681439 Title: qemu-system-x86_64: hw/ide/core.c:685: ide_cancel_dma_sync: Assertion `s->

Re: [PATCH] bugfix: irq: Avoid covering object refcount of qemu_irq

2020-07-27 Thread zhukeqian
Hi Qiang, On 2020/7/27 22:37, Li Qiang wrote: > Keqian Zhu 于2020年7月27日周一 下午9:03写道: >> >> Avoid covering object refcount of qemu_irq, otherwise it may causes >> memory leak. > > Any reproducer? > In mainline Qemu. this function is only used in qtest. One of our internal self-developed module als

[Bug 1681439] Re: qemu-system-x86_64: hw/ide/core.c:685: ide_cancel_dma_sync: Assertion `s->bus->dma->aiocb == NULL' failed.

2020-07-27 Thread John Snow
The qtest reproducers are so nice. writel 0x0 0x outw 0x171 0x32a features := 0x2ab8cb count := 0x03; b8cb outw 0x176 0x3570 device := 0x70 (select device1) b8cb command := 0x35(DMA WRITE EXT)8f98 outl 0xcf8 0x8903 outl 0xcfc 0x4e002700 outl 0xcf8 0x800

[PATCH 4/6 v3] KVM: VMX: Fill in conforming vmx_x86_ops via macro

2020-07-27 Thread Krish Sadhukhan
The names of some of the vmx_x86_ops functions do not have a corresponding 'vmx_' prefix. Generate the names using a macro so that the names are conformant. Fixing the naming will help in better readability and maintenance of the code. Suggested-by: Vitaly Kuznetsov Suggested-by: Paolo Bonzini S

[PATCH 2/6 v3] KVM: SVM: Fill in conforming svm_x86_ops via macro

2020-07-27 Thread Krish Sadhukhan
The names of some of the svm_x86_ops functions do not have a corresponding 'svm_' prefix. Generate the names using a macro so that the names are conformant. Fixing the naming will help in better readability and maintenance of the code. Suggested-by: Vitaly Kuznetsov Suggested-by: Paolo Bonzini S

[PATCH 6/6 v3] QEMU: x86: Change KVM_MEMORY_ENCRYPT_* #defines to make them conformant to the kernel

2020-07-27 Thread Krish Sadhukhan
Suggested-by: Vitaly Kuznetsov Suggested-by: Paolo Bonzini Signed-off-by: Sean Christopherson Signed-off-by: Krish Sadhukhan --- target/i386/sev.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/target/i386/sev.c b/target/i386/sev.c index c3ecf86..0913782 100644 ---

Re: [PATCH] docs/nvdimm: add 'pmem=on' for the device dax backend file

2020-07-27 Thread Liu, Jingqi
Hi Paolo, Any comments for this patch ? Thanks, Jingqi On 7/15/2020 10:54 AM, Liu, Jingqi wrote: At the end of live migration, QEMU uses msync() to flush the data to the backend storage. When the backend file is a character device dax, the pages explicitly avoid the page cache. It will return

[PATCH 3/6 v3] KVM: nSVM: Fill in conforming svm_nested_ops via macro

2020-07-27 Thread Krish Sadhukhan
The names of the nested_svm_ops functions do not have a corresponding 'nested_svm_' prefix. Generate the names using a macro so that the names are conformant. Fixing the naming will help in better readability and maintenance of the code. Suggested-by: Vitaly Kuznetsov Suggested-by: Paolo Bonzini

[PATCH 1/6 v3] KVM: x86: Change names of some of the kvm_x86_ops functions to make them more semantical and readable

2020-07-27 Thread Krish Sadhukhan
Suggested-by: Vitaly Kuznetsov Suggested-by: Paolo Bonzini Signed-off-by: Sean Christopherson Signed-off-by: Krish Sadhukhan --- arch/arm64/include/asm/kvm_host.h | 2 +- arch/mips/include/asm/kvm_host.h| 2 +- arch/powerpc/include/asm/kvm_host.h | 2 +- arch/s390/kvm/kvm-s390.c

[PATCH 0/6 v3] KVM: x86: Fill in conforming {vmx|svm}_x86_ops and {vmx|svm}_nested_ops via macros

2020-07-27 Thread Krish Sadhukhan
v2 -> v3: 1. kvm_arch_hardware_unsetup() is changed to kvm_arch_hardware_teardown() on non-x86 arches as well. 2. The following #defines KVM_MEMORY_ENCRYPT_OP KVM_MEMORY_ENCRYPT_REG_REGION KVM_MEMORY_ENCRYPT_UNREG_REGION

[PATCH 5/6 v3] KVM: nVMX: Fill in conforming vmx_nested_ops via macro

2020-07-27 Thread Krish Sadhukhan
The names of some of the vmx_nested_ops functions do not have a corresponding 'nested_vmx_' prefix. Generate the names using a macro so that the names are conformant. Fixing the naming will help in better readability and maintenance of the code. Suggested-by: Vitaly Kuznetsov Suggested-by: Paolo

RE: [PATCH v2 3/3] virtiofsd: probe unshare(CLONE_FS) and print an error

2020-07-27 Thread misono.tomoh...@fujitsu.com
> Subject: [PATCH v2 3/3] virtiofsd: probe unshare(CLONE_FS) and print an error > > An assertion failure is raised during request processing if > unshare(CLONE_FS) fails. Implement a probe at startup so the problem can > be detected right away. > > Unfortunately Docker/Moby does not include unsha

RE: [PATCH v2 1/3] hw/i386: Initialize topo_ids from CpuInstanceProperties

2020-07-27 Thread Babu Moger
> -Original Message- > From: Igor Mammedov > Sent: Monday, July 27, 2020 12:14 PM > To: Moger, Babu > Cc: qemu-devel@nongnu.org; pbonz...@redhat.com; ehabk...@redhat.com; > r...@twiddle.net > Subject: Re: [PATCH v2 1/3] hw/i386: Initialize topo_ids from > CpuInstanceProperties > > On

Re: [PATCH v2 0/7] target/riscv: NaN-boxing for multiple precison

2020-07-27 Thread Alistair Francis
On Thu, Jul 23, 2020 at 5:28 PM Richard Henderson wrote: > > This is my take on Liu Zhiwei's patch set: > https://patchew.org/QEMU/20200626205917.4545-1-zhiwei_...@c-sky.com > > This differs from Zhiwei's v1 in: > > * If a helper is involved, the helper does the boxing and unboxing. > > * Which

Re: [PATCH v10] qga: add command guest-get-devices for reporting VirtIO devices

2020-07-27 Thread Michael Roth
Quoting Tomáš Golembiovský (2020-07-21 10:40:41) > Add command for reporting devices on Windows guest. The intent is not so > much to report the devices but more importantly the driver (and its > version) that is assigned to the device. This gives caller the > information whether VirtIO drivers are

Re: [PATCH v2 0/4] Allow guest-get-fsinfo also for non-PCI devices

2020-07-27 Thread Michael Roth
Quoting Thomas Huth (2020-07-21 23:40:24) > The information that can be retrieved via UDEV is also usable for non-PCI > devices. So let's allow build_guest_fsinfo_for_real_device() on non-PCI > devices, too. This is required to fix the bug that CCW devices show up > without "Target" when running li

[PULL for-5.1 0/2] qemu-ga patch queue for hard-freeze

2020-07-27 Thread Michael Roth
The following changes since commit 9303ecb658a0194560d1eecde165a1511223c2d8: Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20200727' into staging (2020-07-27 17:25:06 +0100) are available in the Git repository at: git://github.com/mdroth/qemu.git tags/qga-pull-2020-07-2

[PULL for-5.1 1/2] qga-win: fix "guest-get-fsinfo" wrong filesystem type

2020-07-27 Thread Michael Roth
From: Basil Salman This patch handles the case where unmounted volumes exist, where in that case GetVolumePathNamesForVolumeName returns empty path, GetVolumeInformation will use the current working directory instead. This patch fixes the issue by opening a handle to the volumes, and using GetVol

[PULL for-5.1 2/2] qga/qapi-schema: Document -1 for invalid PCI address fields

2020-07-27 Thread Michael Roth
From: Thomas Huth The "guest-get-fsinfo" could also be used for non-PCI devices in the future. And the code in GuestPCIAddress() in qga/commands-win32.c seems to be using "-1" for fields that it can not determine already. Thus let's properly document "-1" as value for invalid PCI address fields.

Re: migration: broken snapshot saves appear on s390 when small fields in migration stream removed

2020-07-27 Thread Bruce Rogers
On Tue, 2020-07-21 at 10:22 +0200, Claudio Fontana wrote: > On 7/20/20 8:24 PM, Claudio Fontana wrote: > > I have now been able to reproduce this on X86 as well. > > > > It happens much more rarely, about once every 10 times. > > > > I will sort out the data and try to make it even more reproduci

Re: [PATCH v5 3/4] target/riscv: Fix the translation of physical address

2020-07-27 Thread Alistair Francis
On Sat, Jul 25, 2020 at 8:05 AM Zong Li wrote: > > The real physical address should add the 12 bits page offset. It also > causes the PMP wrong checking due to the minimum granularity of PMP is > 4 byte, but we always get the physical address which is 4KB alignment, > that means, we always use the

[Bug 1681439] Re: qemu-system-x86_64: hw/ide/core.c:685: ide_cancel_dma_sync: Assertion `s->bus->dma->aiocb == NULL' failed.

2020-07-27 Thread John Snow
** Changed in: qemu Status: New => Confirmed ** Changed in: qemu Assignee: (unassigned) => John Snow (jnsnow) -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1681439 Title: qemu-system-x

Re: [PATCH v5 2/4] target/riscv/pmp.c: Fix the index offset on RV64

2020-07-27 Thread Alistair Francis
On Sat, Jul 25, 2020 at 8:04 AM Zong Li wrote: > > On RV64, the reg_index is 2 (pmpcfg2 CSR) after the seventh pmp > entry, it is not 1 (pmpcfg1 CSR) like RV32. In the original > implementation, the second parameter of pmp_write_cfg is > "reg_index * sizeof(target_ulong)", and we get the the resul

[Bug 1884693] Re: Assertion failure in address_space_unmap through ahci_map_clb_address

2020-07-27 Thread John Snow
** Changed in: qemu Status: Confirmed => In Progress -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1884693 Title: Assertion failure in address_space_unmap through ahci_map_clb_address Statu

Re: [PATCH for-5.1] hw/arm/netduino2, netduinoplus2: Set system_clock_scale

2020-07-27 Thread Alistair Francis
On Mon, Jul 27, 2020 at 9:26 AM Peter Maydell wrote: > > The netduino2 and netduinoplus2 boards forgot to set the system_clock_scale > global, which meant that if guest code used the systick timer in "use > the processor clock" mode it would hang because time never advances. > > Set the global to

[Bug 1883739] Re: ide_dma_cb: Assertion `prep_size >= 0 && prep_size <= n * 512' failed.

2020-07-27 Thread John Snow
** Changed in: qemu Assignee: (unassigned) => John Snow (jnsnow) -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1883739 Title: ide_dma_cb: Assertion `prep_size >= 0 && prep_size <= n * 512' fai

[Bug 1887303] Re: Assertion failure in *bmdma_active_if `bmdma->bus->retry_unit != (uint8_t)-1' failed.

2020-07-27 Thread John Snow
This is another manifestation of the SRST bug. New proposal: https://lists.gnu.org/archive/html/qemu- devel/2020-07/msg06974.html More analysis of the problem in response to Philippe's proposed fix: https://lists.gnu.org/archive/html/qemu-devel/2020-07/msg06237.html ** Changed in: qemu St

Re: device compatibility interface for live migration with assigned devices

2020-07-27 Thread Alex Williamson
On Mon, 27 Jul 2020 15:24:40 +0800 Yan Zhao wrote: > > > As you indicate, the vendor driver is responsible for checking version > > > information embedded within the migration stream. Therefore a > > > migration should fail early if the devices are incompatible. Is it > > but as I know, curre

[Bug 1887309] Re: Floating-point exception in ide_set_sector

2020-07-27 Thread John Snow
New proposal: https://lists.gnu.org/archive/html/qemu- devel/2020-07/msg06974.html (The root cause is that SRST is not handled correctly.) More analysis in the replies to Philippe's patch: https://lists.gnu.org/archive/html/qemu-devel/2020-07/msg05949.html ** Changed in: qemu Assignee: (una

[Bug 1878253] Re: null-ptr dereference in address_space_to_flatview through ide

2020-07-27 Thread John Snow
Proposed fix: https://lists.gnu.org/archive/html/qemu- devel/2020-07/msg06974.html ** Changed in: qemu Assignee: (unassigned) => John Snow (jnsnow) ** Changed in: qemu Status: New => In Progress -- You received this bug notification because you are a member of qemu- devel-ml, which

[Bug 1878255] Re: Assertion failure in bdrv_aio_cancel, through ide

2020-07-27 Thread John Snow
Thank you, Stefan! Fix: https://gitlab.com/qemu- project/qemu/-/commit/1d719ddc35e9827b6e5df771555874df34301a0d ** Changed in: qemu Status: New => Fix Committed -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.la

Re: [PATCH 1/1] scripts/performance: Add bisect.py script

2020-07-27 Thread Aleksandar Markovic
On Monday, July 27, 2020, John Snow wrote: > On 7/25/20 8:31 AM, Aleksandar Markovic wrote: > >> >> >> On Wednesday, July 22, 2020, Ahmed Karaman > > wrote: >> >> Python script that locates the commit that caused a performance >> degradation or improve

Re: [PATCH v2 for-5.1? 0/5] Fix nbd reconnect dead-locks

2020-07-27 Thread Eric Blake
On 7/27/20 1:47 PM, Vladimir Sementsov-Ogievskiy wrote: Hi all! v2: it's a bit updated "[PATCH for-5.1? 0/3] Fix nbd reconnect dead-locks" plus completely rewritten "[PATCH for-5.1? 0/4] non-blocking connect" (which is now the only one patch 05) 01: new 02: rebased on 01, fix (add outer "if") 0

[PATCH v2 2/4] iotests: Make qemu_nbd_popen() a contextmanager

2020-07-27 Thread Nir Soffer
Instead of duplicating the code to wait until the server is ready and remember to terminate the server and wait for it, make it possible to use like this: with qemu_nbd_popen('-k', sock, image): # Access image via qemu-nbd socket... Only test 264 used this helper, but I had to modify

[PATCH v2 3/4] iotests: Add more qemu_img helpers

2020-07-27 Thread Nir Soffer
Add 2 helpers for measuring and checking images: - qemu_img_measure() - qemu_img_check() Both use --output-json and parse the returned json to make easy to use in other tests. I'm going to use them in a new test, and I hope they will be useful in may other tests. Signed-off-by: Nir Soffer --- t

[PATCH v2 0/4] Fix convert to qcow2 compressed to NBD

2020-07-27 Thread Nir Soffer
Fix qemu-img convert -O qcow2 -c to NBD URL and add missing test for this usage. This already works now, but unfortunately qemu-img fails when trying to truncate the target image to the same size at the end of the operation. Changes since v1: - Include complete code for creating OVA file [Eric] -

[PATCH v2 4/4] iotests: Test convert to qcow2 compressed to NBD

2020-07-27 Thread Nir Soffer
Add test for "qemu-img convert -O qcow2 -c" to NBD target. The tests     create a OVA file and write compressed qcow2 disk content directly into the OVA file via qemu-nbd. Signed-off-by: Nir Soffer --- tests/qemu-iotests/302 | 127 + tests/qemu-iotests/302

[PATCH v2 1/4] block: nbd: Fix convert qcow2 compressed to nbd

2020-07-27 Thread Nir Soffer
When converting to qcow2 compressed format, the last step is a special zero length compressed write, ending in call to bdrv_co_truncate(). This call always fails for the nbd driver since it does not implement bdrv_co_truncate(). For block devices, which have the same limits, the call succeeds sinc

[PATCH 1/4] hw/hppa: Sync hppa_hardware.h file with SeaBIOS sources

2020-07-27 Thread Helge Deller
The hppa_hardware.h file is shared with SeaBIOS. Sync it. Signed-off-by: Helge Deller --- hw/hppa/hppa_hardware.h | 6 ++ hw/hppa/lasi.c | 2 -- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/hw/hppa/hppa_hardware.h b/hw/hppa/hppa_hardware.h index 4a2fe2df60..cdb7fa6

[PATCH 0/4] Various fixes for hppa architecture

2020-07-27 Thread Helge Deller
This patch series fixes a few issues with the hppa emulation: * The artist framebuffer emulation reports: "write outside bounds: wants 1256x1023, max size 1280x1024" This is fixed by a patch from Sven Schnelle. * Fix a SeaBIOS hppa compilation issue with gcc-10. * Implement a proper SeaBIOS

[PATCH 3/4] hw/hppa: Implement proper SeaBIOS version check

2020-07-27 Thread Helge Deller
It's important that the SeaBIOS hppa firmware is at least at a minimal level to ensure proper interaction between qemu and firmware. Implement a proper firmware version check by telling SeaBIOS via the fw_cfg interface which minimal SeaBIOS version is required by this running qemu instance. If the

[PATCH 4/4] hw/display/artist.c: fix out of bounds check

2020-07-27 Thread Helge Deller
From: Sven Schnelle Signed-off-by: Sven Schnelle Signed-off-by: Helge Deller --- hw/display/artist.c | 18 ++ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/hw/display/artist.c b/hw/display/artist.c index 6261bfe65b..46043ec895 100644 --- a/hw/display/artist.c +

Re: [PATCH v2 2/5] block/nbd: allow drain during reconnect attempt

2020-07-27 Thread Eric Blake
On 7/27/20 1:47 PM, Vladimir Sementsov-Ogievskiy wrote: It should be to reenter qio_channel_yield() on io/channel read/write be safe path, so it's safe to reduce in_flight and allow attaching new aio context. And no problem to allow drain itself: connection attempt is not a guest request. Mor

Re: [PATCH v2 1/5] block/nbd: split nbd_establish_connection out of nbd_client_connect

2020-07-27 Thread Eric Blake
On 7/27/20 1:47 PM, Vladimir Sementsov-Ogievskiy wrote: We are going to implement non-blocking version of nbd_establish_connection, which for a while will be used only for nbd_reconnect_attempt, not for nbd_open, so we need to call it separately. Refactor nbd_reconnect_attempt in a way which mak

[PULL 24/24] migration: Fix typos in bitmap migration comments

2020-07-27 Thread Eric Blake
Noticed while reviewing the file for newer patches. Fixes: b35ebdf076 Signed-off-by: Eric Blake Message-Id: <20200727203206.134996-1-ebl...@redhat.com> --- migration/block-dirty-bitmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/migration/block-dirty-bitmap.c b/migr

[PULL 22/24] qemu-iotests/199: add source-killed case to bitmaps postcopy

2020-07-27 Thread Eric Blake
From: Vladimir Sementsov-Ogievskiy Previous patches fixes behavior of bitmaps migration, so that errors are handled by just removing unfinished bitmaps, and not fail or try to recover postcopy migration. Add corresponding test. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Andrey Shi

[PULL 19/24] qemu-iotests/199: prepare for new test-cases addition

2020-07-27 Thread Eric Blake
From: Vladimir Sementsov-Ogievskiy Move future common part to start_postcopy() method. Move checking number of bitmaps to check_bitmap(). Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Andrey Shinkevich Message-Id: <20200727194236.19551-19-vsement...@virtuozzo.com> Signed-off-by: Eri

[PULL 21/24] qemu-iotests/199: add early shutdown case to bitmaps postcopy

2020-07-27 Thread Eric Blake
From: Vladimir Sementsov-Ogievskiy Previous patches fixed two crashes which may occur on shutdown prior to bitmaps postcopy finished. Check that it works now. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Andrey Shinkevich Tested-by: Eric Blake Message-Id: <20200727194236.19551-21-

[PULL 23/24] iotests: Adjust which migration tests are quick

2020-07-27 Thread Eric Blake
A quick run of './check -qcow2 -g migration' shows that test 169 is NOT quick, but meanwhile several other tests ARE quick. Let's adjust the test designations accordingly. Signed-off-by: Eric Blake Message-Id: <20200727195117.132151-1-ebl...@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy

[PULL 17/24] migration/block-dirty-bitmap: cancel migration on shutdown

2020-07-27 Thread Eric Blake
From: Vladimir Sementsov-Ogievskiy If target is turned off prior to postcopy finished, target crashes because busy bitmaps are found at shutdown. Canceling incoming migration helps, as it removes all unfinished (and therefore busy) bitmaps. Similarly on source we crash in bdrv_close_all which as

[PULL 11/24] migration/block-dirty-bitmap: move mutex init to dirty_bitmap_mig_init

2020-07-27 Thread Eric Blake
From: Vladimir Sementsov-Ogievskiy No reasons to keep two public init functions. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Andrey Shinkevich Reviewed-by: Dr. David Alan Gilbert Message-Id: <20200727194236.19551-11-vsement...@virtuozzo.com> Signed-off-by: Eric Blake --- migrat

[PULL 14/24] migration/block-dirty-bitmap: simplify dirty_bitmap_load_complete

2020-07-27 Thread Eric Blake
From: Vladimir Sementsov-Ogievskiy bdrv_enable_dirty_bitmap_locked() call does nothing, as if we are in postcopy, bitmap successor must be enabled, and reclaim operation will enable the bitmap. So, actually we need just call _reclaim_ in both if branches, and making differences only to add an as

  1   2   3   4   5   >