From nobody Wed Dec 17 07:37:31 2025 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 1B35DC4321E for ; Wed, 19 Oct 2022 12:01:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232284AbiJSMBK (ORCPT ); Wed, 19 Oct 2022 08:01:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232231AbiJSL7o (ORCPT ); Wed, 19 Oct 2022 07:59:44 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA1BB1285FE for ; Wed, 19 Oct 2022 04:38:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666179488; x=1697715488; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=1YbzoiUXSvQWzBUraiDzjfmE9NvY0qFctz1F+7sN7Sw=; b=h0aAip2JBSMYhQuK+6RhnMi1DTAfpvNE3mHX54BJCFQoWoPob1NRcn4G W7+pm0UjWQXFh65fpM/U0aQy7nUwz29siPo2qYWOG2n2RGelBJBsNn7Xb asAKpip2ZCZNO7qw01a3NxCwxAxFXtbpbum1KlRO5G635YN66Mi/M0dkJ ikXCF8zv/T0mVhIk8J67w3He7nD3r+I6EGWehH4dqy3M7dw68aDYehDIj YgnrmKgNDlbLFqVDuLwGyr3oR8/0aag64YMy+IuLUqlTDvXJntD4nOVz+ PL4ezJFtrH2OSiny/qPAj6jwIO+JXQ4wyazOHrqppwSe1gWVnt+LWFyEz Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10504"; a="308054296" X-IronPort-AV: E=Sophos;i="5.95,195,1661842800"; d="scan'208";a="308054296" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Oct 2022 03:13:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10504"; a="692312619" X-IronPort-AV: E=Sophos;i="5.95,195,1661842800"; d="scan'208";a="692312619" Received: from unknown (HELO fred..) ([172.25.112.68]) by fmsmga008.fm.intel.com with ESMTP; 19 Oct 2022 03:13:32 -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 02:50:33 -0700 Message-Id: <20221019095035.10823-4-xin3.li@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221019095035.10823-1-xin3.li@intel.com> References: <20221019095035.10823-1-xin3.li@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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) =20 /* * 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/sp= ecial_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"); } =20 -extern asmlinkage void asm_load_gs_index(unsigned int selector); +extern asmlinkage void asm_load_gs_index(u16 selector); =20 static inline void native_load_gs_index(unsigned int selector) { --=20 2.34.1