From: Sebastian Ott <sebott@redhat.com>
To: Shaoqin Huang <shahuang@redhat.com>
Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev,
linux-kernel@vger.kernel.org, Marc Zyngier <maz@kernel.org>,
Oliver Upton <oliver.upton@linux.dev>,
James Morse <james.morse@arm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>
Subject: Re: [PATCH v3 1/6] KVM: arm64: unify code to prepare traps
Date: Mon, 27 May 2024 16:23:39 +0200 (CEST) [thread overview]
Message-ID: <ab00cdd6-7b93-05a0-896b-24e68e9413a2@redhat.com> (raw)
In-Reply-To: <080b8820-d665-40d6-9cf2-35e47086d01e@redhat.com>
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
next prev parent reply other threads:[~2024-05-27 14:23 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-14 7:22 [PATCH v3 0/6] KVM: arm64: emulation for CTR_EL0 Sebastian Ott
2024-05-14 7:22 ` [PATCH v3 1/6] KVM: arm64: unify code to prepare traps Sebastian Ott
2024-05-27 8:01 ` Shaoqin Huang
2024-05-27 14:23 ` Sebastian Ott [this message]
2024-05-30 16:54 ` Eric Auger
2024-05-14 7:22 ` [PATCH v3 2/6] KVM: arm64: maintain per VM value for CTR_EL0 Sebastian Ott
2024-05-27 8:37 ` Shaoqin Huang
2024-05-29 10:37 ` Eric Auger
2024-05-29 15:51 ` Sebastian Ott
2024-05-29 17:35 ` Eric Auger
2024-05-30 11:24 ` Sebastian Ott
2024-05-30 12:17 ` Eric Auger
2024-05-14 7:22 ` [PATCH v3 3/6] KVM: arm64: add emulation for CTR_EL0 register Sebastian Ott
2024-05-29 10:37 ` Eric Auger
2024-05-30 12:56 ` Sebastian Ott
2024-05-30 17:20 ` Eric Auger
2024-05-14 7:22 ` [PATCH v3 4/6] KVM: arm64: show writable masks for feature registers Sebastian Ott
2024-05-29 13:49 ` Eric Auger
2024-05-14 7:22 ` [PATCH v3 5/6] KVM: arm64: rename functions for invariant sys regs Sebastian Ott
2024-05-29 13:58 ` Eric Auger
2024-05-29 15:29 ` Sebastian Ott
2024-05-29 17:17 ` Eric Auger
2024-05-14 7:22 ` [PATCH v3 6/6] KVM: selftests: arm64: Test writes to CTR_EL0 Sebastian Ott
2024-05-29 17:07 ` Eric Auger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ab00cdd6-7b93-05a0-896b-24e68e9413a2@redhat.com \
--to=sebott@redhat.com \
--cc=catalin.marinas@arm.com \
--cc=james.morse@arm.com \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maz@kernel.org \
--cc=oliver.upton@linux.dev \
--cc=shahuang@redhat.com \
--cc=suzuki.poulose@arm.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®