From patchwork Mon Nov 28 16:40:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li, Xin3" X-Patchwork-Id: 26881 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp5820201wrr; Mon, 28 Nov 2022 09:13:32 -0800 (PST) X-Google-Smtp-Source: AA0mqf6cVrPBCHpljHyj6AMUX9LGr5o998XKxl2BOAwafmaUFZaa7FUuF5aZYNGFg//aFwyf5LGE X-Received: by 2002:a17:906:6093:b0:78d:b37c:83d9 with SMTP id t19-20020a170906609300b0078db37c83d9mr28479339ejj.637.1669655611985; Mon, 28 Nov 2022 09:13:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669655611; cv=none; d=google.com; s=arc-20160816; b=vvPbdWRxEy9VnNZpnI07zRIUww5GBRiGZpJs+BP2Or42R+l+NGS0DdXkoOUHbrm77H V6rmcjETvTPqWO1R+uc/S1Z2KRX9mN4ZxALbZuhVjIHuiu/8kN+rpKdvsZSyR0hZnxdh Cc+4rbhWQ9auOQsWSnYdT9r6R8DAgkCwqGnAypVkFPF4fQd1/qE4ffmVh2dmWD13TfAb jx5/PPZBwnHpvAh/li8X74yzaT3kPXFSceJJzycWjGjRUs6X5ZxmGwIzGxTxnRNf1IIX 6MZC/BcCOY96C87E7x9qbtWzsN8PpTT9uYMMX2Qbcdt2qM6SorCY5hHAxO1XruaSGpDc 464A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Y0zyNmAYzT3ri+4nefmoVJ0xInwrkHd8fCwz/8mxmhE=; b=u8H1x528Af8+mg18IWHhIrJ2uUfgGcO+roJ+ojgDWKzWucSL+dFmdv8FFfDbS1/EwR NESoycR1cnZH88ULInrM1VRhE/6ReqeTy23KwJC3KGwEpGF7obT2lVtw174591e+NiZv wBKraS0oJM79J3BloYH2TDJ4OEcOm6cEJxFz/a5hOokNOBYl3WOtp7fTZ9XiFGLipGUs hslWlKLsIFKKIzFYYkk+JUsRKh+QViiDNLKb7rbuNxgPKbjxdx0fHJ+eCsk55Ubhcx3V K4Lzz1Y2d+855iu+cbTYWTyMfJ9l7iy5EX8sJsmX3GtaH4HiI2UEKYMIQFlifjaOCYzE r07A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=D5TpavpQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id vp12-20020a170907a48c00b007bb12ecc8besi9415684ejc.939.2022.11.28.09.13.07; Mon, 28 Nov 2022 09:13:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=D5TpavpQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232516AbiK1RF0 (ORCPT + 99 others); Mon, 28 Nov 2022 12:05:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232372AbiK1REb (ORCPT ); Mon, 28 Nov 2022 12:04:31 -0500 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3871BE0BF for ; Mon, 28 Nov 2022 09:04:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669655062; x=1701191062; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=1YbzoiUXSvQWzBUraiDzjfmE9NvY0qFctz1F+7sN7Sw=; b=D5TpavpQX1HiK3giclGNQoZ9U1wd+DsVhKmqRchqSwqCJ9Kdx3SIYN6q G+o7fHvpAEo479sr2YMbvSvNUIJ2kmKEoHcnZMKmG5D7OS84hrgC0NhEj oqKyer4V/Tghg0ewPYwoGmcT/0MrvzzqChiaXnb4ZaMEPTCYDM7jJsXRH wNye7c4P5XFakRPb/6MDlUVF4dAxuI46aVcUgZW6Az3YxKsWAVFhhTV7w 54mm6Te5CPalbuCskK5GU0J+ccBXxAJNSmYjYwL874It7iXZb4NqTHPve awzhZohFuN12nDc8ct+pff3HsRWVJySh4w15dVmtihzMdEfLq+VPAmliY g==; X-IronPort-AV: E=McAfee;i="6500,9779,10545"; a="313591643" X-IronPort-AV: E=Sophos;i="5.96,200,1665471600"; d="scan'208";a="313591643" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Nov 2022 09:04:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10545"; a="706864627" X-IronPort-AV: E=Sophos;i="5.96,200,1665471600"; d="scan'208";a="706864627" Received: from unknown (HELO fred..) ([172.25.112.68]) by fmsmga008.fm.intel.com with ESMTP; 28 Nov 2022 09:04:20 -0800 From: Xin Li To: linux-kernel@vger.kernel.org, x86@kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, peterz@infradead.org, brgerst@gmail.com, chang.seok.bae@intel.com, jgross@suse.com Subject: [PATCH v5 3/5] x86/gsseg: make asm_load_gs_index() take an u16 Date: Mon, 28 Nov 2022 08:40:26 -0800 Message-Id: <20221128164028.4570-4-xin3.li@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221128164028.4570-1-xin3.li@intel.com> References: <20221128164028.4570-1-xin3.li@intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750760802912621869?= X-GMAIL-MSGID: =?utf-8?q?1750760802912621869?= From: "H. Peter Anvin (Intel)" Let gcc know that only the low 16 bits of load_gs_index() argument actually matter. It might allow it to create slightly better code. However, do not propagate this into the prototypes of functions that end up being paravirtualized, to avoid unnecessary changes. Signed-off-by: H. Peter Anvin (Intel) Signed-off-by: Xin Li --- arch/x86/entry/entry_64.S | 2 +- arch/x86/include/asm/special_insns.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S index 9953d966d124..e0c48998d2fb 100644 --- a/arch/x86/entry/entry_64.S +++ b/arch/x86/entry/entry_64.S @@ -779,7 +779,7 @@ _ASM_NOKPROBE(common_interrupt_return) /* * Reload gs selector with exception handling - * edi: new selector + * di: new selector * * Is in entry.text as it shouldn't be instrumented. */ diff --git a/arch/x86/include/asm/special_insns.h b/arch/x86/include/asm/special_insns.h index 35f709f619fb..a71d0e8d4684 100644 --- a/arch/x86/include/asm/special_insns.h +++ b/arch/x86/include/asm/special_insns.h @@ -120,7 +120,7 @@ static inline void native_wbinvd(void) asm volatile("wbinvd": : :"memory"); } -extern asmlinkage void asm_load_gs_index(unsigned int selector); +extern asmlinkage void asm_load_gs_index(u16 selector); static inline void native_load_gs_index(unsigned int selector) {