Re: [PULL 0/2] Block patches

2021-03-24 Thread Peter Maydell
On Wed, 24 Mar 2021 at 20:18, Vladimir Sementsov-Ogievskiy wrote: > > 24.03.2021 21:05, Peter Maydell wrote: > > On Wed, 24 Mar 2021 at 14:52, Stefan Hajnoczi wrote: > >> > >> Vladimir Sementsov-Ogievskiy (2): > >>migration/block-dirty-bitmap: make incoming disabled bitmaps busy > >>

Re: [PATCH v2 05/10] Acceptance Tests: add port redirection for ssh by default

2021-03-24 Thread Willian Rampazzo
On Tue, Mar 23, 2021 at 7:16 PM Cleber Rosa wrote: > > For users of the LinuxTest class, let's set up the VM with the port > redirection for SSH, instead of requiring each test to set the same > arguments. > > Signed-off-by: Cleber Rosa > --- > tests/acceptance/avocado_qemu/__init__.py | 4 +++-

Re: [PATCH v2 03/10] Python: add utility function for retrieving port redirection

2021-03-24 Thread Willian Rampazzo
On Tue, Mar 23, 2021 at 7:16 PM Cleber Rosa wrote: > > Slightly different versions for the same utility code are currently > present on different locations. This unifies them all, giving > preference to the version from virtiofs_submounts.py, because of the > last tweaks added to it. > > While

Re: [PATCH 10/28] qapi: Rework name checking in preparation of stricter checking

2021-03-24 Thread John Snow
On 3/24/21 1:57 AM, Markus Armbruster wrote: John Snow writes: On 3/23/21 5:40 AM, Markus Armbruster wrote: Naming rules differ for the various kinds of names. To prepare enforcing them, define functions to check them: check_name_upper(), check_name_lower(), and check_name_camel(). For

Re: [RFC v11 21/55] target/arm: move arm_mmu_idx* to cpu-mmu

2021-03-24 Thread Richard Henderson
On 3/23/21 9:46 AM, Claudio Fontana wrote: Signed-off-by: Claudio Fontana --- target/arm/cpu-mmu.c| 95 + target/arm/tcg/helper.c | 95 - 2 files changed, 95 insertions(+), 95 deletions(-) Reviewed-by:

Re: [RFC v11 20/55] target/arm: split vfp state setting from tcg helpers

2021-03-24 Thread Richard Henderson
On 3/23/21 9:46 AM, Claudio Fontana wrote: cpu-vfp.c: vfp_get_fpsr and vfp_set_fpsr are needed also for KVM, so create a new cpu-vfp.c tcg/cpu-vfp.c: vfp_get_fpscr_from_host and vv are TCG-only, so we move the implementation to tcg/cpu-vfp.c kvm/helper-stubs.c:

Re: [PULL 0/2] Block patches

2021-03-24 Thread Vladimir Sementsov-Ogievskiy
24.03.2021 21:05, Peter Maydell wrote: On Wed, 24 Mar 2021 at 14:52, Stefan Hajnoczi wrote: The following changes since commit 67c1115edd98f388ca89dd38322ea3fadf034523: Merge remote-tracking branch 'remotes/kraxel/tags/ui-20210323-pull-request' into staging (2021-03-23 23:47:30 +)

[PATCH for-6.0 6/7] hw/block/nvme: update dmsrl limit on namespace detachment

2021-03-24 Thread Klaus Jensen
From: Klaus Jensen The Non-MDTS DMSRL limit must be recomputed when namespaces are detached. Fixes: 645ce1a70cb6 ("hw/block/nvme: support namespace attachment command") Signed-off-by: Klaus Jensen --- hw/block/nvme.c | 17 + 1 file changed, 17 insertions(+) diff --git

[PATCH for-6.0 4/7] hw/block/nvme: fix controller namespaces array indexing

2021-03-24 Thread Klaus Jensen
From: Klaus Jensen The controller namespaces array being 0-indexed requires 'nsid - 1' everywhere. Something that is easy to miss. Align the controller namespaces array with the subsystem namespaces array such that both are 1-indexed. Signed-off-by: Klaus Jensen --- hw/block/nvme.h | 8

[PATCH for-6.0 5/7] hw/block/nvme: fix warning about legacy namespace configuration

2021-03-24 Thread Klaus Jensen
From: Klaus Jensen Remove the unused BlockConf from the controller structure and fix the constraint checking to actually check the right BlockConf and issue the warning. Signed-off-by: Klaus Jensen --- hw/block/nvme.h | 1 - hw/block/nvme.c | 2 +- 2 files changed, 1 insertion(+), 2

[PATCH for-6.0 2/7] hw/block/nvme: fix missing string representation for ns attachment

2021-03-24 Thread Klaus Jensen
From: Klaus Jensen Add the missing nvme_adm_opc_str entry for the Namespace Attachment command. Signed-off-by: Klaus Jensen --- hw/block/nvme.h | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/block/nvme.h b/hw/block/nvme.h index 5b0031b11db2..9edc86d79e98 100644 --- a/hw/block/nvme.h

[PATCH for-6.0 7/7] hw/block/nvme: fix handling of private namespaces

2021-03-24 Thread Klaus Jensen
From: Klaus Jensen Prior to this patch, if a private nvme-ns device (that is, a namespace that is not linked to a subsystem) is wired up to an nvme-subsys linked nvme controller device, the device fails to verify that the namespace id is unique within the subsystem. NVM Express v1.4b, Section

Re: [PATCH 13/28] qapi: Enforce event naming rules

2021-03-24 Thread John Snow
On 3/24/21 2:22 AM, Markus Armbruster wrote: John Snow writes: On 3/23/21 5:40 AM, Markus Armbruster wrote: Event names should be ALL_CAPS with words separated by underscore. Enforce this. The only offenders are in tests/. Fix them. Existing test event-case covers the new error.

[PATCH for-6.0 3/7] hw/block/nvme: fix the nsid 'invalid' value

2021-03-24 Thread Klaus Jensen
From: Klaus Jensen The `nvme_nsid()` function returns '-1' (h) when the given namespace is NULL. Since h is actually a valid namespace identifier (the "broadcast" value), change this to be '0' since that actually *is* the invalid value. Signed-off-by: Klaus Jensen ---

[PATCH for-6.0 1/7] hw/block/nvme: fix pi constraint check

2021-03-24 Thread Klaus Jensen
From: Klaus Jensen Protection Information can only be enabled if there is at least 8 bytes of metadata. Signed-off-by: Klaus Jensen --- hw/block/nvme-ns.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/block/nvme-ns.c b/hw/block/nvme-ns.c index

[PATCH for-6.0 0/7] hw/block/nvme: misc fixes

2021-03-24 Thread Klaus Jensen
From: Klaus Jensen Various fixes for 6.0. Klaus Jensen (7): hw/block/nvme: fix pi constraint check hw/block/nvme: fix missing string representation for ns attachment hw/block/nvme: fix the nsid 'invalid' value hw/block/nvme: fix controller namespaces array indexing hw/block/nvme: fix

Re: [PATCH v2 0/2] hw/block/nvme: coverity fixes

2021-03-24 Thread Klaus Jensen
On Mar 22 13:09, Klaus Jensen wrote: > From: Klaus Jensen > > Fix two issues reported by coverity (CID 1451080 and 1451082). > > v2: > - replace [2/2] with a fix for the bad reference counting noticed by > Max > > Klaus Jensen (2): > hw/block/nvme: fix resource leak in nvme_dif_rw >

[PATCH v3] hw/isa/piix4: Migrate Reset Control Register

2021-03-24 Thread Philippe Mathieu-Daudé
When adding the Reset register in commit 5790b757cfb we forgot to migrate it. While it is possible a VM using the PIIX4 is migrated just after requesting a system shutdown, it is very unlikely. However when restoring a migrated VM, we might have the RCR bit #4 set on the stack and when the VM

Re: [PATCH v2] hw/isa/piix4: Migrate Reset Control Register

2021-03-24 Thread Philippe Mathieu-Daudé
On 3/24/21 8:40 PM, Dr. David Alan Gilbert wrote: > * Philippe Mathieu-Daudé (f4...@amsat.org) wrote: >> When adding the Reset register in commit 5790b757cfb we >> forgot to migrate it. >> >> While it is possible a VM using the PIIX4 is migrated just >> after requesting a system shutdown, it is

Re: [RFC PATCH 13/27] vhost: Send buffers to device

2021-03-24 Thread Stefan Hajnoczi
On Wed, Mar 24, 2021 at 08:04:07PM +0100, Eugenio Perez Martin wrote: > On Mon, Mar 22, 2021 at 6:40 PM Stefan Hajnoczi wrote: > > > > On Mon, Mar 22, 2021 at 04:55:13PM +0100, Eugenio Perez Martin wrote: > > > On Mon, Mar 22, 2021 at 11:51 AM Stefan Hajnoczi > > > wrote: > > > > > > > > On

Re: [PATCH v2 02/10] tests/acceptance/virtiofs_submounts.py: evaluate string not length

2021-03-24 Thread Willian Rampazzo
On Tue, Mar 23, 2021 at 7:15 PM Cleber Rosa wrote: > > If the vmlinuz variable is set to anything that evaluates to True, > then the respective arguments should be set. If the variable contains > an empty string, than it will evaluate to False, and the extra > arguments will not be set. > > This

Re: [PATCH v2] hw/isa/piix4: Migrate Reset Control Register

2021-03-24 Thread Dr. David Alan Gilbert
* Philippe Mathieu-Daudé (f4...@amsat.org) wrote: > When adding the Reset register in commit 5790b757cfb we > forgot to migrate it. > > While it is possible a VM using the PIIX4 is migrated just > after requesting a system shutdown, it is very unlikely. > However when restoring a migrated VM, we

[PATCH v2] hw/isa/piix4: Migrate Reset Control Register

2021-03-24 Thread Philippe Mathieu-Daudé
When adding the Reset register in commit 5790b757cfb we forgot to migrate it. While it is possible a VM using the PIIX4 is migrated just after requesting a system shutdown, it is very unlikely. However when restoring a migrated VM, we might have the RCR bit #4 set on the stack and when the VM

Re: [PATCH 0/4] DEVICE_NOT_DELETED/DEVICE_UNPLUG_ERROR QAPI events

2021-03-24 Thread Daniel Henrique Barboza
On 3/23/21 10:40 PM, David Gibson wrote: On Tue, Mar 23, 2021 at 02:10:22PM -0300, Daniel Henrique Barboza wrote: On 3/22/21 10:12 PM, David Gibson wrote: On Fri, Mar 12, 2021 at 05:07:36PM -0300, Daniel Henrique Barboza wrote: Hi, This series adds 2 new QAPI events, DEVICE_NOT_DELETED

Re: [RFC PATCH 13/27] vhost: Send buffers to device

2021-03-24 Thread Eugenio Perez Martin
On Mon, Mar 22, 2021 at 6:40 PM Stefan Hajnoczi wrote: > > On Mon, Mar 22, 2021 at 04:55:13PM +0100, Eugenio Perez Martin wrote: > > On Mon, Mar 22, 2021 at 11:51 AM Stefan Hajnoczi > > wrote: > > > > > > On Thu, Mar 11, 2021 at 07:53:53PM +0100, Eugenio Perez Martin wrote: > > > > On Fri, Jan

Re: [PATCH v1 1/3] migration: Fix missing qemu_fflush() on buffer file in bg_migration_thread

2021-03-24 Thread Peter Xu
On Wed, Mar 24, 2021 at 05:35:44PM +, Dr. David Alan Gilbert wrote: > * Peter Xu (pet...@redhat.com) wrote: > > On Tue, Mar 23, 2021 at 08:21:43PM +0300, Andrey Gruzdev wrote: > > > > For the long term I think we'd better have a helper: > > > > > > > >

Re: [RFC v11 18/55] target/arm: move cpsr_read, cpsr_write to cpu_common

2021-03-24 Thread Richard Henderson
On 3/23/21 9:46 AM, Claudio Fontana wrote: we need as a result to move switch_mode too, so we put an implementation into cpu_user and cpu_sysemu. Signed-off-by: Claudio Fontana --- target/arm/cpu.h| 2 + target/arm/cpu-common.c | 192 +++

Re: [RFC v11 19/55] target/arm: add temporary stub for arm_rebuild_hflags

2021-03-24 Thread Richard Henderson
On 3/23/21 9:46 AM, Claudio Fontana wrote: this should go away once the configuration and hw/arm is clean Signed-off-by: Claudio Fontana --- hw/arm/boot.c | 5 - target/arm/arm-powerctl.c | 8 +--- target/arm/kvm/helper-stubs.c | 6 ++ 3 files changed, 15

Re: [PATCH v2 2/2] vhost-user-blk: perform immediate cleanup if disconnect on initialization

2021-03-24 Thread Raphael Norwitz
Looks good, just clean up the commit message to reflect the way you've now split the patches. Reviewed-by: Raphael Norwitz On Wed, Mar 24, 2021 at 12:38:29PM +0300, Denis Plotnikov wrote: > Commit 4bcad76f4c39 ("vhost-user-blk: delay vhost_user_blk_disconnect") > introduced postponing vhost_dev

Re: [RFC v11 17/55] target/arm: kvm: add stubs for some helpers

2021-03-24 Thread Richard Henderson
On 3/23/21 9:46 AM, Claudio Fontana wrote: +/* return the effective value of HCR_EL2. For KVM, always 0. */ +uint64_t arm_hcr_el2_eff(CPUARMState *env) +{ +return 0; +} Oh, amusingly, patches for kvm nested virtualization, https://patchew.org/QEMU/cover.1616052889.git.haibo...@linaro.org/

[PATCH v3] linux-user/s390x: Use the guest pointer for the sigreturn stub

2021-03-24 Thread Andreas Krebbel
When setting up the pointer for the sigreturn stub in the return address register (r14) we currently use the host frame address instead of the guest frame address. Note: This only caused problems if Qemu has been built with --disable-pie (as it is in distros nowadays). Otherwise guest_base

Re: [RFC v11 14/55] target/arm: cpregs: fix style (mostly just comments)

2021-03-24 Thread Richard Henderson
On 3/23/21 9:45 AM, Claudio Fontana wrote: Signed-off-by: Claudio Fontana --- target/arm/cpregs.h | 54 ++--- target/arm/cpregs.c | 60 ++ target/arm/tcg/cpregs.c | 253 ++-- 3 files changed, 241 insertions(+), 126 deletions(-)

Re: [PATCH v2] linux-user/s390x: Use the guest pointer for the sigreturn stub

2021-03-24 Thread Andreas Krebbel
On 3/24/21 6:53 PM, Laurent Vivier wrote: > Le 24/03/2021 à 16:55, Andreas Krebbel a écrit : >> When setting up the pointer for the sigreturn stub in the return >> address register (r14) we have to use the guest frame pointer instead >> of the host frame pointer. >> >> Note: This only caused

Re: [RFC v11 15/55] target/arm: move cpu definitions to common cpu module

2021-03-24 Thread Richard Henderson
On 3/23/21 9:45 AM, Claudio Fontana wrote: Signed-off-by: Claudio Fontana --- target/arm/cpu-common.c | 41 + target/arm/tcg/helper.c | 29 - target/arm/meson.build | 1 + 3 files changed, 42 insertions(+), 29

[PATCH v6 05/10] KVM: Provide helper to sync dirty bitmap from slot to ramblock

2021-03-24 Thread Peter Xu
kvm_physical_sync_dirty_bitmap() calculates the ramblock offset in an awkward way from the MemoryRegionSection that passed in from the caller. The truth is for each KVMSlot the ramblock offset never change for the lifecycle. Cache the ramblock offset for each KVMSlot into the structure when the

Re: [RFC v11 16/55] target/arm: only perform TCG cpu and machine inits if TCG enabled

2021-03-24 Thread Richard Henderson
On 3/23/21 9:46 AM, Claudio Fontana wrote: of note, cpreg lists were previously initialized by TCG first, and then thrown away and replaced with the data coming from KVM. Now we just initialize once, either for TCG or for KVM. Signed-off-by: Claudio Fontana --- target/arm/cpu.c | 32

[PATCH v6 08/10] KVM: Add dirty-gfn-count property

2021-03-24 Thread Peter Xu
Add a parameter for dirty gfn count for dirty rings. If zero, dirty ring is disabled. Otherwise dirty ring will be enabled with the per-vcpu gfn count as specified. If dirty ring cannot be enabled due to unsupported kernel or illegal parameter, it'll fallback to dirty logging. By default,

[PATCH v6 06/10] KVM: Simplify dirty log sync in kvm_set_phys_mem

2021-03-24 Thread Peter Xu
kvm_physical_sync_dirty_bitmap() on the whole section is inaccurate, because the section can be a superset of the memslot that we're working on. The result is that if the section covers multiple kvm memslots, we could be doing the synchronization for multiple times for each kvmslot in the

Re: [RFC v11 17/55] target/arm: kvm: add stubs for some helpers

2021-03-24 Thread Richard Henderson
On 3/23/21 9:46 AM, Claudio Fontana wrote: at least the armv7m one should go away with proper configuration changes (only enabling possible boards for KVM). Signed-off-by: Claudio Fontana --- target/arm/kvm/helper-stubs.c | 27 +++ target/arm/kvm/meson.build| 3

Re: [RFC v11 13/55] target/arm: split cpregs from tcg/helper.c

2021-03-24 Thread Richard Henderson
On 3/23/21 9:45 AM, Claudio Fontana wrote: give them their own common module cpregs.c, and an interface cpregs.h. Extract the raw cpustate list to its own module. This is more or less needed for KVM too. For the tcg-specific registers, stuff them into tcg/cpregs.c As a result, the monster that

[PATCH v6 07/10] KVM: Cache kvm slot dirty bitmap size

2021-03-24 Thread Peter Xu
Cache it too because we'll reference it more frequently in the future. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Peter Xu --- accel/kvm/kvm-all.c | 1 + include/sysemu/kvm_int.h | 1 + 2 files changed, 2 insertions(+) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index

[PATCH v6 02/10] KVM: Use a big lock to replace per-kml slots_lock

2021-03-24 Thread Peter Xu
Per-kml slots_lock will bring some trouble if we want to take all slots_lock of all the KMLs, especially when we're in a context that we could have taken some of the KML slots_lock, then we even need to figure out what we've taken and what we need to take. Make this simple by merging all KML

[PATCH v6 09/10] KVM: Disable manual dirty log when dirty ring enabled

2021-03-24 Thread Peter Xu
KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 is for KVM_CLEAR_DIRTY_LOG, which is only useful for KVM_GET_DIRTY_LOG. Skip enabling it for kvm dirty ring. More importantly, KVM_DIRTY_LOG_INITIALLY_SET will not wr-protect all the pages initially, which is against how kvm dirty ring is used - there's no way

[PATCH v6 10/10] KVM: Dirty ring support

2021-03-24 Thread Peter Xu
KVM dirty ring is a new interface to pass over dirty bits from kernel to the userspace. Instead of using a bitmap for each memory region, the dirty ring contains an array of dirtied GPAs to fetch (in the form of offset in slots). For each vcpu there will be one dirty ring that binds to it.

[PATCH v6 03/10] KVM: Create the KVMSlot dirty bitmap on flag changes

2021-03-24 Thread Peter Xu
Previously we have two places that will create the per KVMSlot dirty bitmap: 1. When a newly created KVMSlot has dirty logging enabled, 2. When the first log_sync() happens for a memory slot. The 2nd case is lazy-init, while the 1st case is not (which is a fix of what the 2nd case missed).

[PATCH v6 01/10] memory: Introduce log_sync_global() to memory listener

2021-03-24 Thread Peter Xu
Some of the memory listener may want to do log synchronization without being able to specify a range of memory to sync but always globally. Such a memory listener should provide this new method instead of the log_sync() method. Obviously we can also achieve similar thing when we put the global

[PATCH v6 04/10] KVM: Provide helper to get kvm dirty log

2021-03-24 Thread Peter Xu
Provide a helper kvm_slot_get_dirty_log() to make the function kvm_physical_sync_dirty_bitmap() clearer. We can even cache the as_id into KVMSlot when it is created, so that we don't even need to pass it down every time. Since at it, remove return value of kvm_physical_sync_dirty_bitmap()

[PATCH v6 00/10] KVM: Dirty ring support (QEMU part)

2021-03-24 Thread Peter Xu
This is v6 of the qemu dirty ring interface support. v6: - Fix slots_lock init [Keqian, Paolo] - Comment above KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 on todo (to enable KVM_CLEAR_DIRTY_LOG for dirty ring too) [Keqian, Paolo] - Fix comment for CPUState [Keqian] v5: - rebase - dropped patch

Re: gitlab-ci: Only build /staging branch?

2021-03-24 Thread Philippe Mathieu-Daudé
On 3/24/21 7:01 PM, Philippe Mathieu-Daudé wrote: > Hi, > > Peter's current workflow is push to /staging and if his > testing succeeds, he pushes the same commit as /master. > > IMO there is no point in building /master branch, as it > has already been built earlier as /staging. Also this might

Re: [RFC v11 12/55] target/arm: cpu-mmu: fix comment style

2021-03-24 Thread Richard Henderson
On 3/23/21 9:45 AM, Claudio Fontana wrote: Signed-off-by: Claudio Fontana --- target/arm/cpu-mmu.h| 3 +- target/arm/cpu-mmu-sysemu.c | 149 2 files changed, 101 insertions(+), 51 deletions(-) Surely this should go before the code movement. I

[PATCH-for-6.1] hw/isa/piix4: Use qdev_get_gpio_in_named() to get ISA IRQ

2021-03-24 Thread Philippe Mathieu-Daudé
Since commit 078778c5a55 ("piix4: Add an i8259 Interrupt Controller") the TYPE_PIIX4_PCI_DEVICE exposes the ISA input IRQs as "isa" alias. Use this alias to get IRQ for the power management PCI function. Signed-off-by: Philippe Mathieu-Daudé --- hw/isa/piix4.c | 5 +++-- 1 file changed, 3

Re: [RFC v5 1/6] qmp: add QMP command x-debug-query-virtio

2021-03-24 Thread Dr. David Alan Gilbert
* Jonah Palmer (jonah.pal...@oracle.com) wrote: > From: Laurent Vivier > > --- /dev/null > +++ b/qapi/virtio.json > @@ -0,0 +1,68 @@ > +## > +# = Virtio devices > +## > + > +## > +# @VirtioType: > +# > +# An enumeration of Virtio device types. > +# > +# Since: 6.0 > +## > +{ 'enum':

Re: [RFC v11 11/55] target/arm: move physical address translation to cpu-mmu

2021-03-24 Thread Richard Henderson
On 3/23/21 9:45 AM, Claudio Fontana wrote: get_phys_addr is needed for KVM too, and in turn it requires the aa64_va_parameter* family of functions. Create cpu-mmu and cpu-mmu-sysemu to store these and other mmu-related functions. Signed-off-by: Claudio Fontana --- Reviewed-by: Richard

Re: [PATCH v2 1/2] vhost-user-blk: use different event handlers on initialization

2021-03-24 Thread Raphael Norwitz
Couple commit message NITs but otherwise I'm happy with this. Reviewed-by: Raphael Norwitz On Wed, Mar 24, 2021 at 12:38:28PM +0300, Denis Plotnikov wrote: > It is useful to use different connect/disconnect event handlers > on device initialization and operation as seen from the further >

Re: [RFC v11 08/55] target/arm: tcg: split m_helper user-only and sysemu-only parts

2021-03-24 Thread Richard Henderson
On 3/23/21 9:45 AM, Claudio Fontana wrote: in the process remove a few CONFIG_TCG that are superfluous now. Signed-off-by: Claudio Fontana --- target/arm/tcg/m_helper.h | 21 + target/arm/tcg/m_helper.c | 2766 + target/arm/tcg/sysemu/m_helper.c

Re: [RFC v11 10/55] target/arm: split off cpu-sysemu.c

2021-03-24 Thread Richard Henderson
On 3/23/21 9:45 AM, Claudio Fontana wrote: move work is needed later on to split things into tcg-specific portions and kvm-specific portions of this Signed-off-by: Claudio Fontana Reviewed-by: Alex Bennée --- target/arm/internals.h | 8 ++- target/arm/cpu-sysemu.c | 105

Re: [RFC v11 05/55] target/arm: tcg: split mte_helper user-only and sysemu code

2021-03-24 Thread Richard Henderson
On 3/23/21 9:16 AM, Claudio Fontana wrote: +#ifndef MTE_HELPER_H +#define MTE_HELPER_H +/** Whitespace after the define. Otherwise, Reviewed-by: Richard Henderson r~

Re: [RFC v11 04/55] target/arm: tcg: add sysemu and user subdirs

2021-03-24 Thread Claudio Fontana
On 3/24/21 7:18 PM, Richard Henderson wrote: > On 3/23/21 9:16 AM, Claudio Fontana wrote: >> +arm_softmmu_ss.add(when: ['CONFIG_TCG','CONFIG_SOFTMMU'], if_true: files( >> +)) >> diff --git a/target/arm/tcg/user/meson.build >> b/target/arm/tcg/user/meson.build >> new file mode 100644 >> index

Re: [RFC v11 07/55] target/arm: tcg: split tlb_helper user-only and sysemu-only parts

2021-03-24 Thread Richard Henderson
On 3/23/21 9:17 AM, Claudio Fontana wrote: Signed-off-by: Claudio Fontana --- target/arm/tcg/tlb_helper.h| 17 ++ target/arm/tcg/sysemu/tlb_helper.c | 83 ++ target/arm/tcg/tlb_helper.c| 96 ++

Re: [PULL 0/2] Block patches

2021-03-24 Thread Peter Maydell
On Wed, 24 Mar 2021 at 14:52, Stefan Hajnoczi wrote: > > The following changes since commit 67c1115edd98f388ca89dd38322ea3fadf034523: > > Merge remote-tracking branch 'remotes/kraxel/tags/ui-20210323-pull-request' > into staging (2021-03-23 23:47:30 +) > > are available in the Git

Re: [RFC v11 06/55] target/arm: tcg: move sysemu-only parts of debug_helper

2021-03-24 Thread Richard Henderson
On 3/23/21 9:17 AM, Claudio Fontana wrote: --- a/target/arm/tcg/sysemu/meson.build +++ b/target/arm/tcg/sysemu/meson.build @@ -1,4 +1,5 @@ arm_softmmu_ss.add(when: ['CONFIG_TCG','CONFIG_SOFTMMU'], if_true: files( 'mte_helper.c', + 'debug_helper.c', )) Sort the files as you add

Re: [RFC v11 04/55] target/arm: tcg: add sysemu and user subdirs

2021-03-24 Thread Richard Henderson
On 3/23/21 9:16 AM, Claudio Fontana wrote: +arm_softmmu_ss.add(when: ['CONFIG_TCG','CONFIG_SOFTMMU'], if_true: files( +)) diff --git a/target/arm/tcg/user/meson.build b/target/arm/tcg/user/meson.build new file mode 100644 index 00..d70a51ea9a --- /dev/null +++

[PATCH 6/6] hw/southbridge/vt82c686: Introduce VT82C686B_SOUTHBRIDGE

2021-03-24 Thread Philippe Mathieu-Daudé
The VT82C686B south bridge is a single chipset. Model it as a single sysbus device. Move the vt82c686b_southbridge_init as via_southbridge_realize, add the QOM state: ViaSouthBridgeState. This device needs 2 properties to be realized: the PCI bus and its slot number. 2 aliases are exposed: the ISA

Re: [PATCH v5 02/10] KVM: Use a big lock to replace per-kml slots_lock

2021-03-24 Thread Peter Xu
On Mon, Mar 22, 2021 at 12:27:54PM -0400, Peter Xu wrote: > On Mon, Mar 22, 2021 at 02:54:30PM +0100, Paolo Bonzini wrote: > > On 22/03/21 11:47, Keqian Zhu wrote: > > > > +qemu_mutex_init(_slots_lock); > > > As you said, x86 has two address spaces, is it a problem that we may have > > >

[PATCH 4/6] hw/ide/via: Replace magic 2 value by ARRAY_SIZE / MAX_IDE_DEVS

2021-03-24 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- hw/ide/via.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/ide/via.c b/hw/ide/via.c index be09912b334..6c667a92130 100644 --- a/hw/ide/via.c +++ b/hw/ide/via.c @@ -90,7 +90,7 @@ static void

Re: [RFC v11 04/55] target/arm: tcg: add sysemu and user subdirs

2021-03-24 Thread Richard Henderson
On 3/23/21 9:16 AM, Claudio Fontana wrote: +++ b/target/arm/tcg/sysemu/meson.build @@ -0,0 +1,3 @@ + +arm_softmmu_ss.add(when: ['CONFIG_TCG','CONFIG_SOFTMMU'], if_true: files( +)) Blank lines at the start of each new file? Otherwise, Reviewed-by: Richard Henderson r~

[PATCH 3/6] hw/isa/vt82c686: Let ISA function expose ISA IRQs

2021-03-24 Thread Philippe Mathieu-Daudé
The 2 cascaded 8259 PIC are managed by the PCI function #0 (ISA bridge). Expose the 16 IRQs on this function, so other functions from the same chipset can access them. Signed-off-by: Philippe Mathieu-Daudé --- hw/isa/vt82c686.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-)

gitlab-ci: Only build /staging branch?

2021-03-24 Thread Philippe Mathieu-Daudé
Hi, Peter's current workflow is push to /staging and if his testing succeeds, he pushes the same commit as /master. IMO there is no point in building /master branch, as it has already been built earlier as /staging. Regards, Phil.

[PATCH 2/6] hw/isa/vt82c686: Simplify removing unuseful qemu_allocate_irqs() call

2021-03-24 Thread Philippe Mathieu-Daudé
Instead of creating an input IRQ with qemu_allocate_irqs() to pass it as output IRQ of the PIC, with its handler simply dispatching into the "intr" output IRQ, simplify by directly connecting the PIC to the "intr" named output. Fixes: 3dc31cb8490 ("vt82c686: Move creation of ISA devices to the

[PATCH 5/6] hw/ide/via: Connect IDE function output IRQs to the ISA function input

2021-03-24 Thread Philippe Mathieu-Daudé
To avoid abusing isa_get_irq(NULL) using a hidden ISA bridge under the hood, let the IDE function expose 2 output IRQs, and connect them to the ISA function inputs when creating the south bridge chipset model in vt82c686b_southbridge_init. Signed-off-by: Philippe Mathieu-Daudé --- hw/ide/via.c

[PATCH 1/6] hw/isa/vt82c686: Name output IRQ as 'intr'

2021-03-24 Thread Philippe Mathieu-Daudé
Named IRQs are easier to understand in the monitor. Name the single output interrupt as 'intr'. Signed-off-by: Philippe Mathieu-Daudé --- hw/isa/vt82c686.c | 2 +- hw/mips/fuloong2e.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c

[PATCH 0/6] hw/southbridge: QOM'ify vt82c686 as VT82C686B_SOUTHBRIDGE

2021-03-24 Thread Philippe Mathieu-Daudé
The motivation behind this series is to remove the isa_get_irq(NULL) call to simplify the ISA generic model. Philippe Mathieu-Daudé (6): hw/isa/vt82c686: Name output IRQ as 'intr' hw/isa/vt82c686: Simplify removing unuseful qemu_allocate_irqs() call hw/isa/vt82c686: Let ISA function expose

Re: [PATCH v2] linux-user/s390x: Use the guest pointer for the sigreturn stub

2021-03-24 Thread Laurent Vivier
Le 24/03/2021 à 16:55, Andreas Krebbel a écrit : > When setting up the pointer for the sigreturn stub in the return > address register (r14) we have to use the guest frame pointer instead > of the host frame pointer. > > Note: This only caused problems if Qemu has been built with > --disable-pie

Re: [PULL for 6.0 00/22] various fixes (kernel-doc, semihosting, testing)

2021-03-24 Thread Peter Maydell
On Wed, 24 Mar 2021 at 14:30, Alex Bennée wrote: > > The following changes since commit 01874b15d36e3f9a3506c47941a92ccf8d8bed98: > > Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20210323' into > staging (2021-03-24 11:22:08 +) > > are available in the Git repository at: > >

Re: [PATCH v1 1/3] migration: Fix missing qemu_fflush() on buffer file in bg_migration_thread

2021-03-24 Thread Dr. David Alan Gilbert
* Peter Xu (pet...@redhat.com) wrote: > On Tue, Mar 23, 2021 at 08:21:43PM +0300, Andrey Gruzdev wrote: > > > For the long term I think we'd better have a helper: > > > > > > qemu_put_qio_channel_buffer(QEMUFile *file, QIOChannelBuffer > > > *bioc) > > > > > > So as to hide this flush

Re: [Bug 1909247] Re: QEMU: use after free vulnerability in esp_do_dma() in hw/scsi/esp.c

2021-03-24 Thread Philippe Mathieu-Daudé
On 3/24/21 4:53 PM, Alexander Bulekov wrote: > Hi, > I can still trigger stack-overflows, heap-UAFs and heap-overflows in the > code, but Mark's patches fixed some of the issues. I didn't want to > flood the issue-tracker with further problems in this code, since it > isn't clear what the security

Re: [PATCH v2 05/12] mc146818rtc: put it into the 'misc' category

2021-03-24 Thread Philippe Mathieu-Daudé
On 12/21/20 12:53 PM, Thomas Huth wrote: > On 30/11/2020 09.36, Gan Qixin wrote: >> The category of the mc146818rtc device is not set, put it into the 'misc' >> category. >> >> Signed-off-by: Gan Qixin >> --- >> Cc: Michael S. Tsirkin >> --- >> hw/rtc/mc146818rtc.c | 1 + >> 1 file changed, 1

Re: [PATCH] target/i386: Verify memory operand for lcall and ljmp

2021-03-24 Thread Paolo Bonzini
On 24/03/21 17:46, Richard Henderson wrote: These two opcodes only allow a memory operand. Lacking the check for a register operand, we used the A0 temp without initialization, which led to a tcg abort. Buglink: https://bugs.launchpad.net/qemu/+bug/1921138 Signed-off-by: Richard Henderson ---

[Bug 1921138] Re: tcg.c:3329: tcg fatal error

2021-03-24 Thread Richard Henderson
https://patchew.org/QEMU/20210324164650.128608-1-richard.hender...@linaro.org/ ** 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/1921138

[PATCH] target/i386: Verify memory operand for lcall and ljmp

2021-03-24 Thread Richard Henderson
These two opcodes only allow a memory operand. Lacking the check for a register operand, we used the A0 temp without initialization, which led to a tcg abort. Buglink: https://bugs.launchpad.net/qemu/+bug/1921138 Signed-off-by: Richard Henderson --- target/i386/tcg/translate.c | 6 ++ 1

Re: [PATCH v5 0/6] coroutine rwlock downgrade fix, minor VDI changes

2021-03-24 Thread Paolo Bonzini
On 24/03/21 17:23, Stefan Hajnoczi wrote: On Wed, Mar 17, 2021 at 07:00:07PM +0100, Paolo Bonzini wrote: This is a resubmit of David Edmondson's series at https://patchew.org/QEMU/20210309144015.557477-1-david.edmond...@oracle.com/. After closer analysis on IRC, the CoRwlock's attempt to ensure

Re: [PATCH 4/6] coroutine-lock: reimplement CoRwlock to fix downgrade bug

2021-03-24 Thread Paolo Bonzini
On 24/03/21 17:15, Stefan Hajnoczi wrote: On Wed, Mar 17, 2021 at 07:00:11PM +0100, Paolo Bonzini wrote: +static void qemu_co_rwlock_maybe_wake_one(CoRwlock *lock) +{ +CoRwTicket *tkt = QSIMPLEQ_FIRST(>tickets); +Coroutine *co = NULL; + +/* + * Setting lock->owners here prevents

Re: [PATCH v3 07/10] Reset the auto-converge counter at every checkpoint.

2021-03-24 Thread Dr. David Alan Gilbert
* leirao (lei@intel.com) wrote: > From: "Rao, Lei" > > if we don't reset the auto-converge counter, > it will continue to run with COLO running, > and eventually the system will hang due to the > CPU throttle reaching DEFAULT_MIGRATE_MAX_CPU_THROTTLE. > > Signed-off-by: Lei Rao > --- >

Re: [PATCH v8] drivers/misc: sysgenid: add system generation id driver

2021-03-24 Thread Michael S. Tsirkin
On Tue, Mar 23, 2021 at 05:35:14PM +0100, Greg KH wrote: > On Tue, Mar 23, 2021 at 04:10:27PM +, Catangiu, Adrian Costin wrote: > > Hi Greg, > > > > After your previous reply on this thread we started considering to provide > > this interface and framework/functionality through a userspace

Re: [PATCH v2 2/3] pci: sprinkle assert in PCI pin number

2021-03-24 Thread Michael S. Tsirkin
On Tue, Mar 23, 2021 at 10:24:30AM -0700, Isaku Yamahata wrote: > If a device model > (a) doesn't set the value to a correct interrupt number and then > (b) triggers an interrupt for itself, > it's device model bug. Add assert on interrupt pin number to catch > this kind of bug more obviously. >

Re: [RFC v11 30/55] target/arm: wrap call to aarch64_sve_change_el in tcg_enabled()

2021-03-24 Thread Alex Bennée
Claudio Fontana writes: > On 3/24/21 12:48 PM, Alex Bennée wrote: >> >> Alex Bennée writes: >> >>> Claudio Fontana writes: >>> On 3/23/21 11:50 PM, Alex Bennée wrote: >> >>> Moving up the build chain to the revert I now get: >>> >>> ./qemu-system-aarch64 -M virt,gic=host -cpu host

[Bug 1921138] Re: tcg.c:3329: tcg fatal error

2021-03-24 Thread Richard Henderson
** Changed in: qemu Status: New => Confirmed ** Changed in: qemu Assignee: (unassigned) => Richard Henderson (rth) -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1921138 Title:

Re: [PATCH v5 0/6] coroutine rwlock downgrade fix, minor VDI changes

2021-03-24 Thread Stefan Hajnoczi
On Wed, Mar 17, 2021 at 07:00:07PM +0100, Paolo Bonzini wrote: > This is a resubmit of David Edmondson's series at > https://patchew.org/QEMU/20210309144015.557477-1-david.edmond...@oracle.com/. > After closer analysis on IRC, the CoRwlock's attempt to ensure > fairness turned out to be flawed.

Re: [PATCH] hw/pci/pci.c: Assert that pci_irq_handler() inputs are valid

2021-03-24 Thread Isaku Yamahata
I included (mostly) same patch into my patch series just for patch completeness. Please choose whichever you like. Reviewed-by: Isaku Yamahata On Tue, Mar 23, 2021 at 04:46:01PM +, Peter Maydell wrote: > pci_irq_handler documents that it must be called with 0 <= irq_num <= > 3 and level

[Bug 1921092] Re: how do i delete this bug?

2021-03-24 Thread Peter Maydell
In general, you don't need to delete bugs that turn out to be user error, or edit the description/title; just mark them as 'invalid', perhaps with a comment about what turned out to be the cause. That leaves the trail of what was going on for future readers who might be going down the same path as

Re: [PATCH 4/6] coroutine-lock: reimplement CoRwlock to fix downgrade bug

2021-03-24 Thread Stefan Hajnoczi
On Wed, Mar 17, 2021 at 07:00:11PM +0100, Paolo Bonzini wrote: > +static void qemu_co_rwlock_maybe_wake_one(CoRwlock *lock) > +{ > +CoRwTicket *tkt = QSIMPLEQ_FIRST(>tickets); > +Coroutine *co = NULL; > + > +/* > + * Setting lock->owners here prevents rdlock and wrlock from > +

Re: [Bug 1909247] Re: QEMU: use after free vulnerability in esp_do_dma() in hw/scsi/esp.c

2021-03-24 Thread Alexander Bulekov
Hi, I can still trigger stack-overflows, heap-UAFs and heap-overflows in the code, but Mark's patches fixed some of the issues. I didn't want to flood the issue-tracker with further problems in this code, since it isn't clear what the security expectations are for this device. Of course it is only

Re: [PATCH for 6.0 v2 00/22] fixes for rc1 pre-PR (kernel-doc, semihosting, testing)

2021-03-24 Thread Peter Maydell
On Wed, 24 Mar 2021 at 14:23, Alex Bennée wrote: > > > Peter Maydell writes: > > > On Tue, 23 Mar 2021 at 17:59, Alex Bennée wrote: > >> I've added a testing patch to extend the CFI times, Laurent's series > >> to fix the iotest regressions currently keeping the CI from going > >> green and an

[PATCH v2] linux-user/s390x: Use the guest pointer for the sigreturn stub

2021-03-24 Thread Andreas Krebbel
When setting up the pointer for the sigreturn stub in the return address register (r14) we have to use the guest frame pointer instead of the host frame pointer. Note: This only caused problems if Qemu has been built with --disable-pie (as it is in distros nowadays). Otherwise guest_base defaults

Re: [PATCH V4] file-posix: allow -EBUSY error during ioctl(fd, BLKZEROOUT, range) on block

2021-03-24 Thread Nir Soffer
On Wed, Mar 24, 2021 at 4:52 PM Max Reitz wrote: > On 22.03.21 10:25, ChangLimin wrote: > > For Linux 5.10/5.11, qemu write zeros to a multipath device using > > ioctl(fd, BLKZEROOUT, range) with cache none or directsync return -EBUSY > > permanently. > > So as far as I can track back the

Re: [PATCH v1 0/3] migration: Fixes to the 'background-snapshot' code

2021-03-24 Thread Peter Xu
On Wed, Mar 24, 2021 at 11:09:27AM +0300, Andrey Gruzdev wrote: > > I'm also looking into introducing UFFD_FEATURE_WP_UNALLOCATED so as to > > wr-protect page holes too for a uffd-wp region when the feature bit is set. > > With that feature we should be able to avoid pre-fault as what we do in the

[Bug 1920784] Re: qemu-system-ppc64le fails with kvm acceleration

2021-03-24 Thread Tim Gardner
** Also affects: glibc (Ubuntu Hirsute) Importance: Undecided Status: Invalid ** Also affects: qemu (Ubuntu Hirsute) Importance: Undecided Status: Invalid ** Also affects: linux (Ubuntu Hirsute) Importance: Undecided Assignee: Frank Heimes (fheimes) Status: In

Re: [PATCH] hw/isa/piix4: Migrate Reset Control Register

2021-03-24 Thread Dr. David Alan Gilbert
* Philippe Mathieu-Daudé (f4...@amsat.org) wrote: > Fixes: 5790b757cfb ("piix4: Add the Reset Control Register") > Signed-off-by: Philippe Mathieu-Daudé So if I understand correctly, piix4 is only used on one of the MIPS machines, so that bumping the version here won't break anyone who cares

Re: [PATCH 1/1] linux-user/s390x: Apply h2g to address of sigreturn stub

2021-03-24 Thread Laurent Vivier
Le 24/03/2021 à 15:14, Andreas Krebbel a écrit : > On 3/24/21 2:06 PM, Laurent Vivier wrote: >> Le 24/03/2021 à 12:26, Andreas Krebbel a écrit : >>> On 3/24/21 11:28 AM, Laurent Vivier wrote: Le 24/03/2021 à 10:17, David Hildenbrand a écrit : > On 24.03.21 09:51, Andreas Krebbel wrote:

[Bug 1921138] [NEW] tcg.c:3329: tcg fatal error

2021-03-24 Thread Luis
Public bug reported: I am currently building my own kernel with bootloader and qemu crashed after I have set an IDT in protected mode and then create a invalid opcode exception with the opcode 0xff. My code is here: https://github.com/Luis-

<    1   2   3   4   >