Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1538879rwb; Fri, 7 Oct 2022 14:17:49 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7a+KFTbewEQzX2bfJQUQxhUT7auvD80qnAf/74FrrhuuY8Fn7ULRjCJ65d0YubyodeNwoa X-Received: by 2002:a17:903:240a:b0:180:a7ff:78b7 with SMTP id e10-20020a170903240a00b00180a7ff78b7mr1410606plo.48.1665177469386; Fri, 07 Oct 2022 14:17:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665177469; cv=none; d=google.com; s=arc-20160816; b=PQMNRsN2C7UgE3xgYwBqiP+nSa50aMyKNNF8y/o2fuGwtAJOdkfx7qbeFtnoj1MF6j aciCyJ9FbSY+if6T24/Gvs2dJQWawNtr2SszJTNOQz/VPw2lqJjCaD/9DpPPyblNuu2Y UAUoSZyx4TVY0BjbBIGhjJGOoblrVSPHTaFOLLdps/T+vdFhv4750kijmPwiLzpD8QQo JYZm32zKj4YCgLHU7nuGPTO1WKIaxPlw8+GMBd0XxcDqCHSv/HY4Wh7FhRKaWeZCZCAU JYAla9kD4WYnoOg0ek5y/99pwJyyLjKZppMLz9inNB7ReZ65Fikhb6n3xeX4sxxuU/lW U5Lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=aks1dZGTodUV2dfvpsgaj5WVgEEHrocb8tLpo0QMpGA=; b=jTCrEWFRbPJuYMintVqvOaaBiQyOYvScCgWrGtPHULr41I1rMcKKGtfkU3MrCHajZG yiqb9Z1oJV5LdpsLkOvuqn2BUqvxwvu7BsLGfsDxyxQQT4Ci005fDaO1qqMeuWDivgjc 7pdrT5jxnxHLPWUrEVRrYNTE8WU/23hEF9PI3XGfirmvH1dx4kQnT4wmuTNiHb1xOhg3 O1a0gD11IPjiHjjgJ7EX9PzAhYZnpBiZjGgwaG9BWledPzgRkGG+5yNcm13Bw1b8tZDO mrTw/2iygaojY8qhp45HovKMCbwkUwy6FBp3W6RdA1l0tTnhK2se9xt8cQXHdV0pb3Ed 9GbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=gRb0SFmP; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s19-20020a17090aad9300b00205cc2ec8a6si9726028pjq.136.2022.10.07.14.17.31; Fri, 07 Oct 2022 14:17:49 -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=@infradead.org header.s=casper.20170209 header.b=gRb0SFmP; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230063AbiJGUYA (ORCPT + 99 others); Fri, 7 Oct 2022 16:24:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229459AbiJGUX7 (ORCPT ); Fri, 7 Oct 2022 16:23:59 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0109AA377 for ; Fri, 7 Oct 2022 13:23:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=aks1dZGTodUV2dfvpsgaj5WVgEEHrocb8tLpo0QMpGA=; b=gRb0SFmPivD0ONoUqsL8KSHIyc ISxshrhY9/7nGao4vqf7Xs/FXf1CKAs9SnCJotfED1XsJ5mYQ0SxtLNOZQkd+QBCj3Evk7G7FzLZh br5mCIDPonR7en/3Y6oqt07ebHaDl1DZ8cIQ+JBjjxaS87BPU0jG5MqttPocy7dmkK9XIfZypQJY1 wYHoTrjuv8wwUlOEwPpuDKtF4tsg9sk5SaDKO1VmB7VNUB1TF9m1jJFL+n3fVWbazxT9TT78CSXYi X6IKcUOu5RSknld9udiTY3fgv0PdJQVXvI1LuNg/yFfEtjskfnJyHPIfi5191bLSpdhcE4DYJI9bA I786gGVA==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1ogtsq-002ApD-0D; Fri, 07 Oct 2022 20:23:48 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 59CCD300137; Fri, 7 Oct 2022 22:23:43 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 4187B2C12B12D; Fri, 7 Oct 2022 22:23:43 +0200 (CEST) Date: Fri, 7 Oct 2022 22:23:43 +0200 From: Peter Zijlstra To: "H. Peter Anvin" Cc: "Li, Xin3" , "linux-kernel@vger.kernel.org" , "x86@kernel.org" , "tglx@linutronix.de" , "mingo@redhat.com" , "bp@alien8.de" , "dave.hansen@linux.intel.com" Subject: Re: [PATCH 6/6] x86/gsseg: use the LKGS instruction if available for load_gs_index() Message-ID: References: <20221006154041.13001-1-xin3.li@intel.com> <20221006154041.13001-7-xin3.li@intel.com> <80AC2E90-D842-4EA2-A413-3CC5CFF088BC@zytor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <80AC2E90-D842-4EA2-A413-3CC5CFF088BC@zytor.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,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 On Fri, Oct 07, 2022 at 01:03:12PM -0700, H. Peter Anvin wrote: > On October 7, 2022 12:24:13 PM PDT, Peter Zijlstra wrote: > >On Fri, Oct 07, 2022 at 06:01:06PM +0000, Li, Xin3 wrote: > >> > > + alternative_io("1: call asm_load_gs_index\n" > >> > > + ".pushsection \".fixup\",\"ax\"\n" > >> > > + "2: xorl %k[sel], %k[sel]\n" > >> > > + " jmp 1b\n" > >> > > + ".popsection\n" > >> > > + _ASM_EXTABLE(1b, 2b), > >> > > + _ASM_BYTES(0x3e) LKGS_DI, > >> > > + X86_FEATURE_LKGS, > >> > > + ASM_OUTPUT2([sel] "+D" (sel), ASM_CALL_CONSTRAINT), > >> > > + ASM_NO_INPUT_CLOBBER(_ASM_AX)); > >> > > } > >> > > >> > I'm very sure none of this was tested... the .fixup section hasn't existed for > >> > almost a year now. > >> > >> Weird, did you ever check a kernel dump? > > > >$ readelf -WS defconfig-build/vmlinux | grep fixup > >[ 5] .pci_fixup PROGBITS ffffffff826a5350 18a5350 003570 00 A 0 0 16 > >[ 6] .rela.pci_fixup RELA 0000000000000000 360c388 005028 18 I 60 5 8 > > > >In fact, when I add one I get: > > > >ld: warning: orphan section `.fixup' from `arch/x86/kernel/traps.o' being placed in section `.fixup' > > Perhaps the two of you need to compare confugurations? Whatever for? I know the robots report this warning because there was one from the KVM cross-merge when the .fixup removal went in. It got reported and fixed and that was the last of it. Anyway; try: $ git grep "\.fixup" arch/x86/ there isn't a single usage. Andrew Cooper suggested upgrading the orphan section warning to a hard link error, orphan sections are bad regardless.