Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1426281rda; Mon, 23 Oct 2023 12:11:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGAeCYWBYfvCIVxWq7fBy78toxouqBKfW3kDCby5DAmEmjQBO/ponZNbGJcNekhYjGWX6Uh X-Received: by 2002:a17:902:e3c1:b0:1ca:2c3b:7747 with SMTP id r1-20020a170902e3c100b001ca2c3b7747mr6761436ple.20.1698088274073; Mon, 23 Oct 2023 12:11:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698088274; cv=none; d=google.com; s=arc-20160816; b=Aor9cRv689IQ6ovApZN9wY0kA3U5J34d1U7vKkPHrBHIUREfkZBGAoad32hGe1cA4G SBemNGFxfx7YnJ/RTiyQpd6NDB2dJ3zDqPps9DEMB8pBL4wz8gsq7k/JphkeUydlRD9j 4SYimEPmGNF3xrafagZjB0CICAR298ILPbkaQFB6lhFCNTe4eIepNOsB2RQTk0oiNPj9 spsfEFWf0NqtBjmfDMR1hrpdRNFdMe3mXPpeIWQC8XHY0uBs1q1XefIq9uh27xZG8awR oOYd+XRUNQzjqSSTQChvNfY68C9MFunRbjSTS831H+dyIK+GSHFLSZAk7qLmyBCysrpZ Iy/w== 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=TX477T+N7zFTVcm1sc7Wi/qz8BvTObXEFlB7VOkNuGM=; fh=hZa6Ov/+dTQvnjAYTsnXCSpUeKzg8YC5YooGdh9OF6I=; b=FJ0xUsQ6HFDxXg0TXWls5eX0yy5MEgIRdBDkigNZ5g2OiGLkfLq5F9/OcOkm0f6QOw Y11OTzhF/a+ncU7x3kQsigJ6KhT2ZoQNrZJYKUgQ+AaHdpA0GSrNAgNAqZV68FICp4s8 r0H/sIlkGM7NY1y3W3UNy/XdrOSeZeKl7I+4J18BEm0363NhXmFzxmmaAtqY8LnW1sar 6dqP8b6gBfs8RV7NobbKkI8q16UeZMFi4oarW9LWVPIXshC2E1lG6n3bjxXSZvapJyA4 g64OEVQNTQbpMw0kOS/HIixqMNf+1q0Fj04F68rJc314V/SRwO8BCz9LPkG9/qZTMiqq k26w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fAZcs097; 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 c8-20020a170903234800b001c7615a8e09si7217208plh.593.2023.10.23.12.11.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 12:11:14 -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=fAZcs097; 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 DD095807C855; Mon, 23 Oct 2023 12:10:12 -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 S230328AbjJWTKE (ORCPT + 99 others); Mon, 23 Oct 2023 15:10:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229462AbjJWTKD (ORCPT ); Mon, 23 Oct 2023 15:10:03 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D708D94; Mon, 23 Oct 2023 12:10:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698088201; x=1729624201; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=6FMUuDYUTlK2LKUY1b0PZ+zy98w+sI48pzxcDNADCi0=; b=fAZcs097bdJYP5PZWkn4oYp5f3l4akvhyvN1Zhk4m/9/HQk4nebf7qQp fJSqnist22IDwDkKvrjIp/NI+4aSeQ+WP8LLdYdJAMSzqhALEi1UnGO10 6r1Joxy90vrWpiqdtVYu13g+DDtVqvvEvXZ8wsvr+NPFlZtzmvn7Y5tSh nbM8giiUmBcS8x6A1G7i1INzF+QptL0v6hRA5O08slx5snFiTLLNyWc/O LZJaLQk+EF/VxNU/8U5Dl4QOeJo5TAXTTkJwl3xz/tlfwJQREpoZ6LAOr Pax4nXFY1xjfRR3DiKxYOGx9UGBJ8tY4/Naoc4c96XnkxjisDw/sTrwjG w==; X-IronPort-AV: E=McAfee;i="6600,9927,10872"; a="386718669" X-IronPort-AV: E=Sophos;i="6.03,246,1694761200"; d="scan'208";a="386718669" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Oct 2023 12:10:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10872"; a="824055761" X-IronPort-AV: E=Sophos;i="6.03,246,1694761200"; d="scan'208";a="824055761" Received: from qwilliam-mobl.amr.corp.intel.com (HELO desk) ([10.212.150.186]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Oct 2023 12:10:00 -0700 Date: Mon, 23 Oct 2023 12:09:49 -0700 From: Pawan Gupta To: Josh Poimboeuf Cc: Andrew Cooper , 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: [RESEND][PATCH 1/6] x86/bugs: Add asm helpers for executing VERW Message-ID: <20231023190949.2gdrqisype5metpj@desk> References: <20231020-delay-verw-v1-0-cff54096326d@linux.intel.com> <20231020-delay-verw-v1-1-cff54096326d@linux.intel.com> <20231021011859.c2rtc4vl7l2cl4q6@desk> <20231021022134.kbey242xq7n754rg@desk> <20231023180806.udbnt4nx3r2bdyi3@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20231023180806.udbnt4nx3r2bdyi3@treble> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, 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]); Mon, 23 Oct 2023 12:10:13 -0700 (PDT) On Mon, Oct 23, 2023 at 11:08:06AM -0700, Josh Poimboeuf wrote: > On Fri, Oct 20, 2023 at 07:21:34PM -0700, Pawan Gupta wrote: > > On Sat, Oct 21, 2023 at 02:33:47AM +0100, Andrew Cooper wrote: > > > On 21/10/2023 2:18 am, Pawan Gupta wrote: > > > > On Sat, Oct 21, 2023 at 12:55:45AM +0100, Andrew Cooper wrote: > > > >> Also it avoids playing games with hiding data inside an instruction. > > > >> It's a neat trick, but the neater trick is avoid it whenever possible. > > > > Thanks for the pointers. I think verw in 32-bit mode won't be able to > > > > address the operand outside of 4GB range. > > > > > > And?  In a 32bit kernel, what lives outside of a 4G range? > > > > > > > Maybe this is fine or could it > > > > be a problem addressing from e.g. KVM module? > > > > > > RIP-relative addressing is disp32.  Which is the same as it is for > > > direct calls. > > > > > > So if your module is far enough away for VERW to have issues, you've got > > > far more basic problems to solve first. > > > > Sorry, I raised the wrong problem. In 64-bit mode, verww only has 32-bit > > of relative addressing, so memory operand has to be within 4GB of > > callsite. That could be a constraint. > > Even on x86-64, modules are mapped within 4GB of the kernel, so I don't > think that's a concern. You are correct, modules are indeed mapped within 4GB of the kernel. So what Andrew suggested is feasible. Is that your preference?