lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Fri, 21 Oct 2022 10:21:05 +0200
From:   Juergen Gross <jgross@...e.com>
To:     Andrew Cooper <Andrew.Cooper3@...rix.com>,
        Borislav Petkov <bp@...en8.de>
Cc:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "x86@...nel.org" <x86@...nel.org>,
        Boris Ostrovsky <boris.ostrovsky@...cle.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>,
        Dave Hansen <dave.hansen@...ux.intel.com>,
        "H. Peter Anvin" <hpa@...or.com>,
        "xen-devel@...ts.xenproject.org" <xen-devel@...ts.xenproject.org>,
        "Peter Zijlstra (Intel)" <peterz@...radead.org>
Subject: Re: [PATCH] x86/xen: simplify sysenter and syscall setup

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@...e.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

Download attachment "OpenPGP_0xB0DE9DD628BF132F.asc" of type "application/pgp-keys" (3099 bytes)

Download attachment "OpenPGP_signature" of type "application/pgp-signature" (496 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ