[Bug 1749393] Re: sbrk() not working under qemu-user with a PIE-compiled binary?

2021-11-30 Thread Christian Ehrhardt 
Focal old $ sudo apt install --reinstall qemu-user-static=1:4.2-3ubuntu6.18 Reading package lists... Done Building dependency tree Reading state information... Done 0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded. Need to get 21.3 MB of archives. After this

Re: [PATCH v4] target/ppc: fix Hash64 MMU update of PTE bit R

2021-11-30 Thread Cédric Le Goater
On 11/30/21 21:00, Leandro Lupori wrote: On 30/11/2021 05:44, Cédric Le Goater wrote: It would be interesting to boot directly the PowerNV machine from a FreeBSB kernel and a minimum inirtd without using the skiroot images and an iso. Are images available ? AFAIK there are no minimum initrd

[PATCH] QIO: Add force_quit to the QIOChannel to ensure QIO exits cleanly in some corner case

2021-11-30 Thread Rao, Lei
We found that the QIO channel coroutine could not be awakened in some corner cases during our stress test for COLO. The patch fixes as follow: #0 0x7fad72e24bf6 in __ppoll (fds=0x5563d75861f0, nfds=1, timeout=, sigmask=0x0) at ../sysdeps/unix/sysv/linux/ppoll.c:44 #1

[PATCH v2] docs: fix section numbering in pcie.txt

2021-11-30 Thread Ani Sinha
There is no 5.2 section. Section 5.3 should really be 5.2. Fix it. fixes: 453ac8835b0022 ("docs: add PCIe devices placement guidelines") Reviewed-by: Liu Yi L Signed-off-by: Ani Sinha --- docs/pcie.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pcie.txt

RE: [PATCH] docs: fix section numbering in pcie.txt

2021-11-30 Thread Liu, Yi L
> From: Qemu-devel > On Behalf Of Ani Sinha > Sent: Wednesday, December 1, 2021 2:43 PM > > There is no 5.2 section. Section 5.3 should really be 5.2. Fix it. Reviewed-by: Liu Yi L BTW. Is a fix tag needed? Regards, Yi Liu > Signed-off-by: Ani Sinha > --- > docs/pcie.txt | 2 +- > 1 file

[PATCH] docs: fix section numbering in pcie.txt

2021-11-30 Thread Ani Sinha
There is no 5.2 section. Section 5.3 should really be 5.2. Fix it. Signed-off-by: Ani Sinha --- docs/pcie.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pcie.txt b/docs/pcie.txt index 89e3502075..90310b0c5e 100644 --- a/docs/pcie.txt +++ b/docs/pcie.txt @@ -262,7

Re: [PULL 0/1] MAINTAINERS update

2021-11-30 Thread Richard Henderson
On 11/30/21 9:47 PM, Eduardo Habkost wrote: * MAINTAINERS: Change my email address (Eduardo Habkost) Eduardo Habkost (1): MAINTAINERS: Change my email address MAINTAINERS | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) Not a pull request. But since it's just one

Re: [PATCH] memory: Fix incorrect calls of log_global_start/stop

2021-11-30 Thread Peter Xu
On Tue, Nov 30, 2021 at 04:03:10PM +0100, David Hildenbrand wrote: > On 30.11.21 09:00, Peter Xu wrote: > > We should only call the log_global_start/stop when the global dirty track > > bitmask changes from zero<->non-zero. > > > > No real issue reported for this yet probably because no immediate

Re: [PATCH 1/1] hw/arm/virt: Support for virtio-mem-pci

2021-11-30 Thread Gavin Shan
On 11/30/21 8:37 PM, David Hildenbrand wrote: On 30.11.21 01:33, Gavin Shan wrote: This supports virtio-mem-pci device on "virt" platform, by simply following the implementation on x86. Thanks for picking this up! Thanks, David. * The patch was written by David Hildenbrand

Re: [PATCH v2 1/2] ppc/pnv.c: add a friendly warning when accel=kvm is used

2021-11-30 Thread David Gibson
On Tue, Nov 30, 2021 at 10:31:52AM -0300, Daniel Henrique Barboza wrote: > If one tries to use -machine powernv9,accel=kvm in a Power9 host, a > cryptic error will be shown: > > qemu-system-ppc64: Register sync failed... If you're using kvm-hv.ko, only > "-cpu host" is possible >

Re: [PATCH v8 06/10] target/ppc: enable PMU instruction count

2021-11-30 Thread David Gibson
On Tue, Nov 30, 2021 at 07:24:04PM -0300, Daniel Henrique Barboza wrote: > > > On 11/29/21 01:36, David Gibson wrote: > > On Thu, Nov 25, 2021 at 12:08:13PM -0300, Daniel Henrique Barboza wrote: > > > The PMU is already counting cycles by calculating time elapsed in > > > nanoseconds. Counting

Re: [PATCH v4] target/ppc: fix Hash64 MMU update of PTE bit R

2021-11-30 Thread David Gibson
On Tue, Nov 30, 2021 at 09:44:58AM +0100, Cédric le Goater wrote: > On 11/30/21 01:30, David Gibson wrote: > > On Mon, Nov 29, 2021 at 03:57:51PM -0300, Leandro Lupori wrote: > > > When updating the R bit of a PTE, the Hash64 MMU was using a wrong byte > > > offset, causing the first byte of the

[PULL 0/1] MAINTAINERS update

2021-11-30 Thread Eduardo Habkost
* MAINTAINERS: Change my email address (Eduardo Habkost) Eduardo Habkost (1): MAINTAINERS: Change my email address MAINTAINERS | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) -- 2.32.0

Re: [PATCH] fw_cfg: Fix memory leak in fw_cfg_register_file

2021-11-30 Thread Johan Hovold
On Tue, Nov 16, 2021 at 04:28:34PM +0100, Philippe Mathieu-Daudé wrote: > On 11/16/21 12:42, Miaoqian Lin wrote: > > When kobject_init_and_add() fails, entry should be freed just like > > when sysfs_create_bin_file() fails. > > > > Fixes: fe3c60684377 ("firmware: Fix a reference count leak.") >

[PULL 1/1] MAINTAINERS: Change my email address

2021-11-30 Thread Eduardo Habkost
The ehabk...@redhat.com email address will stop working on 2021-12-01, change it to my personal email address. Signed-off-by: Eduardo Habkost Message-Id: <20211129163053.2506734-1-ehabk...@redhat.com> Signed-off-by: Eduardo Habkost --- MAINTAINERS | 12 ++-- 1 file changed, 6

Re: why is iommu_platform set to off by default?

2021-11-30 Thread Michael S. Tsirkin
On Tue, Nov 30, 2021 at 04:38:11PM +, Stefan Hajnoczi wrote: > On Tue, Nov 30, 2021 at 02:32:49PM +, Peter Maydell wrote: > > I've just spent a day or so trying to track down why PCI passthrough > > of a virtio-blk-pci device wasn't working. The problem turns out to be > > that by default

Re: [PATCH v1 0/3] virtio-mem: Support VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE

2021-11-30 Thread Michael S. Tsirkin
On Tue, Nov 30, 2021 at 10:28:35AM +0100, David Hildenbrand wrote: > Support VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE in QEMU, which indicates to > a guest that we don't support reading unplugged memory. We indicate > the feature based on a new "unplugged-inaccessible" property available > for x86

Re: [PATCH v1 1/3] linux-headers: sync VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE

2021-11-30 Thread Michael S. Tsirkin
On Tue, Nov 30, 2021 at 10:28:36AM +0100, David Hildenbrand wrote: > TODO: replace by a proper header sync. what's the plan for this patchset then? > Signed-off-by: David Hildenbrand > --- > include/standard-headers/linux/virtio_mem.h | 9 ++--- > 1 file changed, 6 insertions(+), 3

Re: why is iommu_platform set to off by default?

2021-11-30 Thread Michael S. Tsirkin
On Tue, Nov 30, 2021 at 02:32:49PM +, Peter Maydell wrote: > I've just spent a day or so trying to track down why PCI passthrough > of a virtio-blk-pci device wasn't working. The problem turns out to be > that by default virtio pci devices don't use the IOMMU, even when the > machine model has

Re: [PATCH] virtio: signal after wrapping packed used_idx

2021-11-30 Thread Michael S. Tsirkin
On Tue, Nov 30, 2021 at 01:45:10PM +, Stefan Hajnoczi wrote: > Packed Virtqueues wrap used_idx instead of letting it run freely like > Split Virtqueues do. If the used ring wraps more than once there is no > way to compare vq->signalled_used and vq->used_idx in > virtio_packed_should_notify()

[RFC PATCH v2 3/4] target/ppc: Remove the software TLB model of 7450 CPUs

2021-11-30 Thread Fabiano Rosas
(Applies to 7441, 7445, 7450, 7451, 7455, 7457, 7447, 7447a and 7448) The QEMU-side software TLB implementation for the 7450 family of CPUs is being removed due to lack of known users in the real world. The last users in the code were removed by the two previous commits. A brief history: The

[RFC PATCH v2 4/4] tests/avocado: ppc: Add smoke tests for MPC7400 and MPC7450 families

2021-11-30 Thread Fabiano Rosas
These tests ensure that our emulation for these cpus is not completely broken and we can at least run OpenBIOS on them. $ make check-avocado AVOCADO_TESTS=../tests/avocado/ppc_74xx.py Signed-off-by: Fabiano Rosas Reviewed-by: Willian Rampazzo --- Note that the 7450s depend on an OpenBIOS

[RFC PATCH v2 1/4] target/ppc: Disable software TLB for the 7450 family

2021-11-30 Thread Fabiano Rosas
(Applies to 7441, 7445, 7450, 7451, 7455, 7457, 7447 and 7447a)* We have since 2011 [1] been unable to run OpenBIOS in the 7450s and have not heard of any other software that is used with those CPUs in QEMU. A current discussion [2] shows that the 7450 software TLB is unsupported in Linux 5.15,

[RFC PATCH v2 2/4] target/ppc: Disable unused facilities in the e600 CPU

2021-11-30 Thread Fabiano Rosas
The e600 CPU is a successor of the 7448 and like all the 7450s CPUs, it has an optional software TLB feature. We have determined that there is no OS software support for the 7450 software TLB available these days. See the previous commit for more information. This patch disables the SPRs and

[RFC PATCH v2 0/4] QEMU/openbios: PPC Software TLB support in the G4 family

2021-11-30 Thread Fabiano Rosas
Hi all, Recap: - QEMU enables 7450 SW TLB search by default; - OpenBIOS does not know about SW TLB (vectors 0x1000, 0x1100, 0x1200); - OpenBIOS does not know about 7450s PVRs. Proposed solutions: a) find another firmware/guest OS code that supports the feature; b) implement the switching of

Re: [PATCH v8 06/10] target/ppc: enable PMU instruction count

2021-11-30 Thread Daniel Henrique Barboza
On 11/29/21 01:36, David Gibson wrote: On Thu, Nov 25, 2021 at 12:08:13PM -0300, Daniel Henrique Barboza wrote: The PMU is already counting cycles by calculating time elapsed in nanoseconds. Counting instructions is a different matter and requires another approach. This patch adds the

Re: [PATCH 2/2] hw/mips/boston: Fix load_elf error detection

2021-11-30 Thread Philippe Mathieu-Daudé
On 11/30/21 22:17, Jiaxun Yang wrote: > load_elf gives negative return in case of error, not zero. > > Fixes: 10e3f30 ("hw/mips/boston: Allow loading elf kernel and dtb") > Signed-off-by: Jiaxun Yang > --- > For 6.2. > --- > hw/mips/boston.c | 5 +++-- > 1 file changed, 3 insertions(+), 2

Re: [PATCH 1/2] hw/mips: bootloader: Fix write_ulong

2021-11-30 Thread Philippe Mathieu-Daudé
On 11/30/21 22:17, Jiaxun Yang wrote: > bl_gen_write_ulong uses sd for both 32 and 64 bit CPU, > while sd is illegal on 32 bit CPUs. > > Replace sd with sw on 32bit CPUs. > > Fixes: 3ebbf86 ("hw/mips: Add a bootloader helper") > Signed-off-by: Jiaxun Yang > --- > Should be backported to 6.0

[PATCH 2/2] hw/mips/boston: Fix load_elf error detection

2021-11-30 Thread Jiaxun Yang
load_elf gives negative return in case of error, not zero. Fixes: 10e3f30 ("hw/mips/boston: Allow loading elf kernel and dtb") Signed-off-by: Jiaxun Yang --- For 6.2. --- hw/mips/boston.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/mips/boston.c

[PATCH 1/2] hw/mips: bootloader: Fix write_ulong

2021-11-30 Thread Jiaxun Yang
bl_gen_write_ulong uses sd for both 32 and 64 bit CPU, while sd is illegal on 32 bit CPUs. Replace sd with sw on 32bit CPUs. Fixes: 3ebbf86 ("hw/mips: Add a bootloader helper") Signed-off-by: Jiaxun Yang --- Should be backported to 6.0 onwards. --- hw/mips/bootloader.c | 6 +- 1 file

[PATCH 0/2] MIPS misc fixes

2021-11-30 Thread Jiaxun Yang
Two problems caught when I was trying to add CI job for various configurations. Jiaxun Yang (2): hw/mips: bootloader: Fix write_ulong hw/mips/boston: Fix elf_load error detection hw/mips/bootloader.c | 6 +- hw/mips/boston.c | 5 +++-- 2 files changed, 8 insertions(+), 3

Re: [PATCH] target/arm: Correct calculation of tlb range invalidate length

2021-11-30 Thread Alex Bennée
Peter Maydell writes: > The calculation of the length of TLB range invalidate operations > in tlbi_aa64_range_get_length() is incorrect in two ways: > * the NUM field is 5 bits, but we read only 4 bits > * we miscalculate the page_shift value, because of an >off-by-one error: > TG

Re: [PATCH v4] target/ppc: fix Hash64 MMU update of PTE bit R

2021-11-30 Thread Leandro Lupori
On 30/11/2021 05:44, Cédric Le Goater wrote: It would be interesting to boot directly the PowerNV machine from a FreeBSB kernel and a minimum inirtd without using the skiroot images and an iso. Are images available ? AFAIK there are no minimum initrd images available. The closest thing would

[Bug 1749393] Re: sbrk() not working under qemu-user with a PIE-compiled binary?

2021-11-30 Thread Brian Murray
Hello Raphaël, or anyone else affected, Accepted qemu into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/qemu/1:4.2-3ubuntu6.19 in a few hours, and then in the -proposed repository. Please help us by testing this new package. See

Re: [PATCH v5 5/6] migration: Add migrate_use_tls() helper

2021-11-30 Thread Leonardo Bras Soares Passos
Hello Juan, Thanks for reviewing! Best regards, Leo On Fri, Nov 12, 2021 at 8:04 AM Juan Quintela wrote: > Leonardo Bras wrote: > > A lot of places check parameters.tls_creds in order to evaluate if TLS is > > in use, and sometimes call migrate_get_current() just for that test. > > > > Add

Re: Odd square bracket encoding in QOM names

2021-11-30 Thread Mark Cave-Ayland
On 30/11/2021 16:41, Peter Maydell wrote: On Tue, 30 Nov 2021 at 08:36, Mark Cave-Ayland wrote: Has there been a recent change as to how square brackets are encoded within QOM names? I noticed that the output has changed here in the "info qom-tree" output in qemu-system-m68k for the q800

Re: Follow-up on the CXL discussion at OFTC

2021-11-30 Thread Ben Widawsky
On 21-11-30 13:09:56, Jonathan Cameron wrote: > On Mon, 29 Nov 2021 18:28:43 + > Alex Bennée wrote: > > > Ben Widawsky writes: > > > > > On 21-11-26 12:08:08, Alex Bennée wrote: > > >> > > >> Ben Widawsky writes: > > >> > > >> > On 21-11-19 02:29:51, Shreyas Shah wrote: > > >> >>

Re: [PATCH] target/arm: Correct calculation of tlb range invalidate length

2021-11-30 Thread Richard Henderson
On 11/30/21 6:32 PM, Peter Maydell wrote: The calculation of the length of TLB range invalidate operations in tlbi_aa64_range_get_length() is incorrect in two ways: * the NUM field is 5 bits, but we read only 4 bits * we miscalculate the page_shift value, because of an off-by-one error:

[PATCH] target/arm: Correct calculation of tlb range invalidate length

2021-11-30 Thread Peter Maydell
The calculation of the length of TLB range invalidate operations in tlbi_aa64_range_get_length() is incorrect in two ways: * the NUM field is 5 bits, but we read only 4 bits * we miscalculate the page_shift value, because of an off-by-one error: TG 0b00 is invalid TG 0b01 is 4K

[PATCH] scripts/entitlement.sh: Use backward-compatible cp flags

2021-11-30 Thread Evan Miller
Older versions of Mac OS X do not support cp -a. The cp man page indicates that -a is equivalent to -pPR. Signed-off-by: Evan Miller --- scripts/entitlement.sh.orig +++ scripts/entitlement.sh @@ -15,7 +15,7 @@ if $in_place; then trap 'rm "$DST.tmp"' exit - cp -af "$SRC" "$DST.tmp" + cp

Re: Odd square bracket encoding in QOM names

2021-11-30 Thread Peter Maydell
On Tue, 30 Nov 2021 at 08:36, Mark Cave-Ayland wrote: > Has there been a recent change as to how square brackets are encoded within > QOM > names? I noticed that the output has changed here in the "info qom-tree" > output in > qemu-system-m68k for the q800 machine. > > The q800 machine has a

Re: [PATCH v3 2/3] test/tcg/ppc64le: test mtfsf

2021-11-30 Thread Cédric Le Goater
Hello Lucas, On 11/24/21 18:25, Lucas Mateus Castro (alqotel) wrote: Added tests for the mtfsf to check if FI bit of FPSCR is being set and if exception calls are being made correctly. Signed-off-by: Lucas Mateus Castro (alqotel) Could you please rebase on mainline and resend ? Thanks, C.

Re: why is iommu_platform set to off by default?

2021-11-30 Thread Stefan Hajnoczi
On Tue, Nov 30, 2021 at 02:32:49PM +, Peter Maydell wrote: > I've just spent a day or so trying to track down why PCI passthrough > of a virtio-blk-pci device wasn't working. The problem turns out to be > that by default virtio pci devices don't use the IOMMU, even when the > machine model has

Re: [PATCH v1 0/8] virtio-mem: Support "prealloc=on"

2021-11-30 Thread Michal Prívozník
On 11/30/21 11:41, David Hildenbrand wrote: > Based-on: <20211130092838.24224-1-da...@redhat.com> > > Patch #1 - #7 are fully reviewed [1] but did not get picked up yet, so I'm > sending them along here, as they are required to use os_mem_prealloc() in > a safe way once the VM is running. > >

Re: [PATCH V6 19/27] vfio-pci: cpr part 1 (fd and dma)

2021-11-30 Thread Steven Sistare
On 11/10/2021 2:48 AM, Zheng Chuan wrote: > > Hi, steve > > On 2021/8/11 1:06, Alex Williamson wrote: >> On Fri, 6 Aug 2021 14:43:53 -0700 >> Steve Sistare wrote: >> [...] >>> +static int >>> +vfio_region_remap(MemoryRegionSection *section, void *handle, Error **errp) >>> +{ >>> +

Re: [PATCH v7 0/3] support dirty restraint on vCPU

2021-11-30 Thread Hyman Huang
On 11/30/21 22:57, Hyman Huang wrote: 1. Start vm with kernel+initrd.img with qemu command line as following: [root@Hyman_server1 fast_qemu]# cat vm.sh #!/bin/bash /usr/bin/qemu-system-x86_64 \     -display none -vga none \     -name guest=simple_vm,debug-threads=on \     -monitor stdio \

Re: [PATCH v1 3/3] virtio-mem: Set "unplugged-inaccessible=auto" for the 6.2 machine on x86

2021-11-30 Thread David Hildenbrand
On 30.11.21 16:34, Michal Prívozník wrote: > On 11/30/21 10:28, David Hildenbrand wrote: >> Set the new default to "auto", keeping it set to "on" for compat > > I believe you wanted to say: keeping it set to "off", because that's > what the patch does. Right, I switched semantics from a

Re: [PATCH 2/2] hw/core/loader: workaround read() size limit.

2021-11-30 Thread Jamie Iles
Hi Philippe, On Thu, Nov 11, 2021 at 05:04:56PM +, Jamie Iles wrote: > On Thu, Nov 11, 2021 at 04:55:35PM +0100, Philippe Mathieu-Daudé wrote: > > On 11/11/21 16:43, Philippe Mathieu-Daudé wrote: > > > On 11/11/21 16:36, Jamie Iles wrote: > > >> Hi Philippe, > > >> > > >> On Thu, Nov 11, 2021

Re: [PATCH v1 2/3] virtio-mem: Support VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE

2021-11-30 Thread Michal Prívozník
On 11/30/21 10:28, David Hildenbrand wrote: > With VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE, we signal the VM that reading > unplugged memory is not supported. We have to fail feature negotiation > in case the guest does not support VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE. > > First,

Re: [PATCH v1 1/3] linux-headers: sync VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE

2021-11-30 Thread Michal Prívozník
On 11/30/21 10:28, David Hildenbrand wrote: > TODO: replace by a proper header sync. > > Signed-off-by: David Hildenbrand > --- > include/standard-headers/linux/virtio_mem.h | 9 ++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > > diff --git

Re: [PATCH v1 3/3] virtio-mem: Set "unplugged-inaccessible=auto" for the 6.2 machine on x86

2021-11-30 Thread Michal Prívozník
On 11/30/21 10:28, David Hildenbrand wrote: > Set the new default to "auto", keeping it set to "on" for compat I believe you wanted to say: keeping it set to "off", because that's what the patch does. > machines. This property is only available for x86 targets. > > TODO: once 6.2 was released

Re: [PATCH v7 3/3] cpus-common: implement dirty page limit on vCPU

2021-11-30 Thread Hyman Huang
On 11/30/21 21:21, Peter Xu wrote: On Tue, Nov 30, 2021 at 06:28:13PM +0800, huang...@chinatelecom.cn wrote: ## +# @set-dirty-limit: +# +# Set the upper limit of dirty page rate for a virtual CPU. +# +# Requires KVM with accelerator property "dirty-ring-size" set. +# A virtual CPU's dirty

Re: [PATCH v7 1/3] migration/dirtyrate: implement vCPU dirtyrate calculation periodically

2021-11-30 Thread Hyman Huang
On 11/30/21 21:04, Peter Xu wrote: On Tue, Nov 30, 2021 at 06:28:11PM +0800, huang...@chinatelecom.cn wrote: +static void dirtylimit_calc_func(void) +{ +CPUState *cpu; +DirtyPageRecord *dirty_pages; +int64_t start_time, end_time, calc_time; +DirtyRateVcpu rate; +int i =

Re: [PATCH] memory: Fix incorrect calls of log_global_start/stop

2021-11-30 Thread David Hildenbrand
On 30.11.21 09:00, Peter Xu wrote: > We should only call the log_global_start/stop when the global dirty track > bitmask changes from zero<->non-zero. > > No real issue reported for this yet probably because no immediate user to > enable both dirty rate measurement and migration at the same time.

Re: [PATCH v7 0/3] support dirty restraint on vCPU

2021-11-30 Thread Hyman Huang
1. Start vm with kernel+initrd.img with qemu command line as following: [root@Hyman_server1 fast_qemu]# cat vm.sh #!/bin/bash /usr/bin/qemu-system-x86_64 \ -display none -vga none \ -name guest=simple_vm,debug-threads=on \ -monitor stdio \ -machine pc-i440fx-2.12 \ -accel

why is iommu_platform set to off by default?

2021-11-30 Thread Peter Maydell
I've just spent a day or so trying to track down why PCI passthrough of a virtio-blk-pci device wasn't working. The problem turns out to be that by default virtio pci devices don't use the IOMMU, even when the machine model has created an IOMMU and arranged for the PCI bus to be underneath it. So

Re: [PATCH 2/2] intel_iommu: Fix irqchip / X2APIC configuration checks

2021-11-30 Thread Claudio Fontana
Acked-by: Claudio Fontana I'll try to find time tonight to give you a tested by. Ciao, Claudio On 11/30/21 2:42 PM, David Woodhouse wrote: > We don't need to check kvm_enable_x2apic(). It's perfectly OK to support > interrupt remapping even if we can't address CPUs above 254. Kind of >

[PATCH] virtio: signal after wrapping packed used_idx

2021-11-30 Thread Stefan Hajnoczi
Packed Virtqueues wrap used_idx instead of letting it run freely like Split Virtqueues do. If the used ring wraps more than once there is no way to compare vq->signalled_used and vq->used_idx in virtio_packed_should_notify() since they are modulo vq->vring.num. This causes the device to stop

[PATCH 2/2] intel_iommu: Fix irqchip / X2APIC configuration checks

2021-11-30 Thread David Woodhouse
We don't need to check kvm_enable_x2apic(). It's perfectly OK to support interrupt remapping even if we can't address CPUs above 254. Kind of pointless, but still functional. The check on kvm_enable_x2apic() needs to happen *anyway* in order to allow CPUs above 254 even without an IOMMU, so allow

[PATCH 1/2] target/i386: Fix sanity check on max APIC ID / X2APIC enablement

2021-11-30 Thread David Woodhouse
The check on x86ms->apic_id_limit in pc_machine_done() had two problems. Firstly, we need KVM to support the X2APIC API in order to allow IRQ delivery to APICs >= 255. So we need to call/check kvm_enable_x2apic(), which was done elsewhere in *some* cases but not all. Secondly, microvm needs the

[PATCH v2 1/2] ppc/pnv.c: add a friendly warning when accel=kvm is used

2021-11-30 Thread Daniel Henrique Barboza
If one tries to use -machine powernv9,accel=kvm in a Power9 host, a cryptic error will be shown: qemu-system-ppc64: Register sync failed... If you're using kvm-hv.ko, only "-cpu host" is possible qemu-system-ppc64: kvm_init_vcpu: kvm_arch_init_vcpu failed (0): Invalid argument Appending '-cpu

[PATCH v2 2/2] docs/system/ppc/powernv.rst: document KVM support status

2021-11-30 Thread Daniel Henrique Barboza
Put in a more accessible place the reasoning behind our decision to officially drop KVM support in the powernv machine. Signed-off-by: Daniel Henrique Barboza --- docs/system/ppc/powernv.rst | 13 + 1 file changed, 13 insertions(+) diff --git a/docs/system/ppc/powernv.rst

[PATCH v2 0/2] ppc/pnv.c: add a friendly warning when accel=kvm is used

2021-11-30 Thread Daniel Henrique Barboza
Hi, In this version a documentation patch was added to explain our motivations to officially disable KVM accel in the powernv machine. Changes from v1: - added a doc patch - v1 link: https://lists.gnu.org/archive/html/qemu-devel/2021-11/msg05207.html Daniel Henrique Barboza (2): ppc/pnv.c:

Re: [PATCH v7 3/3] cpus-common: implement dirty page limit on vCPU

2021-11-30 Thread Peter Xu
On Tue, Nov 30, 2021 at 06:28:13PM +0800, huang...@chinatelecom.cn wrote: > ## > +# @set-dirty-limit: > +# > +# Set the upper limit of dirty page rate for a virtual CPU. > +# > +# Requires KVM with accelerator property "dirty-ring-size" set. > +# A virtual CPU's dirty page rate is a measure of

Re: [PATCH for-6.2 v2] block/nbd: forbid incompatible change of server options on reconnect

2021-11-30 Thread Vladimir Sementsov-Ogievskiy
30.11.2021 00:53, Vladimir Sementsov-Ogievskiy wrote: Reconnect feature was never prepared to handle server options changed on reconnect. Let's be stricter and check what exactly is changed. If server capabilities just got richer don't worry. Otherwise fail and drop the established connection.

Re: Follow-up on the CXL discussion at OFTC

2021-11-30 Thread Jonathan Cameron via
On Mon, 29 Nov 2021 18:28:43 + Alex Bennée wrote: > Ben Widawsky writes: > > > On 21-11-26 12:08:08, Alex Bennée wrote: > >> > >> Ben Widawsky writes: > >> > >> > On 21-11-19 02:29:51, Shreyas Shah wrote: > >> >> Hi Ben > >> >> > >> >> Are you planning to add the CXL2.0 switch

Re: [PATCH v7 1/3] migration/dirtyrate: implement vCPU dirtyrate calculation periodically

2021-11-30 Thread Peter Xu
On Tue, Nov 30, 2021 at 06:28:11PM +0800, huang...@chinatelecom.cn wrote: > +static void dirtylimit_calc_func(void) > +{ > +CPUState *cpu; > +DirtyPageRecord *dirty_pages; > +int64_t start_time, end_time, calc_time; > +DirtyRateVcpu rate; > +int i = 0; > + > +dirty_pages =

Re: [PATCH v7 0/3] support dirty restraint on vCPU

2021-11-30 Thread Peter Xu
On Tue, Nov 30, 2021 at 06:28:10PM +0800, huang...@chinatelecom.cn wrote: > From: Hyman Huang(黄勇) > > The patch [2/3] has not been touched so far. Any corrections and > suggetions are welcome. I played with it today, but the vcpu didn't got throttled as expected. What I did was starting two

Re: [PATCH 2/3] target/m68k: Implement TRAPcc

2021-11-30 Thread Richard Henderson
On 11/30/21 12:57 PM, Laurent Vivier wrote: +DISAS_INSN(trapcc) +{ +    /* Consume and discard the immediate operand. */ +    switch (extract32(insn, 0, 3)) { +    case 2: /* trapcc.w */ +    (void)read_im16(env, s); +    break; +    case 3: /* trapcc.l */ +    (void)read_im32(env,

Re: unable to execute QEMU command 'qom-get': Property 'sgx-epc.unavailable-features' not found

2021-11-30 Thread Yang Zhong
On Thu, Nov 25, 2021 at 08:47:22PM +0800, Yang Zhong wrote: > Hello Paolo, > > Our customer used the Libvirt XML to start a SGX VM, but failed. > > libvirt.libvirtError: internal error: unable to execute QEMU command > 'qom-get': Property 'sgx-epc.unavailable-features' not found > > The XML

Re: [PATCH for-6.1 v2] i386: do not call cpudef-only models functions for max, host, base

2021-11-30 Thread David Woodhouse
On Tue, 2021-11-30 at 10:00 +0100, Claudio Fontana wrote: > I tend to agree that what we want if kvm_enable_x2apic fails is to abort QEMU > if we have been requesting smp > 255, > and if we did not request smp > 255 cpus, we want to not advertise the > feature. > > This is not accomplished,

Re: [PATCH 1/3] target/m68k: Implement TRAPV

2021-11-30 Thread Laurent Vivier
Le 30/11/2021 à 11:37, Richard Henderson a écrit : Signed-off-by: Richard Henderson --- target/m68k/translate.c | 17 + 1 file changed, 17 insertions(+) diff --git a/target/m68k/translate.c b/target/m68k/translate.c index af43c8eab8..858ba761fc 100644 ---

Re: [PATCH v3 17/23] multifd: Use normal pages array on the send side

2021-11-30 Thread Juan Quintela
"Dr. David Alan Gilbert" wrote: > * Juan Quintela (quint...@redhat.com) wrote: >> Signed-off-by: Juan Quintela > > Can you explain a bit more what's going on here? Sorry. Until patch 20, we have what we had always have: pages that are sent through multifd (non zero pages). We are going to

Re: [PATCH 2/3] target/m68k: Implement TRAPcc

2021-11-30 Thread Laurent Vivier
Le 30/11/2021 à 11:37, Richard Henderson a écrit : Resolves: https://gitlab.com/qemu-project/qemu/-/issues/754 Signed-off-by: Richard Henderson --- target/m68k/cpu.h | 2 ++ target/m68k/cpu.c | 1 + target/m68k/translate.c | 21 + 3 files changed, 24

Re: [PATCH 3/3] target/m68k: Implement FTRAPcc

2021-11-30 Thread Richard Henderson
On 11/30/21 11:37 AM, Richard Henderson wrote: +INSN(ftrapcc, f278, ff80, FPU); Whoops, mask should be fff8. r~

[PATCH] aio-posix: split poll check from ready handler

2021-11-30 Thread Stefan Hajnoczi
Adaptive polling measures the execution time of the polling check plus handlers called when a polled event becomes ready. Handlers can take a significant amount of time, making it look like polling was running for a long time when in fact the event handler was running for a long time. For

Re: [PATCH v3 17/23] multifd: Use normal pages array on the send side

2021-11-30 Thread Dr. David Alan Gilbert
* Juan Quintela (quint...@redhat.com) wrote: > Signed-off-by: Juan Quintela Can you explain a bit more what's going on here? Dave > --- > migration/multifd.h | 8 ++-- > migration/multifd-zlib.c | 6 +++--- > migration/multifd-zstd.c | 6 +++--- > migration/multifd.c | 30

[PATCH v1 8/8] virtio-mem: Support "prealloc=on" option

2021-11-30 Thread David Hildenbrand
For scarce memory resources, such as hugetlb, we want to be able to prealloc such memory resources in order to not crash later on access. On simple user errors we could otherwise easily run out of memory resources an crash the VM -- pretty much undesired. For ordinary memory devices, such as

[PATCH v1 6/8] util/oslib-posix: Support concurrent os_mem_prealloc() invocation

2021-11-30 Thread David Hildenbrand
Add a mutex to protect the SIGBUS case, as we cannot mess concurrently with the sigbus handler and we have to manage the global variable sigbus_memset_context. The MADV_POPULATE_WRITE path can run concurrently. Note that page_mutex and page_cond are shared between concurrent invocations, which

[PATCH v1 7/8] util/oslib-posix: Forward SIGBUS to MCE handler under Linux

2021-11-30 Thread David Hildenbrand
Temporarily modifying the SIGBUS handler is really nasty, as we might be unlucky and receive an MCE SIGBUS while having our handler registered. Unfortunately, there is no way around messing with SIGBUS when MADV_POPULATE_WRITE is not applicable or not around. Let's forward SIGBUS that don't

Re: [PATCH v3 16/23] multifd: Unfold "used" variable by its value

2021-11-30 Thread Dr. David Alan Gilbert
* Juan Quintela (quint...@redhat.com) wrote: > Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert > --- > migration/multifd.c | 8 +++- > 1 file changed, 3 insertions(+), 5 deletions(-) > > diff --git a/migration/multifd.c b/migration/multifd.c > index

[PATCH v1 3/8] util/oslib-posix: Introduce and use MemsetContext for touch_all_pages()

2021-11-30 Thread David Hildenbrand
Let's minimize the number of global variables to prepare for os_mem_prealloc() getting called concurrently and make the code a bit easier to read. The only consumer that really needs a global variable is the sigbus handler, which will require protection via a mutex in the future either way as we

[PATCH v1 4/8] util/oslib-posix: Don't create too many threads with small memory or little pages

2021-11-30 Thread David Hildenbrand
Let's limit the number of threads to something sane, especially that - We don't have more threads than the number of pages we have - We don't have threads that initialize small (< 64 MiB) memory Reviewed-by: Pankaj Gupta Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Daniel P. Berrangé

[PATCH v1 5/8] util/oslib-posix: Avoid creating a single thread with MADV_POPULATE_WRITE

2021-11-30 Thread David Hildenbrand
Let's simplify the case when we only want a single thread and don't have to mess with signal handlers. Reviewed-by: Pankaj Gupta Reviewed-by: Daniel P. Berrangé Signed-off-by: David Hildenbrand --- util/oslib-posix.c | 8 1 file changed, 8 insertions(+) diff --git

[PATCH v1 2/8] util/oslib-posix: Support MADV_POPULATE_WRITE for os_mem_prealloc()

2021-11-30 Thread David Hildenbrand
Let's sense support and use it for preallocation. MADV_POPULATE_WRITE does not require a SIGBUS handler, doesn't actually touch page content, and avoids context switches; it is, therefore, faster and easier to handle than our current approach. While MADV_POPULATE_WRITE is, in general, faster than

[PATCH v7 0/3] support dirty restraint on vCPU

2021-11-30 Thread huangy81
From: Hyman Huang(黄勇) The patch [2/3] has not been touched so far. Any corrections and suggetions are welcome. Please review, thanks! v7: - rebase on master - polish the comments and error message according to the advices given by Markus - introduce dirtylimit_enabled function to pre-check

[PATCH v1 0/8] virtio-mem: Support "prealloc=on"

2021-11-30 Thread David Hildenbrand
Based-on: <20211130092838.24224-1-da...@redhat.com> Patch #1 - #7 are fully reviewed [1] but did not get picked up yet, so I'm sending them along here, as they are required to use os_mem_prealloc() in a safe way once the VM is running. Support preallocation of memory to make virtio-mem safe to

[PATCH v1 1/8] util/oslib-posix: Let touch_all_pages() return an error

2021-11-30 Thread David Hildenbrand
Let's prepare touch_all_pages() for returning differing errors. Return an error from the thread and report the last processed error. Translate SIGBUS to -EFAULT, as a SIGBUS can mean all different kind of things (memory error, read error, out of memory). When allocating memory fails via the

[PATCH 2/3] target/m68k: Implement TRAPcc

2021-11-30 Thread Richard Henderson
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/754 Signed-off-by: Richard Henderson --- target/m68k/cpu.h | 2 ++ target/m68k/cpu.c | 1 + target/m68k/translate.c | 21 + 3 files changed, 24 insertions(+) diff --git a/target/m68k/cpu.h

[PATCH v7 2/3] cpu-throttle: implement vCPU throttle

2021-11-30 Thread huangy81
From: Hyman Huang(黄勇) Impose dirty restraint on vCPU by kicking it and sleep as the auto-converge does during migration, but just kick the specified vCPU instead, not all vCPUs of vm. Start a thread to track the dirtylimit status and adjust the throttle pencentage dynamically depend on current

[PATCH v7 1/3] migration/dirtyrate: implement vCPU dirtyrate calculation periodically

2021-11-30 Thread huangy81
From: Hyman Huang(黄勇) Introduce the third method GLOBAL_DIRTY_LIMIT of dirty tracking for calculate dirtyrate periodly for dirty restraint. Implement thread for calculate dirtyrate periodly, which will be used for dirty restraint. Add dirtylimit.h to introduce the util function for dirty limit

[PATCH 3/3] target/m68k: Implement FTRAPcc

2021-11-30 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/m68k/translate.c | 38 ++ 1 file changed, 38 insertions(+) diff --git a/target/m68k/translate.c b/target/m68k/translate.c index cf29f35d91..3c04f9d1a9 100644 --- a/target/m68k/translate.c +++

[PATCH 1/3] target/m68k: Implement TRAPV

2021-11-30 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/m68k/translate.c | 17 + 1 file changed, 17 insertions(+) diff --git a/target/m68k/translate.c b/target/m68k/translate.c index af43c8eab8..858ba761fc 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -4863,6

[PATCH for-7.0 0/3] target/m68k: Implement conditional traps

2021-11-30 Thread Richard Henderson
While looking at #754 for trapcc, I noticed that the other conditional traps, trapv and ftrapcc, are also missing. r~ Richard Henderson (3): target/m68k: Implement TRAPV target/m68k: Implement TRAPcc target/m68k: Implement FTRAPcc target/m68k/cpu.h | 2 ++ target/m68k/cpu.c

[PATCH v7 3/3] cpus-common: implement dirty page limit on vCPU

2021-11-30 Thread huangy81
From: Hyman Huang(黄勇) Implement dirtyrate calculation periodically basing on dirty-ring and throttle vCPU until it reachs the quota dirty page rate given by user. Introduce qmp commands set-dirty-limit/cancel-dirty-limit to set/cancel dirty page limit on vCPU. Signed-off-by: Hyman Huang(黄勇)

[Bug 1749393] Re: sbrk() not working under qemu-user with a PIE-compiled binary?

2021-11-30 Thread Christian Ehrhardt 
Uploaded to F-unapproved, waiting for the SRU team to accept it. -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1749393 Title: sbrk() not working under qemu-user with a PIE-compiled binary? Status

Re: [PATCH for-7.0 0/4] qemu-common.h include cleanup

2021-11-30 Thread Markus Armbruster
Peter Maydell writes: > On Mon, 29 Nov 2021 at 20:05, Peter Maydell wrote: >> >> qemu-common.h has a comment at the top: >> >> * This file is supposed to be included only by .c files. No header file >> should >> * depend on qemu-common.h, as this would easily lead to circular header >> *

[PATCH v2 1/4] block_int: make bdrv_backing_overridden static

2021-11-30 Thread Emanuele Giuseppe Esposito
bdrv_backing_overridden is only used in block.c, so there is no need to leave it in block_int.h Signed-off-by: Emanuele Giuseppe Esposito --- block.c | 4 +++- include/block/block_int.h | 3 --- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/block.c b/block.c

[PATCH v2 4/4] include/sysemu/blockdev.h: remove drive_get_max_devs

2021-11-30 Thread Emanuele Giuseppe Esposito
Remove drive_get_max_devs, as it is not used by anyone. Last use was removed in commit 8f2d75e81d5 ("hw: Drop superfluous special checks for orphaned -drive"). Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Philippe Mathieu-Daudé --- blockdev.c| 17 -

[PATCH v2 2/4] include/sysemu/blockdev.c: introduce block_if_name

2021-11-30 Thread Emanuele Giuseppe Esposito
Add a getter function for the if_name array, so that also outside functions can access it. Signed-off-by: Emanuele Giuseppe Esposito --- blockdev.c| 5 + include/sysemu/blockdev.h | 1 + 2 files changed, 6 insertions(+) diff --git a/blockdev.c b/blockdev.c index

  1   2   >