Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp2837897rda; Wed, 25 Oct 2023 13:55:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGuzSBem8AShE0QtxCGN94pEM77ANAVV5m2TCR1dMyMt57CnVGV8vYxkIIC+9VHjdJJ/m1S X-Received: by 2002:a05:6830:16c9:b0:6c4:8441:f90 with SMTP id l9-20020a05683016c900b006c484410f90mr17124425otr.24.1698267342337; Wed, 25 Oct 2023 13:55:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698267342; cv=none; d=google.com; s=arc-20160816; b=hll5OQnldtGBtH1h5AAcF3oDmTZ4EUu+YY0kpS0KegAI3td2kPnIyuSvWSiQ0zzNQi Th2VSjQfmiZHyuPISkyY4aa5MVAVVRcGfEARA3YIy38FpLTT42oKTTfMBkQxE2OIisqU +/LryhAe0k6BYisH740W+s+aBwvHuJleL8KG7HzbqeJd4yCn7t1iply8A3Naw2z1ZAlX CgLrUiGS0P3MVQOTqAQSn3/ziMzbTybyGb4bqPUpqGq99cBeo5wJCcdDQ7EB5t2a4/fR zcJRhhctOCRpouo8rnxNwNqKfqtkUXA7EWiambtcbZ7eOp6uKzroqFLg90xiUi3KT8JQ uEMA== 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=UtZ6k9Oyj9C76UgVXziiWcsI59b09aZmqIi0GzVC7eo=; fh=lbJsPO+ZRDN9baDq/BZnnNH6CGOpZtNT0YCi3hapTHQ=; b=wLYiA3Mo6iOjsTIOZkrD/cX7DsidxRyzelpFan3lxTikYJ1BhDMMRLw63f43449b0l gT/ZJKF27NtfCn72ooJVc23gT9rwTiXwWPdykNStu7MT/qDdgFywuDEGQ8HccB/Pt34o E+wj6/FNA3HbiHBVoXnKdcuoMtTBo9PVh08b5p50ll7EHPmwNOOWx1qYgfepatuVhDW3 WCd/5Lim9cfz021AmJNWSDTSABd8KIyJ8O7tXAYfLNbgUF5Wci3tetOAHKgnfk60M2je ssMb2sOOncv39iyx7p5907tmnBezrH6mnE8CO1fx9B/G26i9u7vn5pJy3SRbIs6XypCB 3DTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=P2Tp2FfU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id n193-20020a0dcbca000000b005771e239aa8si11766502ywd.30.2023.10.25.13.55.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 13:55:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=P2Tp2FfU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id A3070806E5C2; Wed, 25 Oct 2023 13:53:29 -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 S232076AbjJYUxW (ORCPT + 99 others); Wed, 25 Oct 2023 16:53:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233221AbjJYUxQ (ORCPT ); Wed, 25 Oct 2023 16:53:16 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A67DD50; Wed, 25 Oct 2023 13:53:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698267189; x=1729803189; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=fKL8O9LfX0J38E00Mtc5QFOreN8mewIuIipoFxbNi84=; b=P2Tp2FfUFAD2G856ryNsSeuasFVWSN9mlO29Mzm6TXU9ZG3jZddBNnL0 iGGH07YiN/qXtZIEfQiXxXGdYDAI8afP5+0t2up+wxtTFuJms+JVY/BpK s8viFGeHdMczxgNHn+K5jMu5BMEQwdL5WFDh7GhQBhBh6f1JsQjlvByIH TBPaHalfMd7wxIg7aAhXUlFNBE2IdWGGsyzqEXEcWjHAjqyBSgyIRCtF/ 5pGWzEbw4XDbG7rfWNNPecsk247lBQWv2ZW4nIRxEJTqqee9q23ndY04H np7VvRRSMU0erv7RU3KoBxnsHSPRtFsMJwGeMbttwwU66DHVBwd/lQ0s4 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10874"; a="390255526" X-IronPort-AV: E=Sophos;i="6.03,250,1694761200"; d="scan'208";a="390255526" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2023 13:53:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.03,250,1694761200"; d="scan'208";a="259651" Received: from kkomeyli-mobl.amr.corp.intel.com (HELO desk) ([10.251.29.139]) by fmviesa002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2023 13:52:57 -0700 Date: Wed, 25 Oct 2023 13:53:05 -0700 From: Pawan Gupta To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Peter Zijlstra , Josh Poimboeuf , Andy Lutomirski , Jonathan Corbet , Sean Christopherson , Paolo Bonzini , tony.luck@intel.com, ak@linux.intel.com, tim.c.chen@linux.intel.com Cc: linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, kvm@vger.kernel.org, Alyssa Milburn , Daniel Sneddon , antonio.gomez.iglesias@linux.intel.com, Pawan Gupta Subject: [PATCH v3 3/6] x86/entry_32: Add VERW just before userspace transition Message-ID: <20231025-delay-verw-v3-3-52663677ee35@linux.intel.com> X-Mailer: b4 0.12.3 References: <20231025-delay-verw-v3-0-52663677ee35@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231025-delay-verw-v3-0-52663677ee35@linux.intel.com> X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 25 Oct 2023 13:53:29 -0700 (PDT) As done for entry_64, add support for executing VERW late in exit to user path for 32-bit mode. Signed-off-by: Pawan Gupta --- arch/x86/entry/entry_32.S | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/entry/entry_32.S b/arch/x86/entry/entry_32.S index 6e6af42e044a..74a4358c7f45 100644 --- a/arch/x86/entry/entry_32.S +++ b/arch/x86/entry/entry_32.S @@ -885,6 +885,7 @@ SYM_FUNC_START(entry_SYSENTER_32) BUG_IF_WRONG_CR3 no_user_check=1 popfl popl %eax + CLEAR_CPU_BUFFERS /* * Return back to the vDSO, which will pop ecx and edx. @@ -954,6 +955,7 @@ restore_all_switch_stack: /* Restore user state */ RESTORE_REGS pop=4 # skip orig_eax/error_code + CLEAR_CPU_BUFFERS .Lirq_return: /* * ARCH_HAS_MEMBARRIER_SYNC_CORE rely on IRET core serialization @@ -1146,6 +1148,7 @@ SYM_CODE_START(asm_exc_nmi) /* Not on SYSENTER stack. */ call exc_nmi + CLEAR_CPU_BUFFERS jmp .Lnmi_return .Lnmi_from_sysenter_stack: -- 2.34.1