linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: "H. Peter Anvin" <hpa@zytor.com>, "Li, Xin3" <xin3.li@intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"x86@kernel.org" <x86@kernel.org>
Cc: "tglx@linutronix.de" <tglx@linutronix.de>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"bp@alien8.de" <bp@alien8.de>,
	"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
	"peterz@infradead.org" <peterz@infradead.org>,
	"brgerst@gmail.com" <brgerst@gmail.com>,
	"Bae, Chang Seok" <chang.seok.bae@intel.com>
Subject: Re: [PATCH v4 5/5] x86/gsseg: use the LKGS instruction if available for load_gs_index()
Date: Thu, 20 Oct 2022 06:54:49 +0200	[thread overview]
Message-ID: <826853e4-f7ce-349d-c0c0-74516af6ff8c@suse.com> (raw)
In-Reply-To: <FDC4F3E7-DEDD-41CC-93E6-8021F16B509D@zytor.com>


[-- Attachment #1.1.1: Type: text/plain, Size: 1282 bytes --]

On 19.10.22 20:01, H. Peter Anvin wrote:
> On October 19, 2022 10:45:07 AM PDT, "Li, Xin3" <xin3.li@intel.com> wrote:
>>>> +static inline void __init lkgs_init(void) { #ifdef
>>>> +CONFIG_PARAVIRT_XXL #ifdef CONFIG_X86_64
>>>> +	if (cpu_feature_enabled(X86_FEATURE_LKGS))
>>>> +		pv_ops.cpu.load_gs_index = native_lkgs;
>>>
>>> For this to work correctly when running as a Xen PV guest, you need to add
>>>
>>> 	setup_clear_cpu_cap(X86_FEATURE_LKGS);
>>>
>>> to xen_init_capabilities() in arch/x86/xen/enlighten_pv.c, as otherwise the Xen
>>> specific .load_gs_index vector will be overwritten.
>>
>> Yeah, we definitely should add it to disable LKGS in a Xen PV guest.
>>
>> So does it mean that the Xen PV uses a black list during feature detection?
>> If yes then new features are often required to be masked with an explicit
>> call to setup_clear_cpu_cap.
>>
>> Wouldn't a white list be better?
>> Then the job is more just on the Xen PV side, and it can selectively enable
>> a new feature, sometimes with Xen PV specific handling code added.
>>
>> Xin
>>
>>>
>>>
>>> Juergen
>>
> 
> Most things don't frob the paravirt list.
> 
> Maybe we should make the paravirt frobbing a separate patch, at it is separable.

Works for me.


Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3149 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

  reply	other threads:[~2022-10-20  4:54 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-19  9:50 [PATCH v4 0/5] Enable LKGS instruction Xin Li
2022-10-19  9:50 ` [PATCH v4 1/5] x86/cpufeature: add the cpu feature bit for LKGS Xin Li
2022-10-19  9:50 ` [PATCH v4 2/5] x86/opcode: add the LKGS instruction to x86-opcode-map Xin Li
2022-10-19  9:50 ` [PATCH v4 3/5] x86/gsseg: make asm_load_gs_index() take an u16 Xin Li
2022-10-19  9:50 ` [PATCH v4 4/5] x86/gsseg: move load_gs_index() to its own new header file Xin Li
2022-10-19  9:50 ` [PATCH v4 5/5] x86/gsseg: use the LKGS instruction if available for load_gs_index() Xin Li
2022-10-19 12:16   ` Juergen Gross
2022-10-19 17:45     ` Li, Xin3
2022-10-19 18:01       ` H. Peter Anvin
2022-10-20  4:54         ` Juergen Gross [this message]
2022-10-20  6:05           ` Li, Xin3
2022-10-20  4:53       ` Juergen Gross
2022-10-20  5:58         ` Li, Xin3
2022-10-20  6:08           ` Juergen Gross
2022-10-20  6:24             ` Li, Xin3
2022-10-19 10:23 [PATCH v4 0/5] x86: Enable LKGS instruction Xin Li
2022-10-19 10:23 ` [PATCH v4 5/5] x86/gsseg: use the LKGS instruction if available for load_gs_index() Xin Li

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=826853e4-f7ce-349d-c0c0-74516af6ff8c@suse.com \
    --to=jgross@suse.com \
    --cc=bp@alien8.de \
    --cc=brgerst@gmail.com \
    --cc=chang.seok.bae@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=xin3.li@intel.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).