Re: [PATCH 1/2] KVM: selftests: arm64: Simplify specification of filtered registers

2024-08-04 Thread Marc Zyngier
On Fri, 02 Aug 2024 22:57:53 +0100, Mark Brown wrote: > > Since we already import the generated sysreg definitions from the main > kernel and reference them in processor.h for use in other KVM tests we > can also make use of them for get-reg-list as well instead of having hard > coded magic

Re: [PATCH 2/2] KVM: selftests: arm64: Use generated defines for named system registers

2024-08-03 Thread Marc Zyngier
so, this hides the horrible truth about existing ABI bugs, see below. > We still have a number of numerically specified registers, some of these > are reserved registers without defined names (eg, unallocated ID registers) > and others don't have kernel macro definitions yet. > > No c

Re: [PATCH] KVM: selftests: arm64: Correct feature test for S1PIE in get-reg-list

2024-08-02 Thread Marc Zyngier
On Fri, 02 Aug 2024 13:43:03 +0100, Mark Brown wrote: > > [1 ] > On Fri, Aug 02, 2024 at 10:00:28AM +0100, Marc Zyngier wrote: > > > Also, the test predates the generated stuff by some margin. > > Yeah, there were still defines in the main kernel source that were bei

Re: [PATCH] KVM: selftests: arm64: Correct feature test for S1PIE in get-reg-list

2024-08-02 Thread Marc Zyngier
On Thu, 01 Aug 2024 20:14:38 +0100, Mark Brown wrote: > > [1 ] > On Thu, Aug 01, 2024 at 05:45:49PM +0100, Marc Zyngier wrote: > > > Can we please switch all this stuff to symbolic naming instead of > > magic numbers? Given how much effort is going into the "au

Re: [PATCH] KVM: selftests: arm64: Correct feature test for S1PIE in get-reg-list

2024-08-01 Thread Marc Zyngier
On Wed, 31 Jul 2024 17:21:13 +0100, Mark Brown wrote: > > The ID register for S1PIE is ID_AA64MMFR3_EL1.S1PIE which is bits 11:8 but > get-reg-list uses a shift of 4, checking SCTLRX instead. Use a shift of 8 > instead. > > Fixes: 5f0419a0083b ("KVM: selftests: get-reg-list: add Permission >

Re: [PATCH v9 13/39] KVM: arm64: Manage GCS registers for guests

2024-07-10 Thread Marc Zyngier
On Wed, 10 Jul 2024 18:16:46 +0100, Mark Brown wrote: > > [1 ] > On Wed, Jul 10, 2024 at 04:17:02PM +0100, Marc Zyngier wrote: > > Mark Brown wrote: > > > > + if (ctxt_has_gcs(ctxt)) { > > > Since this is conditioned on S1PIE, it should be only

Re: [PATCH v9 13/39] KVM: arm64: Manage GCS registers for guests

2024-07-10 Thread Marc Zyngier
On Tue, 25 Jun 2024 15:57:41 +0100, Mark Brown wrote: > > GCS introduces a number of system registers for EL1 and EL0, on systems > with GCS we need to context switch them and expose them to VMMs to allow > guests to use GCS, as well as describe their fine grained traps to > nested

Re: [RFC PATCH v1 0/2] KVM: arm64: Making BT Field in ID_AA64PFR1_EL1 writable

2024-06-13 Thread Marc Zyngier
On Thu, 13 Jun 2024 09:31:45 +0100, Shaoqin Huang wrote: > > If we don't care about the FEAT_CNTSC right now. Could I fix the > compile issue and respin this again without the background of enabling > migration between MtCollins and AmpereOne, and just keep the > information of the different BT

Re: [RFC PATCH v1 0/2] KVM: arm64: Making BT Field in ID_AA64PFR1_EL1 writable

2024-06-12 Thread Marc Zyngier
On Wed, 12 Jun 2024 06:30:51 +0100, Oliver Upton wrote: > > Hi Shaoqin, > > On Tue, Jun 11, 2024 at 10:35:50PM -0400, Shaoqin Huang wrote: > > Hi guys, > > > > I'm trying to enable migration from MtCollins(Ampere Altra, ARMv8.2+) to > > AmpereOne(AmpereOne, ARMv8.6+), the migration always

Re: [PATCH AUTOSEL 6.1 08/25] KVM: selftests: Add test for uaccesses to non-existent vgic-v2 CPUIF

2024-05-13 Thread Marc Zyngier
On Mon, 13 May 2024 09:20:38 +0100, Pavel Machek wrote: > > Hi! > > > Assert that accesses to a non-existent vgic-v2 CPU interface > > consistently fail across the various KVM device attr ioctls. This also > > serves as a regression test for a bug wherein KVM hits a NULL > > dereference when

Re: [PATCH v6 2/5] KVM: arm64: Add newly allocated ID registers to register descriptions

2024-04-10 Thread Marc Zyngier
On Tue, 02 Apr 2024 18:21:55 +0100, Mark Brown wrote: > > On Sun, Mar 31, 2024 at 11:59:06AM +0100, Marc Zyngier wrote: > > Mark Brown wrote: > > > > The 2023 architecture extensions have allocated some new ID registers, add > > > them to the KV

Re: [PATCH v6 1/5] KVM: arm64: Share all userspace hardened thread data with the hypervisor

2024-04-10 Thread Marc Zyngier
On Tue, 02 Apr 2024 17:20:36 +0100, Mark Brown wrote: > > On Tue, Apr 02, 2024 at 03:53:33PM +0100, Marc Zyngier wrote: > > Mark Brown wrote: > > > > Sure, those patches are still in flight though. It does seem reasonable > > > to target the current

Re: [PATCH v6 1/5] KVM: arm64: Share all userspace hardened thread data with the hypervisor

2024-04-02 Thread Marc Zyngier
On Tue, 02 Apr 2024 15:34:27 +0100, Mark Brown wrote: > > [1 ] > On Sun, Mar 31, 2024 at 11:00:41AM +0100, Marc Zyngier wrote: > > Mark Brown wrote: > > > > As part of the lazy FPSIMD state transitioning done by the hypervisor we > > > currently share

Re: [PATCH v6 2/5] KVM: arm64: Add newly allocated ID registers to register descriptions

2024-03-31 Thread Marc Zyngier
On Fri, 29 Mar 2024 00:13:43 +, Mark Brown wrote: > > The 2023 architecture extensions have allocated some new ID registers, add > them to the KVM system register descriptions so that they are visible to > guests. > > We make the newly introduced dpISA features writeable, as well as >

Re: [PATCH v6 1/5] KVM: arm64: Share all userspace hardened thread data with the hypervisor

2024-03-31 Thread Marc Zyngier
On Fri, 29 Mar 2024 00:13:42 +, Mark Brown wrote: > > As part of the lazy FPSIMD state transitioning done by the hypervisor we > currently share the userpsace FPSIMD state in thread->uw.fpsimd_state with > the host. Since this struct is non-extensible userspace ABI we have to keep Using the

Re: [PATCH v4 02/14] arm64/fpsimd: Enable host kernel access to FPMR

2024-02-23 Thread Marc Zyngier
ap(ARM64_HAS_MOPS) ? (HCRX_EL2_MSCEn | > HCRX_EL2_MCE2) : 0)) > -#define HCRX_HOST_FLAGS (HCRX_EL2_MSCEn | HCRX_EL2_TCR2En) > +#define HCRX_HOST_FLAGS (HCRX_EL2_MSCEn | HCRX_EL2_TCR2En | HCRX_EL2_EnFPM) > > /* TCR_EL2 Registers bits */ > #define TCR_EL2_DS (1UL << 32) &g

Re: [PATCH v4 11/14] KVM: arm64: Add newly allocated ID registers to register descriptions

2024-02-23 Thread Marc Zyngier
On Mon, 22 Jan 2024 16:28:14 +, Mark Brown wrote: > > The 2023 architecture extensions have allocated some new ID registers, add > them to the KVM system register descriptions so that they are visible to > guests. > > Signed-off-by: Mark Brown > --- > arch/arm64/kvm/sys_regs.c | 6 +++---

Re: [PATCH v4 12/14] KVM: arm64: Support FEAT_FPMR for guests

2024-02-23 Thread Marc Zyngier
On Mon, 22 Jan 2024 16:28:15 +, Mark Brown wrote: > > FEAT_FPMR introduces a new system register FPMR which allows configuration > of floating point behaviour, currently for FP8 specific features. Allow use > of this in guests, disabling the trap while guests are running and saving > and

Re: [PATCH v4 03/14] arm64/fpsimd: Support FEAT_FPMR

2024-02-23 Thread Marc Zyngier
On Mon, 22 Jan 2024 16:28:06 +, Mark Brown wrote: > > FEAT_FPMR defines a new EL0 accessible register FPMR use to configure the > FP8 related features added to the architecture at the same time. Detect > support for this register and context switch it for EL0 when present. > > Due to the

Re: [PATCH v5 00/12] RISCV: Add kvm Sstc timer selftests

2024-02-05 Thread Marc Zyngier
On Mon, 05 Feb 2024 13:10:26 +, Haibo Xu wrote: > > Hi Marc, > > Could you help review the first 3 patches in this series? For these 3 patches: Reviewed-by: Marc Zyngier Thanks, M. -- Without deviation from the norm, progress is not possible.

Re: [PATCH v8 13/38] KVM: arm64: Manage GCS registers for guests

2024-02-05 Thread Marc Zyngier
On Mon, 05 Feb 2024 12:35:53 +, Mark Brown wrote: > > On Mon, Feb 05, 2024 at 09:46:16AM +, Marc Zyngier wrote: > > On Sat, 03 Feb 2024 12:25:39 +, > > Mark Brown wrote: > > > > +++ b/arch/arm64/kvm/hyp/include/hyp/sysreg-sr.h > > &g

Re: [PATCH v8 13/38] KVM: arm64: Manage GCS registers for guests

2024-02-05 Thread Marc Zyngier
On Sat, 03 Feb 2024 12:25:39 +, Mark Brown wrote: > > GCS introduces a number of system registers for EL1 and EL0, on systems and EL2. > with GCS we need to context switch them and expose them to VMMs to allow > guests to use GCS, as well as describe their fine grained traps to > nested

Re: [PATCH v4 11/11] KVM: selftests: Enable tunning of err_margin_us in arch timer test

2023-12-21 Thread Marc Zyngier
On Thu, 21 Dec 2023 02:58:40 +, Haibo Xu wrote: > > On Wed, Dec 20, 2023 at 9:58 PM Marc Zyngier wrote: > > > > On Wed, 20 Dec 2023 13:51:24 +, > > Haibo Xu wrote: > > > > > > On Wed, Dec 20, 2023 at 5:00 PM Marc Zyngier wrote: > >

Re: [PATCH v4 11/11] KVM: selftests: Enable tunning of err_margin_us in arch timer test

2023-12-20 Thread Marc Zyngier
On Wed, 20 Dec 2023 13:51:24 +, Haibo Xu wrote: > > On Wed, Dec 20, 2023 at 5:00 PM Marc Zyngier wrote: > > > > On 2023-12-20 06:50, Haibo Xu wrote: > > > On Wed, Dec 20, 2023 at 2:22 AM Marc Zyngier wrote: > > >> > > >> On Tue,

Re: [PATCH v4 11/11] KVM: selftests: Enable tunning of err_margin_us in arch timer test

2023-12-20 Thread Marc Zyngier
On 2023-12-20 06:50, Haibo Xu wrote: On Wed, Dec 20, 2023 at 2:22 AM Marc Zyngier wrote: On Tue, 12 Dec 2023 09:31:20 +, Haibo Xu wrote: > > @@ -216,6 +221,9 @@ static bool parse_args(int argc, char *argv[]) > case 'm': > test_args.migra

Re: [PATCH v4 11/11] KVM: selftests: Enable tunning of err_margin_us in arch timer test

2023-12-19 Thread Marc Zyngier
On Tue, 12 Dec 2023 09:31:20 +, Haibo Xu wrote: > > @@ -216,6 +221,9 @@ static bool parse_args(int argc, char *argv[]) > case 'm': > test_args.migration_freq_ms = > atoi_non_negative("Frequency", optarg); > break; > + case

Re: [PATCH v3 15/21] KVM: arm64: Support FEAT_FPMR for guests

2023-12-07 Thread Marc Zyngier
On Thu, 07 Dec 2023 12:30:45 +, Mark Brown wrote: > > On Thu, Dec 07, 2023 at 08:39:46AM +, Marc Zyngier wrote: > > Mark Brown wrote: > > > > #define HCRX_GUEST_FLAGS \ > > > - (HCRX_EL2_SMPME | HCRX_EL2_TCR2En | \ > > > + (HCRX_EL

Re: [PATCH v3 15/21] KVM: arm64: Support FEAT_FPMR for guests

2023-12-07 Thread Marc Zyngier
On Tue, 05 Dec 2023 16:48:13 +, Mark Brown wrote: > > FEAT_FPMR introduces a new system register FPMR which allows configuration > of floating point behaviour, currently for FP8 specific features. Allow use > of this in guests, disabling the trap while guests are running and saving > and

Re: [PATCH v3 00/25] Permission Overlay Extension

2023-12-04 Thread Marc Zyngier
Hi Joey, On Fri, 24 Nov 2023 16:34:45 +, Joey Gouly wrote: > > Hello everyone, > > This series implements the Permission Overlay Extension introduced in 2022 > VMSA enhancements [1]. It is based on v6.7-rc2. > > Changes since v2[2]: > # Added ptrace support and selftest > #

Re: [PATCH v3 06/25] KVM: arm64: Save/restore POE registers

2023-11-30 Thread Marc Zyngier
On Fri, 24 Nov 2023 16:34:51 +, Joey Gouly wrote: > > Define the new system registers that POE introduces and context switch them. Thinking about it some more, I don't think this is enough. One fundamental thing that POE changes is that read permissions can now be removed from S1 by the

Re: [PATCH v3 06/25] KVM: arm64: Save/restore POE registers

2023-11-29 Thread Marc Zyngier
On Wed, 29 Nov 2023 15:11:23 +, Joey Gouly wrote: > > Hi Marc, > > Thanks for taking a look. > > On Mon, Nov 27, 2023 at 06:01:18PM +, Marc Zyngier wrote: > > On Fri, 24 Nov 2023 16:34:51 +, > > Joey Gouly wrote: > > > > > > Def

Re: [PATCH v3 06/25] KVM: arm64: Save/restore POE registers

2023-11-27 Thread Marc Zyngier
On Fri, 24 Nov 2023 16:34:51 +, Joey Gouly wrote: > > Define the new system registers that POE introduces and context switch them. I would really like to see a discussion on the respective lifetimes of these two registers (see below). > > Signed-off-by: Joey Gouly > Cc: Mar