From: Ganapatrao Kulkarni <gankulkarni@os.amperecomputing.com>
To: Marc Zyngier <maz@kernel.org>
Cc: kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org,
linux-kselftest@vger.kernel.org, oliver.upton@linux.dev,
joey.gouly@arm.com, suzuki.poulose@arm.com,
darren@os.amperecomputing.com, scott@os.amperecomputing.com
Subject: Re: [RFC PATCH 1/2] KVM: arm64: nv: selftests: Add guest hypervisor test
Date: Wed, 19 Feb 2025 18:17:28 +0530 [thread overview]
Message-ID: <9bb48635-ce40-4710-8c43-be10ef217d9d@os.amperecomputing.com> (raw)
In-Reply-To: <5192ba8d-577a-4bd6-b8ee-7e3547f2c86b@os.amperecomputing.com>
On 07-02-2025 10:16 pm, Ganapatrao Kulkarni wrote:
>
>
> On 07-02-2025 07:29 pm, Marc Zyngier wrote:
>> On Fri, 07 Feb 2025 13:26:41 +0000,
>> Ganapatrao Kulkarni <gankulkarni@os.amperecomputing.com> wrote:
>>>
>>>>> + if (is_vcpu_nested(vcpu)) {
>>>>> + vcpu_set_reg(vcpu, KVM_ARM64_SYS_REG(SYS_CPTR_EL2), fpen);
>>>>> + vcpu_set_reg(vcpu, KVM_ARM64_SYS_REG(SYS_SCTLR_EL2),
>>>>> sctlr_el1);
>>>>> + vcpu_set_reg(vcpu, KVM_ARM64_SYS_REG(SYS_TCR_EL2), tcr_el1);
>>>>> + vcpu_set_reg(vcpu, KVM_ARM64_SYS_REG(SYS_MAIR_EL2),
>>>>> DEFAULT_MAIR_EL1);
>>>>> + vcpu_set_reg(vcpu, KVM_ARM64_SYS_REG(SYS_TTBR0_EL2),
>>>>> ttbr0_el1);
>>>>> + vcpu_set_reg(vcpu, KVM_ARM64_SYS_REG(SYS_TPIDR_EL2), vcpu-
>>>>> >id);
>>>>
>>>> How about some of the basics such as HCR_EL2, MDCR_EL2? A bunch of
>>>> things there do have an impact on how the guest behaves, and relying
>>>> on defaults feels like a bad idea.
>>>
>>> Sure, I will try to have these registers also set to required value
>>> explicitly.
>>>
>>>>
>>>> This also assumes VHE, without trying to enforce it.
>>>
>>> Ok, I will try to set specific bits of HCR_EL2 to force it run in VHE.
>>>
>>>>
>>>> Finally, how to you plan to make all the existing tests run as EL2
>>>> guests if TPIDR_EL1 isn't populated with the expected value? Surely
>>>> you need to change the read side...
>>>
IIUC, we need not write to TPIDR_EL2, instead write always to TPIDR_EL1
and in guest code(like function cpu_copy_el2regs in Linux kernel) copy
TPIDR_EL1 value to TPIDR_EL2.
OR, Write to both TPIDR_EL1 and TPIDR_EL2 in the test code itself during
vcpu setup.
--
Thanks,
Ganapat/GK
next prev parent reply other threads:[~2025-02-19 12:47 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-06 16:41 [RFC PATCH 0/2] Add NV Selftest cases Ganapatrao Kulkarni
2025-02-06 16:41 ` [RFC PATCH 1/2] KVM: arm64: nv: selftests: Add guest hypervisor test Ganapatrao Kulkarni
2025-02-06 21:14 ` Marc Zyngier
2025-02-07 13:26 ` Ganapatrao Kulkarni
2025-02-07 13:59 ` Marc Zyngier
2025-02-07 16:46 ` Ganapatrao Kulkarni
2025-02-19 12:47 ` Ganapatrao Kulkarni [this message]
2025-02-06 16:41 ` [RFC PATCH 2/2] KVM: arm64: nv: selftests: Access VNCR mapped registers Ganapatrao Kulkarni
2025-02-06 17:30 ` Marc Zyngier
2025-02-06 16:45 ` [RFC PATCH 0/2] Add NV Selftest cases Ganapatrao Kulkarni
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=9bb48635-ce40-4710-8c43-be10ef217d9d@os.amperecomputing.com \
--to=gankulkarni@os.amperecomputing.com \
--cc=darren@os.amperecomputing.com \
--cc=joey.gouly@arm.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=maz@kernel.org \
--cc=oliver.upton@linux.dev \
--cc=scott@os.amperecomputing.com \
--cc=suzuki.poulose@arm.com \
/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®