Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp34278rda; Fri, 20 Oct 2023 19:26:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEWPWbeC2iqYLwpcaAGBBrTs3gClF40/kahuP16WTahUU1Txor6SenhDAlLRUDJDZ1FZg6D X-Received: by 2002:a05:6358:786:b0:150:8ba9:4d with SMTP id n6-20020a056358078600b001508ba9004dmr4105295rwj.3.1697855176844; Fri, 20 Oct 2023 19:26:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697855176; cv=none; d=google.com; s=arc-20160816; b=FNqMhGbGhrcENkJgiuzLSRyrxtxnYlZDdi7uaOmJ/tYrPQgWkJr/3ks6lDMZB8B0Ot leIh33hzaCNy0dFimXVe6H/40ECjGB98iojUwrqpThtJ6PNoZj50EH4my+aKY0Lvv2kv BlltjgmHrEFXrSeNWqPKS9FXcXv0vYOoqskdUVK5x4l3tot0H+P7adYsRSjN6sBPlMDI jmBzMhelj9ugRLpwPOGmdbbjavyhRgXXsKUjdOcAQNluydINehmFpoj0ZB8+IMF0iVFE CaNKYYdy5asLbti7gRvoFbl/BAwqpNlVsRhCRHVDRI4aLu1rJ7BaqluNJQhvl66Aadjr AM0A== 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=C1Gyl+j5ZrUbkYpsn4fLZU1eaJP3+CNT4IsUF6L8DQ4=; fh=p7ekuMuBKYy6HfUq8fyIfc2tMYhRoZsUjTVXFIuLfSY=; b=hpQ7o2Wy74DzXz25HqpheFB+Rgo/b46D6U8AN/t5jvkdyau3kpOLBphR3WijWVoNEb pTmyEiw03SCsRbkIOjfFTvdR/++BnLGTAQ1yv2l6RwT5IZ3MlWEoHQMjO4WM7Sju8tzx JccJqgBh36635XXmXZHThv9+ufIKIS1+i2S68HYP5AzQBkuYJu7gVQXH5jt+4//ZDUV0 Kelpj8xO2I8lOl0CAlMKlp9g8aeoq39wwwpRMGpmC1op7ixl7VVKEocM/TUE3F5ImhJN RDjV44XFRMoMw1Zg+vifkrGrargs4mBm6wv/9+EAqIIOx1SleFkXYILDulF3Hkyd5oMV SinA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=MjEamM8E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id r2-20020a632b02000000b005add209e106si2776810pgr.442.2023.10.20.19.26.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 19:26:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=MjEamM8E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id ABD49835CE85; Fri, 20 Oct 2023 19:26:02 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230456AbjJUCVu (ORCPT + 99 others); Fri, 20 Oct 2023 22:21:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229500AbjJUCVt (ORCPT ); Fri, 20 Oct 2023 22:21:49 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D66CD46; Fri, 20 Oct 2023 19:21:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697854904; x=1729390904; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=uTfWeCyQb/gkcYps2//6ulKi3cBIu9cNCAyCJLjIm9g=; b=MjEamM8EpBT8IQuKgx1mMr9c+zjRX4+6HKQzRHwXvDxDyNPKOvhXHs7x AR2uAeSHuoSJDiOBRvezI/qpX3xJtQqBjalyT06aM7+0okemDVBMBkffg wrdO5DqXj+oMme4pAVNUgpaEd4ow4gDr1anqYWdBRX9mhl4tqTISwXFgN qyXPFLFsqSoa9Mm8K9nsH0u0eYwTTmG+VzLJ4hMAULSKgseGv+EraQFQ/ 7+MPXDo7vKYbskGN8c8zv91ks7imscdw4YT6DJNfVDE5OSYrW5cf5GBNs dYSSjGHHbslJa2ByCp1IG9J5SWJvQFqr1oMAGu9E/hlx9tOyYnHZ6o+9m Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10869"; a="366831930" X-IronPort-AV: E=Sophos;i="6.03,239,1694761200"; d="scan'208";a="366831930" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Oct 2023 19:21:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10869"; a="874099227" X-IronPort-AV: E=Sophos;i="6.03,239,1694761200"; d="scan'208";a="874099227" Received: from hkchanda-mobl.amr.corp.intel.com (HELO desk) ([10.209.90.113]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Oct 2023 19:21:42 -0700 Date: Fri, 20 Oct 2023 19:21:34 -0700 From: Pawan Gupta To: Andrew Cooper Cc: 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, 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: <20231021022134.kbey242xq7n754rg@desk> References: <20231020-delay-verw-v1-0-cff54096326d@linux.intel.com> <20231020-delay-verw-v1-1-cff54096326d@linux.intel.com> <20231021011859.c2rtc4vl7l2cl4q6@desk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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 pete.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 (pete.vger.email [0.0.0.0]); Fri, 20 Oct 2023 19:26:03 -0700 (PDT) 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.