[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YFm5HIC/2Toowhnx@google.com>
Date: Tue, 23 Mar 2021 09:47:08 +0000
From: Quentin Perret <qperret@...gle.com>
To: Marc Zyngier <maz@...nel.org>
Cc: catalin.marinas@....com, james.morse@....com,
julien.thierry.kdev@...il.com, suzuki.poulose@....com,
android-kvm@...gle.com, seanjc@...gle.com, mate.toth-pal@....com,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
kernel-team@...roid.com, kvmarm@...ts.cs.columbia.edu,
tabba@...gle.com, ardb@...nel.org, mark.rutland@....com,
dbrazdil@...gle.com
Subject: Re: [PATCH 2/3] KVM: arm64: Generate final CTR_EL0 value when
running in Protected mode
Hi Marc,
On Monday 22 Mar 2021 at 18:37:14 (+0000), Marc Zyngier wrote:
> Can't say I'm keen on the yucky bit, but here's an alternative (ha!)
> for you:
>
> diff --git a/arch/arm64/include/asm/assembler.h b/arch/arm64/include/asm/assembler.h
> index 1a4cee7eb3c9..7582c3bd2f05 100644
> --- a/arch/arm64/include/asm/assembler.h
> +++ b/arch/arm64/include/asm/assembler.h
> @@ -278,6 +278,9 @@ alternative_else
> ldr_l \reg, arm64_ftr_reg_ctrel0 + ARM64_FTR_SYSVAL
> alternative_endif
> #else
> +alternative_if_not ARM64_KVM_PROTECTED_MODE
> + ASM_BUG()
> +alternative_else_nop_endif
> alternative_cb kvm_compute_final_ctr_el0
> movz \reg, #0
> movk \reg, #0, lsl #16
>
> Yes, it is one more instruction, but it is cleaner and allows us to
> from the first patch of the series.
>
> What do you think?
Yes, I think having the ASM_BUG() in this macro is bit nicer and I doubt
the additional nop will make any difference, so this is looking good to
me!
Thanks,
Quentin
Powered by blists - more mailing lists