mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nikolay Borisov <nik.borisov@suse.com>
To: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	Nikolay Borisov <nik.borisov@suse.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	linux-coco@lists.linux.dev, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCHv4 3/4] x86/tdx: Dynamically disable SEPT violations from causing #VEs
Date: Wed, 15 May 2024 16:14:18 +0300	[thread overview]
Message-ID: <8a5fa107-a055-4c05-bcb1-dc4044be841d@suse.com> (raw)
In-Reply-To: <hlif565xmuj4oqdpap3boizepwg5ch3dssb67zzvy7i7smzp3n@x6hzdyc2qk4y>



On 15.05.24 г. 12:30 ч., Kirill A. Shutemov wrote:
> On Tue, May 14, 2024 at 05:56:21PM +0300, Nikolay Borisov wrote:
>>> diff --git a/arch/x86/coco/tdx/tdx.c b/arch/x86/coco/tdx/tdx.c
>>> index 1ff571cb9177..ba37f4306f4e 100644
>>> --- a/arch/x86/coco/tdx/tdx.c
>>> +++ b/arch/x86/coco/tdx/tdx.c
>>> @@ -77,6 +77,20 @@ static inline void tdcall(u64 fn, struct tdx_module_args *args)
>>>    		panic("TDCALL %lld failed (Buggy TDX module!)\n", fn);
>>>    }
>>> +/* Read TD-scoped metadata */
>>> +static inline u64 tdg_vm_rd(u64 field, u64 *value)
>>> +{
>>> +	struct tdx_module_args args = {
>>> +		.rdx = field,
>>> +	};
>>> +	u64 ret;
>>> +
>>> +	ret = __tdcall_ret(TDG_VM_RD, &args);
>>> +	*value = args.r8;
>>> +
>>> +	return ret;
>>> +}
>>
>> nit: Perhaps this function can be put in the first patch and the description
>> there be made more generic, something along the lines of "introduce
>> functions for tdg_rd/tdg_wr" ?
> 
> A static function without an user will generate a build warning. I don't
> think it is good idea.
> 

But are those 2 wrappers really static-worthy? Those two interfaces seem 
to be rather generic and could be used by more things in the future? 
OTOH when the time comes they can be exposed as needed.

Anyway that could be considered a minor thing.

  reply	other threads:[~2024-05-15 13:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-12 12:21 [PATCHv4 0/4] x86/tdx: Adjust TD settings on boot Kirill A. Shutemov
2024-05-12 12:21 ` [PATCHv4 1/4] x86/tdx: Factor out TD metadata write TDCALL Kirill A. Shutemov
2024-05-12 12:21 ` [PATCHv4 2/4] x86/tdx: Rename tdx_parse_tdinfo() to tdx_setup() Kirill A. Shutemov
2024-05-12 12:21 ` [PATCHv4 3/4] x86/tdx: Dynamically disable SEPT violations from causing #VEs Kirill A. Shutemov
2024-05-14 14:56   ` Nikolay Borisov
2024-05-15  9:30     ` Kirill A. Shutemov
2024-05-15 13:14       ` Nikolay Borisov [this message]
2024-05-15 13:22         ` Kirill A. Shutemov
2024-05-15 13:53       ` Dave Hansen
2024-05-12 12:21 ` [PATCHv4 4/4] x86/tdx: Enable CPU topology enumeration Kirill A. Shutemov

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=8a5fa107-a055-4c05-bcb1-dc4044be841d@suse.com \
    --to=nik.borisov@suse.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-coco@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=x86@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®