All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: Andrew Cooper <Andrew.Cooper3@citrix.com>,
	Borislav Petkov <bp@alien8.de>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"x86@kernel.org" <x86@kernel.org>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	"Peter Zijlstra (Intel)" <peterz@infradead.org>
Subject: Re: [PATCH] x86/xen: simplify sysenter and syscall setup
Date: Fri, 21 Oct 2022 10:21:05 +0200	[thread overview]
Message-ID: <6eb2c033-ea00-8015-fe4f-0438f9790b77@suse.com> (raw)
In-Reply-To: <bd3e990b-e2a7-bbf0-7e2f-259e6a353393@citrix.com>


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

On 21.10.22 10:06, Andrew Cooper wrote:
> On 20/10/2022 12:39, Borislav Petkov wrote:
>> On Thu, Oct 20, 2022 at 01:36:19PM +0200, Juergen Gross wrote:
>>> xen_enable_sysenter() and xen_enable_syscall() can be simplified a lot.
>>>
>>> Signed-off-by: Juergen Gross <jgross@suse.com>
>>> ---
>>>   arch/x86/xen/setup.c | 23 ++++++-----------------
>>>   1 file changed, 6 insertions(+), 17 deletions(-)
>>>
>>> diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
>>> index cfa99e8f054b..0f33ed6d3a7b 100644
>>> --- a/arch/x86/xen/setup.c
>>> +++ b/arch/x86/xen/setup.c
>>> @@ -910,17 +910,9 @@ static int register_callback(unsigned type, const void *func)
>>>   
>>>   void xen_enable_sysenter(void)
>>>   {
>>> -	int ret;
>>> -	unsigned sysenter_feature;
>>> -
>>> -	sysenter_feature = X86_FEATURE_SYSENTER32;
>>> -
>>> -	if (!boot_cpu_has(sysenter_feature))
>>> -		return;
>>> -
>>> -	ret = register_callback(CALLBACKTYPE_sysenter, xen_entry_SYSENTER_compat);
>>> -	if(ret != 0)
>>> -		setup_clear_cpu_cap(sysenter_feature);
>>> +	if (boot_cpu_has(X86_FEATURE_SYSENTER32) &&
>> Can you switch that and below to cpu_feature_enabled() while at it, pls?
> 
> Why?
> 
> This function (should) be called on the BSP only (because Xen's API lets
> this be specified when starting APs).

No, this is true for the syscall callback only. the sysenter and the syscall32
callbacks can only be set via Xen tools or on the local cpu by registering.

> 
> Whether it's once, or one per cpu, it doesn't matter.

It does.


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-21  8:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-20 11:36 [PATCH] x86/xen: simplify sysenter and syscall setup Juergen Gross
2022-10-20 11:39 ` Borislav Petkov
2022-10-20 11:41   ` Juergen Gross
2022-10-21  8:06   ` Andrew Cooper
2022-10-21  8:21     ` Juergen Gross [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=6eb2c033-ea00-8015-fe4f-0438f9790b77@suse.com \
    --to=jgross@suse.com \
    --cc=Andrew.Cooper3@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=bp@alien8.de \
    --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=xen-devel@lists.xenproject.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.