linux-coco.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: "Paluri, PavanKumar" <papaluri@amd.com>
To: Borislav Petkov <bp@alien8.de>
Cc: linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-coco@lists.linux.dev, Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	Eric Van Tassell <Eric.VanTassell@amd.com>,
	Tom Lendacky <thomas.lendacky@amd.com>,
	Ashish Kalra <ashish.kalra@amd.com>,
	Michael Roth <michael.roth@amd.com>,
	"H . Peter Anvin" <hpa@zytor.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Dhaval Giani <dhaval.giani@amd.com>
Subject: Re: [PATCH v7 2/2] x86 KVM:SVM: Provide "nosnp" boot option for sev kernel command line
Date: Mon, 14 Oct 2024 16:09:45 -0500	[thread overview]
Message-ID: <5c3344b9-e896-e93b-6853-1bff83d6544c@amd.com> (raw)
In-Reply-To: <20241014154040.GBZw07eBVDJoLJZV0w@fat_crate.local>

Hello Boris,

On 10/14/2024 10:40 AM, Borislav Petkov wrote:
> On Mon, Oct 14, 2024 at 08:09:48AM -0500, Pavan Kumar Paluri wrote:
>> @@ -25,6 +26,12 @@ static int __init init_sev_config(char *str)
>>  			continue;
>>  		}
>>  
>> +		if (!strcmp(s, "nosnp")) {
>> +			setup_clear_cpu_cap(X86_FEATURE_SEV_SNP);
>> +			cc_platform_clear(CC_ATTR_HOST_SEV_SNP);
>> +			continue;
>> +		}
> 
> Well, if it is a HV-only option, then it better be such:
> 
> @@ -25,6 +26,17 @@ static int __init init_sev_config(char *str)
>  			continue;
>  		}
>  
> +		if (!strcmp(s, "nosnp")) {
> +			if (!cpu_feature_enabled(X86_FEATURE_HYPERVISOR)) {

Sure, it does make sense to add this check since nosnp is only a HV option.

Thanks,
Pavan

> +				setup_clear_cpu_cap(X86_FEATURE_SEV_SNP);
> +				cc_platform_clear(CC_ATTR_HOST_SEV_SNP);
> +				continue;
> +			} else {
> +				goto warn;
> +			}
> +		}
> +
> +warn:
>  		pr_info("SEV command-line option '%s' was not recognized\n", s);
>  	}
>  
> 

      reply	other threads:[~2024-10-14 21:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-14 13:09 [PATCH v7 0/2] nosnp sev command line support Pavan Kumar Paluri
2024-10-14 13:09 ` [PATCH v7 1/2] x86, KVM:SVM: Move sev specific parsing into arch/x86/virt/svm Pavan Kumar Paluri
2024-10-14 13:09 ` [PATCH v7 2/2] x86 KVM:SVM: Provide "nosnp" boot option for sev kernel command line Pavan Kumar Paluri
2024-10-14 15:40   ` Borislav Petkov
2024-10-14 21:09     ` Paluri, PavanKumar [this message]

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=5c3344b9-e896-e93b-6853-1bff83d6544c@amd.com \
    --to=papaluri@amd.com \
    --cc=Eric.VanTassell@amd.com \
    --cc=ashish.kalra@amd.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=dhaval.giani@amd.com \
    --cc=hpa@zytor.com \
    --cc=linux-coco@lists.linux.dev \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.roth@amd.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=thomas.lendacky@amd.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;
as well as URLs for NNTP newsgroup(s).