Re: [RFC v2 0/5] ARM Nested Virt Support

2024-02-12 Thread Marc Zyngier
On 2024-02-09 18:57, Peter Maydell wrote: On Fri, 9 Feb 2024 at 16:00, Eric Auger wrote: This series adds ARM Nested Virtualization support in KVM mode. This is a respin of previous contributions from Miguel [1] and Haibo [2]. This was tested with Marc's v11 [3] on Ampere HW with fedora L1

Re: [PATCH v3 13/14] hw/arm: Prefer arm_feature(AARCH64) over object_property_find(aarch64)

2024-01-11 Thread Marc Zyngier
On Thu, 11 Jan 2024 09:39:18 +, Philippe Mathieu-Daudé wrote: > > On 10/1/24 20:53, Philippe Mathieu-Daudé wrote: > > The "aarch64" property is added to ARMCPU when the > > ARM_FEATURE_AARCH64 feature is available. Rather than > > checking whether the QOM property is present, directly > >

Re: [PATCH V9 32/46] vfio-pci: cpr part 2 (msi)

2023-07-13 Thread Marc Zyngier
On Thu, 13 Jul 2023 13:35:57 +0100, Kunkun Jiang wrote: > > For ARM, it will first send a DISCARD command to ITS and then > establish the interrupt reporting channel for GICv3. The DISCARD > will remove the pending interrupt. Interrupts that come before > channel re-establishment are silently

Re: [RFC PATCH 2/5] hw/intc/gicv3: add support for setting KVM vGIC maintenance IRQ

2023-03-06 Thread Marc Zyngier
On Mon, 06 Mar 2023 14:02:33 +, Peter Maydell wrote: > > On Mon, 27 Feb 2023 at 16:37, Miguel Luis wrote: > > > > From: Haibo Xu > > > > Use the VGIC maintenance IRQ if VHE is requested. As per the ARM GIC > > Architecture Specification for GICv3 and GICv4 Arm strongly recommends that > >

Re: regression: insmod module failed in VM with nvdimm on

2022-11-29 Thread Marc Zyngier
On Wed, 30 Nov 2022 02:52:35 +, "chenxiang (M)" wrote: > > Hi, > > We boot the VM using following commands (with nvdimm on) (qemu > version 6.1.50, kernel 6.0-r4): How relevant is the presence of the nvdimm? Do you observe the failure without this? > > qemu-system-aarch64 -machine >

Re: [PATCH v2] vfio/pci: Verify each MSI vector to avoid invalid MSI vectors

2022-11-26 Thread Marc Zyngier
On Sat, 26 Nov 2022 06:33:15 +, "chenxiang (M)" wrote: > > > 在 2022/11/23 20:08, Marc Zyngier 写道: > > On Wed, 23 Nov 2022 01:42:36 +, > > chenxiang wrote: > >> From: Xiang Chen > >> > >> Currently the number of MSI vectors co

Re: [PATCH v2] vfio/pci: Verify each MSI vector to avoid invalid MSI vectors

2022-11-24 Thread Marc Zyngier
On Wed, 23 Nov 2022 19:55:14 +, Alex Williamson wrote: > > On Wed, 23 Nov 2022 12:08:05 +0000 > Marc Zyngier wrote: > > > On Wed, 23 Nov 2022 01:42:36 +, > > chenxiang wrote: > > > > > > +static int vfio_pci_verify_msi_entry(struct vfio_pci

Re: [PATCH v2] vfio/pci: Verify each MSI vector to avoid invalid MSI vectors

2022-11-23 Thread Marc Zyngier
On Wed, 23 Nov 2022 01:42:36 +, chenxiang wrote: > > From: Xiang Chen > > Currently the number of MSI vectors comes from register PCI_MSI_FLAGS > which should be power-of-2 in qemu, in some scenaries it is not the same as > the number that driver requires in guest, for example, a PCI

Re: [PATCH] KVM: Add system call KVM_VERIFY_MSI to verify MSI vector

2022-11-10 Thread Marc Zyngier
On Wed, 09 Nov 2022 06:21:18 +, "chenxiang (M)" wrote: > > Hi Marc, > > > 在 2022/11/8 20:47, Marc Zyngier 写道: > > On Tue, 08 Nov 2022 08:08:57 +, > > chenxiang wrote: > >> From: Xiang Chen > >> > >> Currently the nu

Re: [PATCH] KVM: Add system call KVM_VERIFY_MSI to verify MSI vector

2022-11-08 Thread Marc Zyngier
On Tue, 08 Nov 2022 08:08:57 +, chenxiang wrote: > > From: Xiang Chen > > Currently the numbers of MSI vectors come from register PCI_MSI_FLAGS > which should be power-of-2, but in some scenaries it is not the same as > the number that driver requires in guest, for example, a PCI driver

Re: [PATCH v6 0/7] hw/arm/virt: Improve address assignment for high memory regions

2022-10-29 Thread Marc Zyngier
e/html/qemu-arm/2022-09/msg00258.html > > v2: https://lore.kernel.org/all/20220815062958.100366-1-gs...@redhat.com/T/ > > v1: https://lists.nongnu.org/archive/html/qemu-arm/2022-08/msg00013.html > > > > Could you help to take a look when getting a chance? I think Connie an

Re: [PATCH v5 6/6] hw/arm/virt: Add 'compact-highmem' property

2022-10-20 Thread Marc Zyngier
On Thu, 20 Oct 2022 00:57:32 +0100, Gavin Shan wrote: > > For Marc's suggestion to add properties so that these high memory > regions can be disabled by users. I can add one patch after this one > to introduce the following 3 properties. Could you please confirm > the property names are good

Re: [PATCH v4 6/6] hw/arm/virt: Add 'compact-highmem' property

2022-10-04 Thread Marc Zyngier
On Tue, 04 Oct 2022 01:26:27 +0100, Gavin Shan wrote: > > After the improvement to high memory region address assignment is > applied, the memory layout can be changed, introducing possible > migration breakage. For example, VIRT_HIGH_PCIE_MMIO memory region > is disabled or enabled when the

Re: [PATCH v3] target/arm/kvm: Retry KVM_CREATE_VM call if it fails EINTR

2022-09-30 Thread Marc Zyngier
y correctly check errno. This time for sure! > --- > target/arm/kvm.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) Acked-by: Marc Zyngier M. -- Without deviation from the norm, progress is not possible.

Re: [PATCH] target/arm: Use the max page size in a 2-stage ptw

2022-09-28 Thread Marc Zyngier
the max of the two page sizes. > > > > Reported-by: Marc Zyngier This is no longer a thing (and hasn't been for over 3 years! ;-). m...@kernel.org is the canonical address. > > Signed-off-by: Richard Henderson > > --- > > > > Hi Mark, I think this will fix

Re: [PATCH] target/arm/kvm: Retry KVM_CREATE_VM call if it fails EINTR

2022-09-26 Thread Marc Zyngier
; > Reported-by: Vitaly Chikunov > Signed-off-by: Peter Maydell Acked-by: Marc Zyngier M. -- Without deviation from the norm, progress is not possible.

Re: qemu-system-aarch64: Failed to retrieve host CPU features

2022-08-13 Thread Marc Zyngier
On Sat, 13 Aug 2022 12:11:37 +0100, Vitaly Chikunov wrote: > > Marc, > > On Fri, Aug 12, 2022 at 04:02:37PM +0100, Marc Zyngier wrote: > > On Fri, 12 Aug 2022 10:25:55 +0100, > > Peter Maydell wrote: > > > > > > I've added some more relevant mailin

Re: qemu-system-aarch64: Failed to retrieve host CPU features

2022-08-12 Thread Marc Zyngier
On Fri, 12 Aug 2022 10:25:55 +0100, Peter Maydell wrote: > > I've added some more relevant mailing lists to the cc. > > On Fri, 12 Aug 2022 at 09:45, Vitaly Chikunov wrote: > > On Fri, Aug 12, 2022 at 05:14:27AM +0300, Vitaly Chikunov wrote: > > > I noticed that we starting to get many errors

Re: qemu-system-aarch64: Failed to retrieve host CPU features

2022-08-12 Thread Marc Zyngier
Hi Peter, On Fri, 12 Aug 2022 10:25:55 +0100, Peter Maydell wrote: > > I've added some more relevant mailing lists to the cc. > > On Fri, 12 Aug 2022 at 09:45, Vitaly Chikunov wrote: > > On Fri, Aug 12, 2022 at 05:14:27AM +0300, Vitaly Chikunov wrote: > > > I noticed that we starting to get

Re: [PATCH 1/2] hw/arm/virt: Improve address assignment for highmem IO regions

2022-08-11 Thread Marc Zyngier
Hi Gavin, On Thu, 11 Aug 2022 06:32:36 +0100, Gavin Shan wrote: > > Hi Marc, > > On 8/8/22 7:17 PM, Marc Zyngier wrote: > > On Wed, 03 Aug 2022 14:02:04 +0100, > > Gavin Shan wrote: [...] > Sorry for the delay. I think the original changelog is confusing >

Re: [PATCH 1/2] hw/arm/virt: Improve address assignment for highmem IO regions

2022-08-08 Thread Marc Zyngier
On Wed, 03 Aug 2022 14:02:04 +0100, Gavin Shan wrote: > > Hi Marc, > > On 8/3/22 5:01 PM, Marc Zyngier wrote: > > On Wed, 03 Aug 2022 04:01:04 +0100, > > Gavin Shan wrote: > >> On 8/2/22 7:41 PM, Eric Auger wrote: > >>> On 8/2/22 08:45, Gavin Shan

Re: [PATCH 1/2] hw/arm/virt: Improve address assignment for highmem IO regions

2022-08-03 Thread Marc Zyngier
On Wed, 03 Aug 2022 04:01:04 +0100, Gavin Shan wrote: > > Hi Eric, > > On 8/2/22 7:41 PM, Eric Auger wrote: > > On 8/2/22 08:45, Gavin Shan wrote: > >> There are 3 highmem IO regions as below. They can be disabled in > >> two situations: (a) The specific region is disabled by user. (b) > >> The

Re: [QUESTION] Exception print when enabling GICv4

2022-07-13 Thread Marc Zyngier
On Wed, 13 Jul 2022 07:02:10 +0100, "chenxiang (M)" wrote: > > Hi Marc, > > Thank you for your reply. > > 在 2022/7/12 23:25, Marc Zyngier 写道: > > Hi Xiang, > > > > On Tue, 12 Jul 2022 13:55:16 +0100, > > "chenxiang (M)" wr

Re: [QUESTION] Exception print when enabling GICv4

2022-07-12 Thread Marc Zyngier
Hi Xiang, On Tue, 12 Jul 2022 13:55:16 +0100, "chenxiang (M)" wrote: > > Hi, > I encounter a issue related to GICv4 enable on ARM64 platform (kernel > 5.19-rc4, qemu 6.2.0): > We have a accelaration module whose VF has 3 MSI interrupts, and we > passthrough it to virtual machine with following

Re: [PATCH kvm-unit-tests] MAINTAINERS: Change drew's email address

2022-06-23 Thread Marc Zyngier
On Thu, 23 Jun 2022 14:10:17 +0100, Andrew Jones wrote: > > As a side effect of leaving Red Hat I won't be able to use my Red Hat > email address anymore. I'm also changing the name of my gitlab group. > > Signed-off-by: Andrew Jones > Signed-off-by: Andrew Jones Acke

Re: [RFC 1/3] serial: Enable MSI capablity and option

2022-04-12 Thread Marc Zyngier
On 2022-04-12 03:10, Atish Patra wrote: The seria-pci device doesn't support MSI. Enable the device to provide MSI so that any platform with MSI support only can also use this serial device. MSI can be enabled by enabling the newly introduced device property. This will be disabled by default

Re: [PATCH] target/arm: Report KVM's actual PSCI version to guest in dtb

2022-02-24 Thread Marc Zyngier via
in the dtb that the PSCI implementation is 1.0-compatible if appropriate. (The device tree binding currently only distinguishes "pre-0.2", "0.2-compatible" and "1.0-compatible".) Signed-off-by: Peter Maydell Reviewed-by: Marc Zyngier M. -- Who you jivin' with that Cosmik Debris?

Re: [PULL 18/38] hw/arm/virt: Honor highmem setting when computing the memory map

2022-02-13 Thread Marc Zyngier
[+ Alex for HVF] On Sun, 13 Feb 2022 05:05:33 +, Akihiko Odaki wrote: > > On 2022/01/20 21:36, Peter Maydell wrote: > > From: Marc Zyngier > > > > Even when the VM is configured with highmem=off, the highest_gpa > > field includes devices that are above

Re: Raspberry Pi?

2022-01-26 Thread Marc Zyngier
On 2022-01-26 02:59, Philippe Mathieu-Daudé via wrote: Hi, On 26/1/22 00:59, Kenneth Adam Miller wrote: Hello all, I would like to emulate something on a pi so that I don't have to pay as high of a translation penalty since the guest and host will share the same arch. I'm finding that on

[PATCH v5 6/6] hw/arm/virt: Drop superfluous checks against highmem

2022-01-14 Thread Marc Zyngier
Now that the devices present in the extended memory map are checked against the available PA space and disabled when they don't fit, there is no need to keep the same checks against highmem, as highmem really is a shortcut for the PA space being 32bit. Reviewed-by: Eric Auger Signed-off-by: Marc

[PATCH v5 1/6] hw/arm/virt: Add a control for the the highmem PCIe MMIO

2022-01-14 Thread Marc Zyngier
Just like we can control the enablement of the highmem PCIe ECAM region using highmem_ecam, let's add a control for the highmem PCIe MMIO region. Similarily to highmem_ecam, this region is disabled when highmem is off. Signed-off-by: Marc Zyngier --- hw/arm/virt-acpi-build.c | 10

[PATCH v5 2/6] hw/arm/virt: Add a control for the the highmem redistributors

2022-01-14 Thread Marc Zyngier
Just like we can control the enablement of the highmem PCIe region using highmem_ecam, let's add a control for the highmem GICv3 redistributor region. Similarily to highmem_ecam, these redistributors are disabled when highmem is off. Reviewed-by: Andrew Jones Signed-off-by: Marc Zyngier

[PATCH v5 3/6] hw/arm/virt: Honor highmem setting when computing the memory map

2022-01-14 Thread Marc Zyngier
range, as the reported IPA space is larger than what it should be. Instead, honor the user-specified limit to only use the devices at the lowest end of the spectrum, and fail if we have memory crossing the 4GiB limit. Reviewed-by: Andrew Jones Reviewed-by: Eric Auger Signed-off-by: Marc Zyngier

[PATCH v5 4/6] hw/arm/virt: Use the PA range to compute the memory map

2022-01-14 Thread Marc Zyngier
-off-by: Marc Zyngier --- hw/arm/virt.c | 64 +-- 1 file changed, 52 insertions(+), 12 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index ecc3e3e5b0..a427676b50 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1660,7 +1660,7 @@ static

[PATCH v5 0/6] target/arm: Reduced-IPA space and highmem fixes

2022-01-14 Thread Marc Zyngier
the memory map - Drop useless MAX() when computing highest_gpa - Fixed more deviations from the QEMU coding style - Collected Eric's RBs, with thanks [1]: https://lore.kernel.org/r/20220107163324.2491209-1-...@kernel.org Marc Zyngier (6): hw/arm/virt: Add a control for the the highmem

[PATCH v5 5/6] hw/arm/virt: Disable highmem devices that don't fit in the PA range

2022-01-14 Thread Marc Zyngier
In order to only keep the highmem devices that actually fit in the PA range, check their location against the range and update highest_gpa if they fit. If they don't, mark them as disabled. Signed-off-by: Marc Zyngier --- hw/arm/virt.c | 34 -- 1 file changed, 28

Re: [PATCH v3] hw/arm/virt: KVM: Enable PAuth when supported by the host

2022-01-11 Thread Marc Zyngier
On Tue, 11 Jan 2022 13:58:49 +, Peter Maydell wrote: > > On Sat, 8 Jan 2022 at 13:42, Marc Zyngier wrote: > > > > On 2022-01-07 20:23, Richard Henderson wrote: > > > On 1/7/22 7:01 AM, Marc Zyngier wrote: > > >> @@ -1380,17 +1380,10 @@ voi

Re: [PATCH] virtio-pci: fix up config interrupt handling

2022-01-10 Thread Marc Zyngier
Hi Michael, On Sun, 09 Jan 2022 17:49:19 +, "Michael S. Tsirkin" wrote: > > Fixes a couple of issues with irqfd use by config interrupt: > - Rearrange initialization so cleanup happens in the reverse order > - Don't use irqfd for config when not in use for data path > I am not sure this is

Re: [PATCH v4 5/6] hw/arm/virt: Disable highmem devices that don't fit in the PA range

2022-01-10 Thread Marc Zyngier
On Mon, 10 Jan 2022 17:12:50 +, Eric Auger wrote: > > Hi Marc, > > On 1/7/22 5:33 PM, Marc Zyngier wrote: > > In order to only keep the highmem devices that actually fit in > > the PA range, check their location against the range and update > > highest_gpa if

Re: [PATCH v4 2/6] hw/arm/virt: Add a control for the the highmem redistributors

2022-01-10 Thread Marc Zyngier
On Mon, 10 Jan 2022 15:47:47 +, Peter Maydell wrote: > > On Mon, 10 Jan 2022 at 15:45, Marc Zyngier wrote: > > $ /home/maz/vminstall/qemu-hack -m 1G -smp 256 -cpu host -machine > > virt,accel=kvm,gic-version=3,highmem=on -nographic -drive > > if=pflash,format=r

Re: [PATCH v4 4/6] hw/arm/virt: Use the PA range to compute the memory map

2022-01-10 Thread Marc Zyngier
On Mon, 10 Jan 2022 15:38:56 +, Eric Auger wrote: > > Hi Marc, > > On 1/7/22 5:33 PM, Marc Zyngier wrote: > > The highmem attribute is nothing but another way to express the > > PA range of a VM. To support HW that has a smaller PA range then > > what QE

Re: [PATCH v4 2/6] hw/arm/virt: Add a control for the the highmem redistributors

2022-01-10 Thread Marc Zyngier
Hi Eric, On Mon, 10 Jan 2022 15:35:44 +, Eric Auger wrote: > > Hi Marc, > > On 1/7/22 5:33 PM, Marc Zyngier wrote: [...] > > @@ -190,7 +191,8 @@ static inline int > > virt_gicv3_redist_region_count(VirtMachineState *vms) > > > > assert(vm

Re: [PATCH v3] hw/arm/virt: KVM: Enable PAuth when supported by the host

2022-01-08 Thread Marc Zyngier
On 2022-01-07 20:23, Richard Henderson wrote: On 1/7/22 7:01 AM, Marc Zyngier wrote: @@ -1380,17 +1380,10 @@ void arm_cpu_finalize_features(ARMCPU *cpu, Error **errp) return; } -/* - * KVM does not support modifications to this feature. - * We

Re: [PATCH v3 3/5] hw/arm/virt: Honor highmem setting when computing the memory map

2022-01-07 Thread Marc Zyngier
On Fri, 07 Jan 2022 18:48:16 +, Peter Maydell wrote: > > On Fri, 7 Jan 2022 at 18:18, Marc Zyngier wrote: > > This is a chicken and egg problem: you need the IPA size to compute > > the memory map, and you need the memory map to compute the IPA > > size. Fun, isn't i

Re: [PATCH v3 3/5] hw/arm/virt: Honor highmem setting when computing the memory map

2022-01-07 Thread Marc Zyngier
Hi Eric, On Fri, 07 Jan 2022 17:15:19 +, Eric Auger wrote: > > Hi Marc, > > On 1/6/22 10:26 PM, Marc Zyngier wrote: > > On Wed, 05 Jan 2022 09:22:39 +, > > Eric Auger wrote: > >> Hi Marc, > >> > >> On 12/27/21 10:16 PM, Marc

[PATCH v4 5/6] hw/arm/virt: Disable highmem devices that don't fit in the PA range

2022-01-07 Thread Marc Zyngier
In order to only keep the highmem devices that actually fit in the PA range, check their location against the range and update highest_gpa if they fit. If they don't, mark them them as disabled. Signed-off-by: Marc Zyngier --- hw/arm/virt.c | 34 -- 1 file

[PATCH v4 6/6] hw/arm/virt: Drop superfluous checks against highmem

2022-01-07 Thread Marc Zyngier
Now that the devices present in the extended memory map are checked against the available PA space and disabled when they don't fit, there is no need to keep the same checks against highmem, as highmem really is a shortcut for the PA space being 32bit. Signed-off-by: Marc Zyngier --- hw/arm

[PATCH v4 1/6] hw/arm/virt: Add a control for the the highmem PCIe MMIO

2022-01-07 Thread Marc Zyngier
Just like we can control the enablement of the highmem PCIe ECAM region using highmem_ecam, let's add a control for the highmem PCIe MMIO region. Similarily to highmem_ecam, this region is disabled when highmem is off. Signed-off-by: Marc Zyngier --- hw/arm/virt-acpi-build.c | 10

[PATCH v4 3/6] hw/arm/virt: Honor highmem setting when computing the memory map

2022-01-07 Thread Marc Zyngier
range, as the reported IPA space is larger than what it should be. Instead, honor the user-specified limit to only use the devices at the lowest end of the spectrum, and fail if we have memory crossing the 4GiB limit. Reviewed-by: Andrew Jones Signed-off-by: Marc Zyngier --- hw/arm/virt.c | 10

[PATCH v4 4/6] hw/arm/virt: Use the PA range to compute the memory map

2022-01-07 Thread Marc Zyngier
-off-by: Marc Zyngier --- hw/arm/virt.c | 53 --- 1 file changed, 46 insertions(+), 7 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 57c55e8a37..db4b0636e1 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1660,7 +1660,7 @@ static

[PATCH v4 0/6] target/arm: Reduced-IPA space and highmem fixes

2022-01-07 Thread Marc Zyngier
redist and PCIe ECAM ranges, but not the high PCIe range. - Dropped some of Andrew's RBs, as the code significantly changed. [1] https://lore.kernel.org/r/20211227211642.994461-1-...@kernel.org Marc Zyngier (6): hw/arm/virt: Add a control for the the highmem PCIe MMIO hw/arm/virt: Add

[PATCH v4 2/6] hw/arm/virt: Add a control for the the highmem redistributors

2022-01-07 Thread Marc Zyngier
Just like we can control the enablement of the highmem PCIe region using highmem_ecam, let's add a control for the highmem GICv3 redistributor region. Similarily to highmem_ecam, these redistributors are disabled when highmem is off. Reviewed-by: Andrew Jones Signed-off-by: Marc Zyngier

[PATCH v3] hw/arm/virt: KVM: Enable PAuth when supported by the host

2022-01-07 Thread Marc Zyngier
is removed from cpu-features.rst, as it is now common to both TCG and KVM. Tested on an Apple M1 running 5.16-rc6. Cc: Eric Auger Cc: Richard Henderson Cc: Peter Maydell Reviewed-by: Andrew Jones Signed-off-by: Marc Zyngier --- * From v2: - Fixed indentation and spelling - Slightly

Re: [PATCH v3 3/5] hw/arm/virt: Honor highmem setting when computing the memory map

2022-01-06 Thread Marc Zyngier
On Wed, 05 Jan 2022 09:22:39 +, Eric Auger wrote: > > Hi Marc, > > On 12/27/21 10:16 PM, Marc Zyngier wrote: > > Even when the VM is configured with highmem=off, the highest_gpa > > field includes devices that are above the 4GiB limit. > > Similarily, nothing

Re: [PATCH v2 1/5] hw/arm/virt: Key enablement of highmem PCIe on highmem_ecam

2022-01-06 Thread Marc Zyngier
Hi Eric, On Wed, 05 Jan 2022 09:41:19 +, Eric Auger wrote: > > couldn't you simply introduce highmem_redist which is truly missing. You > could set it in virt_set_memmap() in case you skip extended_map overlay > and use it in virt_gicv3_redist_region_count() as you did? > In addition to the

Re: [PATCH v2] hw/arm/virt: KVM: Enable PAuth when supported by the host

2022-01-06 Thread Marc Zyngier
On Thu, 06 Jan 2022 18:26:29 +, Richard Henderson wrote: > > Mm. It does beg the question of why KVM exposes multiple bits. If > they must be tied, then it only serves to make the interface more > complicated than necessary. We would be better served to have a > single bit to control all

Re: [PATCH v2] hw/arm/virt: KVM: Enable PAuth when supported by the host

2022-01-06 Thread Marc Zyngier
On Thu, 06 Jan 2022 17:20:33 +, Richard Henderson wrote: > > On 1/6/22 1:16 AM, Marc Zyngier wrote: > >>> +static bool kvm_arm_pauth_supported(void) > >>> +{ > >>> +return (kvm_check_extension(kvm_state, KVM_CAP_ARM_PTRAUTH_ADDRESS) >

Re: [PATCH v2] hw/arm/virt: KVM: Enable PAuth when supported by the host

2022-01-06 Thread Marc Zyngier
Hi Richard, On Wed, 05 Jan 2022 21:36:55 +, Richard Henderson wrote: > > On 1/3/22 10:05 AM, Marc Zyngier wrote: > > -/* > > - * KVM does not support modifications to this feature. > > - * We have not registered the cpu properties when KVM &

Re: [PATCH v2 1/5] hw/arm/virt: Key enablement of highmem PCIe on highmem_ecam

2022-01-04 Thread Marc Zyngier
Hi Eric, On Tue, 04 Jan 2022 15:31:33 +, Eric Auger wrote: > > Hi Marc, > > On 12/27/21 4:53 PM, Marc Zyngier wrote: > > Hi Eric, > > > > Picking this up again after a stupidly long time... > > > > On Mon, 04 Oct 2021 13:00:21 +0100, > > Er

Re: [PATCH] hw/arm/virt: KVM: Enable PAuth when supported by the host

2022-01-03 Thread Marc Zyngier
Hi Andrew, On Mon, 03 Jan 2022 13:46:01 +, Andrew Jones wrote: > > Hi Marc, > > On Tue, Dec 28, 2021 at 06:23:47PM +, Marc Zyngier wrote: > > Add basic support for Pointer Authentication when running a KVM > > guest and that the host supports it, loosely base

[PATCH v2] hw/arm/virt: KVM: Enable PAuth when supported by the host

2022-01-03 Thread Marc Zyngier
is removed from cpu-features.rst, as it is now common to both TCG and KVM. Tested on an Apple M1 running 5.16-rc6. Cc: Eric Auger Cc: Andrew Jones Cc: Richard Henderson Cc: Peter Maydell Signed-off-by: Marc Zyngier --- * From v1: - Drop 'pauth' documentation - Make the TCG path common

[PATCH] hw/arm/virt: KVM: Enable PAuth when supported by the host

2021-12-28 Thread Marc Zyngier
M1 running 5.16-rc6. Cc: Eric Auger Cc: Andrew Jones Cc: Richard Henderson Cc: Peter Maydell Signed-off-by: Marc Zyngier --- docs/system/arm/cpu-features.rst | 5 + target/arm/cpu.c | 1 + target/arm/cpu.h | 1 + target/arm/cpu64.c | 36

[PATCH v3 4/5] hw/arm/virt: Use the PA range to compute the memory map

2021-12-27 Thread Marc Zyngier
-off-by: Marc Zyngier --- hw/arm/virt.c | 64 --- 1 file changed, 50 insertions(+), 14 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 84dd3b36fb..212079e7a6 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1660,10 +1660,10 @@ static

[PATCH v3 0/5] target/arm: Reduced-IPA space and highmem=off fixes

2021-12-27 Thread Marc Zyngier
- Collected Andrew's RBs, with thanks [1] https://lore.kernel.org/r/20211003164605.3116450-1-...@kernel.org Marc Zyngier (5): hw/arm/virt: Key enablement of highmem PCIe on highmem_ecam hw/arm/virt: Add a control for the the highmem redistributors hw/arm/virt: Honor highmem setting when

[PATCH v3 1/5] hw/arm/virt: Key enablement of highmem PCIe on highmem_ecam

2021-12-27 Thread Marc Zyngier
Currently, the highmem PCIe region is oddly keyed on the highmem attribute instead of highmem_ecam. Move the enablement of this PCIe region over to highmem_ecam. Reviewed-by: Andrew Jones Signed-off-by: Marc Zyngier --- hw/arm/virt-acpi-build.c | 10 -- hw/arm/virt.c| 4

[PATCH v3 3/5] hw/arm/virt: Honor highmem setting when computing the memory map

2021-12-27 Thread Marc Zyngier
range, as the reported IPA space is larger than what it should be. Instead, honor the user-specified limit to only use the devices at the lowest end of the spectrum, and fail if we have memory crossing the 4GiB limit. Reviewed-by: Andrew Jones Signed-off-by: Marc Zyngier --- hw/arm/virt.c | 9

[PATCH v3 2/5] hw/arm/virt: Add a control for the the highmem redistributors

2021-12-27 Thread Marc Zyngier
Just like we can control the enablement of the highmem PCIe region using highmem_ecam, let's add a control for the highmem GICv3 redistributor region. Similarily to highmem_ecam, these redistributors are disabled when highmem is off. Reviewed-by: Andrew Jones Signed-off-by: Marc Zyngier

[PATCH v3 5/5] hw/arm/virt: Disable highmem devices that don't fit in the PA range

2021-12-27 Thread Marc Zyngier
Make sure both the highmem PCIe and GICv3 regions are disabled when they don't fully fit in the PA range. Reviewed-by: Andrew Jones Signed-off-by: Marc Zyngier --- hw/arm/virt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 212079e7a6..18e615070f

Re: [PATCH v2 4/5] hw/arm/virt: Use the PA range to compute the memory map

2021-12-27 Thread Marc Zyngier
On Mon, 04 Oct 2021 11:11:10 +0100, Andrew Jones wrote: > > On Sun, Oct 03, 2021 at 05:46:04PM +0100, Marc Zyngier wrote: > > The highmem attribute is nothing but another way to express the > > PA range of a VM. To support HW that has a smaller PA range then > > what QE

Re: [PATCH v2 3/5] hw/arm/virt: Honor highmem setting when computing the memory map

2021-12-27 Thread Marc Zyngier
On Mon, 04 Oct 2021 13:23:41 +0100, Eric Auger wrote: > > Hi Marc, > > On 10/3/21 6:46 PM, Marc Zyngier wrote: > > Even when the VM is configured with highmem=off, the highest_gpa > > field includes devices that are above the 4GiB limit. > > Similarily, nothing

Re: [PATCH v2 1/5] hw/arm/virt: Key enablement of highmem PCIe on highmem_ecam

2021-12-27 Thread Marc Zyngier
Hi Eric, Picking this up again after a stupidly long time... On Mon, 04 Oct 2021 13:00:21 +0100, Eric Auger wrote: > > Hi Marc, > > On 10/3/21 6:46 PM, Marc Zyngier wrote: > > Currently, the highmem PCIe region is oddly keyed on the highmem > > attribute inste

Re: [PATCH for-6.2? 0/2] arm_gicv3: Fix handling of LPIs in list registers

2021-11-29 Thread Marc Zyngier
er interrupt, and is quite happy to carry an active bit that eventually gets exposed to the hypervisor. I don't think this ever caused any issue, but I'd be pretty happy to see the QEMU implementation fixed. For the whole series: Reviewed-by: Marc Zyngier Thanks, M. [1] https://git.kernel

[PATCH v2 5/5] hw/arm/virt: Disable highmem devices that don't fit in the PA range

2021-10-03 Thread Marc Zyngier
Make sure both the highmem PCIe and GICv3 regions are disabled when they don't fully fit in the PA range. Signed-off-by: Marc Zyngier --- hw/arm/virt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index a572e0c9d9..756f67b6c8 100644 --- a/hw/arm/virt.c

[PATCH v2 3/5] hw/arm/virt: Honor highmem setting when computing the memory map

2021-10-03 Thread Marc Zyngier
range, as the reported IPA space is larger than what it should be. Instead, honor the user-specified limit to only use the devices at the lowest end of the spectrum, and fail if we have memory crossing the 4GiB limit. Signed-off-by: Marc Zyngier --- hw/arm/virt.c | 9 - 1 file changed

[PATCH v2 0/5] target/arm: Reduced-IPA space and highmem=off fixes

2021-10-03 Thread Marc Zyngier
and GICv3 RDs when they are outside of the PA range This has been tested on an M1-based Mac-mini running Linux v5.15-rc3. [1] https://lore.kernel.org/r/2021082211.1290891-1-...@kernel.org Marc Zyngier (5): hw/arm/virt: Key enablement of highmem PCIe on highmem_ecam hw/arm/virt: Add

[PATCH v2 1/5] hw/arm/virt: Key enablement of highmem PCIe on highmem_ecam

2021-10-03 Thread Marc Zyngier
Currently, the highmem PCIe region is oddly keyed on the highmem attribute instead of highmem_ecam. Move the enablement of this PCIe region over to highmem_ecam. Signed-off-by: Marc Zyngier --- hw/arm/virt-acpi-build.c | 10 -- hw/arm/virt.c| 4 ++-- 2 files changed, 6

[PATCH v2 4/5] hw/arm/virt: Use the PA range to compute the memory map

2021-10-03 Thread Marc Zyngier
-off-by: Marc Zyngier --- hw/arm/virt.c | 46 +++--- 1 file changed, 35 insertions(+), 11 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 9d2abdbd5f..a572e0c9d9 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1610,10 +1610,10 @@ static

[PATCH v2 2/5] hw/arm/virt: Add a control for the the highmem redistributors

2021-10-03 Thread Marc Zyngier
Just like we can control the enablement of the highmem PCIe region using highmem_ecam, let's add a control for the highmem GICv3 redistributor region. Similarily to highmem_ecam, these redistributors are disabled when highmem is off. Signed-off-by: Marc Zyngier --- hw/arm/virt-acpi-build.c | 2

Re: [PATCH v9 07/11] hvf: arm: Implement PSCI handling

2021-09-15 Thread Marc Zyngier
On Wed, 15 Sep 2021 11:58:29 +0100, Alexander Graf wrote: > > > On 15.09.21 11:46, Marc Zyngier wrote: > > On Mon, 13 Sep 2021 13:30:57 +0100, > > Peter Maydell wrote: > >> On Mon, 13 Sept 2021 at 13:02, Alexander Graf wrote: > >>> > >>>

Re: [PATCH v9 07/11] hvf: arm: Implement PSCI handling

2021-09-15 Thread Marc Zyngier
On Mon, 13 Sep 2021 13:30:57 +0100, Peter Maydell wrote: > > On Mon, 13 Sept 2021 at 13:02, Alexander Graf wrote: > > > > > > On 13.09.21 13:44, Peter Maydell wrote: > > > On Mon, 13 Sept 2021 at 12:07, Alexander Graf wrote: > > >> To keep your train of thought though, what would you do if we

Re: [PATCH 3/3] docs/system/arm/virt: Fix documentation for the 'highmem' option

2021-09-08 Thread Marc Zyngier
On Tue, 07 Sep 2021 19:25:23 +0100, Peter Maydell wrote: > > On Tue, 7 Sept 2021 at 18:10, Marc Zyngier wrote: > > > > Hi Peter, > > > > On Tue, 07 Sep 2021 13:51:13 +0100, > > Peter Maydell wrote: > > > > > > On Sun, 22 Aug 2021 at 15:45,

Re: [PATCH 3/3] docs/system/arm/virt: Fix documentation for the 'highmem' option

2021-09-07 Thread Marc Zyngier
Hi Peter, On Tue, 07 Sep 2021 13:51:13 +0100, Peter Maydell wrote: > > On Sun, 22 Aug 2021 at 15:45, Marc Zyngier wrote: > > > > The documentation for the 'highmem' option indicates that it controls > > the placement of both devices and RAM. The actual beh

Re: [PATCH 0/3] target/arm: Reduced-IPA space and highmem=off fixes

2021-08-22 Thread Marc Zyngier
On 2021-08-22 15:44, Marc Zyngier wrote: With the availability of a fruity range of arm64 systems, it becomes obvious that QEMU doesn't deal very well with limited IPA ranges when used as a front-end for KVM. This short series aims at making usable on such systems: - the first patch makes

[PATCH 0/3] target/arm: Reduced-IPA space and highmem=off fixes

2021-08-22 Thread Marc Zyngier
- the second one actually removes the highmem devices from the computed IPA range when highmem=off - the last one addresses an imprecision in the documentation for the highmem option This has been tested on an M1-based Mac-mini running Linux v5.14-rc6. Marc Zyngier (3): hw/arm/virt: KVM: Probe

[PATCH 1/3] hw/arm/virt: KVM: Probe for KVM_CAP_ARM_VM_IPA_SIZE when creating scratch VM

2021-08-22 Thread Marc Zyngier
as KVM cannot use the default 40bit that '0' represents. Instead, probe for the extension and use the reported IPA limit if available. Cc: Andrew Jones Cc: Eric Auger Cc: Peter Maydell Signed-off-by: Marc Zyngier --- target/arm/kvm.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion

[PATCH 3/3] docs/system/arm/virt: Fix documentation for the 'highmem' option

2021-08-22 Thread Marc Zyngier
behaviour. Cc: Andrew Jones Cc: Eric Auger Cc: Peter Maydell Signed-off-by: Marc Zyngier --- docs/system/arm/virt.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/system/arm/virt.rst b/docs/system/arm/virt.rst index 59acf0eeaf..e206e7565d 100644 --- a/docs/system

[PATCH 2/3] hw/arm/virt: Honor highmem setting when computing highest_gpa

2021-08-22 Thread Marc Zyngier
-by: Marc Zyngier --- hw/arm/virt.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 81eda46b0b..bc189e30b8 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1598,7 +1598,7 @@ static uint64_t virt_cpu_mp_affinity(VirtMachineState *vms

Re: [PATCH v17 5/6] KVM: arm64: ioctl to fetch/store tags in a guest

2021-06-24 Thread Marc Zyngier
e_pfn_dirty(pfn); > + } > + > + if (num_tags != MTE_GRANULES_PER_PAGE) { > + ret = -EFAULT; > + goto out; > + } > + > + /* Set the flag after checking the write completed fully */ > + i

Re: [PATCH v17 0/6] MTE support for KVM guest

2021-06-22 Thread Marc Zyngier
On Mon, 21 Jun 2021 12:17:10 +0100, Steven Price wrote: > This series adds support for using the Arm Memory Tagging Extensions > (MTE) in a KVM guest. > > Changes since v16[1]: > > - Dropped the first patch ("Handle race when synchronising tags") as >it's not KVM specific and by restricting

Re: [PATCH v17 2/6] KVM: arm64: Introduce MTE VM feature

2021-06-22 Thread Marc Zyngier
On Mon, 21 Jun 2021 18:00:20 +0100, Fuad Tabba wrote: > > Hi, > > On Mon, Jun 21, 2021 at 12:18 PM Steven Price wrote: > > > > Add a new VM feature 'KVM_ARM_CAP_MTE' which enables memory tagging > > for a VM. This will expose the feature to the guest and automatically > > tag memory pages

Re: [PATCH v17 5/6] KVM: arm64: ioctl to fetch/store tags in a guest

2021-06-22 Thread Marc Zyngier
Hi Fuad, On Tue, 22 Jun 2021 09:56:22 +0100, Fuad Tabba wrote: > > Hi, > > > On Mon, Jun 21, 2021 at 12:18 PM Steven Price wrote: > > > > The VMM may not wish to have it's own mapping of guest memory mapped > > with PROT_MTE because this causes problems if the VMM has tag checking > >

Re: [PATCH v17 6/6] KVM: arm64: Document MTE capability and ioctl

2021-06-22 Thread Marc Zyngier
On Tue, 22 Jun 2021 10:42:42 +0100, Fuad Tabba wrote: > > Hi, > > > On Mon, Jun 21, 2021 at 12:18 PM Steven Price wrote: > > > > A new capability (KVM_CAP_ARM_MTE) identifies that the kernel supports > > granting a guest access to the tags, and provides a mechanism for the > > VMM to enable

Re: [PATCH v17 4/6] KVM: arm64: Expose KVM_ARM_CAP_MTE

2021-06-22 Thread Marc Zyngier
On Tue, 22 Jun 2021 09:07:51 +0100, Fuad Tabba wrote: > > Hi, > > On Mon, Jun 21, 2021 at 12:18 PM Steven Price wrote: > > > > It's now safe for the VMM to enable MTE in a guest, so expose the > > capability to user space. > > > > Reviewed-by: Catalin Marinas > > Signed-off-by: Steven Price

Re: [PATCH v16 3/7] KVM: arm64: Introduce MTE VM feature

2021-06-21 Thread Marc Zyngier
On Fri, 18 Jun 2021 14:28:22 +0100, Steven Price wrote: > > Add a new VM feature 'KVM_ARM_CAP_MTE' which enables memory tagging > for a VM. This will expose the feature to the guest and automatically > tag memory pages touched by the VM as PG_mte_tagged (and clear the tag > storage) to ensure

Re: [PATCH v16 1/7] arm64: mte: Handle race when synchronising tags

2021-06-18 Thread Marc Zyngier
On 2021-06-18 15:40, Catalin Marinas wrote: On Fri, Jun 18, 2021 at 02:28:20PM +0100, Steven Price wrote: mte_sync_tags() used test_and_set_bit() to set the PG_mte_tagged flag before restoring/zeroing the MTE tags. However if another thread were to race and attempt to sync the tags on the

Re: [PATCH v15 0/7] MTE support for KVM guest

2021-06-17 Thread Marc Zyngier
On Thu, 17 Jun 2021 14:24:25 +0100, Steven Price wrote: > > On 17/06/2021 14:15, Marc Zyngier wrote: > > On Thu, 17 Jun 2021 13:13:22 +0100, > > Catalin Marinas wrote: > >> > >> On Mon, Jun 14, 2021 at 10:05:18AM +0100, Steven Price wrote: > >>

Re: [PATCH v15 0/7] MTE support for KVM guest

2021-06-17 Thread Marc Zyngier
On Thu, 17 Jun 2021 13:13:22 +0100, Catalin Marinas wrote: > > On Mon, Jun 14, 2021 at 10:05:18AM +0100, Steven Price wrote: > > I realise there are still open questions[1] around the performance of > > this series (the 'big lock', tag_sync_lock, introduced in the first > > patch). But there

Re: [PATCH v14 1/8] arm64: mte: Handle race when synchronising tags

2021-06-09 Thread Marc Zyngier
On Wed, 09 Jun 2021 11:51:34 +0100, Steven Price wrote: > > On 09/06/2021 11:30, Marc Zyngier wrote: > > On Mon, 07 Jun 2021 12:08:09 +0100, > > Steven Price wrote: > >> > >> mte_sync_tags() used test_and_set_bit() to set the PG_mte_tagged flag > &

Re: [PATCH v14 1/8] arm64: mte: Handle race when synchronising tags

2021-06-09 Thread Marc Zyngier
On Mon, 07 Jun 2021 12:08:09 +0100, Steven Price wrote: > > mte_sync_tags() used test_and_set_bit() to set the PG_mte_tagged flag > before restoring/zeroing the MTE tags. However if another thread were to > race and attempt to sync the tags on the same page before the first > thread had

Re: [PATCH v12 8/8] KVM: arm64: Document MTE capability and ioctl

2021-05-20 Thread Marc Zyngier
On Wed, 19 May 2021 15:09:23 +0100, Steven Price wrote: > > On 17/05/2021 19:09, Marc Zyngier wrote: > > On Mon, 17 May 2021 13:32:39 +0100, > > Steven Price wrote: > >> > >> A new capability (KVM_CAP_ARM_MTE) identifies that the kernel supports >

  1   2   3   >