mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Paluri, PavanKumar" <papaluri@amd.com>
To: Tom Lendacky <thomas.lendacky@amd.com>, linux-kernel@vger.kernel.org
Cc: linux-doc@vger.kernel.org, Borislav Petkov <bp@alien8.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	Eric Van Tassell <Eric.VanTassell@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>
Subject: Re: [PATCH v4 1/2] x86, KVM:SVM: Move sev specific parsing into arch/x86/virt/svm
Date: Thu, 26 Sep 2024 12:06:54 -0500	[thread overview]
Message-ID: <52753566-147a-6862-b059-622ec2b7de41@amd.com> (raw)
In-Reply-To: <776effda-641b-d504-9aab-f56d862b79dc@amd.com>

Hello Tom,

On 9/25/2024 10:57 AM, Tom Lendacky wrote:
> On 9/21/24 22:36, Pavan Kumar Paluri wrote:
>> Move SEV specific kernel command line option parsing support from
>> arch/x86/coco/sev/core.c to arch/x86/virt/svm/cmdline.c so that both
>> host and guest related SEV command line options can be supported.
>>
>> No functional changes intended.
>>
>> Signed-off-by: Pavan Kumar Paluri <papaluri@amd.com>
>> Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
>> ---
>>  arch/x86/coco/sev/core.c          | 44 -------------------------------
>>  arch/x86/include/asm/sev-common.h | 29 ++++++++++++++++++++
>>  arch/x86/virt/svm/Makefile        |  1 +
>>  arch/x86/virt/svm/cmdline.c       | 32 ++++++++++++++++++++++
>>  4 files changed, 62 insertions(+), 44 deletions(-)
>>  create mode 100644 arch/x86/virt/svm/cmdline.c
>>
> 

...
>> +extern struct sev_config sev_cfg __read_mostly;
> 
> So I believe the "__read_mostly" attribute really needs to be on the
> actual declaration of the struct, below, in cmdline.c, right?
> 

Yes, I will move this attribute to cmdline.c

> You can check and see which section the sev_cfg struct ends up being
> placed after a build to verify.
>

It is placed in .data.readmostly section.
0000000000000000 g     O .data..read_mostly     0000000000000008 sev_cfg

> Thanks,
> Tom
> 
Thanks for the review,
Pavan

>> +
>>  #endif
>> diff --git a/arch/x86/virt/svm/Makefile b/arch/x86/virt/svm/Makefile
>> index ef2a31bdcc70..eca6d71355fa 100644
>> --- a/arch/x86/virt/svm/Makefile
>> +++ b/arch/x86/virt/svm/Makefile
>> @@ -1,3 +1,4 @@
>>  # SPDX-License-Identifier: GPL-2.0
>>  
>>  obj-$(CONFIG_KVM_AMD_SEV) += sev.o
>> +obj-$(CONFIG_CPU_SUP_AMD) += cmdline.o
>> diff --git a/arch/x86/virt/svm/cmdline.c b/arch/x86/virt/svm/cmdline.c
>> new file mode 100644
>> index 000000000000..964677ab02d6
>> --- /dev/null
>> +++ b/arch/x86/virt/svm/cmdline.c
>> @@ -0,0 +1,32 @@
>> +// SPDX-License-Identifier: GPL-2.0-only
>> +/*
>> + * AMD SVM-SEV command line parsing support
>> + *
>> + * Copyright (C) 2023 - 2024 Advanced Micro Devices, Inc.
>> + *
>> + * Author: Michael Roth <michael.roth@amd.com>
>> + */
>> +
>> +#include <linux/string.h>
>> +#include <linux/printk.h>
>> +
>> +#include <asm/sev-common.h>
>> +
>> +struct sev_config sev_cfg;
>> +
>> +static int __init init_sev_config(char *str)
>> +{
>> +	char *s;
>> +
>> +	while ((s = strsep(&str, ","))) {
>> +		if (!strcmp(s, "debug")) {
>> +			sev_cfg.debug = true;
>> +			continue;
>> +		}
>> +
>> +		pr_info("SEV command-line option '%s' was not recognized\n", s);
>> +	}
>> +
>> +	return 1;
>> +}
>> +__setup("sev=", init_sev_config);

  reply	other threads:[~2024-09-26 17:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-22  3:36 [PATCH v4 0/2] nosnp sev command line support Pavan Kumar Paluri
2024-09-22  3:36 ` [PATCH v4 1/2] x86, KVM:SVM: Move sev specific parsing into arch/x86/virt/svm Pavan Kumar Paluri
2024-09-25 15:57   ` Tom Lendacky
2024-09-26 17:06     ` Paluri, PavanKumar [this message]
2024-09-22  3:36 ` [PATCH v4 2/2] x86 KVM:SVM: Provide "nosnp" boot option for sev kernel command line Pavan Kumar Paluri

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=52753566-147a-6862-b059-622ec2b7de41@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=hpa@zytor.com \
    --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

all inboxes | Powered by JetHome®