Re: [PATCH v2 1/1] spapr_caps.c: check user input before warning about TCG only caps

2021-01-20 Thread Greg Kurz
when the > user didn't request any of those caps in the command line. > > Check if these caps were set in the command line before sending an user > warning. > > Signed-off-by: Daniel Henrique Barboza > --- Heh I've just posted a mail suggesting y

Re: [PATCH 1/1] spapr_caps.c: disable KVM specific caps when running with TCG

2021-01-20 Thread Greg Kurz
On Wed, 20 Jan 2021 11:24:45 +1100 David Gibson wrote: > On Tue, Jan 19, 2021 at 05:58:24PM -0300, Daniel Henrique Barboza wrote: > > Commit 006e9d361869 added warning messages for cap-cfpc, cap-ibs and > > cap-sbbc when enabled under TCG. Commit 8ff43ee404d3 did the same thing > > when

Re: [PATCH 2/3] 9pfs: Convert V9fsFidState::fid_list to QSIMPLEQ

2021-01-19 Thread Greg Kurz
On Tue, 19 Jan 2021 16:28:01 +0100 Christian Schoenebeck wrote: > On Dienstag, 19. Januar 2021 15:34:07 CET Greg Kurz wrote: > > On Tue, 19 Jan 2021 14:31:26 +0100 > > > > Christian Schoenebeck wrote: > > > On Montag, 18. Januar 2021 15:22:59 CET Greg Ku

Re: [PATCH v2 1/1] spapr.c: always pulse guest IRQ in spapr_core_unplug_request()

2021-01-19 Thread Greg Kurz
On Tue, 19 Jan 2021 10:11:19 -0300 Daniel Henrique Barboza wrote: > > > On 1/19/21 6:50 AM, Greg Kurz wrote: > > On Mon, 18 Jan 2021 16:30:35 -0300 > > Daniel Henrique Barboza wrote: > > > >> Commit 47c8c915b162 fixed a problem where multiple spapr_drc_

Re: [PATCH 2/3] 9pfs: Convert V9fsFidState::fid_list to QSIMPLEQ

2021-01-19 Thread Greg Kurz
On Tue, 19 Jan 2021 14:31:26 +0100 Christian Schoenebeck wrote: > On Montag, 18. Januar 2021 15:22:59 CET Greg Kurz wrote: > > The fid_list is currently open-coded. This doesn't seem to serve any > > purpose that cannot be met with QEMU's generic lists. Let's go for

Re: [PATCH v2 1/1] spapr.c: always pulse guest IRQ in spapr_core_unplug_request()

2021-01-19 Thread Greg Kurz
On Mon, 18 Jan 2021 16:30:35 -0300 Daniel Henrique Barboza wrote: > Commit 47c8c915b162 fixed a problem where multiple spapr_drc_detach() > requests were breaking QEMU. The solution was to just spapr_drc_detach() > once, and use spapr_drc_unplug_requested() to filter whether we > already

Re: [RFC PATCH v0 1/1] target/ppc: Support for H_RPT_INVALIDATE hcall

2021-01-19 Thread Greg Kurz
On Tue, 19 Jan 2021 10:14:55 +0530 Bharata B Rao wrote: > On Fri, Jan 15, 2021 at 06:30:05PM +0100, Greg Kurz wrote: > > On Fri, 15 Jan 2021 14:01:28 +0530 > > Bharata B Rao wrote: > > > > > On Wed, Jan 13, 2021 at 05:22:56PM +0100, Greg Kurz wrote: > > >

[PATCH 2/3] 9pfs: Convert V9fsFidState::fid_list to QSIMPLEQ

2021-01-18 Thread Greg Kurz
The fid_list is currently open-coded. This doesn't seem to serve any purpose that cannot be met with QEMU's generic lists. Let's go for a QSIMPLEQ : this will allow to add new fids at the end of the list and to improve the logic in v9fs_mark_fids_unreclaim(). Signed-off-by: Greg Kurz --- hw

[PATCH 1/3] 9pfs: Convert V9fsFidState::clunked to bool

2021-01-18 Thread Greg Kurz
This can only be 0 or 1. Signed-off-by: Greg Kurz --- hw/9pfs/9p.c | 4 ++-- hw/9pfs/9p.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index 6026b51a1c04..37c3379b7462 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -413,7 +413,7 @@ static

[PATCH 3/3] 9pfs: Improve unreclaim loop

2021-01-18 Thread Greg Kurz
be safely passed to QSIMPLEQ_NEXT() afterwards. Since the associated put_fid() can also yield, same is done with the next fid. So the logic here is to get a reference on a fid and only put it back during the next iteration after we could get a reference on the next fid. Signed-off-by: Greg Kurz

[PATCH 0/3] 9pfs: Improve unreclaim logic

2021-01-18 Thread Greg Kurz
clone of "master" Greg Kurz (3): 9pfs: Convert V9fsFidState::clunked to bool 9pfs: Convert V9fsFidState::fid_list to QSIMPLEQ 9pfs: Improve unreclaim loop hw/9pfs/9p.c | 83 +--- hw/9pfs/9p.h | 6 ++-- 2 files changed, 50 inserti

Re: [PATCH v1 7/7] spapr.c: consider CPU core online state before allowing unplug

2021-01-18 Thread Greg Kurz
On Mon, 18 Jan 2021 12:12:03 +1100 David Gibson wrote: > On Fri, Jan 15, 2021 at 06:22:16PM +0100, Greg Kurz wrote: > > On Thu, 14 Jan 2021 15:06:28 -0300 > > Daniel Henrique Barboza wrote: > > > > > The only restriction we have when unplugging CPUs is to forbi

Re: [RFC PATCH v0 1/1] target/ppc: Support for H_RPT_INVALIDATE hcall

2021-01-15 Thread Greg Kurz
On Fri, 15 Jan 2021 14:01:28 +0530 Bharata B Rao wrote: > On Wed, Jan 13, 2021 at 05:22:56PM +0100, Greg Kurz wrote: > > Hi Bharata, > > > > On Wed, 6 Jan 2021 14:29:10 +0530 > > Bharata B Rao wrote: > > > > > If KVM_CAP_RPT_INVALIDATE KVM capabilit

Re: [PATCH v1 7/7] spapr.c: consider CPU core online state before allowing unplug

2021-01-15 Thread Greg Kurz
On Thu, 14 Jan 2021 15:06:28 -0300 Daniel Henrique Barboza wrote: > The only restriction we have when unplugging CPUs is to forbid unplug of > the boot cpu core. spapr_core_unplug_possible() does not contemplate the I can't remember why this restriction was introduced in the first place... This

[PATCH] MAINTAINERS: Update 9pfs tree URL

2021-01-15 Thread Greg Kurz
I've already moved my repositories to gitlab for extra CI coverage, and I won't use the ones at github anymore. Signed-off-by: Greg Kurz --- MAINTAINERS |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index cb0656aec3d4..21038d3fdfce 100644

Re: [PATCH] fuzz: Add virtio-9p configurations for fuzzing

2021-01-15 Thread Greg Kurz
On Thu, 14 Jan 2021 17:17:48 -0500 Alexander Bulekov wrote: > Signed-off-by: Alexander Bulekov > --- No changelog at all ? > tests/qtest/fuzz/generic_fuzz_configs.h | 12 > 1 file changed, 12 insertions(+) > > diff --git a/tests/qtest/fuzz/generic_fuzz_configs.h >

[PULL 1/1] 9pfs: Fully restart unreclaim loop (CVE-2021-20181)

2021-01-15 Thread Greg Kurz
-by: Christian Schoenebeck Reviewed-by: Stefano Stabellini Message-Id: <161064025265.1838153.15185571283519390907.st...@bahia.lan> Signed-off-by: Greg Kurz --- hw/9pfs/9p.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index 94df44

[PULL 0/1] 9p security fix 2021-01-15

2021-01-15 Thread Greg Kurz
Greg Kurz (1): 9pfs: Fully restart unreclaim loop (CVE-2021-20181) hw/9pfs/9p.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.26.2

[Bug 1911666] Re: ZDI-CAN-10904: QEMU Plan 9 File System TOCTOU Privilege Escalation Vulnerability

2021-01-14 Thread Greg Kurz
** 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/1911666 Title: ZDI-CAN-10904: QEMU Plan 9 File System TOCTOU Privilege Escalation

[PATCH] 9pfs: Fully restart unreclaim loop (CVE-2021-20181)

2021-01-14 Thread Greg Kurz
-by: Christian Schoenebeck Signed-off-by: Greg Kurz --- hw/9pfs/9p.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index 94df440fc740..6026b51a1c04 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -502,9 +502,9 @@ static int coroutine_fn

Re: [PATCH] 9pfs/proxy: Check return value of proxy_marshal()

2021-01-14 Thread Greg Kurz
On Mon, 11 Jan 2021 14:15:17 +0100 Christian Schoenebeck wrote: > On Montag, 11. Januar 2021 10:49:56 CET Greg Kurz wrote: > > This should always successfully write exactly two 32-bit integers. > > Make it clear with an assert(), like v9fs_receive_status() and > > v9fs_recei

Re: [PATCH v7 10/13] spapr: Add PEF based confidential guest support

2021-01-14 Thread Greg Kurz
On Thu, 14 Jan 2021 10:58:08 +1100 David Gibson wrote: > Some upcoming POWER machines have a system called PEF (Protected > Execution Facility) which uses a small ultravisor to allow guests to > run in a way that they can't be eavesdropped by the hypervisor. The > effect is roughly similar to

Re: [PATCH v7 09/13] confidential guest support: Update documentation

2021-01-14 Thread Greg Kurz
option > 2. Add a docs/confidential-guest-support.txt to cover the generalities of > the confidential guest support scheme > > Signed-off-by: David Gibson > --- LGTM Reviewed-by: Greg Kurz > docs/amd-memory-encryption.txt | 2 +- > docs/co

Re: [PATCH v7 07/13] confidential guest support: Introduce cgs "ready" flag

2021-01-14 Thread Greg Kurz
any new cgs implementation, I guess it could be advertised a bit more with some extra documentation in the confidential-guest-support.h header file as well. Anyway, Reviewed-by: Greg Kurz Unrelated. I've just spotted mdr...@linux.vnet.ibm.com in the Cc list of this thread, but, as you kno

Re: [PATCH] spapr: Improve handling of memory unplug with old guests

2021-01-13 Thread Greg Kurz
On Wed, 13 Jan 2021 12:20:58 +1100 David Gibson wrote: > On Fri, Jan 08, 2021 at 06:31:27PM +0100, Greg Kurz wrote: > > Since commit 1e8b5b1aa16b ("spapr: Allow memory unplug to always succeed") > > trying to unplug memory from a guest that doesn't support it (eg. rhel6

Re: [RFC PATCH v0 1/1] target/ppc: Support for H_RPT_INVALIDATE hcall

2021-01-13 Thread Greg Kurz
Hi Bharata, On Wed, 6 Jan 2021 14:29:10 +0530 Bharata B Rao wrote: > If KVM_CAP_RPT_INVALIDATE KVM capability is enabled, then > > - indicate the availability of H_RPT_INVALIDATE hcall to the guest via > ibm,hypertas-functions property. > - Enable the hcall > > Both the above are done only

Re: [PATCH v6 11/13] spapr: PEF: prevent migration

2021-01-12 Thread Greg Kurz
ame approach used by AMD SEV). > > Signed-off-by: David Gibson > Reviewed-by: Dr. David Alan Gilbert > --- Reviewed-by: Greg Kurz > hw/ppc/pef.c | 7 +++ > 1 file changed, 7 insertions(+) > > diff --git a/hw/ppc/pef.c b/hw/ppc/pef.c > index b227dc6905..822668d9ae

Re: [PATCH v6 12/13] confidential guest support: Alter virtio default properties for protected guests

2021-01-12 Thread Greg Kurz
ed with > the hypervisor or hardware so that DMA will work. > > Signed-off-by: David Gibson > Reviewed-by: Dr. David Alan Gilbert > Reviewed-by: Cornelia Huck > --- Reviewed-by: Greg Kurz > hw/core/machine.c | 13 + > 1 file changed, 13 insertions(+) > &

Re: [PATCH v6 10/13] spapr: Add PEF based confidential guest support

2021-01-12 Thread Greg Kurz
On Tue, 12 Jan 2021 15:45:05 +1100 David Gibson wrote: > Some upcoming POWER machines have a system called PEF (Protected > Execution Facility) which uses a small ultravisor to allow guests to > run in a way that they can't be eavesdropped by the hypervisor. The > effect is roughly similar to

Re: [PATCH v6 05/13] confidential guest support: Rework the "memory-encryption" property

2021-01-12 Thread Greg Kurz
warning in machine_set_memory_encryption() ? Apart from that, LGTM: Reviewed-by: Greg Kurz > Signed-off-by: David Gibson > --- > accel/kvm/kvm-all.c | 5 +++-- > accel/kvm/sev-stub.c | 5 +++-- > hw/core/machine.c| 43 +-

Re: [PATCH v6 04/13] confidential guest support: Move side effect out of machine_set_memory_encryption()

2021-01-12 Thread Greg Kurz
_init() conditional on > the final value of the property. > > Signed-off-by: David Gibson > Reviewed-by: Richard Henderson > --- Reviewed-by: Greg Kurz > hw/core/machine.c | 17 + > 1 file changed, 9 insertions(+), 8 deletions(-) > > diff --git a/hw/core/

[PATCH] 9pfs/proxy: Check return value of proxy_marshal()

2021-01-11 Thread Greg Kurz
This should always successfully write exactly two 32-bit integers. Make it clear with an assert(), like v9fs_receive_status() and v9fs_receive_response() already do when unmarshalling the same header. Fixes: Coverity CID 1438968 Signed-off-by: Greg Kurz --- hw/9pfs/9p-proxy.c |3 ++- 1 file

[PATCH] spapr: Improve handling of memory unplug with old guests

2021-01-08 Thread Greg Kurz
cceed") Signed-off-by: Greg Kurz --- hw/ppc/spapr.c | 24 +--- hw/ppc/spapr_events.c |3 +-- hw/ppc/spapr_ovec.c |7 +++ include/hw/ppc/spapr.h |2 +- include/hw/ppc/spapr_ovec.h |1 + 5 files changed, 23 insertions(+)

Re: [PATCH 3/3] sam460ex: Use type cast macro instead of simple cast

2021-01-07 Thread Greg Kurz
On Thu, 7 Jan 2021 10:45:26 +0100 BALATON Zoltan wrote: > On Thu, 7 Jan 2021, Greg Kurz wrote: > > On Wed, 6 Jan 2021 16:24:01 +0100 > > BALATON Zoltan via wrote: > > > >> Use the PCI_BUS type cast macro to convert result of > >> qdev_get_child_bus(). Al

Re: [PATCH 3/3] sam460ex: Use type cast macro instead of simple cast

2021-01-07 Thread Greg Kurz
On Wed, 6 Jan 2021 16:24:01 +0100 BALATON Zoltan via wrote: > Use the PCI_BUS type cast macro to convert result of > qdev_get_child_bus(). Also remove the check for NULL afterwards which > should not be needed because sysbus_create_simple() uses error_abort It seems to me that

Re: [PATCH 6/6] spapr: Model DR connectors as simple objects

2021-01-06 Thread Greg Kurz
On Mon, 28 Dec 2020 19:28:39 +1100 David Gibson wrote: > On Fri, Dec 18, 2020 at 11:34:00AM +0100, Greg Kurz wrote: > > Modeling DR connectors as individual devices raises some > > concerns, as already discussed a year ago in this thread: > > > > https://patchew.org/

[PATCH v3 3/3] pnv: Fix reverse dependency on PCI express root ports

2020-12-24 Thread Greg Kurz
dependency on PCI. For this reason, PCI_EXPRESS and MSI_NONBROKEN are also moved under PCI_POWERNV. Signed-off-by: Greg Kurz Reviewed-by: Cédric Le Goater --- hw/pci-host/Kconfig |5 + hw/pci-host/meson.build |2 +- hw/ppc/Kconfig |3 +-- 3 files changed, 7 insertions

[PATCH v3 1/3] ppc: Fix build with --without-default-devices

2020-12-24 Thread Greg Kurz
because CI doesn't test the build with --without-default-devices and KVM enabled on a POWER host. Signed-off-by: Greg Kurz --- The various comments motivated me enough for another round, which is basically to split the cleanup out to a separate patch and use CONFIG_PSERIES in hw/intc/mes

[PATCH v3 2/3] ppc: Simplify reverse dependencies of POWERNV and PSERIES on XICS and XIVE

2020-12-24 Thread Greg Kurz
Have PSERIES to select XICS and XIVE, and directly check PSERIES in hw/intc/meson.build to enable build of the XICS and XIVE sPAPR backends, like POWERNV already does. This allows to get rid of the intermediate XICS_SPAPR and XIVE_SPAPR. Signed-off-by: Greg Kurz --- hw/intc/Kconfig |4

[PATCH v2 2/2] pnv: Fix reverse dependency on PCI express root ports

2020-12-23 Thread Greg Kurz
dependency on PCI. For this reason, PCI_EXPRESS and MSI_NONBROKEN are also moved under PCI_POWERNV. Signed-off-by: Greg Kurz --- hw/pci-host/Kconfig |5 + hw/pci-host/meson.build |2 +- hw/ppc/Kconfig |3 +-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git

[PATCH v2 1/2] ppc: Fix build with --without-default-devices

2020-12-23 Thread Greg Kurz
VE_SPAPR to hw/intc/Kconfig where it belongs. This went unnoticed so far because CI doesn't test the build with --without-default-devices and KVM enabled on a POWER host. Signed-off-by: Greg Kurz --- v2: - check CONFIG_KVM in the meson.build as suggested by Paolo --- hw/intc/Kconfig

Re: [PATCH] ppc: Fix build with --without-default-devices

2020-12-23 Thread Greg Kurz
On Wed, 23 Dec 2020 09:55:58 +0100 Paolo Bonzini wrote: > On 23/12/20 09:10, Greg Kurz wrote: > > Linking of the qemu-system-ppc64 fails on a POWER9 host when > > --without-default-devices is passed to configure: > > > > $ ./configure --without-default-devices \ >

[PATCH] ppc: Fix build with --without-default-devices

2020-12-23 Thread Greg Kurz
lt-devices and KVM enabled on a POWER host. Signed-off-by: Greg Kurz --- hw/intc/Kconfig | 18 +- hw/ppc/Kconfig | 17 ++--- 2 files changed, 15 insertions(+), 20 deletions(-) diff --git a/hw/intc/Kconfig b/hw/intc/Kconfig index 468d548ca771..0a5c080c4f5c 100644 ---

Re: [RFC Qemu PATCH v2 1/2] spapr: drc: Add support for async hcalls at the drc level

2020-12-21 Thread Greg Kurz
On Mon, 21 Dec 2020 13:08:53 +0100 Greg Kurz wrote: > Hi Shiva, > > On Mon, 30 Nov 2020 09:16:39 -0600 > Shivaprasad G Bhat wrote: > > > The patch adds support for async hcalls at the DRC level for the > > spapr devices. To be used by spapr-scm device

Re: [RFC Qemu PATCH v2 0/2] spapr: nvdimm: Asynchronus flush hcall support

2020-12-21 Thread Greg Kurz
On Mon, 30 Nov 2020 09:16:14 -0600 Shivaprasad G Bhat wrote: > The nvdimm devices are expected to ensure write persistent during power > failure kind of scenarios. > > The libpmem has architecture specific instructions like dcbf on power > to flush the cache data to backend nvdimm device during

Re: [RFC Qemu PATCH v2 2/2] spapr: nvdimm: Implement async flush hcalls

2020-12-21 Thread Greg Kurz
On Mon, 30 Nov 2020 09:17:24 -0600 Shivaprasad G Bhat wrote: > When the persistent memory beacked by a file, a cpu cache flush instruction > is not sufficient to ensure the stores are correctly flushed to the media. > > The patch implements the async hcalls for flush operation on demand from

Re: [PATCH qemu v12] spapr: Implement Open Firmware client interface

2020-12-21 Thread Greg Kurz
iously, this code is being added to the QEMU source tree, not like it is some foreign code imported as a git submodule, so I don't see why regular QEMU coding style guidelines wouldn't apply ? > > > > > Acked-by: Greg Kurz > > > > and > > > &g

Re: [RFC Qemu PATCH v2 1/2] spapr: drc: Add support for async hcalls at the drc level

2020-12-21 Thread Greg Kurz
Hi Shiva, On Mon, 30 Nov 2020 09:16:39 -0600 Shivaprasad G Bhat wrote: > The patch adds support for async hcalls at the DRC level for the > spapr devices. To be used by spapr-scm devices in the patch/es to follow. > > Signed-off-by: Shivaprasad G Bhat > --- The overall idea looks good but I

Re: [PATCH] spapr: Fix buffer overflow in spapr_numa_associativity_init()

2020-12-18 Thread Greg Kurz
On Fri, 18 Dec 2020 16:16:49 +0100 Philippe Mathieu-Daudé wrote: > On 12/18/20 2:53 PM, Greg Kurz wrote: > > Running a guest with 128 NUMA nodes crashes QEMU: > > > > ../../util/error.c:59: error_setv: Assertion `*errp == NULL' failed. > > > > The crash happens

[PATCH] spapr: Fix buffer overflow in spapr_numa_associativity_init()

2020-12-18 Thread Greg Kurz
so this moves the definition of NVGPU_MAX_NUM to "hw/ppc/spapr.h" instead. Reported-by: Min Deng BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1908693 Fixes: dd7e1d7ae431 ("spapr_numa: move NVLink2 associativity handling to spapr_numa.c") Cc: danielhb...@gmail.com Signed-off-

Re: [PATCH qemu v12] spapr: Implement Open Firmware client interface

2020-12-18 Thread Greg Kurz
ardev=SOCKET0,mode=control > > --- > Changes: > v12: > * split VOF and SPAPR > Thanks for the split. The VOF paths are now clearly identified in the sPAPR code, and well guarded by a check on x-vof. Rest of the patch looks good to me. I gave it a try with a stock fedora 33 kernel and initramfs and it booted really fast ! With the checkpatch complaints addressed, Acked-by: Greg Kurz and Tested-by: Greg Kurz

[PATCH 4/6] spapr: Use spapr_drc_reset_all() at machine reset

2020-12-18 Thread Greg Kurz
PCI bridge, both of which will then in turn destroy their PCI DRCs. This could potentially invalidate the iterator used by do_object_child_foreach(). It is pure luck that this haven't caused any issues so far. Use spapr_drc_reset_all() since it can cope with DRC removal. Signed-off-by: Greg Kurz -

[PATCH 0/6] spapr: Fix visibility and traversal of DR connectors

2020-12-18 Thread Greg Kurz
-tree' output. This is transparent to migration. Greg Kurz (6): spapr: Call spapr_drc_reset() for all DRCs at CAS spapr: Fix reset of transient DR connectors spapr: Introduce spapr_drc_reset_all() spapr: Use spapr_drc_reset_all() at machine reset spapr: Add drc_ prefix to the DRC realize

[PATCH 5/6] spapr: Add drc_ prefix to the DRC realize and unrealize functions

2020-12-18 Thread Greg Kurz
Use a less generic name for an easier experience with tools such as cscope or grep. Signed-off-by: Greg Kurz --- hw/ppc/spapr_drc.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c index a4d2608017c5..8571d5bafe4e 100644

[PATCH 1/6] spapr: Call spapr_drc_reset() for all DRCs at CAS

2020-12-18 Thread Greg Kurz
Non-transient DRCs are either in the empty or the ready state, which means spapr_drc_reset() doesn't change their state. It is thus not needed to do any checking. Call spapr_drc_reset() unconditionally and squash spapr_drc_transient() into its only user, spapr_drc_needed(). Signed-off-by: Greg

[PATCH 3/6] spapr: Introduce spapr_drc_reset_all()

2020-12-18 Thread Greg Kurz
No need to expose the way DRCs are traversed outside of spapr_drc.c. Signed-off-by: Greg Kurz --- include/hw/ppc/spapr_drc.h | 6 ++ hw/ppc/spapr_drc.c | 31 + hw/ppc/spapr_hcall.c | 40 ++ 3 files changed, 43

[PATCH 2/6] spapr: Fix reset of transient DR connectors

2020-12-18 Thread Greg Kurz
. This can potentially increase the overall DRC reset time, especially with a high maxmem which generates a lot of LMB DRCs. But this kind of setup is rare, and so is the use case of rebooting a guest while doing hot-unplug. Signed-off-by: Greg Kurz --- include/hw/ppc/spapr_drc.h | 3 ++- hw/ppc/s

[PATCH 6/6] spapr: Model DR connectors as simple objects

2020-12-18 Thread Greg Kurz
the DRC with spapr_dr_connector_free() instead of object_unparent(). No longer add the DRCs to the QOM composition tree. Track them with a glib hash table using the global DRC index as the key instead. This makes traversal a linear operation. Signed-off-by: Greg Kurz --- include/hw/ppc/spapr_drc.h

Re: [for-6.0 v5 11/13] spapr: PEF: prevent migration

2020-12-17 Thread Greg Kurz
On Thu, 17 Dec 2020 12:38:42 +0100 Cornelia Huck wrote: > On Thu, 17 Dec 2020 16:47:36 +1100 > David Gibson wrote: > > > On Mon, Dec 14, 2020 at 06:22:40PM +0100, Cornelia Huck wrote: > > > On Fri, 4 Dec 2020 16:44:13 +1100 > > > David Gibson wrote: > > > > > > > We haven't yet

[PATCH] spapr: DRC lookup cannot fail

2020-12-15 Thread Greg Kurz
1437757 and 1437758. Signed-off-by: Greg Kurz --- hw/ppc/spapr.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index dee48a0043bb..c283ff639040 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -3424,6 +3424,7 @@ static void spapr_add_lmbs(DeviceState *dev

Re: [PULL 06/30] spapr: Do PHB hoplug sanity check at pre-plug

2020-12-15 Thread Greg Kurz
On Tue, 15 Dec 2020 16:56:36 + Peter Maydell wrote: > On Mon, 14 Dec 2020 at 04:58, David Gibson > wrote: > > > > From: Greg Kurz > > > > We currently detect that a PHB index is already in use at plug time. > > But this can be decteted at pr

[PATCH] spapr: Fix DR properties of the root node

2020-12-14 Thread Greg Kurz
now we also have the 4 ((2G - 1G) / 256M) LMBs and the 8 (slots) PMEMs. Fixes: 3998ccd09298 ("spapr: populate PHB DRC entries for root DT node") Signed-off-by: Greg Kurz --- hw/ppc/spapr.c | 21 - hw/ppc/spapr_drc.c |6 ++ 2 files changed, 18 insertions(+)

[PATCH REPOST] spapr: Allow memory unplug to always succeed

2020-12-14 Thread Greg Kurz
memory from a guest that doesn't support it will likely just do nothing and the memory will only get removed at next reboot. Such older guests can still get the existing behavior by using an older machine type. Signed-off-by: Greg Kurz --- This patch was initially posted before the compat machine

Re: [PATCH v3 1/1] spapr.c: set a 'kvm-type' default value instead of relying on NULL

2020-12-10 Thread Greg Kurz
VM_CREATE_VM > ioctl(), where the default value '0' makes the kernel choose an available > KVM module to use, giving precedence to kvm_hv. This logic is described in > the kernel source file arch/powerpc/kvm/powerpc.c, function > kvm_arch_init_vm(). > > Signed-off-by: Daniel Henr

Re: [PATCH v2 1/1] spapr.c: set a 'kvm-type' default value instead of relying on NULL

2020-12-10 Thread Greg Kurz
On Thu, 10 Dec 2020 15:01:20 +0100 Greg Kurz wrote: > On Thu, 10 Dec 2020 10:07:21 -0300 > Daniel Henrique Barboza wrote: > > > spapr_kvm_type() is considering 'vm_type=NULL' as a valid input, where > > the function returns 0. This is relying on the current QEMU machine

Re: [PATCH v2 1/1] spapr.c: set a 'kvm-type' default value instead of relying on NULL

2020-12-10 Thread Greg Kurz
On Thu, 10 Dec 2020 10:07:21 -0300 Daniel Henrique Barboza wrote: > spapr_kvm_type() is considering 'vm_type=NULL' as a valid input, where > the function returns 0. This is relying on the current QEMU machine > options handling logic, where the absence of the 'kvm-type' option > will be

Re: [PATCH 1/1] spapr.c: set a 'kvm-type' default value instead of relying on NULL

2020-12-10 Thread Greg Kurz
On Thu, 10 Dec 2020 10:10:21 -0300 Daniel Henrique Barboza wrote: > > > On 12/10/20 9:47 AM, Greg Kurz wrote: > > On Thu, 10 Dec 2020 13:34:59 +0100 > > Paolo Bonzini wrote: > > > >> To sum up everything: > >> > > > > LGTM > >

Re: [PATCH 1/1] spapr.c: set a 'kvm-type' default value instead of relying on NULL

2020-12-10 Thread Greg Kurz
On Thu, 10 Dec 2020 13:34:59 +0100 Paolo Bonzini wrote: > To sum up everything: > LGTM > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c > index 2d5aeeb45a..61f0963916 100644 > --- a/hw/ppc/spapr.c > +++ b/hw/ppc/spapr.c > @@ -3028,11 +3028,11 @@ static int spapr_kvm_type(MachineState *machine,

Re: [PATCH for-6.0] spapr: Allow memory unplug to always succeed

2020-12-10 Thread Greg Kurz
On Thu, 10 Dec 2020 14:38:44 +1100 David Gibson wrote: > On Tue, Dec 08, 2020 at 10:06:09AM +0100, Greg Kurz wrote: > > On Tue, 8 Dec 2020 15:30:04 +1100 > > David Gibson wrote: > > > > > On Mon, Dec 07, 2020 at 02:37:04PM +0100, Greg Kurz wrote: > > &

Re: [PATCH 6/6] target/ppc: Add mce_req_event() handler to PPCVirtualHypervisorClass

2020-12-10 Thread Greg Kurz
On Thu, 10 Dec 2020 14:54:08 +1100 David Gibson wrote: > On Wed, Dec 09, 2020 at 06:00:52PM +0100, Greg Kurz wrote: > > kvm_handle_nmi() directly calls spapr_mce_req_event() which is machine > > level code. Apart from being ugly, this forces spapr_mce_req_event() > > to rel

Re: [PATCH 1/6] spapr: Add an "spapr" property to sPAPR CPU core

2020-12-10 Thread Greg Kurz
On Thu, 10 Dec 2020 14:53:02 +1100 David Gibson wrote: > On Wed, Dec 09, 2020 at 01:26:17PM -0500, Eduardo Habkost wrote: > > On Wed, Dec 09, 2020 at 07:11:40PM +0100, Philippe Mathieu-Daudé wrote: > > [...] > > > @@ -200,7 +199,7 @@ static void spapr_cpu_core_reset(DeviceState > > >

Re: [PATCH 1/6] spapr: Add an "spapr" property to sPAPR CPU core

2020-12-09 Thread Greg Kurz
On Wed, 9 Dec 2020 13:26:17 -0500 Eduardo Habkost wrote: > On Wed, Dec 09, 2020 at 07:11:40PM +0100, Philippe Mathieu-Daudé wrote: > [...] > > @@ -200,7 +199,7 @@ static void spapr_cpu_core_reset(DeviceState *dev) > > int i; > > > > for (i = 0; i < cc->nr_threads;

Re: [PATCH 1/6] spapr: Add an "spapr" property to sPAPR CPU core

2020-12-09 Thread Greg Kurz
On Wed, 9 Dec 2020 18:34:31 +0100 Philippe Mathieu-Daudé wrote: > On 12/9/20 6:00 PM, Greg Kurz wrote: > > The sPAPR CPU core device can only work with pseries machine types. > > This is currently checked in the realize function with a dynamic > > cast of qdev_get_machine

[PATCH 0/2] target/ppc: Fix detection of 64-bit MMU models

2020-12-09 Thread Greg Kurz
in the future. Greg Kurz (1): target/ppc: Introduce an mmu_is_64bit() helper Stephane Duverger (1): ppc/translate: Use POWERPC_MMU_64 to detect 64-bit MMU models target/ppc/cpu-qom.h| 5 + target/ppc/excp_helper.c| 4 ++-- target/ppc/machine.c| 4

[PATCH 2/2] target/ppc: Introduce an mmu_is_64bit() helper

2020-12-09 Thread Greg Kurz
Callers don't really need to know how 64-bit MMU model enums are computed. Hide this in a helper. Signed-off-by: Greg Kurz --- target/ppc/cpu-qom.h| 5 + target/ppc/excp_helper.c| 4 ++-- target/ppc/machine.c| 4 ++-- target/ppc/mmu-hash64.c | 2

[PATCH 1/2] ppc/translate: Use POWERPC_MMU_64 to detect 64-bit MMU models

2020-12-09 Thread Greg Kurz
stores on hash64") Signed-off-by: Stephane Duverger [groug: - extended patch to address another misuse of POWERPC_MMU_64B - updated title and changelog accordingly] Signed-off-by: Greg Kurz --- target/ppc/translate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t

[PATCH 3/6] spapr: Pass sPAPR machine state down to spapr_pci_switch_vga()

2020-12-09 Thread Greg Kurz
This allows to drop a user of qdev_get_machine(). Signed-off-by: Greg Kurz --- include/hw/ppc/spapr.h | 2 +- hw/ppc/spapr_hcall.c | 7 --- hw/ppc/spapr_pci.c | 3 +-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h index

[PATCH 5/6] spapr: Pass sPAPR machine state to some RTAS events handling functions

2020-12-09 Thread Greg Kurz
Some functions in hw/ppc/spapr_events.c get a pointer to the machine state using qdev_get_machine(). Convert them to get it from their caller when possible. Signed-off-by: Greg Kurz --- hw/ppc/spapr_events.c | 21 ++--- 1 file changed, 10 insertions(+), 11 deletions(-) diff

[PATCH 4/6] spapr: Don't use qdev_get_machine() in spapr_msi_write()

2020-12-09 Thread Greg Kurz
spapr_phb_realize() passes the sPAPR machine state as opaque data for the I/O callbacks: memory_region_init_io(>msiwindow, OBJECT(sphb), _msi_ops, spapr, ^ "msi", msi_window_size); Signed

[PATCH 1/6] spapr: Add an "spapr" property to sPAPR CPU core

2020-12-09 Thread Greg Kurz
spapr" link property which officialy points to the machine. This link is set by pseries machine types only in the pre-plug handler. This allows to drop some users of qdev_get_machine(). Signed-off-by: Greg Kurz --- include/hw/ppc/spapr_cpu_core.h | 2 ++ hw/ppc/spapr.c |

[PATCH 0/6] spapr: Drop some users of qdev_get_machine()

2020-12-09 Thread Greg Kurz
Accessing the machine state using the global qdev_get_machine() function isn't generally recommended. In a bunch of places in the sPAPR code, the machine state can be obtained from the caller actually. Greg Kurz (6): spapr: Add an "spapr" property to sPAPR CPU core spapr: Add

[PATCH 2/6] spapr: Add an "spapr" property to sPAPR PHB

2020-12-09 Thread Greg Kurz
spapr" link property which officialy points to the machine. This link is set by pseries machine types only in the pre-plug handler. This allows to drop some users of qdev_get_machine(). Signed-off-by: Greg Kurz --- include/hw/pci-host/spapr.h | 1 + hw/ppc/spapr.c | 4 ++

[PATCH 6/6] target/ppc: Add mce_req_event() handler to PPCVirtualHypervisorClass

2020-12-09 Thread Greg Kurz
, which happens to be the machine itself with sPAPR. Turn spapr_mce_req_event() into a PPC virtual hypervisor operation, and adapt kvm_handle_nmi() to call it as such. Signed-off-by: Greg Kurz --- include/hw/ppc/spapr.h | 3 ++- target/ppc/cpu.h | 2 ++ hw/ppc/spapr.c | 1 + hw/ppc

Re: [PATCH] ppc/translate: Fix need_access_type for non MMU_64

2020-12-09 Thread Greg Kurz
On Wed, 9 Dec 2020 10:35:44 +0100 Stephane Duverger wrote: > The 64bits MMU variants have POWERPC_MMU_64 flag and POWERPC_MMU_64B > is a specific one (POWERPC_MMU_32B with flag POWERPC_MMU_64). As a > consequence, the original test ignored POWERPC_MMU_32B too. Hrm... POWERPC_MMU_64B is just the

Re: [PATCH 1/1] spapr.c: set a 'kvm-type' default value instead of relying on NULL

2020-12-08 Thread Greg Kurz
Hi Daniel, On Tue, 8 Dec 2020 10:45:36 -0300 Daniel Henrique Barboza wrote: > spapr_kvm_type() is considering 'vm_type=NULL' as a valid input, where > the function returns 0. This is relying on the current QEMU machine > options handling logic, where the absence of the 'kvm-type' option > will

Re: [PATCH for-6.0] spapr: Allow memory unplug to always succeed

2020-12-08 Thread Greg Kurz
On Tue, 8 Dec 2020 15:30:04 +1100 David Gibson wrote: > On Mon, Dec 07, 2020 at 02:37:04PM +0100, Greg Kurz wrote: > > It is currently impossible to hot-unplug a memory device between > > machine reset and CAS. > > > > (qemu) device_del dimm1 > > Error

Re: [PATCH qemu v11] spapr: Implement Open Firmware client interface

2020-12-07 Thread Greg Kurz
On Mon, 7 Dec 2020 18:33:27 +1100 Alexey Kardashevskiy wrote: > The PAPR platform which describes an OS environment that's presented by > a combination of a hypervisor and firmware. The features it specifies > require collaboration between the firmware and the hypervisor. > > Since the

[PATCH for-6.0] spapr: Allow memory unplug to always succeed

2020-12-07 Thread Greg Kurz
memory from a guest that doesn't support it will likely just do nothing and the memory will only get removed at next reboot. Such older guests can still get the existing behavior by using an older machine type. Signed-off-by: Greg Kurz --- Based-on: 20201109173928.1001764-1-coh...@redhat.com

Re: [PATCH qemu v10] spapr: Implement Open Firmware client interface

2020-12-07 Thread Greg Kurz
On Mon, 7 Dec 2020 18:33:34 +1100 Alexey Kardashevskiy wrote: [...] > >> +} > >> + > >> +return offset; > >> +} > >> + > >> +static uint32_t of_client_finddevice(const void *fdt, uint32_t nodeaddr) > >> +{ > >> +char *node, *unit, *part; > > > > If you do this: > > > >

Re: [PATCH qemu v10] spapr: Implement Open Firmware client interface

2020-12-04 Thread Greg Kurz
On Fri, 4 Dec 2020 19:32:05 +0100 Greg Kurz wrote: > > That's all for now. > Just one last item. I'm observing failures with nvram in the guest: [root@vir76 ~]# nvram --print-config [ 88.179444] nvram[936]: unhandled signal 11 at 7fffc83a nip 00012d802110 lr 000

Re: [PATCH qemu v10] spapr: Implement Open Firmware client interface

2020-12-04 Thread Greg Kurz
On Tue, 13 Oct 2020 13:19:11 +1100 Alexey Kardashevskiy wrote: > The PAPR platform which describes an OS environment that's presented by > a combination of a hypervisor and firmware. The features it specifies > require collaboration between the firmware and the hypervisor. > > Since the

Re: [PATCH for-6.0 v2 2/3] spapr/xive: Fix size of END table and number of claimed IPIs

2020-12-04 Thread Greg Kurz
On Fri, 4 Dec 2020 09:46:31 +0100 Cédric Le Goater wrote: > >> I don't think we need much more than patch 1 which clarifies the > >> nature of the values being manipulated, quantities vs. numbering. > >> > >> The last 2 patches are adding complexity to try to optimize the > >> XIVE VP space in

Re: [for-6.0] MAINTAINERS: Add Greg Kurz as co-maintainer for ppc

2020-12-03 Thread Greg Kurz
n > --- Acked-by: Greg Kurz > MAINTAINERS | 17 - > 1 file changed, 16 insertions(+), 1 deletion(-) > > I've also applied this change to my ppc-for-6.0 branch. > > diff --git a/MAINTAINERS b/MAINTAINERS > index 68bc160f41..bb7e3b3203 100644 > --- a/M

Re: [PATCH for-6.0 v2 2/3] spapr/xive: Fix size of END table and number of claimed IPIs

2020-12-03 Thread Greg Kurz
On Thu, 3 Dec 2020 10:51:10 +0100 Cédric Le Goater wrote: > On 11/30/20 7:07 PM, Cédric Le Goater wrote: > > On 11/30/20 5:52 PM, Greg Kurz wrote: > >> The sPAPR XIVE device has an internal ENDT table the size of > >> which is configurable by the machine. This table

Re: [PATCH for-6.0 v2 1/3] spapr: Improve naming of some vCPU id related items

2020-12-03 Thread Greg Kurz
On Wed, 2 Dec 2020 15:56:16 +1100 David Gibson wrote: > On Mon, Nov 30, 2020 at 05:52:56PM +0100, Greg Kurz wrote: > > The machine tells the IC backend the number of vCPU ids it will be > > exposed to, in order to: > > - fill the "ibm,interrupt-server-ranges" prope

[PATCH for-6.0] hw/ppc: Do not re-read the clock on pre_save if doing savevm

2020-12-02 Thread Greg Kurz
for live migration of paused guests (commit d14f33976282). Extend the logic to do the same with savevm. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1893787 Signed-off-by: Greg Kurz --- hw/ppc/ppc.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/ppc/ppc.c b

Re: [PATCH] target/ppc: Remove "compat" property of server class POWER CPUs

2020-12-01 Thread Greg Kurz
Just to clarify, this is for 6.0. On Tue, 1 Dec 2020 14:11:03 +0100 Greg Kurz wrote: > This property has been deprecated since QEMU 5.0 by commit 22062e54bb68. > We only kept a legacy hack that internally converts "compat" into the > official "max-cpu-compat" pr

[PATCH] target/ppc: Remove "compat" property of server class POWER CPUs

2020-12-01 Thread Greg Kurz
QEMU 5.2 already. Do it now ; since ppc_cpu_parse_featurestr() now just calls the generic parent_parse_features handler, drop it as well. Users are supposed to use the "max-cpu-compat" property of the pseries machine type instead. Signed-off-by: Greg Kurz --- docs/system/deprecated.

[PATCH for-6.0 v2 4/4] spapr: spapr_drc_attach() cannot fail

2020-12-01 Thread Greg Kurz
All users are passing _abort already. Document the fact that spapr_drc_attach() should only be passed a free DRC, which is supposedly the case if appropriate checking is done earlier. Signed-off-by: Greg Kurz --- include/hw/ppc/spapr_drc.h | 8 +++- hw/ppc/spapr.c | 6 +++--- hw

[PATCH for-6.0 v2 3/4] spapr: Simplify error path of spapr_core_plug()

2020-12-01 Thread Greg Kurz
and that spapr_drc_attach() shouldn't fail. Pass _abort to spapr_drc_attach() and simplify error handling. Signed-off-by: Greg Kurz --- hw/ppc/spapr.c | 21 ++--- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 3a32918dd9a9

<    2   3   4   5   6   7   8   9   10   11   >