All of lore.kernel.org
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: Elliot Berman <quic_eberman@quicinc.com>
Cc: Marc Zyngier <maz@kernel.org>,
	linux-kernel@vger.kernel.org, Will Deacon <will@kernel.org>,
	kvmarm@lists.cs.columbia.edu,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2] KVM: arm64: Only set KVM_MODE_PROTECTED if is_hyp_mode_available()
Date: Fri, 9 Sep 2022 18:28:34 +0100	[thread overview]
Message-ID: <Yxt3wmXYYbWraXrd@arm.com> (raw)
In-Reply-To: <20220909144552.3000716-1-quic_eberman@quicinc.com>

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.

-- 
Catalin
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

WARNING: multiple messages have this Message-ID (diff)
From: Catalin Marinas <catalin.marinas@arm.com>
To: Elliot Berman <quic_eberman@quicinc.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 18:28:34 +0100	[thread overview]
Message-ID: <Yxt3wmXYYbWraXrd@arm.com> (raw)
In-Reply-To: <20220909144552.3000716-1-quic_eberman@quicinc.com>

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.

-- 
Catalin

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: Catalin Marinas <catalin.marinas@arm.com>
To: Elliot Berman <quic_eberman@quicinc.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 18:28:34 +0100	[thread overview]
Message-ID: <Yxt3wmXYYbWraXrd@arm.com> (raw)
In-Reply-To: <20220909144552.3000716-1-quic_eberman@quicinc.com>

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.

-- 
Catalin

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

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-09 14:45 [PATCH v2] KVM: arm64: Only set KVM_MODE_PROTECTED if is_hyp_mode_available() Elliot Berman
2022-09-09 14:45 ` Elliot Berman
2022-09-09 14:45 ` Elliot Berman
2022-09-09 17:28 ` Catalin Marinas [this message]
2022-09-09 17:28   ` Catalin Marinas
2022-09-09 17:28   ` Catalin Marinas
2022-09-09 17:55   ` Elliot Berman
2022-09-09 17:55     ` Elliot Berman
2022-09-09 17:55     ` Elliot Berman
2022-09-10  9:09     ` Marc Zyngier
2022-09-10  9:09       ` Marc Zyngier
2022-09-10 13:43       ` Will Deacon
2022-09-10 13:43         ` Will Deacon
2022-09-10 13:43         ` Will Deacon
2022-09-10 14:20         ` Marc Zyngier
2022-09-10 14:20           ` Marc Zyngier
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=Yxt3wmXYYbWraXrd@arm.com \
    --to=catalin.marinas@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=quic_eberman@quicinc.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.