[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ab00cdd6-7b93-05a0-896b-24e68e9413a2@redhat.com>
Date: Mon, 27 May 2024 16:23:39 +0200 (CEST)
From: Sebastian Ott <sebott@...hat.com>
To: Shaoqin Huang <shahuang@...hat.com>
cc: linux-arm-kernel@...ts.infradead.org, kvmarm@...ts.linux.dev,
linux-kernel@...r.kernel.org, Marc Zyngier <maz@...nel.org>,
Oliver Upton <oliver.upton@...ux.dev>, James Morse <james.morse@....com>,
Suzuki K Poulose <suzuki.poulose@....com>,
Catalin Marinas <catalin.marinas@....com>, Will Deacon <will@...nel.org>
Subject: Re: [PATCH v3 1/6] KVM: arm64: unify code to prepare traps
Hi Shaoqin,
On Mon, 27 May 2024, Shaoqin Huang wrote:
> On 5/14/24 15:22, Sebastian Ott wrote:
>> +++ b/arch/arm64/include/asm/kvm_emulate.h
>> static inline void vcpu_reset_hcr(struct kvm_vcpu *vcpu)
>> {
>> - vcpu->arch.hcr_el2 = HCR_GUEST_FLAGS;
>> - if (has_vhe() || has_hvhe())
>> - vcpu->arch.hcr_el2 |= HCR_E2H;
>> - if (cpus_have_final_cap(ARM64_HAS_RAS_EXTN)) {
>> - /* route synchronous external abort exceptions to EL2 */
>> - vcpu->arch.hcr_el2 |= HCR_TEA;
>> - /* trap error record accesses */
>> - vcpu->arch.hcr_el2 |= HCR_TERR;
>> - }
>> + if (!vcpu_has_run_once(vcpu))
>> + vcpu->arch.hcr_el2 = HCR_GUEST_FLAGS;
>
> Could you give more explaination in your comments about why we still keep the
> non-FWB handling in vcpu_reset_hcr()? That would be better for understanding
> the special case.
>
VM ops trapping needs to be toggled via KVM_ARM_VCPU_INIT for this case to
catch when the guest activates its MMU. This is different to the other
traps that are setup once before the guest runs for the first time.
Sebastian
Powered by blists - more mailing lists