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: <86v8m6bcuh.wl-maz@kernel.org>
Date:   Tue, 20 Dec 2022 10:15:18 +0000
From:   Marc Zyngier <maz@...nel.org>
To:     Dong Bo <dongbo4@...wei.com>
Cc:     <linux-kernel@...r.kernel.org>,
        <linux-arm-kernel@...ts.infradead.org>, <kvmarm@...ts.linux.dev>,
        <kvmarm@...ts.cs.columbia.edu>,
        Nianyao Tang <tangnianyao@...wei.com>,
        James Morse <james.morse@....com>,
        Alexandru Elisei <alexandru.elisei@....com>,
        Suzuki K Poulose <suzuki.poulose@....com>,
        Oliver Upton <oliver.upton@...ux.dev>,
        Catalin Marinas <catalin.marinas@....com>,
        Will Deacon <will@...nel.org>, Mark Brown <broonie@...nel.org>
Subject: Re: [PATCH] KVM: arm64: Synchronize SMEN on vcpu schedule out

+ Mark

On Tue, 20 Dec 2022 10:50:24 +0000,
Dong Bo <dongbo4@...wei.com> wrote:
> 
> From: Nianyao Tang <tangnianyao@...wei.com>
> 
> If we have VHE and need to reenable SME for host in
> kvm_arch_vcpu_put_fp, CPACR.SMEN is modified from 0 to 1. Trap
> control for reading SVCR is modified from enable to disable.
> Synchronization 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 <maz@...nel.org>
> Cc: James Morse <james.morse@....com>
> Cc: Alexandru Elisei <alexandru.elisei@....com>
> Cc: Suzuki K Poulose <suzuki.poulose@....com>
> Cc: Oliver Upton <oliver.upton@...ux.dev>
> Cc: Catalin Marinas <catalin.marinas@....com>
> Cc: Will Deacon <will@...nel.org>
> Signed-off-by: Nianyao Tang <tangnianyao@...wei.com>
> ---
>  arch/arm64/kvm/fpsimd.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm64/kvm/fpsimd.c b/arch/arm64/kvm/fpsimd.c
> index 02dd7e9ebd39..f5799f571317 100644
> --- a/arch/arm64/kvm/fpsimd.c
> +++ b/arch/arm64/kvm/fpsimd.c
> @@ -184,6 +184,7 @@ void kvm_arch_vcpu_put_fp(struct kvm_vcpu *vcpu)
>  			sysreg_clear_set(CPACR_EL1,
>  					 CPACR_EL1_SMEN_EL0EN,
>  					 CPACR_EL1_SMEN_EL1EN);
> +		isb();
>  	}
>  
>  	if (vcpu->arch.fp_state == FP_STATE_GUEST_OWNED) {
> -- 
> 1.8.3.1
> 
> 

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ