From patchwork Wed Oct 19 10:23:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li, Xin3" X-Patchwork-Id: 5236 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp267046wrs; Wed, 19 Oct 2022 04:26:16 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6xPiT4iuHDRJl31PJNxPBwp8AA0k2LX2nGPlsI24rhU7OhBZR2f7rDJNFyjawODQ/r1b59 X-Received: by 2002:a17:903:11c7:b0:178:af17:e93e with SMTP id q7-20020a17090311c700b00178af17e93emr7879240plh.78.1666178776366; Wed, 19 Oct 2022 04:26:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666178776; cv=none; d=google.com; s=arc-20160816; b=ZeW9MIgA9AgtxM1OKLntrcIRix6lyyjZhPfxkWdKXKmA33h2TjJLoOAHRGnR9aOWNM PfQOgmzQAC1OSKIVCKD8wT0xwkhru1z1vJMKJ37512WhKdzEAksEhH6QCpD0KyrosMD2 bzEyKp37c1W29LbsPF8hsnix7/Jfdeb8q1yE5zlnBhh7x3xdNtXpnTSkkJM3/zLCQOAj NU//41N4qbHYlWt4GwCNESot1MShUud/F77ALp+cMwsiXzkuFGDtL98AYgqW0fnKHFD2 wOPmbY42n8gAu26W/Ja83zXzbpAlaxx8kVSuFcmAxqfuB145yjZQv1e8ORUi/Mn/jAAx 18+w== 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=Nxb6V4IJPT8DIs5XN4s27oWhyAl4rJZerbfuhwMVVql61GhASkquxO3VzEuZxVUY08 gybPl4mdhEFghcEVCo5romuOfb883pFTfEngN0218eCYj9Je4BSVJcmPM/hQ4mwRy66S zrGoUpnVo2y3kVAKO5/j0ETJaYR5r+1sbXfQP/U6lS0b2BNH3kkxnVScVxPFvv+R8L7U cLIawflw7LueUV5wpTLAjbuahyVbXGkEk2FWys2/d4RPMtAHWYHlr6z1u5Mw03MX0Odb 12f/Ad1BYpN/W6kjWmfqBk1wMuUsi/etm24dQkZvJkJoAbtixpUVUHcL7OwKO1DP61yK oitA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=UQuPoghW; 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 l198-20020a633ecf000000b0043ce6a5a14bsi18417053pga.99.2022.10.19.04.26.00; Wed, 19 Oct 2022 04:26:16 -0700 (PDT) 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=UQuPoghW; 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 S232017AbiJSLUD (ORCPT + 99 others); Wed, 19 Oct 2022 07:20:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231620AbiJSLSt (ORCPT ); Wed, 19 Oct 2022 07:18:49 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3D69191D56 for ; Wed, 19 Oct 2022 03:48:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666176513; x=1697712513; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=1YbzoiUXSvQWzBUraiDzjfmE9NvY0qFctz1F+7sN7Sw=; b=UQuPoghWFZHvCq7rzMzBdsvgJG+u1opDMS3CXDOCPmEShpBunNYiSFyj 7Q48EspvwLnwn0Q5KOwWjnpY+IULtMJA1kngX0xA0M7K0ZtYbMqEJqSxF HE+C24Vv3BumQlP2vMJ7ivjAa9O+rAZLnwMHx4GJkin45qq5E1WrFV+Q1 cJFmfa7P5kj7KD/FzhHiP1IetWL2BqLQ44Ye4mEnL78GApKse5rgKZHtP 0badRB2FDaLCK7DwCcbNv+Z11RnUslYijwjzGjXTASbnN9vtVt76Lylbv kX11OF51IbybZojZidZfy4bIt5+YTy95B7YKw6EGrGf0tvuXXBMrLFgXw g==; X-IronPort-AV: E=McAfee;i="6500,9779,10504"; a="293770257" X-IronPort-AV: E=Sophos;i="5.95,196,1661842800"; d="scan'208";a="293770257" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Oct 2022 03:46:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10504"; a="804242250" X-IronPort-AV: E=Sophos;i="5.95,196,1661842800"; d="scan'208";a="804242250" Received: from unknown (HELO fred..) ([172.25.112.68]) by orsmga005.jf.intel.com with ESMTP; 19 Oct 2022 03:46:21 -0700 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 Subject: [PATCH v4 3/5] x86/gsseg: make asm_load_gs_index() take an u16 Date: Wed, 19 Oct 2022 03:23:08 -0700 Message-Id: <20221019102310.1543-4-xin3.li@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221019102310.1543-1-xin3.li@intel.com> References: <20221019102310.1543-1-xin3.li@intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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?1747115076438700148?= X-GMAIL-MSGID: =?utf-8?q?1747115076438700148?= 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) {