Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1427848rda; Mon, 23 Oct 2023 12:13:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE4gBu9AgjY+ugoT7RhUTgPcc2XYHTSpHZRL+ErSZlEg+qMleC5m+JFgLUKIpgIQzpx3+xU X-Received: by 2002:a17:90a:b015:b0:274:4161:b9dc with SMTP id x21-20020a17090ab01500b002744161b9dcmr10254705pjq.31.1698088433455; Mon, 23 Oct 2023 12:13:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698088433; cv=none; d=google.com; s=arc-20160816; b=dHfs7mKNsbn59lVz2Xui64vCUqi97Fm3C70RUkXxKpa5+wmk8YonieIYTZykqXTD3p CUSgABkM0ax4MsGcUbzrGnLgp/fQnVy+d3PlZFyIGZ8CvDDQmw3BmbqD0bob7dXl7ywt 0QIlG+HdaFFsOhebAfeAU0Y0UwEyXF7N+J/G/uw1ucOv1CNl6eupG2Ih8g4kldVV51Sa fYRNePFVWgRf2EJqhljmijq2BijuKaKbNBVVyctRLdTaS4vH/LKk2o3stGfDrPs+x4G/ LEJTb7BTicm3xSJiS/M4yybOk/BNdKeEHGPY8c+AFNhK2ehxtUMPkfl2hitrrRoT2sXl O7nA== 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=JQ/UG5BVcsG6FxQ97YHrukwvupODCY/qYFi7AbLM4Xs=; fh=dncd8ud6L9IovtlDluSfOA7x+HzSYgMNdhRYLwrRJy0=; b=sq11LEeR17LL4rywA48JcbGIprf0V0XVd++ESNxBjk7eJ3egTG+EI+3cINFLb3w043 b5lfWDxTKkacM5mbOPtObszUleU29i0wC0gFBAX/ROquFH2V76ODstoY1NevqveSnSs5 DutYjO77Hpj23aaVWQYh+gqXekehwynvHkqZJaI4/tDSkxMHKDDg/GFwE+wBJC3GVlv1 Z6YVI1o/KjgXhjh90WIOA2f3T8WRbm4H5HKstf+zSSb6acxpXIqiKunvCif2QbBZLaK5 YhEa8kA9MrmhQVZw9UFQHb2bDenK9U6ziaLyH65FhR1PW79HCWenIL/xXUsPGM6Mah9x f9nQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=n4qjsoxC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id z11-20020a17090abd8b00b00273dfe0741csi8991436pjr.90.2023.10.23.12.13.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 12:13:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=n4qjsoxC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id CBC3E808EDC5; Mon, 23 Oct 2023 12:13:48 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229714AbjJWTNl (ORCPT + 99 others); Mon, 23 Oct 2023 15:13:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229532AbjJWTNk (ORCPT ); Mon, 23 Oct 2023 15:13:40 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C8E8C5; Mon, 23 Oct 2023 12:13:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698088418; x=1729624418; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=WPOxCjo/MZ3d3oAzLRk/DrwPZNYoVWIGJnSvwkEFy2M=; b=n4qjsoxCUVrPkHsUoQctc0mftT7FuYrjbYDswdLnCcDj0DpPN7Zqp2h7 0Ei6YKD8SVX1JywOGgmK62qlSzERShcfTCC/ywQvjNeCVtn9eL1WoduJ3 zkNLqn8EQ9vboNrEF4REK58zUNKqr0nPuCR9x/M60lMK2FhkBYjkjNx5l BX9ZC+DBjLY0df85j40vAUFx6Y11FtpTjww68PVTqtPoSm4Kl5Hhrz+Sl iTdbMOUVLIXQUvXbhY04UQWkQ9ynw+Ux7YvZ3DWAH/g6JzBci7438K/RM YIC/QHt2hCxZMt1ANw996CMVlEJdepBR3jI/re/fwOMeVjTPc7qrCHdKP w==; X-IronPort-AV: E=McAfee;i="6600,9927,10872"; a="389758354" X-IronPort-AV: E=Sophos;i="6.03,246,1694761200"; d="scan'208";a="389758354" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Oct 2023 12:13:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10872"; a="1089592710" X-IronPort-AV: E=Sophos;i="6.03,246,1694761200"; d="scan'208";a="1089592710" Received: from qwilliam-mobl.amr.corp.intel.com (HELO desk) ([10.212.150.186]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Oct 2023 12:13:36 -0700 Date: Mon, 23 Oct 2023 12:13:25 -0700 From: Pawan Gupta To: Josh Poimboeuf 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: <20231023191325.ot2eomswz4h5aqx2@desk> References: <20231020-delay-verw-v1-0-cff54096326d@linux.intel.com> <20231020-delay-verw-v1-2-cff54096326d@linux.intel.com> <20231023182211.5ojm2rsoqqqwqg46@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231023182211.5ojm2rsoqqqwqg46@treble> X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,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 fry.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 (fry.vger.email [0.0.0.0]); Mon, 23 Oct 2023 12:13:49 -0700 (PDT) On Mon, Oct 23, 2023 at 11:22:11AM -0700, Josh Poimboeuf wrote: > 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. Sure, I will move the comments to definition. > Speaking of the macro name, I think just "CLEAR_CPU_BUFFERS" is > sufficient. The "USER_" prefix makes it harder to read IMO. Ok, will drop "USER_".