Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1190750rwi; Mon, 10 Oct 2022 12:32:51 -0700 (PDT) X-Google-Smtp-Source: AMsMyM60+ktxJ4O36SBXvEZ9K5KOgZCxXsCWquIo3+wnC0OBKC9iwJ6q1BlvlJKNid618KHpOwKD X-Received: by 2002:a17:90b:4f8a:b0:20a:8c29:6c7b with SMTP id qe10-20020a17090b4f8a00b0020a8c296c7bmr33348974pjb.140.1665430370859; Mon, 10 Oct 2022 12:32:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665430370; cv=none; d=google.com; s=arc-20160816; b=T0aQJyimfz4fPH30mvU9Wl3qEWDxoUc1RIP14A1JBvwvTQxGbTNZZeQlPqt9j/gEbH WPwIfXQkXSRcjiJWOYeyct0m2Fm7GbT3L8kJ+ouKhLMaTQcsloKNdA3GTKzD7VGjBFrq 28kU23WydIiSEA+aW4jA7cTSW69PgAfMyiOnxk4lqo/RlJeArkyTwvq3r0j+K7bhcyU9 v2k/OGVU5TvljV8fgCcDXKTkDslwRtiqVGJfm6aoWtIIE5phx4glL5BJq18urkeCBJvQ XiZQe40HF2jOjEvHqH1fBo7ww3sfiMUyDbjpAU8pcFcyDMAU/Vj6PCBOyld1VbAeKvYf VGkw== 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=VmeI68a4TXg6tSBk1/abOr349RMiHpR4sbCh0qp7BH8FwGDEBWktVwlfWfLfCOjuLK kUmU6/9YxqRl+q6dYA8PU+6DloQhhzKsntXkGOvAlZSjf3sETKkIA9rkp/vBLFHA0VmZ V4jRlFSR9vFZapj2UfCQdOq7JsZ5pBg0CnYaikkx0NqvE2i9zAuD01WwH8AdfA6UqYKb JNfnfVTcYxOXIFM4w7v2Ud+GkgA9xyywXDPTzIk+4Jx8N3HCe1TtAp2PguIFeSVll1lO 2x76HEg7L2Z9R0JCoRxS6sFijX6EGzQrGQ6MrGSGozv/tkg3FHSyUSXJZQeq6uWyOs6b tZ3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="KF/BsLxV"; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o2-20020a170902d4c200b001783df7f2e9si10500199plg.166.2022.10.10.12.32.28; Mon, 10 Oct 2022 12:32:50 -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="KF/BsLxV"; 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 S229795AbiJJTYH (ORCPT + 99 others); Mon, 10 Oct 2022 15:24:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229597AbiJJTXw (ORCPT ); Mon, 10 Oct 2022 15:23:52 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FA7161122 for ; Mon, 10 Oct 2022 12:23:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1665429832; x=1696965832; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=1YbzoiUXSvQWzBUraiDzjfmE9NvY0qFctz1F+7sN7Sw=; b=KF/BsLxVUqNcvSh9O6XYW+Dwq9eCiyKu3WSMqda1hQ1eUjSLMCi5pO24 M7i3KBkGscKVtwEmKGP2nLu65MNHABFxxMh0RSqk1g0TENsOHKzx7Tpga Ygyfo2ioNJn/WzcWoxTpPtKAd8mRSGhRXYUwmd+va7eDi3z2VhBoCdnpi lPdMszg+NMZt36HSHt2+EPfEn44TgNbvPPIRn/FI2y792rKDYlzl8ZMh/ UsCBuhqNzfYjwbvl/WrR3NbT2y1AjcOYWFpQvdgdpGhTYuEXK0DGR+ntx LvSTgF+VwogvvpsJG7M2pz158Rippc658EgXQ24iTiMIZh4jIJMjTP5bt Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10496"; a="284044533" X-IronPort-AV: E=Sophos;i="5.95,173,1661842800"; d="scan'208";a="284044533" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2022 12:23:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10496"; a="694762692" X-IronPort-AV: E=Sophos;i="5.95,173,1661842800"; d="scan'208";a="694762692" Received: from unknown (HELO fred..) ([172.25.112.68]) by fmsmga004.fm.intel.com with ESMTP; 10 Oct 2022 12:23:50 -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 Subject: [PATCH v2 3/6] x86/gsseg: make asm_load_gs_index() take an u16 Date: Mon, 10 Oct 2022 12:01:56 -0700 Message-Id: <20221010190159.11920-4-xin3.li@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221010190159.11920-1-xin3.li@intel.com> References: <20221010190159.11920-1-xin3.li@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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_PASS,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 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) { -- 2.34.1