Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1401928rda; Mon, 23 Oct 2023 11:22:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHNzDO18pH16uPk3cfKVQ+9kHN/5zqy+J4IDeSpUXkkYEoQvBhAWJpkuQO4bhq8EIAiE35f X-Received: by 2002:a05:6358:880d:b0:166:dc89:8c9a with SMTP id hv13-20020a056358880d00b00166dc898c9amr12015038rwb.22.1698085346644; Mon, 23 Oct 2023 11:22:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698085346; cv=none; d=google.com; s=arc-20160816; b=Mc9X662BClAmZJdtOZf7nHyMmSn2n+Abr1dfU/PQNHvCcMh0J6BXx/dwf7gMQxQ29B 4WsZ5kzka6MJATFU1T2OtghYWEmIxxk+pOSWhoIFrUIWtEU4swZ2quNwGHMDqOlhsiak FLqL0GvAM0p7eEIY0kTopJo1gezzbeBEVhDdpiazubWeEbpwsFA+YiNctC4ILjrUFYB2 PcxbgS2wVZ9Y1ohZvTC/bO+KJdiqnG9atzouSCDF8QjUfw79rmgoWRImO3tbQnqx+oyC 6zR7ZRqwJE+81qXojRNUZ9fY+qjLdZ3yA10vLn43jsI7VLFDQtYpPQ+TfB3XaR9N6bLT j1Zw== 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=0ZiOXR+hc+BYnP56upfQolatBDIR4P+cAaoUkTY7Zi4=; fh=EEmuDgHe7+GkkgYSN4e1h/DfOT9/bZas3+va72Szr1k=; b=ilwX0/pbjk+Dbn3ibklV1xTBfuOSEfTHxULE+PWrQxHX+olH//XlgDClZ0JIMgEV31 5WHDPDulk8vZR1XC0G/SNPYKsdmVpj4sJkbjW/n0U+u9UkNrxzaOcktQ4A5TMX7tpjzm BUBssZiGkDY8OWnWlBuj5Jx5zlDUxOCBRqxhalHShXgKT+ppAqtTcSS311bEqSZC7njd 3HByNj15TqTEHjT5SD78/hdOWmY8NV5J+hYP2wh1z0GPEV/gz1jBLXEqAzg8IvytpseB 8c1bo34V/iJKxE4y+iCpPqM8iKlkMuJZidtItzOAAM3G7QJ7zx+STd0DIqcsdPT+pw5V VLMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=joEFNxBA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id e25-20020a656899000000b00578bacd7fc7si6394001pgt.713.2023.10.23.11.22.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 11:22:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=joEFNxBA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id A1DF38045BD3; Mon, 23 Oct 2023 11:22:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233313AbjJWSWR (ORCPT + 99 others); Mon, 23 Oct 2023 14:22:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230220AbjJWSWQ (ORCPT ); Mon, 23 Oct 2023 14:22:16 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 828BC8E; Mon, 23 Oct 2023 11:22:14 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 56641C433C9; Mon, 23 Oct 2023 18:22:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698085334; bh=DuXRKNTPP+oxmrxXIzF8KREEatSCS8sUp02WksFrGHg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=joEFNxBAGlFzt7+m9GSg8uOSLPPf/HstBuyv+wpoc82ZVPcmKOjVpkea0MN1e7CGo YdTtmzBOmG3lDwrNZmnbbPlA3I02u+TjXLBwapbyYIZEjmMVMG9nwbiZ9ELOCmdbK9 GF9xiST4DIUhMBxcqsMz0ZuG8QqGN/XEgxtVTsG0T1RwCW39WA18gDk1JDRJ4mBOXn HB+IxTp3mXU0z23EWRuDI8oGeSslGA3l2xK/djKgYdyhF9RjdLaOstpDl1FsXijOV4 dAgXubZrFZIt3WIAcX6IvJuxfbKVF2TuFjY/GEtzD3l1E4adXKnuIiDO3+D4VZJPAb 5fahPDLQmdc3Q== Date: Mon, 23 Oct 2023 11:22:11 -0700 From: Josh Poimboeuf To: Pawan Gupta Cc: 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, Dave Hansen Subject: Re: [PATCH 2/6] x86/entry_64: Add VERW just before userspace transition Message-ID: <20231023182211.5ojm2rsoqqqwqg46@treble> References: <20231020-delay-verw-v1-0-cff54096326d@linux.intel.com> <20231020-delay-verw-v1-2-cff54096326d@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20231020-delay-verw-v1-2-cff54096326d@linux.intel.com> 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_NONE,SPF_PASS 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 23 Oct 2023 11:22:25 -0700 (PDT) On Fri, Oct 20, 2023 at 01:45:03PM -0700, Pawan Gupta wrote: > + /* Mitigate CPU data sampling attacks .e.g. MDS */ > + USER_CLEAR_CPU_BUFFERS > + > jmp .Lnative_iret > > > @@ -774,6 +780,9 @@ native_irq_return_ldt: > */ > popq %rax /* Restore user RAX */ > > + /* Mitigate CPU data sampling attacks .e.g. MDS */ > + USER_CLEAR_CPU_BUFFERS > + I'm thinking the comments add unnecessary noise here. The macro name is self-documenting enough. The detail about what mitigations are being done can go above the macro definition itself, which the reader can refer to if they want more detail about what the macro is doing and why. Speaking of the macro name, I think just "CLEAR_CPU_BUFFERS" is sufficient. The "USER_" prefix makes it harder to read IMO. -- Josh