Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1430380rwb; Fri, 7 Oct 2022 12:30:05 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5WkRFGrDTlsgwnFz76J4NQyijOdieq8P25jYd9YpeM02BrqGWoN+5McoUPZdcPdSDDkfjS X-Received: by 2002:a17:907:2c4f:b0:78d:161c:240a with SMTP id hf15-20020a1709072c4f00b0078d161c240amr5359382ejc.55.1665171005648; Fri, 07 Oct 2022 12:30:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665171005; cv=none; d=google.com; s=arc-20160816; b=F+FBMzoC3ZUFRXRC/2jhnz+iedCIy3995IzHQAnOOa3yiKvGefus0MTkgaYjryQ9vL 3WWrWv1C62cGsmDr45XoFm6/xRd9aYX35tS4yxfLa7boInN52NKRNtOr/C11sOKvz/+D o+K3eScpKSum24FE2mqkToyGMDv+6rPJgR2tW5WFeJKb68v0DJHKb+YApUWCxum3WNjq VmUV8cOxYiWidTkLt/e5+xahVGwbAVtXQKfxQePBodd78aY859wPUXxxidzZHS7Igr6U Cte9c8JuInt7TVtt1wnavLFsPlRfdB+un5nFmHQTZOQ7Fyh+yF3VXrgM6HtI6rhapFRq 4Txw== 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=PbGi9qswumamHM20nhxfQsLsToNlE1XdvdzMw825Asw=; b=vRM/zJO2rFCBQSFKWZl5X5DbjTgp1riZjeicOOKhcN7z3JUIgQjXnvSh5iubOb092I VUjWb9a96BZasK1wdHqMMsPcusODlUBUfxKjAktrUJeK5cy/MGhXU9BHnpJk/0vBSGVa RadFcTA+Uu/mSXozjeU3Su5hAXvqD0ksFtKN9gd+eWu0UfOW0b+5epSt5QdMaVnyR3aY Be8RuFj5bzdhQOd/beAFK8xYKZeOrqx8emyXblOpLXhlOTwqMl0q3UxygRCcmAar/ZpH n2E70vdJXt8t3voMBNXDA35oGIaziyc6xd1AQEg4Un1xPQ0Mxvk5u77m9egSZU+sOJBd 7r1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=n1HjNK6j; 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 dd21-20020a1709069b9500b00783d10996f7si3151128ejc.606.2022.10.07.12.29.37; Fri, 07 Oct 2022 12:30:05 -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=n1HjNK6j; 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 S229913AbiJGTZ5 (ORCPT + 99 others); Fri, 7 Oct 2022 15:25:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230215AbiJGTY6 (ORCPT ); Fri, 7 Oct 2022 15:24:58 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1FC7895E6 for ; Fri, 7 Oct 2022 12:24:30 -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=PbGi9qswumamHM20nhxfQsLsToNlE1XdvdzMw825Asw=; b=n1HjNK6j+ySYzF0jmf7hO08NC6 OZUkag0tS3c3NjWrqvAJKTbVw1SCFuEtdDXbwtTrFQgK0BDvpJ0STHMrTVcr8tB5b3ovRBYS2EAmf 6ZEXdP+sATJnNdJ/iy3gRHgaG8KiRglDjRjXzasN8IUjqGHMKKDxpVPd94alBPAQwl0DsuhUZQ7V6 fZo2Tpsrh99lOipo4ImRJk/Y/p7RN+o1RPLuP6pLkSHVWwzeXCBsWUXA1xcVGNxKrh/fk62aaNFJc bH7RlPi8CGLhInNP4Uhd2mDDpWzQgiO9QaOF6loDfbege6tm5tqx4DMbzEbX3bNHj4aw7ec7prxdq mHV78J6Q==; 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 1ogsxG-00284U-CC; Fri, 07 Oct 2022 19:24:19 +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 7AD92300205; Fri, 7 Oct 2022 21:24:13 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 645C92C0F480E; Fri, 7 Oct 2022 21:24:13 +0200 (CEST) Date: Fri, 7 Oct 2022 21:24:13 +0200 From: Peter Zijlstra To: "Li, Xin3" Cc: "linux-kernel@vger.kernel.org" , "x86@kernel.org" , "tglx@linutronix.de" , "mingo@redhat.com" , "bp@alien8.de" , "dave.hansen@linux.intel.com" , "hpa@zytor.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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 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'