From nobody Fri May 17 11:05:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1660633941; cv=none; d=zohomail.com; s=zohoarc; b=GpkkaBSb6DTEFCj83KwQELleWzT2rhDC6N2xCYdHMNMqYVazyzj60bu3dkAIVb3KLKFCnSdyODyMGPbRK01RcavStCrtWvF8xg/6WEdmL9mEaTOmfiMlwcHfpmaEk1j6Uvfl49WUCQ7HZU/9Sd6Pmk5bV1DnWOJkw7lx0Tfenmc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1660633941; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=h6M793SMY2ynvWE6o2wfHm041bnCM3HfZCKa0vLCTLw=; b=h1c/ExCOMXMpdhy6b3IP/6SEBU0MV8dJ3I9aUEiH9hEm25G7rs68TGt4uXQ1jAt2f6JEdqxXTrD4jbHJq2IC3LDpLnEdGgqGKdJFr7ncnM6tD1FqUoLC10S7JBiuomwa5LwVccg0dbKsbzYrc6cFwepG0maKQqTvjk91T5zMav4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1660633941341152.98991941091163; Tue, 16 Aug 2022 00:12:21 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.388004.624524 (Exim 4.92) (envelope-from ) id 1oNqjo-0002lS-Ip; Tue, 16 Aug 2022 07:11:44 +0000 Received: by outflank-mailman (output) from mailman id 388004.624524; Tue, 16 Aug 2022 07:11:44 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oNqjo-0002lL-FP; Tue, 16 Aug 2022 07:11:44 +0000 Received: by outflank-mailman (input) for mailman id 388004; Tue, 16 Aug 2022 07:11:43 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oNqjm-0002lF-WD for xen-devel@lists.xenproject.org; Tue, 16 Aug 2022 07:11:43 +0000 Received: from smtp-out1.suse.de (smtp-out1.suse.de [2001:67c:2178:6::1c]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id a7027b00-1d32-11ed-924f-1f966e50362f; Tue, 16 Aug 2022 09:11:32 +0200 (CEST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 0BE7534BCC; Tue, 16 Aug 2022 07:11:40 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id AD685139B7; Tue, 16 Aug 2022 07:11:39 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id TFETKStD+2IqPQAAMHmgww (envelope-from ); Tue, 16 Aug 2022 07:11:39 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: a7027b00-1d32-11ed-924f-1f966e50362f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1660633900; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=h6M793SMY2ynvWE6o2wfHm041bnCM3HfZCKa0vLCTLw=; b=Mnw1d5F8tJcd+2r4BZoh0xSWKXDiI7+4lg4EXt0O0JeuEibB9/ttLcmvqnCvzkQjQlsIfq cPQBqndN4J06ZB89+uOr1tOMexHZu+bnr/pcckpzdReiYrI3/3W8a1mPM1ePMASQ73nmRN 4hOH/RWI+ptWU2HuqYTQwWApTd3Hm34= From: Juergen Gross To: xen-devel@lists.xenproject.org, x86@kernel.org, linux-kernel@vger.kernel.org Cc: Juergen Gross , Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , stable@vger.kernel.org Subject: [PATCH] x86/entry: fix entry_INT80_compat for Xen PV guests Date: Tue, 16 Aug 2022 09:11:37 +0200 Message-Id: <20220816071137.4893-1-jgross@suse.com> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1660633942997100001 Content-Type: text/plain; charset="utf-8" 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-de= fault #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 de= finition of SWAPGS") Signed-off-by: Juergen Gross Acked-by: Peter Zijlstra (Intel) Reviewed-by: Jan Beulich --- 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_com= pat.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 =20 /* * User tracing code (ptrace or signal handlers) might assume that --=20 2.35.3