[FINAL WARNING] kvmarm@lists.cs.columbia.edu going away

2023-01-06 Thread Marc Zyngier
Hi folks, After many years of awesome service, the kvmarm mailing list hosted by Columbia is being decommissioned. No new email will be archived on lore.kernel.org, and I am placing the old list under emergency moderation *NOW*. If you haven't yet subscribed to the new kvmarm list and still want

[GIT PULL] KVM/arm64 fixes for 6.2, take #1

2023-01-05 Thread Marc Zyngier
Alexandru Elisei (1): MAINTAINERS: Remove myself as a KVM/arm64 reviewer James Clark (1): KVM: arm64: PMU: Fix PMCR_EL0 reset value Marc Zyngier (8): KVM: arm64: Fix S1PTW handling on RO memslots KVM: arm64: Document the behaviour of S1PTW faults

Re: [PATCH rcu 02/27] arch/arm64/kvm: Remove "select SRCU"

2023-01-05 Thread Marc Zyngier
On Thu, 05 Jan 2023 00:37:48 +, "Paul E. McKenney" wrote: > > Now that the SRCU Kconfig option is unconditionally selected, there is > no longer any point in selecting it. Therefore, remove the "select SRCU" > Kconfig statements. > > Signed-off-by

Re: [PATCH 1/3] KVM: arm64: vgic: Add Apple M2 cpus to the list of broken SEIS implementations

2023-01-03 Thread Marc Zyngier
pts so I apologize if the following review > is rather shallow but... No need to apologise. Any extra pair of eye is welcome, specially when the idiot behind the keyboard writes stuff like the patch below... > > On Tue, Jan 03, 2023 at 09:50:20AM +, Marc Zyngier wrote: > > I

Re: [PATCH 0/1] KVM: arm64: PMU: Fix PMCR_EL0 reset value

2023-01-03 Thread Marc Zyngier
On Fri, 9 Dec 2022 16:44:45 +, James Clark wrote: > We noticed qemu failing to run because of an assert on our CI. I don't see > the issue anymore with > this fix. > > Applies to kvmarm/next (753d734f3f34) > > Thanks > > [...] Applied to fixes, thanks! [1/1] KVM: arm64: PMU: Fix PMCR_EL0

Re: (subset) [PATCH 0/3] KVM: arm64: M2 vgic maintenance interrupt rework pre-NV

2023-01-03 Thread Marc Zyngier
On Tue, 3 Jan 2023 09:50:19 +, Marc Zyngier wrote: > I've spent the holiday break reviving the Nested Virt KVM/arm64 > implementation[1] and allowing it to work on the Apple M2 SoC. The > amusing part is that it actually works! > > However, the way the vgic is implemented on t

Re: [PATCH] MAINTAINERS: Add Zenghui Yu as a KVM/arm64 reviewer

2023-01-03 Thread Marc Zyngier
On Tue, 3 Jan 2023 12:39:33 +, Marc Zyngier wrote: > Zenghui has been around for quite some time, and has been instrumental > in reviewing the GICv4/4.1 KVM support. I'm delighted that he's agreed > to help with the patch review in a more official capacity! Applied to fixes, than

Re: [PATCH] MAINTAINERS: Remove myself as a KVM/arm64 reviewer

2023-01-03 Thread Marc Zyngier
ned-off-by: Alexandru Elisei > --- > MAINTAINERS | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/MAINTAINERS b/MAINTAINERS > index 7f86d02cb427..813673637500 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -11356,7 +11356,6 @@ F:virt/kvm/* > KERNEL

Re: [PATCH 0/7] KVM: arm64: PMU: Allow userspace to limit the number of PMCs on vCPU

2023-01-03 Thread Marc Zyngier
On Tue, 03 Jan 2023 12:40:34 +, Jonathan Cameron wrote: > > On Thu, 29 Dec 2022 19:59:21 -0800 > Reiji Watanabe wrote: > > > The goal of this series is to allow userspace to limit the number > > of PMU event counters on the vCPU. > > Hi Rieji, > > Why do you want to do this? > > I can

[PATCH] MAINTAINERS: Add Zenghui Yu as a KVM/arm64 reviewer

2023-01-03 Thread Marc Zyngier
Zenghui has been around for quite some time, and has been instrumental in reviewing the GICv4/4.1 KVM support. I'm delighted that he's agreed to help with the patch review in a more official capacity! Cc: Zenghui Yu Signed-off-by: Marc Zyngier --- MAINTAINERS | 1 + 1 file changed, 1 insertion

[PATCH v2 3/3] KVM: arm64: Convert FSC_* over to ESR_ELx_FSC_*

2023-01-03 Thread Marc Zyngier
The former is an AArch32 legacy, so let's move over to the verbose (and strictly identical) version. This involves moving some of the #defines that were private to KVM into the more generic esr.h. Signed-off-by: Marc Zyngier --- arch/arm64/include/asm/esr.h| 9 + arch

[PATCH v2 1/3] KVM: arm64: Fix S1PTW handling on RO memslots

2023-01-03 Thread Marc Zyngier
d-by: Ard Biesheuvel Regression-tested-by: Ard Biesheuvel Signed-off-by: Marc Zyngier Cc: sta...@vger.kernel.org --- arch/arm64/include/asm/kvm_emulate.h | 22 -- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/arch/arm64/include/asm/kvm_emulate.h b/arch/arm64/inclu

[PATCH v2 2/3] KVM: arm64: Document the behaviour of S1PTW faults on RO memslots

2023-01-03 Thread Marc Zyngier
, document the fact that such an access results in a guest exception, not an exit. This is consistent with the guest being terminally broken anyway. Reviewed-by: Oliver Upton Signed-off-by: Marc Zyngier --- Documentation/virt/kvm/api.rst | 8 1 file changed, 8 insertions(+) diff --git

[PATCH v2 0/3] KVM: arm64: Fix handling of S1PTW S2 fault on RO memslots

2023-01-03 Thread Marc Zyngier
. * From v1: - Added the documentation patch - Dropped the AF micro-optimisation, as it was creating more confusion, was hard to test, and was of dubious value - Collected RBs, with thanks Marc Zyngier (3): KVM: arm64: Fix S1PTW handling on RO memslots KVM: arm64: Document the behaviour

[PATCH 3/3] irqchip/apple-aic: Register vgic maintenance interrupt with KVM

2023-01-03 Thread Marc Zyngier
In order to deliver vgic maintenance interrupts that Nested Virt requires, hook it into the FIQ space, even if it is delivered as an IRQ (we don't distinguish between the two anyway). Signed-off-by: Marc Zyngier --- drivers/irqchip/irq-apple-aic.c | 55 + 1 file

[PATCH 0/3] KVM: arm64: M2 vgic maintenance interrupt rework pre-NV

2023-01-03 Thread Marc Zyngier
-WIP Marc Zyngier (3): KVM: arm64: vgic: Add Apple M2 cpus to the list of broken SEIS implementations KVM: arm64: vgic: Allow registration of a non-maskable maintenance interrupt irqchip/apple-aic: Register vgic maintenance interrupt with KVM arch/arm64/include/asm/cputype.h | 4

[PATCH 2/3] KVM: arm64: vgic: Allow registration of a non-maskable maintenance interrupt

2023-01-03 Thread Marc Zyngier
useful once we enable NV on M2 HW. Signed-off-by: Marc Zyngier --- arch/arm64/kvm/vgic/vgic-init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/kvm/vgic/vgic-init.c b/arch/arm64/kvm/vgic/vgic-init.c index f6d4f4052555..e61d9ca01768 100644 --- a/arch/arm64/kvm/vgic

[PATCH 1/3] KVM: arm64: vgic: Add Apple M2 cpus to the list of broken SEIS implementations

2023-01-03 Thread Marc Zyngier
, this is all a bit crap. Signed-off-by: Marc Zyngier --- arch/arm64/include/asm/cputype.h | 4 arch/arm64/kvm/vgic/vgic-v3.c| 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/cputype.h b/arch/arm64/include/asm/cputype.h index 4e8b66c74ea2..683ca3af4084

[PATCH 0/3] KVM: arm64: M2 vgic maintenance interrupt rework pre-NV

2023-01-03 Thread Marc Zyngier
-WIP Marc Zyngier (3): KVM: arm64: vgic: Add Apple M2 cpus to the list of broken SEIS implementations KVM: arm64: vgic: Allow registration of a non-maskable maintenance interrupt irqchip/apple-aic: Register vgic maintenance interrupt with KVM arch/arm64/include/asm/cputype.h | 4

Re: [PATCH 2/3] KVM: arm64: nv: Emulate ISTATUS when emulated timers are fired.

2023-01-02 Thread Marc Zyngier
On Thu, 29 Dec 2022 13:53:15 +, Marc Zyngier wrote: > > On Wed, 24 Aug 2022 07:03:03 +0100, > Ganapatrao Kulkarni wrote: > > > > Guest-Hypervisor forwards the timer interrupt to Guest-Guest, if it is > > enabled, unmasked and ISTATUS bit of register CNTV_CTL_

Re: [PATCH 3/3] KVM: arm64: nv: Avoid block mapping if max_map_size is smaller than block size.

2022-12-29 Thread Marc Zyngier
On Wed, 24 Aug 2022 07:03:04 +0100, Ganapatrao Kulkarni wrote: > > In NV case, Shadow stage 2 page table is created using host hypervisor > page table configuration like page size, block size etc. Also, the shadow > stage 2 table uses block level mapping if the Guest Hypervisor IPA is > backed

Re: [PATCH 2/3] KVM: arm64: nv: Emulate ISTATUS when emulated timers are fired.

2022-12-29 Thread Marc Zyngier
On Wed, 24 Aug 2022 07:03:03 +0100, Ganapatrao Kulkarni wrote: > > Guest-Hypervisor forwards the timer interrupt to Guest-Guest, if it is > enabled, unmasked and ISTATUS bit of register CNTV_CTL_EL0 is set for a > loaded timer. > > For NV2 implementation, the Host-Hypervisor is not emulating

Re: [PATCH 1/3] KVM: arm64: nv: only emulate timers that have not yet fired

2022-12-29 Thread Marc Zyngier
On Wed, 24 Aug 2022 07:03:02 +0100, Ganapatrao Kulkarni wrote: > > From: D Scott Phillips > > The timer emulation logic goes into an infinite loop when the NestedVM(L2) > timer is being emulated. > > While the CPU is executing in L1 context, the L2 timers are emulated using > host hrtimer.

Re: [PATCH v2 00/50] KVM: Rework kvm_init() and hardware enabling

2022-12-28 Thread Marc Zyngier
On 2022-12-27 13:02, Paolo Bonzini wrote: Queued, thanks. I will leave this in kvm/queue after testing everything else and moving it to kvm/next; this way, we can wait for test results on other architectures. Can you please make this a topic branch, and if possible based on a released -rc?

Re: running openbsd on KVM running on fedora over raspberry pi 4

2022-12-26 Thread Marc Zyngier
On Fri, 23 Dec 2022 11:33:35 +, Sandeep Gupta wrote: > > I am trying to run openbsd as guest OS. > I am using this command to create the vm > ``` > > virt-install --name openbsd1 --ram 2048 --vcpus 2 --disk > path=/var/lib/libvirt/images/openbsd1.qcow2,format=qcow2,bus=virtio,size=20 >

Re: [PATCH v4 7/7] KVM: arm64: Normalize cache configuration

2022-12-25 Thread Marc Zyngier
the values saved with the old kernel. > > Suggested-by: Marc Zyngier > Signed-off-by: Akihiko Odaki > --- > arch/arm64/include/asm/cache.h| 3 + > arch/arm64/include/asm/kvm_host.h | 4 + > arch/arm64/kvm/reset.c| 1 + > arch/arm64/kvm/sys_regs.c

Re: [PATCH 1/3] KVM: arm64: Fix S1PTW handling on RO memslots

2022-12-24 Thread Marc Zyngier
On Thu, 22 Dec 2022 13:01:55 +, Ard Biesheuvel wrote: > > On Tue, 20 Dec 2022 at 21:09, Marc Zyngier wrote: > > > > A recent development on the EFI front has resulted in guests having > > their page tables baked in the firmware binary, and mapped into > > t

Re: [PATCH 2/3] KVM: arm64: Handle S1PTW translation with TCR_HA set as a write

2022-12-24 Thread Marc Zyngier
On Thu, 22 Dec 2022 20:58:40 +, Oliver Upton wrote: > > On Thu, Dec 22, 2022 at 09:01:15AM +, Marc Zyngier wrote: > > On Wed, 21 Dec 2022 17:46:24 +, Oliver Upton > > wrote: > > > - When UFFD is in use, translation faults are reported to userspace as >

Re: [PATCH 2/2] KVM: arm64: Remove use of ARM64_FEATURE_MASK()

2022-12-22 Thread Marc Zyngier
On Wed, 21 Dec 2022 18:06:10 +, Mark Brown wrote: > > The KVM code makes extensive use of ARM64_FEATURE_MASK() to generate a > mask for fields in the ID registers. This macro has the assumption that > all feature fields are 4 bits wide but the architecture has evolved to > add fields with

Re: [PATCH 2/3] KVM: arm64: Handle S1PTW translation with TCR_HA set as a write

2022-12-22 Thread Marc Zyngier
On Wed, 21 Dec 2022 17:46:24 +, Oliver Upton wrote: > > On Wed, Dec 21, 2022 at 08:46:06AM -0800, Ricardo Koller wrote: > > [...] > > > > - return false; > > > + /* Can't introspect TCR_EL1 with pKVM */ > > > + if

Re: [PATCH 1/3] KVM: arm64: Fix S1PTW handling on RO memslots

2022-12-21 Thread Marc Zyngier
On Wed, 21 Dec 2022 16:50:30 +, Oliver Upton wrote: > > On Wed, Dec 21, 2022 at 09:35:06AM +, Marc Zyngier wrote: > > [...] > > > > > + if (kvm_vcpu_abt_iss1tw(vcpu)) { > > > > + /* > > > > +

Re: [PATCH 2/3] KVM: arm64: Handle S1PTW translation with TCR_HA set as a write

2022-12-21 Thread Marc Zyngier
Hi Ricardo, On Wed, 21 Dec 2022 16:46:06 +, Ricardo Koller wrote: > > Hello, > > On Tue, Dec 20, 2022 at 08:09:22PM +, Marc Zyngier wrote: > > As a minor optimisation, we can retrofit the "S1PTW is a write > > even on translation fault" concept *if* th

Re: [PATCH 1/3] KVM: arm64: Fix S1PTW handling on RO memslots

2022-12-21 Thread Marc Zyngier
On Tue, 20 Dec 2022 21:47:36 +, Oliver Upton wrote: > > Hi Marc, > > On Tue, Dec 20, 2022 at 08:09:21PM +, Marc Zyngier wrote: > > A recent development on the EFI front has resulted in guests having > > their page tables baked in the firmware binary, and mappe

[PATCH 3/3] KVM: arm64: Convert FSC_* over to ESR_ELx_FSC_*

2022-12-20 Thread Marc Zyngier
The former is an AArch32 legacy, so let's move over to the verbose (and strictly identical) version. This involves moving some of the #defines that were private to KVM into the more generic esr.h. Signed-off-by: Marc Zyngier --- arch/arm64/include/asm/esr.h| 9 + arch

[PATCH 2/3] KVM: arm64: Handle S1PTW translation with TCR_HA set as a write

2022-12-20 Thread Marc Zyngier
s to parse the PTs to find out if the DBM bit is set there. This is not going to happen. Signed-off-by: Marc Zyngier --- arch/arm64/include/asm/kvm_emulate.h | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/kvm_emulate.h b/arch/arm

[PATCH 0/3] KVM: arm64: Fix handling of S1PTW S2 fault on RO memslots

2022-12-20 Thread Marc Zyngier
* page sizes! M. Marc Zyngier (3): KVM: arm64: Fix S1PTW handling on RO memslots KVM: arm64: Handle S1PTW translation with TCR_HA set as a write KVM: arm64: Convert FSC_* over to ESR_ELx_FSC_* arch/arm64/include/asm/esr.h| 9 arch/arm64/include/asm/kvm_arm.h

[PATCH 1/3] KVM: arm64: Fix S1PTW handling on RO memslots

2022-12-20 Thread Marc Zyngier
ume write fault on S1PTW permission fault on instruction fetch") Signed-off-by: Marc Zyngier Cc: sta...@vger.kernel.org --- arch/arm64/include/asm/kvm_emulate.h | 22 -- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/arch/arm64/include/asm/kvm_emulate.h b/ar

Re: [PATCH] KVM: arm64: Synchronize SMEN on vcpu schedule out

2022-12-20 Thread Marc Zyngier
hronization is needed before reading SVCR later in > fpsimd_save, or it may cause sync exception which can not be > handled by host. > > Cc: Marc Zyngier > Cc: James Morse > Cc: Alexandru Elisei > Cc: Suzuki K Poulose > Cc: Oliver Upton > Cc: Catalin Marinas

Re: [PATCH v3 1/7] arm64/sysreg: Convert CCSIDR_EL1 to automatic generation

2022-12-19 Thread Marc Zyngier
On Mon, 19 Dec 2022 15:00:15 +, Mark Brown wrote: > > [1 ] > On Sun, Dec 18, 2022 at 01:11:01PM +0000, Marc Zyngier wrote: > > Akihiko Odaki wrote: > > > > arch/arm64/tools/gen-sysreg.awk does not allow a hole and requires all > > > bits are described h

Re: [PATCH 1/3] arm64/sysreg: Add CCSIDR2_EL1

2022-12-19 Thread Marc Zyngier
On 2022-12-19 14:50, Mark Brown wrote: On Mon, Dec 19, 2022 at 02:47:25PM +, Marc Zyngier wrote: Since you're reviewing some of this, please have a look at v3[1], which outlined a limitation of the sysreg generation tool as well as a potential fix. Hrm, would've been nice to be CCed

Re: [PATCH 1/3] arm64/sysreg: Add CCSIDR2_EL1

2022-12-19 Thread Marc Zyngier
On 2022-12-19 13:12, Mark Brown wrote: On Sun, Dec 11, 2022 at 02:16:58PM +0900, Akihiko Odaki wrote: CCSIDR2_EL1 was added with FEAT_CCIDX. This corresponds to the definition in DDI0487I.a. Reviewed-by: Mark Brown Since you're reviewing some of this, please have a look at v3[1], which

Re: [PATCH v3 5/7] KVM: arm64: Allow user to set CCSIDR_EL1

2022-12-18 Thread Marc Zyngier
On Sun, 18 Dec 2022 05:14:10 +, Akihiko Odaki wrote: > > Allow the userspace to set CCSIDR_EL1 so that if the kernel changes the > default values of CCSIDR_EL1, the userspace can restore the old values > from an old saved VM context. > > Suggested-by: Marc Zyngier > S

Re: [PATCH v3 1/7] arm64/sysreg: Convert CCSIDR_EL1 to automatic generation

2022-12-18 Thread Marc Zyngier
On Sun, 18 Dec 2022 11:35:12 +, Akihiko Odaki wrote: > > On 2022/12/18 20:23, Marc Zyngier wrote: > > On Sun, 18 Dec 2022 05:14:06 +, > > Akihiko Odaki wrote: > >> > >> Convert CCSIDR_EL1 to automatic generation as per DDI0487I.a. The field > &g

Re: [PATCH v3 1/7] arm64/sysreg: Convert CCSIDR_EL1 to automatic generation

2022-12-18 Thread Marc Zyngier
On Sun, 18 Dec 2022 05:14:06 +, Akihiko Odaki wrote: > > Convert CCSIDR_EL1 to automatic generation as per DDI0487I.a. The field > definition is for case when FEAT_CCIDX is not implemented. Fields WT, > WB, RA and WA are defined as per A.j since they are now reserved and > may have UNKNOWN

Re: [PATCH v1 00/12] KVM: arm64: Support FEAT_LPA2 at hyp s1 and vm s2

2022-12-15 Thread Marc Zyngier
On Thu, 15 Dec 2022 00:52:28 +, Oliver Upton wrote: > > On Tue, Dec 06, 2022 at 01:59:18PM +, Ryan Roberts wrote: > > (appologies, I'm resending this series as I managed to send the cover > > letter to > > all but the following patches only to myself on first attempt). > > > > This is

Re: [PATCH 3/3] KVM: arm64: Normalize cache configuration

2022-12-14 Thread Marc Zyngier
that > the VMM can restore the values saved with the old kernel. > > Suggested-by: Marc Zyngier > Signed-off-by: Akihiko Odaki > --- > arch/arm64/include/asm/kvm_arm.h | 3 +- > arch/arm64/include/asm/kvm_emulate.h | 4 - > arch/arm64/include/asm

Re: [PATCH 06/14] KVM: selftests: Rename UNAME_M to ARCH_DIR, fill explicitly for x86

2022-12-14 Thread Marc Zyngier
On 2022-12-13 20:03, Sean Christopherson wrote: One last thought/question, what do y'all think about renaming directories to follow the kernel proper? I.e. aarch64=>arm64, s390x=>s390, and x86_64=>x86. Then $(ARCH_DIR) would go away. The churn would be unfortunate, but it would be nice to

Re: [PATCH 0/1] KVM: arm64: PMU: Fix PMCR_EL0 reset value

2022-12-12 Thread Marc Zyngier
On Fri, 9 Dec 2022 16:44:45 +, James Clark wrote: > We noticed qemu failing to run because of an assert on our CI. I don't see > the issue anymore with > this fix. > > Applies to kvmarm/next (753d734f3f34) > > Thanks > > [...] Applied to fixes, thanks! [1/1] KVM: arm64: PMU: Fix PMCR_EL0

Re: [kvm-unit-tests PATCH 1/3] arm: pmu: Fix overflow checks for PMUv3p5 long counters

2022-12-12 Thread Marc Zyngier
Alex, On Sun, 11 Dec 2022 11:40:39 +, Alexandru Elisei wrote: > > A simple "hey, you're wrong here, the PMU extensions do not follow the > principles of the ID scheme for fields in ID registers" would have > sufficed. This is what I did, and saved you the hassle of looking it up. > Guess

Re: [PATCH 0/3] KVM: arm64: Handle CCSIDR associativity mismatches

2022-12-11 Thread Marc Zyngier
On Sun, 11 Dec 2022 05:25:31 +, Akihiko Odaki wrote: > > On 2022/12/04 23:57, Marc Zyngier wrote: > > On Fri, 02 Dec 2022 09:55:24 +, > > Akihiko Odaki wrote: > >> > >> On 2022/12/02 18:40, Marc Zyngier wrote: > >>> On Fri, 02 Dec

Re: [PATCH 1/1] KVM: arm64: PMU: Fix PMCR_EL0 reset value

2022-12-10 Thread Marc Zyngier
On Fri, 09 Dec 2022 17:58:31 +, Oliver Upton wrote: > > On Fri, Dec 09, 2022 at 04:44:46PM +, James Clark wrote: > > ARMV8_PMU_PMCR_N_MASK is an unshifted value which results in the wrong > > reset value for PMCR_EL0, so shift it to fix it. > > That's just mean. *_MASK tends to be a

Re: [kvm-unit-tests PATCH 1/3] arm: pmu: Fix overflow checks for PMUv3p5 long counters

2022-12-10 Thread Marc Zyngier
On Fri, 09 Dec 2022 17:47:14 +, Alexandru Elisei wrote: > > Hi, > > On Fri, Dec 02, 2022 at 04:55:25AM +, Ricardo Koller wrote: > > PMUv3p5 uses 64-bit counters irrespective of whether the PMU is configured > > for overflowing at 32 or 64-bits. The consequence is that tests that check >

Re: [GIT PULL] KVM/arm64 updates for 6.2

2022-12-06 Thread Marc Zyngier
On Tue, 06 Dec 2022 21:43:43 +, Paolo Bonzini wrote: > > On 12/6/22 19:20, Mark Brown wrote: > >> I almost suggested doing that on multiple occasions this cycle, but > >> ultimately > >> decided not to because it would effectively mean splitting series that > >> touch KVM > >> and

Re: [GIT PULL] KVM/arm64 updates for 6.2

2022-12-06 Thread Marc Zyngier
On Tue, 06 Dec 2022 17:41:21 +, Paolo Bonzini wrote: > > On 12/5/22 16:58, Marc Zyngier wrote: > > - There is a lot of selftest conflicts with your own branch, see: > > > >https://lore.kernel.org/r/20221201112432.4cb9a...@canb.auug.org.au > >

Re: [PATCH v1 00/12] KVM: arm64: Support FEAT_LPA2 at hyp s1 and vm s2

2022-12-06 Thread Marc Zyngier
On Tue, 06 Dec 2022 12:06:00 +, Ryan Roberts wrote: > > This is my first upstream feature submission so please go easy ;-) Sure! Where are the patches? ;-) M. -- Without deviation from the norm, progress is not possible. ___ kvmarm

[GIT PULL] KVM/arm64 updates for 6.2

2022-12-05 Thread Marc Zyngier
tic generation arm64/sysreg: Convert ID_DFR1_EL1 to automatic generation Marc Zyngier (32): Merge tag 'kvmarm-fixes-6.1-3' into kvm-arm64/dirty-ring arm64: Add ID_DFR0_EL1.PerfMon values for PMUv3p7 and IMP_DEF KVM: arm64: PMU: Align chained counter implementation with architect

Re: [PATCH v1] KVM: arm64: Fix benign bug with incorrect use of VA_BITS.

2022-12-05 Thread Marc Zyngier
On Mon, 5 Dec 2022 11:40:31 +, Ryan Roberts wrote: > get_user_mapping_size() uses kvm's pgtable library to walk a user space > page table created by the kernel, and in doing so, fakes up the metadata > that the library needs, including ia_bits, which defines the size of the > input address. >

Re: [PATCH v1] KVM: arm64: Fix benign bug with incorrect use of VA_BITS.

2022-12-05 Thread Marc Zyngier
Hi Ryan, Thanks for that. On Mon, 05 Dec 2022 11:40:31 +, Ryan Roberts wrote: > > get_user_mapping_size() uses kvm's pgtable library to walk a user space > page table created by the kernel, and in doing so, fakes up the metadata > that the library needs, including ia_bits, which defines

Re: [PATCH v4 04/16] KVM: arm64: PMU: Distinguish between 64bit counter and 64bit overflow

2022-12-05 Thread Marc Zyngier
On Thu, 01 Dec 2022 16:51:46 +, Ricardo Koller wrote: > > On Thu, Dec 01, 2022 at 08:47:47AM -0800, Ricardo Koller wrote: > > On Sun, Nov 13, 2022 at 04:38:20PM +, Marc Zyngier wrote: > > > The PMU architecture makes a subtle difference between a 64bit > &

Re: [PATCH] KVM: arm64: Always mask CCSIDR associativity bits

2022-12-04 Thread Marc Zyngier
ove, this paragraph doesn't make much sense. > > Also, allow the userspace to overwrite the bits with arbitrary values so > that it can restore a vCPU state saved with an older kernel. > > Signed-off-by: Akihiko Odaki > Suggested-by: Marc Zyngier > --- > arch/arm64/inclu

Re: [PATCH 0/3] KVM: arm64: Handle CCSIDR associativity mismatches

2022-12-04 Thread Marc Zyngier
On Fri, 02 Dec 2022 09:55:24 +, Akihiko Odaki wrote: > > On 2022/12/02 18:40, Marc Zyngier wrote: > > On Fri, 02 Dec 2022 05:17:12 +, > > Akihiko Odaki wrote: > >> > >>>> On M2 MacBook Air, I have seen no other difference in standard ID &

Re: [PATCH 0/3] KVM: arm64: Handle CCSIDR associativity mismatches

2022-12-02 Thread Marc Zyngier
On Fri, 02 Dec 2022 05:17:12 +, Akihiko Odaki wrote: > > >> On M2 MacBook Air, I have seen no other difference in standard ID > >> registers and CCSIDRs are exceptions. Perhaps Apple designed this way > >> so that macOS's Hypervisor can freely migrate vCPU, but I can't assure > >> that

Re: [PATCH 0/3] KVM: arm64: Handle CCSIDR associativity mismatches

2022-12-01 Thread Marc Zyngier
On Thu, 01 Dec 2022 18:29:51 +, Oliver Upton wrote: > > On Thu, Dec 01, 2022 at 11:06:50AM +, Marc Zyngier wrote: > > [...] > > > It would be a lot better to expose a virtual topology > > (one set, one way, one level). It would also save us fro

Re: [PATCH 0/3] KVM: arm64: Handle CCSIDR associativity mismatches

2022-12-01 Thread Marc Zyngier
On Thu, 01 Dec 2022 17:26:08 +, Akihiko Odaki wrote: > > On 2022/12/01 20:06, Marc Zyngier wrote: > > On Thu, 01 Dec 2022 10:49:11 +, > > Akihiko Odaki wrote: > > > > Thanks for looking into this. > > > >> M2 MacBook Air has mism

Re: [PATCH 0/3] KVM: arm64: Handle CCSIDR associativity mismatches

2022-12-01 Thread Marc Zyngier
On Thu, 01 Dec 2022 10:49:11 +, Akihiko Odaki wrote: Thanks for looking into this. > M2 MacBook Air has mismatched CCSIDR associativity bits, which makes the > bits a KVM vCPU sees inconsistent when migrating. Can you describe the actual discrepancy? Is that an issue between the two core

Re: [PATCH 0/4] KVM: arm64: Parallel access faults

2022-11-30 Thread Marc Zyngier
On Tue, 29 Nov 2022 19:19:42 +, Oliver Upton wrote: > > When I implemented the parallel faults series I was mostly focused on > improving the performance of 8.1+ implementations which bring us > FEAT_HAFDBS. In so doing, I failed to put access faults on the read side > of the MMU lock. > >

Re: [PATCH 2/4] KVM: arm64: Don't serialize if the access flag isn't set

2022-11-30 Thread Marc Zyngier
On Wed, 30 Nov 2022 01:23:20 +, Ricardo Koller wrote: > > On Tue, Nov 29, 2022 at 09:15:21PM +, Oliver Upton wrote: > > Hi Ricardo, > > > > Thanks for having a look. > > > > On Tue, Nov 29, 2022 at 12:52:12PM -0800, Ricardo Koller wrote: > > > On Tue, Nov 29, 2022 at 07:19:44PM +,

Re: [PATCH v2 0/2] KVM: selftests: Enable access_tracking_perf_test for arm64

2022-11-29 Thread Marc Zyngier
On Fri, 18 Nov 2022 21:15:01 +, Oliver Upton wrote: > Small series to add support for arm64 to access_tracking_perf_test and > correct a couple bugs along the way. > > Tested on Ampere Altra w/ all supported guest modes. > > v1 -> v2: > - Have perf_test_util indicate when to stop vCPU

Re: [PATCH v5 0/8] KVM: arm64: permit MAP_SHARED mappings with MTE enabled

2022-11-29 Thread Marc Zyngier
On Thu, 3 Nov 2022 18:10:33 -0700, Peter Collingbourne wrote: > This patch series allows VMMs to use shared mappings in MTE enabled > guests. The first five patches were taken from Catalin's tree [1] which > addressed some review feedback from when they were previously sent out > as v3 of this

Re: [PATCH v5 0/8] KVM: arm64: permit MAP_SHARED mappings with MTE enabled

2022-11-24 Thread Marc Zyngier
On Fri, 04 Nov 2022 17:42:27 +, Peter Collingbourne wrote: > > On Fri, Nov 4, 2022 at 9:23 AM Marc Zyngier wrote: > > > > On Fri, 04 Nov 2022 01:10:33 +, > > Peter Collingbourne wrote: > > > > > > Hi, > > > > > > This pa

Re: [PATCH v4 13/16] KVM: arm64: PMU: Implement PMUv3p5 long counter support

2022-11-24 Thread Marc Zyngier
On Wed, 23 Nov 2022 17:11:41 +, Reiji Watanabe wrote: > > Hi Marc, > > On Wed, Nov 23, 2022 at 3:11 AM Marc Zyngier wrote: > > > > On Wed, 23 Nov 2022 05:58:17 +, > > Reiji Watanabe wrote: > > > > > > Hi Marc, > > >

Re: [PATCH v4 13/16] KVM: arm64: PMU: Implement PMUv3p5 long counter support

2022-11-23 Thread Marc Zyngier
On Wed, 23 Nov 2022 05:58:17 +, Reiji Watanabe wrote: > > Hi Marc, > > On Sun, Nov 13, 2022 at 8:46 AM Marc Zyngier wrote: > > > > PMUv3p5 (which is mandatory with ARMv8.5) comes with some extra > > features: > > > > - All counters are 64bit

Re: [PATCH v4 12/16] KVM: arm64: PMU: Allow ID_DFR0_EL1.PerfMon to be set from userspace

2022-11-19 Thread Marc Zyngier
On 2022-11-19 05:52, Reiji Watanabe wrote: Hi Marc, On Sun, Nov 13, 2022 at 8:46 AM Marc Zyngier wrote: Allow userspace to write ID_DFR0_EL1, on the condition that only the PerfMon field can be altered and be something that is compatible with what was computed for the AArch64 view

Re: [PATCH v4 09/16] KVM: arm64: PMU: Do not let AArch32 change the counters' top 32 bits

2022-11-19 Thread Marc Zyngier
On 2022-11-18 07:45, Reiji Watanabe wrote: Hi Marc, On Sun, Nov 13, 2022 at 8:38 AM Marc Zyngier wrote: Even when using PMUv3p5 (which implies 64bit counters), there is no way for AArch32 to write to the top 32 bits of the counters. The only way to influence these bits (other than

Re: [External] Re: [v2 0/6] KVM: arm64: implement vcpu_is_preempted check

2022-11-17 Thread Marc Zyngier
On Mon, 07 Nov 2022 12:00:44 +, Usama Arif wrote: > > > > On 06/11/2022 16:35, Marc Zyngier wrote: > > On Fri, 04 Nov 2022 06:20:59 +, > > Usama Arif wrote: > >> > >> This patchset adds support for vcpu_is_preempted in arm64, whic

Re: [PATCH 0/2] KVM: arm64: selftests: Fixes for single-step test

2022-11-17 Thread Marc Zyngier
correct KVM define > KVM: arm64: selftests: Disable single-step without relying on ucall() I'm obviously late to the party, but hey... For the record: Acked-by: Marc Zyngier M. -- Without deviation from the norm, progress is not possible. ___

Re: [PATCH v2] KVM: arm64: Don't acquire RCU read lock for exclusive table walks

2022-11-15 Thread Marc Zyngier
On Tue, 15 Nov 2022 22:55:02 +, Oliver Upton wrote: > > Marek reported a BUG resulting from the recent parallel faults changes, > as the hyp stage-1 map walker attempted to allocate table memory while > holding the RCU read lock: > > BUG: sleeping function called from invalid context at >

Re: [RFC PATCH 2/3] KVM: arm64: Allow userspace to trap SMCCC sub-ranges

2022-11-14 Thread Marc Zyngier
On Fri, 11 Nov 2022 23:39:09 +, Oliver Upton wrote: > > On Fri, Nov 11, 2022 at 08:26:02AM +, Marc Zyngier wrote: > > On Thu, 10 Nov 2022 21:13:54 +, Oliver Upton > > wrote: > > > The goal of what I was trying to get at is that either the kernel or >

[PATCH v4 16/16] KVM: arm64: PMU: Make kvm_pmc the main data structure

2022-11-13 Thread Marc Zyngier
The PMU code has historically been torn between referencing a counter as a pair vcpu+index or as the PMC pointer. Given that it is pretty easy to go from one representation to the other, standardise on the latter which, IMHO, makes the code slightly more readable. YMMV. Signed-off-by: Marc

[PATCH v4 12/16] KVM: arm64: PMU: Allow ID_DFR0_EL1.PerfMon to be set from userspace

2022-11-13 Thread Marc Zyngier
Allow userspace to write ID_DFR0_EL1, on the condition that only the PerfMon field can be altered and be something that is compatible with what was computed for the AArch64 view of the guest. Signed-off-by: Marc Zyngier --- arch/arm64/kvm/sys_regs.c | 57

[PATCH v4 11/16] KVM: arm64: PMU: Allow ID_AA64DFR0_EL1.PMUver to be set from userspace

2022-11-13 Thread Marc Zyngier
Allow userspace to write ID_AA64DFR0_EL1, on the condition that only the PMUver field can be altered and be at most the one that was initially computed for the guest. Signed-off-by: Marc Zyngier --- arch/arm64/kvm/sys_regs.c | 42 ++- 1 file changed, 41

[PATCH v4 14/16] KVM: arm64: PMU: Allow PMUv3p5 to be exposed to the guest

2022-11-13 Thread Marc Zyngier
Now that the infrastructure is in place, bump the PMU support up to PMUv3p5. Signed-off-by: Marc Zyngier --- arch/arm64/kvm/pmu-emul.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/kvm/pmu-emul.c b/arch/arm64/kvm/pmu-emul.c index c37cc67ff1d7..b7a5f75d008d

[PATCH v4 10/16] KVM: arm64: PMU: Move the ID_AA64DFR0_EL1.PMUver limit to VM creation

2022-11-13 Thread Marc Zyngier
-by: Marc Zyngier --- arch/arm64/include/asm/kvm_host.h | 4 arch/arm64/kvm/arm.c | 6 ++ arch/arm64/kvm/pmu-emul.c | 11 ++ arch/arm64/kvm/sys_regs.c | 36 --- include/kvm/arm_pmu.h | 6 ++ 5 files

[PATCH v4 13/16] KVM: arm64: PMU: Implement PMUv3p5 long counter support

2022-11-13 Thread Marc Zyngier
kvm_pmu_is_3p5() helper makes it easy to spot the PMUv3p5 specific handling. Signed-off-by: Marc Zyngier --- arch/arm64/kvm/pmu-emul.c | 8 +--- arch/arm64/kvm/sys_regs.c | 4 include/kvm/arm_pmu.h | 7 +++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/arch/arm64/kvm

[PATCH v4 15/16] KVM: arm64: PMU: Simplify vcpu computation on perf overflow notification

2022-11-13 Thread Marc Zyngier
The way we compute the target vcpu on getting an overflow is a bit odd, as we use the PMC array as an anchor for kvm_pmc_to_vcpu, while we could directly compute the correct address. Get rid of the intermediate step and directly compute the target vcpu. Signed-off-by: Marc Zyngier --- arch

[PATCH v4 08/16] KVM: arm64: PMU: Simplify setting a counter to a specific value

2022-11-13 Thread Marc Zyngier
by something that is pending. The counter should be updated with the value set by SW, and start counting from there if required. Remove the odd computation and just assign the provided value after having released the perf event (which is then restarted). Signed-off-by: Marc Zyngier --- arch/arm64

[PATCH v4 04/16] KVM: arm64: PMU: Distinguish between 64bit counter and 64bit overflow

2022-11-13 Thread Marc Zyngier
this distinction in the few cases where it matters in the code, as we will reuse this with PMUv3p5 long counters. Signed-off-by: Marc Zyngier --- arch/arm64/kvm/pmu-emul.c | 43 --- 1 file changed, 31 insertions(+), 12 deletions(-) diff --git a/arch/arm64/kvm/pmu-emul.c b

[PATCH v4 06/16] KVM: arm64: PMU: Only narrow counters that are not 64bit wide

2022-11-13 Thread Marc Zyngier
The current PMU emulation sometimes narrows counters to 32bit if the counter isn't the cycle counter. As this is going to change with PMUv3p5 where the counters are all 64bit, fix the couple of cases where this happens unconditionally. Signed-off-by: Marc Zyngier --- arch/arm64/kvm/pmu-emul.c

[PATCH v4 07/16] KVM: arm64: PMU: Add counter_index_to_*reg() helpers

2022-11-13 Thread Marc Zyngier
In order to reduce the boilerplate code, add two helpers returning the counter register index (resp. the event register) in the vcpu register file from the counter index. Reviewed-by: Oliver Upton Signed-off-by: Marc Zyngier --- arch/arm64/kvm/pmu-emul.c | 33

[PATCH v4 00/16] KVM: arm64: PMU: Fixing chained events, and PMUv3p5 support

2022-11-13 Thread Marc Zyngier
/20221028105402.2030192-1-...@kernel.org [3] https://lore.kernel.org/r/20221107085435.2581641-1-...@kernel.org Marc Zyngier (16): arm64: Add ID_DFR0_EL1.PerfMon values for PMUv3p7 and IMP_DEF KVM: arm64: PMU: Align chained counter implementation with architecture pseudocode KVM: arm64: PMU

[PATCH v4 01/16] arm64: Add ID_DFR0_EL1.PerfMon values for PMUv3p7 and IMP_DEF

2022-11-13 Thread Marc Zyngier
Align the ID_DFR0_EL1.PerfMon values with ID_AA64DFR0_EL1.PMUver. Reviewed-by: Oliver Upton Signed-off-by: Marc Zyngier --- arch/arm64/include/asm/sysreg.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/include/asm/sysreg.h b/arch/arm64/include/asm/sysreg.h index 7d301700d1a9

[PATCH v4 02/16] KVM: arm64: PMU: Align chained counter implementation with architecture pseudocode

2022-11-13 Thread Marc Zyngier
in code deletion, removing the notions of "counter pair", "chained counters", and "canonical counter". The code is further restructured to make the CHAIN handling similar to SWINC, as the two are now extremely similar in behaviour. Reported-by: Ricardo Koller Signed-o

[PATCH v4 05/16] KVM: arm64: PMU: Narrow the overflow checking when required

2022-11-13 Thread Marc Zyngier
For 64bit counters that overflow on a 32bit boundary, make sure we only check the bottom 32bit to generate a CHAIN event. Signed-off-by: Marc Zyngier --- arch/arm64/kvm/pmu-emul.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm64/kvm/pmu-emul.c b/arch/arm64/kvm

[PATCH v4 03/16] KVM: arm64: PMU: Always advertise the CHAIN event

2022-11-13 Thread Marc Zyngier
Even when the underlying HW doesn't offer the CHAIN event (which happens with QEMU), we can always support it as we're in control of the counter overflow. Always advertise the event via PMCEID0_EL0. Reviewed-by: Reiji Watanabe Signed-off-by: Marc Zyngier --- arch/arm64/kvm/pmu-emul.c | 2

[PATCH v4 09/16] KVM: arm64: PMU: Do not let AArch32 change the counters' top 32 bits

2022-11-13 Thread Marc Zyngier
on a counter update. Signed-off-by: Marc Zyngier --- arch/arm64/kvm/pmu-emul.c | 35 +++ 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/arch/arm64/kvm/pmu-emul.c b/arch/arm64/kvm/pmu-emul.c index ea0c8411641f..419e5e0a13d0 100644 --- a/arch/arm64/kvm/pmu

Re: [PATCH v2 11/14] KVM: arm64: PMU: Allow ID_AA64DFR0_EL1.PMUver to be set from userspace

2022-11-13 Thread Marc Zyngier
On 2022-11-08 05:36, Reiji Watanabe wrote: Hi Marc, > BTW, if we have no intention of supporting a mix of vCPUs with and > without PMU, I think it would be nice if we have a clear comment on > that in the code. Or I'm hoping to disallow it if possible though. I'm not sure we're in a position

Re: [PATCH v3 11/14] KVM: arm64: PMU: Allow ID_AA64DFR0_EL1.PMUver to be set from userspace

2022-11-13 Thread Marc Zyngier
On 2022-11-08 05:38, Reiji Watanabe wrote: Hi Marc, On Mon, Nov 7, 2022 at 1:16 AM Marc Zyngier wrote: Allow userspace to write ID_AA64DFR0_EL1, on the condition that only the PMUver field can be altered and be at most the one that was initially computed for the guest. Signed-off-by: Marc

Re: [PATCH v3 02/14] KVM: arm64: PMU: Align chained counter implementation with architecture pseudocode

2022-11-12 Thread Marc Zyngier
Hi Reiji, On Sat, 12 Nov 2022 07:55:38 +, Reiji Watanabe wrote: > > Hi Marc, > > On Mon, Nov 7, 2022 at 12:54 AM Marc Zyngier wrote: > > > > Ricardo recently pointed out that the PMU chained counter emulation > > in KVM wasn't quite behaving l

Re: [PATCH v10 3/7] KVM: Support dirty ring in conjunction with bitmap

2022-11-11 Thread Marc Zyngier
On 2022-11-11 22:19, Gavin Shan wrote: Hi Marc, On 11/11/22 11:19 PM, Marc Zyngier wrote: On Thu, 10 Nov 2022 23:47:41 +, Gavin Shan wrote: commit b05377ecbe003f12c8b79846fa3a300401dcab68 (HEAD -> kvm/arm64_dirtyring) Author: Gavin Shan Date: Fri Nov 11 07:13:12 2022 +0

Re: [PATCH] KVM: arm64: Update comment of create_hyp_mappings

2022-11-11 Thread Marc Zyngier
On Thu, 03 Nov 2022 05:32:28 +, Wei-Lin Chang wrote: > > HYP_PAGE_OFFSET is removed since 4.8, and the method for generating Hyp > VAs has evolved. Update the functional description of > create_hyp_mappings accordingly. > > Signed-off-by: Wei-Lin Chang > --- > arch/arm64/kvm/mmu.c | 7

  1   2   3   4   5   6   7   8   9   10   >