mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Elliot Berman <quic_eberman@quicinc.com>
To: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>, Marc Zyngier <maz@kernel.org>,
	James Morse <james.morse@arm.com>,
	Alexandru Elisei <alexandru.elisei@arm.com>,
	"Suzuki K Poulose" <suzuki.poulose@arm.com>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>, <kvmarm@lists.cs.columbia.edu>
Subject: Re: [PATCH v2] KVM: arm64: Only set KVM_MODE_PROTECTED if is_hyp_mode_available()
Date: Fri, 9 Sep 2022 10:55:18 -0700	[thread overview]
Message-ID: <05057e2a-1a85-69ba-ffcd-584d4090467a@quicinc.com> (raw)
In-Reply-To: <Yxt3wmXYYbWraXrd@arm.com>



On 9/9/2022 10:28 AM, Catalin Marinas wrote:
> On Fri, Sep 09, 2022 at 07:45:52AM -0700, Elliot Berman wrote:
>> Do not switch kvm_mode to KVM_MODE_PROTECTED if hypervisor mode is not
>> available. This prevents "Protected KVM" cpu capability being reported
>> when Linux is booting in EL1 and would not have KVM enabled.
>>
>> Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
>> ---
>>   arch/arm64/kvm/arm.c | 4 +++-
>>   1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
>> index 8fe73ee5fa84..861f4b388879 100644
>> --- a/arch/arm64/kvm/arm.c
>> +++ b/arch/arm64/kvm/arm.c
>> @@ -2272,7 +2272,9 @@ static int __init early_kvm_mode_cfg(char *arg)
>>   		return -EINVAL;
>>   
>>   	if (strcmp(arg, "protected") == 0) {
>> -		if (!is_kernel_in_hyp_mode())
>> +		if (!is_hyp_mode_available())
>> +			kvm_mode = KVM_MODE_DEFAULT;
> 
> I think kvm_mode is already KVM_MODE_DEFAULT at this point. You may want
> to print a warning instead.
> 

Does it make sense to print warning for kvm-arm.mode=nvhe as well?

  reply	other threads:[~2022-09-09 18:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-09 14:45 Elliot Berman
2022-09-09 17:28 ` Catalin Marinas
2022-09-09 17:55   ` Elliot Berman [this message]
     [not found]     ` <878rmrr3xw.wl-maz@kernel.org>
2022-09-10 13:43       ` Will Deacon
2022-09-10 14:20         ` Marc Zyngier

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=05057e2a-1a85-69ba-ffcd-584d4090467a@quicinc.com \
    --to=quic_eberman@quicinc.com \
    --cc=alexandru.elisei@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=james.morse@arm.com \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    --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®