Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp20309rdh; Wed, 25 Oct 2023 14:49:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHU0keHHvcBO+HE1C8NW6xHjg09PbkCBUBnWg/gZSgApsLEGM1Fcb/73yWW359kJu/MSd8E X-Received: by 2002:a81:7c8a:0:b0:576:fc3a:3ef5 with SMTP id x132-20020a817c8a000000b00576fc3a3ef5mr17991872ywc.47.1698270566300; Wed, 25 Oct 2023 14:49:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698270566; cv=none; d=google.com; s=arc-20160816; b=o5JT/wPnwulykBWetEoG2vWZwZY+XsHrBKVBwFdYlfzW8wXFJOE9Dl66dDXydfy5qT 9gQZjffs7DiZEq8sScBLhzHcXBd0Nd+V+d9qGS+tZxAVfwhH40z/cw7qbcd1ZSJSmSLJ iIOrtM9DYCdtCXpiCVtivb2j/+5qJNTNU0fqcWIM9G1yM0Yi3GM9rZqsGFZerDRNRtLp x9P2AEY0iVkaXRiQqJMs0z4GS7q4eDjlF7olnQRbfbl5SZYTYGQ+8tUlw91fqqJomBIj xIksyPG8JQ3LeTHef1DtJKU5FaNmZsLJlwa7bbc4icDWwnj4UhnqxUQGo86Jzo5hsFaP 6hKw== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=w1f3RfOkdfNebxeLUl63DTDJDizlPdz8lx3ztB/K08g=; fh=xElMBGngjraJblePx7+NUCvWisFb+mHTLa7DSDMeEqc=; b=OEJRX88fLhEObMsXSHc5lbsR+873puguCphHBBngHGV3uUYYIrp+9yd6a+3yOU4eSf tsZWXK94i2KEN0DgaK5HtndX8xevWl1oc382Y/u106NKNl9UMjkt/rRaYoGc7acQNCnF maJux2CY2Flf6d7f3o9tRKVBDjnIJ6sL+CXC4lq6oxqyPjcTOe8S10hmNawyTGEJdPin 0L+SpvAe85CD8OhyzQ9H8lvbatFvRSi0eyNiSP1sKynbzeRvsSaLi0mK6ZGGColGKErE U0vvV3Ls638judqEBk6ZmczYAsxN0tjvxLX477ZiHQaAJgb3XfOGkIMMQ58SuHTLL2rd hcLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DlIKAJg5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id z71-20020a0dd74a000000b0058cba826cb2si12638418ywd.83.2023.10.25.14.49.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 14:49:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DlIKAJg5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 7620D802A340; Wed, 25 Oct 2023 14:49:23 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229776AbjJYVtQ (ORCPT + 99 others); Wed, 25 Oct 2023 17:49:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229682AbjJYVtO (ORCPT ); Wed, 25 Oct 2023 17:49:14 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C1ABB9; Wed, 25 Oct 2023 14:49:12 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3004DC433C8; Wed, 25 Oct 2023 21:49:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698270552; bh=UBlwui6JXaWM1dHC4n9599bjvvRTpUdWTM8kRxLfVA0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DlIKAJg5/J0kp89aSFTWjntfSUCBR8JmJ/nwvzDR1KOa/xQXGRYf1n4+D1EmF5wZi moo6yCTKlRUpYxfsrsJ7RnHmzq6MsQx+jIu91Ten/GYPUEiyh+OZ6jtBX3e7dSL6w1 NYth1Y8dP0HwwuUjYpStlSYygiCcvb3435jdcIYm4DrWN9UWdHZvpPlK82tDtzSS/d LqkPaNJiIMqtJ4qwkj3TpsHq9FrLUb5FNZO1Uwytm00qeRftaeDX3BK61Snem/Z97/ vxfeLM0+EG9M5VV2nch8gdDO6532a2mPe31wDo2dSFZMovqRGuhHRUH8MQ2/ZHLhzE KD+OpBf8Qg2dQ== Date: Wed, 25 Oct 2023 14:49:09 -0700 From: Josh Poimboeuf To: Andrew Cooper Cc: Pawan Gupta , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Peter Zijlstra , Andy Lutomirski , Jonathan Corbet , Sean Christopherson , Paolo Bonzini , tony.luck@intel.com, ak@linux.intel.com, tim.c.chen@linux.intel.com, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, kvm@vger.kernel.org, Alyssa Milburn , Daniel Sneddon , antonio.gomez.iglesias@linux.intel.com, Alyssa Milburn Subject: Re: [PATCH v3 1/6] x86/bugs: Add asm helpers for executing VERW Message-ID: <20231025214909.yxcldnporsnicrdi@treble> References: <20231025-delay-verw-v3-0-52663677ee35@linux.intel.com> <20231025-delay-verw-v3-1-52663677ee35@linux.intel.com> <8b6d857f-cbf6-4969-8285-f90254bdafc0@citrix.com> <20231025212806.pgykrxzcmbhrhix5@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 25 Oct 2023 14:49:23 -0700 (PDT) On Wed, Oct 25, 2023 at 10:30:52PM +0100, Andrew Cooper wrote: > On 25/10/2023 10:28 pm, Josh Poimboeuf wrote: > > On Wed, Oct 25, 2023 at 10:10:41PM +0100, Andrew Cooper wrote: > >> On 25/10/2023 9:52 pm, Pawan Gupta wrote: > >>> diff --git a/arch/x86/entry/entry.S b/arch/x86/entry/entry.S > >>> index bfb7bcb362bc..f8ba0c0b6e60 100644 > >>> --- a/arch/x86/entry/entry.S > >>> +++ b/arch/x86/entry/entry.S > >>> @@ -20,3 +23,16 @@ SYM_FUNC_END(entry_ibpb) > >>> EXPORT_SYMBOL_GPL(entry_ibpb); > >>> > >>> .popsection > >>> + > >>> +.pushsection .entry.text, "ax" > >>> + > >>> +.align L1_CACHE_BYTES, 0xcc > >>> +SYM_CODE_START_NOALIGN(mds_verw_sel) > >>> + UNWIND_HINT_UNDEFINED > >>> + ANNOTATE_NOENDBR > >>> + .word __KERNEL_DS > >> You need another .align here.  Otherwise subsequent code will still > >> start in this cacheline and defeat the purpose of trying to keep it > >> separate. > >> > >>> +SYM_CODE_END(mds_verw_sel); > >> Thinking about it, should this really be CODE and not a data entry? > >> > >> It lives in .entry.text but it really is data and objtool shouldn't be > >> writing ORC data for it at all. > >> > >> (Not to mention that if it's marked as STT_OBJECT, objdump -d will do > >> the sensible thing and not even try to disassemble it). > >> > >> ~Andrew > >> > >> P.S. Please CC on the full series.  Far less effort than fishing the > >> rest off lore. > > +1 to putting it in .rodata or so. > > It's necessarily in .entry.text so it doesn't explode with KPTI active. Ah, right. In general tooling doesn't take too kindly to putting data in a text section. But it might be ok. -- Josh