From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88BDDC2BB41 for ; Tue, 16 Aug 2022 10:00:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234213AbiHPKAB (ORCPT ); Tue, 16 Aug 2022 06:00:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234199AbiHPJ7Y (ORCPT ); Tue, 16 Aug 2022 05:59:24 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 494BC7FFA4; Tue, 16 Aug 2022 02:04:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=N3rr8Ih/OydanFv1CV/YUpYdg2xo/RO8uoYUBb7azUE=; b=NeI5iJNKMM5exB1dec5OXgnxuR IjrRsj1TQ/c1iNcZdivLGlMbNMXyssN41VvmWeI8YNYt2AfMpXSs1ldnjmoL/hXXGcAwZf6Pj4Sgy QvR/TF/nsr9wYQYgSoW2PFLeHhWHEVxK5xQWhiJD3jjysvXRm+NNUbup2wNjDfv2yVlhNTZvGogAq yKlKCb7gAeHrxfvs+Qto/Uzjnad3oKmifKdSBvhSV4TP7dHUa+1MmhPkOH7SAdtMfv3pKJjbeTN6f 1k/fIwntE3/ao9NgFoXj+HuJM5xlV2xaof+6kEv4TKRKF+LSb1Mx685frlfLVJGzhq6f+8HB4bbGn IlMHL/ww==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=worktop.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1oNsUL-002uhh-D6; Tue, 16 Aug 2022 09:03:55 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 8A763980163; Tue, 16 Aug 2022 11:03:52 +0200 (CEST) Date: Tue, 16 Aug 2022 11:03:52 +0200 From: Peter Zijlstra To: Juergen Gross Cc: xen-devel@lists.xenproject.org, x86@kernel.org, linux-kernel@vger.kernel.org, Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , stable@vger.kernel.org Subject: Re: [PATCH] x86/entry: fix entry_INT80_compat for Xen PV guests Message-ID: References: <20220816071137.4893-1-jgross@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220816071137.4893-1-jgross@suse.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 16, 2022 at 09:11:37AM +0200, Juergen Gross wrote: > Commit c89191ce67ef ("x86/entry: Convert SWAPGS to swapgs and remove > the definition of SWAPGS") missed one use case of SWAPGS in > entry_INT80_compat. Removing of the SWAPGS macro led to asm just > using "swapgs", as it is accepting instructions in capital letters, > too. > > This in turn leads to splats in Xen PV guests like: > > [ 36.145223] general protection fault, maybe for address 0x2d: 0000 [#1] PREEMPT SMP NOPTI > [ 36.145794] CPU: 2 PID: 1847 Comm: ld-linux.so.2 Not tainted 5.19.1-1-default #1 openSUSE Tumbleweed f3b44bfb672cdb9f235aff53b57724eba8b9411b > [ 36.146608] Hardware name: HP ProLiant ML350p Gen8, BIOS P72 11/14/2013 > [ 36.148126] RIP: e030:entry_INT80_compat+0x3/0xa3 > > Fix that by open coding this single instance of the SWAPGS macro. > > Cc: # 5.19 > Fixes: c89191ce67ef ("x86/entry: Convert SWAPGS to swapgs and remove the definition of SWAPGS") > Signed-off-by: Juergen Gross It's a little unfortunate int80 is different from the other compat entry points, but that's life I suppose. Acked-by: Peter Zijlstra (Intel) > --- > arch/x86/entry/entry_64_compat.S | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/x86/entry/entry_64_compat.S b/arch/x86/entry/entry_64_compat.S > index 682338e7e2a3..4dd19819053a 100644 > --- a/arch/x86/entry/entry_64_compat.S > +++ b/arch/x86/entry/entry_64_compat.S > @@ -311,7 +311,7 @@ SYM_CODE_START(entry_INT80_compat) > * Interrupts are off on entry. > */ > ASM_CLAC /* Do this early to minimize exposure */ > - SWAPGS > + ALTERNATIVE "swapgs", "", X86_FEATURE_XENPV > > /* > * User tracing code (ptrace or signal handlers) might assume that > -- > 2.35.3 >