lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <867ckh9y7l.wl-maz@kernel.org>
Date: Wed, 10 Jan 2024 12:20:30 +0000
From: Marc Zyngier <maz@...nel.org>
To: Ruidong Tian <tianruidong@...ux.alibaba.com>
Cc: kvmarm@...ts.linux.dev,
	linux-kernel@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org,
	oliver.upton@...ux.dev,
	james.morse@....com,
	suzuki.poulose@....com,
	yuzenghui@...wei.com,
	catalin.marinas@....com,
	will@...nel.org
Subject: Re: [PATCH] KVM: arm64: Add missing ERX*_EL1 registers

On Wed, 10 Jan 2024 07:57:39 +0000,
Ruidong Tian <tianruidong@...ux.alibaba.com> wrote:
> 
> Commit 464f2164da7e ("arm64: Add missing ERX*_EL1 encodings") add some
> new RAS registers. Trap them to kvm.

Well, they *are* already trapped by virtue of HCR_EL2.FIEN being
0. They are lacking a trap handler though.

> 
> Signed-off-by: Ruidong Tian <tianruidong@...ux.alibaba.com>
> ---
>  arch/arm64/kvm/sys_regs.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c
> index 30253bd19917..76a9ba155d58 100644
> --- a/arch/arm64/kvm/sys_regs.c
> +++ b/arch/arm64/kvm/sys_regs.c
> @@ -2389,8 +2389,13 @@ static const struct sys_reg_desc sys_reg_descs[] = {
>  	{ SYS_DESC(SYS_ERXCTLR_EL1), trap_raz_wi },
>  	{ SYS_DESC(SYS_ERXSTATUS_EL1), trap_raz_wi },
>  	{ SYS_DESC(SYS_ERXADDR_EL1), trap_raz_wi },
> +	{ SYS_DESC(SYS_ERXPFGF_EL1), trap_raz_wi },
> +	{ SYS_DESC(SYS_ERXPFGCTL_EL1), trap_raz_wi },
> +	{ SYS_DESC(SYS_ERXPFGCDN_EL1), trap_raz_wi },
>  	{ SYS_DESC(SYS_ERXMISC0_EL1), trap_raz_wi },
>  	{ SYS_DESC(SYS_ERXMISC1_EL1), trap_raz_wi },
> +	{ SYS_DESC(SYS_ERXMISC2_EL1), trap_raz_wi },
> +	{ SYS_DESC(SYS_ERXMISC3_EL1), trap_raz_wi },
>  
>  	MTE_REG(TFSR_EL1),
>  	MTE_REG(TFSRE0_EL1),

If my reading of the ARM ARM is correct, these registers only exist if
FEAT_RASv1p1 is implemented. Which means that we shouldn't handle
those as RAZ/WI unconditionally, but instead check for what we
advertise to the guest and handle it accordingly.

Thanks,

	M.

-- 
Without deviation from the norm, progress is not possible.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ