From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CD728C25B46 for ; Mon, 23 Oct 2023 18:08:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232263AbjJWSIN (ORCPT ); Mon, 23 Oct 2023 14:08:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231159AbjJWSIK (ORCPT ); Mon, 23 Oct 2023 14:08:10 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0EF14B4; Mon, 23 Oct 2023 11:08:09 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D54E0C433C8; Mon, 23 Oct 2023 18:08:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698084488; bh=nIgs0wvJThOXxn7oOFB3LcbF7XBEJd/S1r1uOMhwaUo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pfON6swb831n8aeMwzxjj6xbWsYHljK018mYgGx5xpYQ23ww+ylfFIAnLPz8ARk9a 6T3Ne9hpYee+sflOr8FZhPc5KDP3OD3ouG4DcMWu2TkWyQXi7L1eFcy1H/ixJndj6Z kb0Q9MoK+7JyY/3I3baH153a6h1T9nfa87axTJt4jC4/gvruTx/1/KQh3NXH8WKXZ2 NQLfec/mlk8Sn/vYMYqDBRBNgwAvcBI3nwPtwKHsSDQne1DgG0zpKlnOkWIBD1QD/f wATJITKZwjKP/tDk95E9ZaEpofBlAOUPsTHQFP/If/BVmJ0bW/KMB/nXYTIz8k5DIt /vmkRx8q2Pksg== Date: Mon, 23 Oct 2023 11:08:06 -0700 From: Josh Poimboeuf To: Pawan Gupta 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: <20231023180806.udbnt4nx3r2bdyi3@treble> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20231021022134.kbey242xq7n754rg@desk> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. -- Josh