Re: [PATCH] tests/qtest/migrate-test: Add a postcopy memfile test

2024-05-30 Thread Nicholas Piggin
On Thu May 30, 2024 at 3:35 AM AEST, Fabiano Rosas wrote: > Peter Xu writes: > > > On Wed, May 29, 2024 at 09:54:30AM -0300, Fabiano Rosas wrote: > >> Nicholas Piggin writes: > >> > >> > Postcopy requires userfaultfd support, which requires tmpfs if a memory > >> > file is used. > >> > > >> > Th

[PATCH] qga: Remove deprecated 'blacklist' argument / config key

2024-05-30 Thread Philippe Mathieu-Daudé
The 'blacklist' argument / config key are deprecated since commi 582a098e6c ("qga: Replace 'blacklist' command line and config file options by 'block-rpcs'"), time to remove them. Signed-off-by: Philippe Mathieu-Daudé --- docs/about/deprecated.rst | 18 -- docs/about/remove

Re: [PATCH v4 11/11] ppc/pnv: Update skiboot.lid to support Power11

2024-05-30 Thread Cédric Le Goater
On 5/30/24 08:41, Aditya Gupta wrote: Hello Cedric, On Tue, May 28, 2024 at 09:15:29AM GMT, Cédric Le Goater wrote: On 5/28/24 09:05, Aditya Gupta wrote: Skiboot/OPAL patches are in discussion upstream [1], with corresponding commits in github repository [2]. Update skiboot.lid, with binary b

[RFC v2 PATCH] docs: Enhance documentation for iommu bypass

2024-05-30 Thread Aaron Lu
When Intel vIOMMU is used and irq remapping is enabled, using bypass_iommu will cause following two callstacks dumped during guest kernel boot(Linux x86_64) and all PCI devices attached to root bridge lose their MSI capability and fall back to using IOAPIC: [0.960262] [ cut here ]-

Re: [PATCH v4 02/11] ppc/pseries: Add Power11 cpu type

2024-05-30 Thread Harsh Prateek Bora
On 5/28/24 12:35, Aditya Gupta wrote: Add sPAPR CPU Core definition for Power11 Cc: David Gibson (reviewer:sPAPR (pseries)) Cc: Harsh Prateek Bora (reviewer:sPAPR (pseries)) Cc: Cédric Le Goater Cc: Daniel Henrique Barboza Cc: Frédéric Barrat Cc: Mahesh J Salgaonkar Cc: Madhavan Sriniva

[PATCH 0/2] qapi: Remove deprecated events

2024-05-30 Thread Philippe Mathieu-Daudé
Remove MEM_UNPLUG_ERROR and 'vcpu' field in TRACE events, all deprecated since long enough. Philippe Mathieu-Daudé (2): hw/acpi: Remove the deprecated QAPI MEM_UNPLUG_ERROR event trace: Remove deprecated 'vcpu' field from QMP trace events docs/about/deprecated.rst | 16

[PATCH 1/2] hw/acpi: Remove the deprecated QAPI MEM_UNPLUG_ERROR event

2024-05-30 Thread Philippe Mathieu-Daudé
The MEM_UNPLUG_ERROR event is deprecated since commit d43f1670c7 ("qapi/qdev.json: add DEVICE_UNPLUG_GUEST_ERROR QAPI event"), time to remove it. Signed-off-by: Philippe Mathieu-Daudé --- docs/about/deprecated.rst | 5 - docs/about/removed-features.rst | 9 + qapi/machine.jso

[PATCH 2/2] trace: Remove deprecated 'vcpu' field from QMP trace events

2024-05-30 Thread Philippe Mathieu-Daudé
'vcpu' fields are deprecated since commit 5485e52a33 ("qapi: make the vcpu parameters deprecated for 8.1"), time to remove them. Signed-off-by: Philippe Mathieu-Daudé --- docs/about/deprecated.rst | 11 --- docs/about/removed-features.rst | 6 ++ qapi/trace.json

Re: [PATCH v4 02/11] ppc/pseries: Add Power11 cpu type

2024-05-30 Thread Cédric Le Goater
On 5/30/24 09:06, Harsh Prateek Bora wrote: On 5/28/24 12:35, Aditya Gupta wrote: Add sPAPR CPU Core definition for Power11 Cc: David Gibson (reviewer:sPAPR (pseries)) Cc: Harsh Prateek Bora (reviewer:sPAPR (pseries)) Cc: Cédric Le Goater Cc: Daniel Henrique Barboza Cc: Frédéric Barrat C

Re: [PATCH 3/3] semihosting: Restrict to TCG

2024-05-30 Thread Philippe Mathieu-Daudé
On 30/5/24 08:02, Paolo Bonzini wrote: On Wed, May 29, 2024 at 5:56 PM Philippe Mathieu-Daudé wrote: It is pointless to build semihosting when TCG is not available. Why? I would have naively assumed that a suitable semihosting API could be implemented by KVM. The justification (and thus the c

Re: [PATCH 0/3] semihosting: Restrict to TCG

2024-05-30 Thread Philippe Mathieu-Daudé
On 30/5/24 08:03, Paolo Bonzini wrote: On Wed, May 29, 2024 at 9:11 PM Alex Bennée wrote: Philippe Mathieu-Daudé writes: It is pointless to build semihosting when TCG is not available. Philippe Mathieu-Daudé (3): target/mips: Restrict semihosting to TCG target/riscv: Restrict semihos

Re: [PATCH 3/3] semihosting: Restrict to TCG

2024-05-30 Thread Alex Bennée
Paolo Bonzini writes: > On Wed, May 29, 2024 at 5:56 PM Philippe Mathieu-Daudé > wrote: >> It is pointless to build semihosting when TCG is not available. > > Why? I would have naively assumed that a suitable semihosting API > could be implemented by KVM. The justification (and thus the commit >

Re: [PATCH 3/3] semihosting: Restrict to TCG

2024-05-30 Thread Paolo Bonzini
On Thu, May 30, 2024 at 9:22 AM Philippe Mathieu-Daudé wrote: > > On 30/5/24 08:02, Paolo Bonzini wrote: > > On Wed, May 29, 2024 at 5:56 PM Philippe Mathieu-Daudé > > wrote: > >> It is pointless to build semihosting when TCG is not available. > > > > Why? I would have naively assumed that a suit

RE: [PATCH v4 14/16] aspeed/soc: fix incorrect dram size for AST2700

2024-05-30 Thread Jamin Lin
Hi Cedric, > From: Cédric Le Goater > > Hello Jamin > > On 5/27/24 10:02, Jamin Lin wrote: > > AST2700 dram size calculation is not back compatible AST2600. > > According to the DDR capacity hardware behavior, if users write the > > data to address which is beyond the ram size, it would write th

Re: [PATCH] qga: Remove deprecated 'blacklist' argument / config key

2024-05-30 Thread Konstantin Kostiuk
Reviewed-by: Konstantin Kostiuk On Thu, May 30, 2024 at 10:04 AM Philippe Mathieu-Daudé wrote: > The 'blacklist' argument / config key are deprecated since commi > 582a098e6c ("qga: Replace 'blacklist' command line and config file > options by 'block-rpcs'"), time to remove them. > > Signed-o

[PATCH v3 1/4] tests/qtest: Move common define from libqos-spapr.h to new ppc-util.h

2024-05-30 Thread Nicholas Piggin
The spapr QEMU machine defaults is useful outside libqos, so create a new header for ppc specific qtests and move it there. Reviewed-by: Thomas Huth Signed-off-by: Nicholas Piggin --- tests/qtest/libqos/libqos-spapr.h | 7 --- tests/qtest/ppc-util.h| 19 +++ tes

[PATCH 1/4] hw/s390x: Introduce the @dump-s390-skeys QMP command

2024-05-30 Thread Philippe Mathieu-Daudé
@dump-skeys is specific to the qemu-system-s390x binary. In order to provide it in an unified single binary, add a equivalent new command named @dump-s390-skeys, which works identically on s390x and reports an error on other targets. Signed-off-by: Philippe Mathieu-Daudé --- qapi/misc.json

[PATCH v3 4/4] tests/qtest/migration-test: Use custom asm bios for ppc64

2024-05-30 Thread Nicholas Piggin
Similar to other archs, build a custom bios memory updater. Running the test with OF code is a cool trick, but SLOF takes a long time to boot. This reduces test time by around 3x (150s to 50s). Reviewed-by: Fabiano Rosas Signed-off-by: Nicholas Piggin --- tests/migration/migration-test.h | 1

[PATCH 3/4] hw/s390x: Deprecate the HMP 'dump_skeys' command

2024-05-30 Thread Philippe Mathieu-Daudé
Prefer 'dump_s390_skeys' which is target agnostic. Signed-off-by: Philippe Mathieu-Daudé --- hw/s390x/s390-skeys.c | 2 ++ hmp-commands.hx | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/s390x/s390-skeys.c b/hw/s390x/s390-skeys.c index e7dab52a6e..12ec8a808e 100

[PATCH v3 2/4] tests/qtest/migration-test: Quieten ppc64 QEMU warnings

2024-05-30 Thread Nicholas Piggin
Reviewed-by: Thomas Huth Signed-off-by: Nicholas Piggin --- tests/qtest/migration-test.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index b7e3406471..48f59822f4 100644 --- a/tests/qtest/migration-test.c +++ b

[PATCH 2/4] hw/s390x: Introduce the 'dump_s390_skeys' HMP command

2024-05-30 Thread Philippe Mathieu-Daudé
'dump_skeys' is specific to the qemu-system-s390x binary. In order to provide it in an unified single binary, add a equivalent new command named 'dump_s390_skeys', which works identically on s390x and reports an error on other targets. Signed-off-by: Philippe Mathieu-Daudé --- include/monitor/hm

Re: [RFC PATCH 08/10] ppc/pnv: Invert the design for big-core machine modelling

2024-05-30 Thread Cédric Le Goater
@@ -157,6 +157,14 @@ static int pnv_dt_core(PnvChip *chip, PnvCore *pc, void *fdt) pnv_cc->processor_id(chip, pc->hwid, 0, &pir, &tir); +/* Only one DT node per (big) core */ +if (tir != 0) { +g_assert(pc->big_core); +g_assert(tir == 1); +g_asser

[PATCH 0/4] hw/s390x: Alias @dump-skeys -> @dump-s390-skey and deprecate

2024-05-30 Thread Philippe Mathieu-Daudé
We are trying to unify all qemu-system-FOO to a single binary. In order to do that we need to remove QAPI target specific code. @dump-skeys is only available on qemu-system-s390x. This series rename it as @dump-s390-skey, making it available on other binaries. We take care of backward compatibilit

[PATCH v3 3/4] tests/qtest/migration-test: Enable on ppc64 TCG

2024-05-30 Thread Nicholas Piggin
ppc64 with TCG seems to no longer be failing this test, perhaps since commit 03bfc2188f061 ("physmem: Fix migration dirty bitmap coherency with TCG memory access") which is not ppc specific but was seen to hit ppc64 quite easily. Let's enable it again. The s390x problem has been identified so men

[PATCH 4/4] hw/s390x: Deprecate the QMP @dump-skeys command

2024-05-30 Thread Philippe Mathieu-Daudé
Prefer @dump-s390-skeys which is target agnostic. Signed-off-by: Philippe Mathieu-Daudé --- docs/about/deprecated.rst | 5 + qapi/misc-target.json | 5 + 2 files changed, 10 insertions(+) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 40585ca7d5..3cb43085ba

[PATCH v3 0/4] tests/qtest/migration-test: Improve and enable on ppc64

2024-05-30 Thread Nicholas Piggin
Since v2: - Fixed subject typo noticed by Thomas. - Drop the non-ppc patches from the series. Thanks, Nick Nicholas Piggin (4): tests/qtest: Move common define from libqos-spapr.h to new ppc-util.h tests/qtest/migration-test: Quieten ppc64 QEMU warnings tests/qtest/migration-test: Enable on

Re: [PATCH 1/1] vhost-vsock: add VIRTIO_F_RING_PACKED to feaure_bits

2024-05-30 Thread Stefano Garzarella
On Wed, May 29, 2024 at 02:49:28PM GMT, Halil Pasic wrote: On Tue, 28 May 2024 17:32:26 +0200 Stefano Garzarella wrote: >1) The uses is explicitly asking for a vhost device and giving the user >a non vhost device is not an option. I didn't get this point :-( can you elaborate? I was thinkin

Re: [PATCH v4 14/16] aspeed/soc: fix incorrect dram size for AST2700

2024-05-30 Thread Cédric Le Goater
On 5/30/24 09:42, Jamin Lin wrote: Hi Cedric, From: Cédric Le Goater > Hello Jamin On 5/27/24 10:02, Jamin Lin wrote: AST2700 dram size calculation is not back compatible AST2600. According to the DDR capacity hardware behavior, if users write the data to address which is beyond the ram size,

RE: [PATCH v4 14/16] aspeed/soc: fix incorrect dram size for AST2700

2024-05-30 Thread Jamin Lin
Hi Cedric, > From: Cédric Le Goater > On 5/30/24 09:42, Jamin Lin wrote: > > Hi Cedric, > >> From: Cédric Le Goater > Hello Jamin > >> > >> On 5/27/24 10:02, Jamin Lin wrote: > >>> AST2700 dram size calculation is not back compatible AST2600. > >>> According to the DDR capacity hardware behavior,

Re: [PATCH v4 11/11] ppc/pnv: Update skiboot.lid to support Power11

2024-05-30 Thread Aditya Gupta
Hello Nick, On Wed, May 29, 2024 at 10:16:58AM GMT, Nicholas Piggin wrote: > On Tue May 28, 2024 at 5:15 PM AEST, Cédric Le Goater wrote: > > On 5/28/24 09:05, Aditya Gupta wrote: > > > Skiboot/OPAL patches are in discussion upstream [1], with corresponding > > > commits in github repository [2].

Re: [PATCH 1/2] hw/acpi: Remove the deprecated QAPI MEM_UNPLUG_ERROR event

2024-05-30 Thread Harsh Prateek Bora
On 5/30/24 12:45, Philippe Mathieu-Daudé wrote: The MEM_UNPLUG_ERROR event is deprecated since commit d43f1670c7 ("qapi/qdev.json: add DEVICE_UNPLUG_GUEST_ERROR QAPI event"), time to remove it. Signed-off-by: Philippe Mathieu-Daudé --- docs/about/deprecated.rst | 5 - docs/abou

Failed to hot-plug device to pxb bridge

2024-05-30 Thread Gao,Shiyuan
Hi Igor, Daniel and all: https://lore.kernel.org/all/20220422135101.65796...@redhat.com/t/#r831d589f243c24334a09995620b74408847a87a0 This message discuss hotplug device to pxb bridge. At the end, Igor suggested enable shpc on pxb bridge: pxb_dev_realize_common(): qdev_prop_set_bit(bds, PC

Re: [PATCH v3 1/3] accel/kvm: Introduce kvm_create_and_park_vcpu() helper

2024-05-30 Thread Nicholas Piggin
On Thu May 23, 2024 at 5:26 PM AEST, Harsh Prateek Bora wrote: > There are distinct helpers for creating and parking a KVM vCPU. > However, there can be cases where a platform needs to create and > immediately park the vCPU during early stages of vcpu init which > can later be reused when vcpu thre

Re: [PATCH v3 2/3] cpu-common.c: export cpu_get_free_index to be reused later

2024-05-30 Thread Nicholas Piggin
On Thu May 23, 2024 at 5:26 PM AEST, Harsh Prateek Bora wrote: > This helper provides an easy way to identify the next available free cpu > index which can be used for vcpu creation. Until now, this is being > called at a very later stage and there is a need to be able to call it > earlier (for now

Re: hw/usb/hcd-ohci: Fix #1510, #303: pid not IN or OUT

2024-05-30 Thread Alex Bennée
Cord Amfmgm writes: > On Tue, May 28, 2024 at 11:32 AM Peter Maydell > wrote: > > On Tue, 28 May 2024 at 16:37, Cord Amfmgm wrote: > > > > On Tue, May 28, 2024 at 9:03 AM Peter Maydell > wrote: > >> > >> On Mon, 20 May 2024 at 23:24, Cord Amfmgm wrote: > >> > On Mon, May 20, 2024 at 1

Re: [PATCH v3 3/3] target/ppc: handle vcpu hotplug failure gracefully

2024-05-30 Thread Nicholas Piggin
On Thu May 23, 2024 at 5:26 PM AEST, Harsh Prateek Bora wrote: > On ppc64, the PowerVM hypervisor runs with limited memory and a VCPU > creation during hotplug may fail during kvm_ioctl for KVM_CREATE_VCPU, > leading to termination of guest since errp is set to &error_fatal while > calling kvm_init

[PATCH] hw/riscv/virt.c: add address-cells in create_fdt_one_aplic()

2024-05-30 Thread Daniel Henrique Barboza
We need #address-cells properties in all interrupt controllers that are referred by an interrupt-map [1]. For the RISC-V machine, both PLIC and APLIC controllers must have this property. PLIC already sets it in create_fdt_socket_plic(). Set the property for APLIC in create_fdt_one_aplic(). [1] h

Re: [PATCH 0/4] hw/s390x: Alias @dump-skeys -> @dump-s390-skey and deprecate

2024-05-30 Thread Anton Johansson via
On 30/05/24, Philippe Mathieu-Daudé wrote: > We are trying to unify all qemu-system-FOO to a single binary. > In order to do that we need to remove QAPI target specific code. > > @dump-skeys is only available on qemu-system-s390x. This series > rename it as @dump-s390-skey, making it available on

Re: [PATCH] hw/net: prevent potential NULL dereference

2024-05-30 Thread Peter Maydell
On Thu, 30 May 2024 at 01:52, David Gibson wrote: > > On Wed, May 29, 2024 at 02:07:18PM +0300, Oleg Sviridov wrote: > > Pointer, returned from function 'spapr_vio_find_by_reg', may be NULL and is > > dereferenced immediately after. > > > > Found by Linux Verification Center (linuxtesting.org) wi

Re: [RESEND PATCH v2 0/5] target/riscv: Support RISC-V privilege 1.13 spec

2024-05-30 Thread Daniel Henrique Barboza
Hi Fea, On 5/30/24 00:30, Fea Wang wrote: Hi Daniel, thank you for your help. I found that only the cover is without many maintainers. I used to send patches by git send-email --dry-run --to 'qemu-devel@nongnu.org ,qemu-ri...@nongnu.org

[PATCH v2 0/4] tests/qtest/migration-test: Improve shared

2024-05-30 Thread Nicholas Piggin
These apply on top of the previous ppc series. They are similar to what was discussed except the end result does not attempt to run /dev/shm tests on Gitlab CI because of concerns about consistency of test results if shm becomes exhausted. Thanks, Nick Nicholas Piggin (4): tests/qtest/migration

[PATCH v2 1/4] tests/qtest/migration-test: Use regular file file for shared-memory tests

2024-05-30 Thread Nicholas Piggin
There is no need to use /dev/shm for file-backed memory devices, and on Gitlab CI the tmpfs mount is too small to be usable for migration tests. Switch to using a regular file in /tmp/ which will usually have more space available. Signed-off-by: Nicholas Piggin --- tests/qtest/migration-test.c |

[PATCH v2 2/4] tests/qtest/migration-test: Enable test_mode_reboot

2024-05-30 Thread Nicholas Piggin
Fabiano pointed out this test probably is not flaky, just that it could not run under Gitlab CI due to very small shm filesystem size in that environment. Now that it has moved to use /tmp instead of /dev/shm files, enable it. Signed-off-by: Nicholas Piggin --- tests/qtest/migration-test.c | 10

[PATCH v2 3/4] tests/qtest/migration-test: Fix and enable test_ignore_shared

2024-05-30 Thread Nicholas Piggin
This test is already starting to bitrot, so first remove it from ifdef and fix compile issues. ppc64 transfers about 2MB, so bump the size threshold too. It was said to be broken on aarch64 but it may have been due to the limited shm size under Gitlab CI. Now that it uses /tmp, enable it. Cc: Yur

[PATCH v2 4/4] tests/qtest/migration-test: Add a postcopy memfile test

2024-05-30 Thread Nicholas Piggin
Postcopy requires userfaultfd support, which requires tmpfs if a memory file is used. This adds back support for /dev/shm memory files, but adds preallocation to skip environments where that mount is limited in size. Signed-off-by: Nicholas Piggin --- tests/qtest/migration-test.c | 77 +

[RFC v2 2/7] hw/core: Define cache topology for machine

2024-05-30 Thread Zhao Liu
Define the cache topology based on CPU topology level for two reasons: 1. In practice, a cache will always be bound to the CPU container (either private in the CPU container or shared among multiple containers), and CPU container is often expressed in terms of CPU topology level. 2. The x

[RFC v2 0/7] Introduce SMP Cache Topology

2024-05-30 Thread Zhao Liu
Hi, Now that the i386 cache model has been able to define the topology clearly, it's time to move on to discussing/advancing this feature about configuring the cache topology with -smp as the following example: -smp 32,sockets=2,dies=2,modules=2,cores=2,threads=2,maxcpus=32,\ l1d-cache=core,

[RFC v2 6/7] i386/pc: Support cache topology in -smp for PC machine

2024-05-30 Thread Zhao Liu
Signed-off-by: Zhao Liu --- hw/i386/pc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 7b638da7aaa8..2e03b33a4116 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1844,6 +1844,9 @@ static void pc_machine_class_init(ObjectClass *oc, void *data) mc->

[RFC v2 7/7] qemu-options: Add the cache topology description of -smp

2024-05-30 Thread Zhao Liu
Signed-off-by: Zhao Liu --- Changes since RFC v1: * Use "*_cache=topo_level" as -smp example as the original "level" term for a cache has a totally different meaning. (Jonathan) --- qemu-options.hx | 50 +++-- 1 file changed, 44 insertions(+), 6 del

[RFC v2 3/7] hw/core: Add cache topology options in -smp

2024-05-30 Thread Zhao Liu
Add "l1d-cache", "l1i-cache". "l2-cache", and "l3-cache" options in -smp to define the cache topology for SMP system. Signed-off-by: Zhao Liu --- Changes since RFC v1: * Set has_*_cache field in machine_get_smp(). (JeeHeng) * Adjust string breaking style in error_setg() for more semantic sen

[RFC v2 4/7] i386/cpu: Support thread and module level cache topology

2024-05-30 Thread Zhao Liu
Allows cache to be defined at the thread and module level. This increases flexibility for x86 users to customize their cache topology. Signed-off-by: Zhao Liu --- target/i386/cpu.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.

[RFC v2 5/7] i386/cpu: Update cache topology with machine's configuration

2024-05-30 Thread Zhao Liu
User will configure SMP cache topology via -smp. For this case, update the x86 CPUs' cache topology with user's configuration in MachineState. Signed-off-by: Zhao Liu --- target/i386/cpu.c | 21 + 1 file changed, 21 insertions(+) diff --git a/target/i386/cpu.c b/target/i386

[RFC v2 1/7] hw/core: Make CPU topology enumeration arch-agnostic

2024-05-30 Thread Zhao Liu
Cache topology needs to be defined based on CPU topology levels. Thus, define CPU topology enumeration in qapi/machine.json to make it generic for all architectures. To match the general topology naming style, rename CPU_TOPO_LEVEL_SMT and CPU_TOPO_LEVEL_PACKAGE to CPU_TOPO_LEVEL_THREAD and CPU_TO

Re: [PATCH 1/1] arm/sbsa-ref: move to Neoverse-N2 as default

2024-05-30 Thread Peter Maydell
On Thu, 23 May 2024 at 17:54, Marcin Juszkiewicz wrote: > > Moving to Neoverse-N2 gives us several cpu features to use for expanding > our platform: > > - branch target identification > - pointer authentication > - RME for confidential computing > - RNG for EFI_PROTOCOL_RNG > - SVE being enabled b

Re: [PATCH v2 0/2] Fix GICv2 handling of pending interrupts

2024-05-30 Thread Peter Maydell
On Fri, 24 May 2024 at 12:33, Sebastian Huber wrote: > > v2: > > * Fix handling of SPIs. > > * Remove pending state if not in new target list. > > Sebastian Huber (2): > hw/intc/arm_gic: Fix set pending of PPIs > hw/intc/arm_gic: Fix writes to GICD_ITARGETSRn Applied to target-arm.next, tha

Re: [PATCH v4 01/11] ppc: Add Power11 DD2.0 processor

2024-05-30 Thread Harsh Prateek Bora
On 5/30/24 12:18, Aditya Gupta wrote: Hello Harsh, On Thu, May 30, 2024 at 10:57:31AM GMT, Harsh Prateek Bora wrote: Hi Aditya, On 5/28/24 12:35, Aditya Gupta wrote: Add CPU target code to add support for new Power11 Processor. Power11 core is same as Power10, hence reuse functions define

Re: [PATCH v2 2/2] hw/arm/xilinx_zynq: Support up to two CPU cores

2024-05-30 Thread Peter Maydell
On Fri, 24 May 2024 at 13:08, Sebastian Huber wrote: > > The Zynq 7000 SoCs contain two Arm Cortex-A9 MPCore (the Zynq 7000S have only > one core). Add support for up to two simulated cores. > > Signed-off-by: Sebastian Huber > +DeviceState *cpudev = DEVICE(OBJECT(zynq_machine->cpu[n]))

Re: [PATCH v2 0/2] Zynq 7000 Improvements

2024-05-30 Thread Peter Maydell
On Fri, 24 May 2024 at 13:08, Sebastian Huber wrote: > > v2: > > * Add Kconfig support > > * Add array of CPUs to ZynqMachineState > > * Add FIQ support > > Sebastian Huber (2): > hw/arm/xilinx_zynq: Add cache controller > hw/arm/xilinx_zynq: Support up to two CPU cores Applied to target-ar

Re: [RESEND PATCH v2 0/5] target/riscv: Support RISC-V privilege 1.13 spec

2024-05-30 Thread Andrew Jones
On Thu, May 30, 2024 at 11:30:28AM GMT, Fea Wang wrote: > Hi Daniel, > thank you for your help. > > I found that only the cover is without many maintainers. I used to send > patches by git send-email --dry-run --to 'qemu-devel@nongnu.org, > qemu-ri...@nongnu.org' --cc-cmd='scripts/get_maintainer.p

Re: [PATCH v2] virtio-pci: Fix the failure process in kvm_virtio_pci_vector_use_one()

2024-05-30 Thread Peter Maydell
On Tue, 28 May 2024 at 09:48, Cindy Lu wrote: > > In function kvm_virtio_pci_vector_use_one(), the function will only use > the irqfd/vector for itself. Therefore, in the undo label, the failing > process is incorrect. > To fix this, we can just remove this label. > > Fixes: f9a09ca3ea ("vhost: ad

[PATCH] stdvga: fix screen blanking

2024-05-30 Thread Gerd Hoffmann
In case the display surface uses a shared buffer (i.e. uses vga vram directly instead of a shadow) go unshare the buffer before clearing it. This avoids vga memory corruption, which in turn fixes unblanking not working properly with X11. Cc: qemu-sta...@nongnu.org Resolves: https://gitlab.com/qem

Re: [PATCH] hw/riscv/virt.c: add address-cells in create_fdt_one_aplic()

2024-05-30 Thread Andrew Jones
On Thu, May 30, 2024 at 05:49:49AM GMT, Daniel Henrique Barboza wrote: > We need #address-cells properties in all interrupt controllers that are > referred by an interrupt-map [1]. For the RISC-V machine, both PLIC and > APLIC controllers must have this property. > > PLIC already sets it in create

Re: [PATCH] hw/riscv/virt.c: add address-cells in create_fdt_one_aplic()

2024-05-30 Thread Andrew Jones
On Thu, May 30, 2024 at 01:05:41PM GMT, Andrew Jones wrote: > On Thu, May 30, 2024 at 05:49:49AM GMT, Daniel Henrique Barboza wrote: > > We need #address-cells properties in all interrupt controllers that are > > referred by an interrupt-map [1]. For the RISC-V machine, both PLIC and > > APLIC cont

[PATCH v2] vnc: increase max display size

2024-05-30 Thread Gerd Hoffmann
It's 2024. 4k display resolutions are a thing these days. Raise width and height limits of the qemu vnc server. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1596 Signed-off-by: Gerd Hoffmann --- ui/vnc.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/vnc.h

[PATCH v4 26/31] i386/sev: Invoke launch_updata_data() for SNP class

2024-05-30 Thread Pankaj Gupta
Invoke as sev_snp_launch_update_data() for SNP object. Signed-off-by: Pankaj Gupta --- target/i386/sev.c | 9 + 1 file changed, 9 insertions(+) diff --git a/target/i386/sev.c b/target/i386/sev.c index 7a0c2ee10f..7d2f67e2f3 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -1108

[PATCH v4 10/31] i386/sev: Add snp_kvm_init() override for SNP class

2024-05-30 Thread Pankaj Gupta
SNP does not support SMM and requires guest_memfd for private guest memory, so add SNP specific kvm_init() functionality in snp_kvm_init() class method. Signed-off-by: Michael Roth Co-developed-by: Pankaj Gupta Signed-off-by: Pankaj Gupta --- target/i386/sev.c | 23 ++- 1 f

[PATCH v4 27/31] hw/i386/sev: Use guest_memfd for legacy ROMs

2024-05-30 Thread Pankaj Gupta
From: Michael Roth Current SNP guest kernels will attempt to access these regions with with C-bit set, so guest_memfd is needed to handle that. Otherwise, kvm_convert_memory() will fail when the guest kernel tries to access it and QEMU attempts to call KVM_SET_MEMORY_ATTRIBUTES to set these range

[PATCH v4 16/31] i386/sev: Add handling to encrypt/finalize guest launch data

2024-05-30 Thread Pankaj Gupta
From: Brijesh Singh Process any queued up launch data and encrypt/measure it into the SNP guest instance prior to initial guest launch. This also updates the KVM_SEV_SNP_LAUNCH_UPDATE call to handle partial update responses. Signed-off-by: Brijesh Singh Co-developed-by: Michael Roth Signed-of

[PATCH v4 06/31] i386/sev: Move sev_launch_finish to separate class method

2024-05-30 Thread Pankaj Gupta
When sev-snp-guest objects are introduced there will be a number of differences in how the launch finish is handled compared to the existing sev-guest object. Move sev_launch_finish() to a class method to make it easier to implement SNP-specific launch update functionality later. Signed-off-by: Pa

[PATCH v4 20/31] i386/sev: Add support for SNP CPUID validation

2024-05-30 Thread Pankaj Gupta
From: Michael Roth SEV-SNP firmware allows a special guest page to be populated with a table of guest CPUID values so that they can be validated through firmware before being loaded into encrypted guest memory where they can be used in place of hypervisor-provided values[1]. As part of SEV-SNP g

[PATCH v4 05/31] i386/sev: Move sev_launch_update to separate class method

2024-05-30 Thread Pankaj Gupta
When sev-snp-guest objects are introduced there will be a number of differences in how the launch data is handled compared to the existing sev-guest object. Move sev_launch_start() to a class method to make it easier to implement SNP-specific launch update functionality later. Signed-off-by: Panka

[PATCH v4 03/31] memory: Introduce memory_region_init_ram_guest_memfd()

2024-05-30 Thread Pankaj Gupta
From: Xiaoyao Li Introduce memory_region_init_ram_guest_memfd() to allocate private guset memfd on the MemoryRegion initialization. It's for the use case of TDVF, which must be private on TDX case. Signed-off-by: Xiaoyao Li Signed-off-by: Michael Roth Signed-off-by: Pankaj Gupta --- include/

[PATCH v4 30/31] i386/kvm: Add KVM_EXIT_HYPERCALL handling for KVM_HC_MAP_GPA_RANGE

2024-05-30 Thread Pankaj Gupta
From: Michael Roth KVM_HC_MAP_GPA_RANGE will be used to send requests to userspace for private/shared memory attribute updates requested by the guest. Implement handling for that use-case along with some basic infrastructure for enabling specific hypercall events. Signed-off-by: Michael Roth Si

[PATCH v4 25/31] i386/sev: Invoke launch_updata_data() for SEV class

2024-05-30 Thread Pankaj Gupta
Add launch_update_data() in SevCommonStateClass and invoke as sev_launch_update_data() for SEV object. Signed-off-by: Pankaj Gupta --- target/i386/sev.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/target/i386/sev.c b/target/i386/sev.c index c5c703bc8d..7a0

[PATCH v4 19/31] i386/sev: Add support for populating OVMF metadata pages

2024-05-30 Thread Pankaj Gupta
From: Brijesh Singh OVMF reserves various pages so they can be pre-initialized/validated prior to launching the guest. Add support for populating these pages with the expected content. Signed-off-by: Brijesh Singh Signed-off-by: Michael Roth Co-developed-by: Pankaj Gupta Signed-off-by: Pankaj

[PATCH v4 17/31] i386/sev: Set CPU state to protected once SNP guest payload is finalized

2024-05-30 Thread Pankaj Gupta
From: Michael Roth Once KVM_SNP_LAUNCH_FINISH is called the vCPU state is copied into the vCPU's VMSA page and measured/encrypted. Any attempt to read/write CPU state afterward will only be acting on the initial data and so are effectively no-ops. Set the vCPU state to protected at this point so

[PATCH v4 07/31] i386/sev: Introduce 'sev-snp-guest' object

2024-05-30 Thread Pankaj Gupta
From: Brijesh Singh SEV-SNP support relies on a different set of properties/state than the existing 'sev-guest' object. This patch introduces the 'sev-snp-guest' object, which can be used to configure an SEV-SNP guest. For example, a default-configured SEV-SNP guest with no additional information

[PATCH v4 31/31] i386/sev: Enable KVM_HC_MAP_GPA_RANGE hcall for SNP guests

2024-05-30 Thread Pankaj Gupta
From: Michael Roth KVM will forward GHCB page-state change requests to userspace in the form of KVM_HC_MAP_GPA_RANGE, so make sure the hypercall handling is enabled for SNP guests. Signed-off-by: Michael Roth Signed-off-by: Pankaj Gupta --- target/i386/sev.c | 5 + 1 file changed, 5 inser

[PATCH v4 09/31] i386/sev: Add sev_kvm_init() override for SEV class

2024-05-30 Thread Pankaj Gupta
Some aspects of the init routine SEV are specific to SEV and not applicable for SNP guests, so move the SEV-specific bits into separate class method and retain only the common functionality. Co-developed-by: Michael Roth Signed-off-by: Michael Roth Signed-off-by: Pankaj Gupta --- target/i386/s

[PATCH v4 18/31] hw/i386/sev: Add function to get SEV metadata from OVMF header

2024-05-30 Thread Pankaj Gupta
From: Brijesh Singh A recent version of OVMF expanded the reset vector GUID list to add SEV-specific metadata GUID. The SEV metadata describes the reserved memory regions such as the secrets and CPUID page used during the SEV-SNP guest launch. The pc_system_get_ovmf_sev_metadata_ptr() is used to

[PATCH v4 24/31] hw/i386/sev: Add support to encrypt BIOS when SEV-SNP is enabled

2024-05-30 Thread Pankaj Gupta
From: Brijesh Singh As with SEV, an SNP guest requires that the BIOS be part of the initial encrypted/measured guest payload. Extend sev_encrypt_flash() to handle the SNP case and plumb through the GPA of the BIOS location since this is needed for SNP. Signed-off-by: Brijesh Singh Signed-off-by

[PATCH v4 23/31] i386/sev: Allow measured direct kernel boot on SNP

2024-05-30 Thread Pankaj Gupta
From: Dov Murik In SNP, the hashes page designated with a specific metadata entry published in AmdSev OVMF. Therefore, if the user enabled kernel hashes (for measured direct boot), QEMU should prepare the content of hashes table, and during the processing of the metadata entry it copy the conten

[PATCH v4 28/31] hw/i386: Add support for loading BIOS using guest_memfd

2024-05-30 Thread Pankaj Gupta
From: Michael Roth When guest_memfd is enabled, the BIOS is generally part of the initial encrypted guest image and will be accessed as private guest memory. Add the necessary changes to set up the associated RAM region with a guest_memfd backend to allow for this. Current support centers around

[PATCH v4 21/31] i386/sev: Extract build_kernel_loader_hashes

2024-05-30 Thread Pankaj Gupta
From: Dov Murik Extract the building of the kernel hashes table out from sev_add_kernel_loader_hashes() to allow building it in other memory areas (for SNP support). No functional change intended. Signed-off-by: Dov Murik Signed-off-by: Michael Roth Signed-off-by: Pankaj Gupta --- target/i3

[PATCH v4 15/31] i386/sev: Add the SNP launch start context

2024-05-30 Thread Pankaj Gupta
From: Brijesh Singh The SNP_LAUNCH_START is called first to create a cryptographic launch context within the firmware. Signed-off-by: Brijesh Singh Signed-off-by: Michael Roth Co-developed-by: Pankaj Gupta Signed-off-by: Pankaj Gupta --- target/i386/sev.c| 39 +++

[PATCH v4 04/31] i386/sev: Introduce "sev-common" type to encapsulate common SEV state

2024-05-30 Thread Pankaj Gupta
From: Michael Roth Currently all SEV/SEV-ES functionality is managed through a single 'sev-guest' QOM type. With upcoming support for SEV-SNP, taking this same approach won't work well since some of the properties/state managed by 'sev-guest' is not applicable to SEV-SNP, which will instead rely

[PATCH v4 29/31] hw/i386/sev: Allow use of pflash in conjunction with -bios

2024-05-30 Thread Pankaj Gupta
From: Michael Roth SEV-ES and SEV-SNP support OVMF images with non-volatile storage in cases where the storage area is generated as a separate image as part of the OVMF build process. Currently these are exposed with unit=0 corresponding to the actual BIOS image, and unit=1 corresponding to the

[PATCH v4 14/31] i386/sev: Update query-sev QAPI format to handle SEV-SNP

2024-05-30 Thread Pankaj Gupta
From: Michael Roth Most of the current 'query-sev' command is relevant to both legacy SEV/SEV-ES guests and SEV-SNP guests, with 2 exceptions: - 'policy' is a 64-bit field for SEV-SNP, not 32-bit, and the meaning of the bit positions has changed - 'handle' is not relevant to SEV-SNP To

[PATCH v4 01/31] i386/sev: Replace error_report with error_setg

2024-05-30 Thread Pankaj Gupta
Signed-off-by: Pankaj Gupta --- target/i386/sev.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/i386/sev.c b/target/i386/sev.c index d30b68c11e..67ed32e5ea 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -952,13 +952,13 @@ static int sev_kvm_init(Confi

[PATCH v4 22/31] i386/sev: Reorder struct declarations

2024-05-30 Thread Pankaj Gupta
From: Dov Murik Move the declaration of PaddedSevHashTable before SevSnpGuest so we can add a new such field to the latter. No functional change intended. Signed-off-by: Dov Murik Signed-off-by: Michael Roth Signed-off-by: Pankaj Gupta --- target/i386/sev.c | 56 +++-

[PATCH v4 12/31] i386/sev: Don't return launch measurements for SEV-SNP guests

2024-05-30 Thread Pankaj Gupta
From: Michael Roth For SEV-SNP guests, launch measurement is queried from within the guest during attestation, so don't attempt to return it as part of query-sev-launch-measure. Signed-off-by: Michael Roth Signed-off-by: Pankaj Gupta --- target/i386/sev.c | 4 +++- 1 file changed, 3 insertion

[Semihosting Tests PATCH v2 1/3] .editorconfig: add code conventions for tooling

2024-05-30 Thread Alex Bennée
It's a pain when you come back to a code base you haven't touched in a while and realise whatever indent settings you were using having carried over. Add an editorconfig and be done with it. Signed-off-by: Alex Bennée --- v2 - drop mention of custom major modes (not needed here) - include se

[Semihosting Tests PATCH v2 0/3] add SYS_GET_CMDLINE test

2024-05-30 Thread Alex Bennée
Hi Peter, Looking at bug #2322 I wanted to make sure SYS_GET_CMDLINE works as I expected. While at it I needed to fix a compile error with headers which I guess we got away with on earlier compilers. I've added an editorconfig for good measure. v2 - addressed review comments Alex Bennée (3):

[Semihosting Tests PATCH v2 2/3] update includes for bare metal compiling

2024-05-30 Thread Alex Bennée
We shouldn't use for our own implementation. Also the base types we need live in as doesn't exist for the bare metal compilers. Signed-off-by: Alex Bennée Reviewed-by: Peter Maydell --- semihosting.c | 4 ++-- semihosting.h | 2 +- string.c | 2 +- usertest.c| 2 +- 4 files changed,

[PATCH v4 13/31] i386/sev: Add a class method to determine KVM VM type for SNP guests

2024-05-30 Thread Pankaj Gupta
SEV guests can use either KVM_X86_DEFAULT_VM, KVM_X86_SEV_VM, or KVM_X86_SEV_ES_VM depending on the configuration and what the host kernel supports. SNP guests on the other hand can only ever use KVM_X86_SNP_VM, so split determination of VM type out into a separate class method that can be set acco

[PATCH v4 00/31] Add AMD Secure Nested Paging (SEV-SNP) support

2024-05-30 Thread Pankaj Gupta
These patches implement SEV-SNP base support along with CPUID enforcement support for QEMU, and are also available at: https://github.com/pagupta/qemu/tree/snp_v4 Latest version of kvm changes are posted here [2] and also queued in kvm/next. Patch Layout 01-03: 'error_setg' independ

[Semihosting Tests PATCH v2 3/3] add SYS_GET_CMDLINE test

2024-05-30 Thread Alex Bennée
Adds a new test case for the semihosting SYS_GET_CMDLINE call. We can use the existing previously unused semi_get_cmdline helper and we then verify: - the call succeeds - the call returns the expected length string - the call returns the expected binary name as arg0 The most fiddly bit was exp

[PATCH v4 02/31] linux-headers: Update to current kvm/next

2024-05-30 Thread Pankaj Gupta
Co-developed-by: Michael Roth Signed-off-by: Michael Roth Signed-off-by: Pankaj Gupta --- linux-headers/asm-loongarch/bitsperlong.h | 23 ++ linux-headers/asm-loongarch/kvm.h | 4 ++ linux-headers/asm-loongarch/mman.h| 9 linux-headers/asm-riscv/kvm.h

[PATCH v4 08/31] i386/sev: Add a sev_snp_enabled() helper

2024-05-30 Thread Pankaj Gupta
From: Michael Roth Add a simple helper to check if the current guest type is SNP. Also have SNP-enabled imply that SEV-ES is enabled as well, and fix up any places where the sev_es_enabled() check is expecting a pure/non-SNP guest. Signed-off-by: Michael Roth Signed-off-by: Pankaj Gupta --- t

[PATCH v4 11/31] i386/cpu: Set SEV-SNP CPUID bit when SNP enabled

2024-05-30 Thread Pankaj Gupta
From: Michael Roth SNP guests will rely on this bit to determine certain feature support. Signed-off-by: Michael Roth Signed-off-by: Pankaj Gupta --- target/i386/cpu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index bc2dceb647..914bef442c 100644

  1   2   3   >