Received: by 2002:ac8:760c:0:b0:40f:fb00:664b with SMTP id t12csp918521qtq; Thu, 14 Sep 2023 22:23:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFmoU9an5NkSk/B45It3BBPGh61llHUlab4jHn/laLtKf99JmpZFWJmhKfNeElb3KTUH0U+ X-Received: by 2002:a05:6a00:14d5:b0:690:4362:7025 with SMTP id w21-20020a056a0014d500b0069043627025mr664327pfu.29.1694755384745; Thu, 14 Sep 2023 22:23:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694755384; cv=none; d=google.com; s=arc-20160816; b=VrtynblRqLqze61IvLpLbPFH5fQSEjLlpF0RFFDE0rD3CLyr9HEmFLBw1TY25owj6P I16gpS10M2s9Bw5duj4yppt75/RfCQVl9rhsut4P9k/0wDfxZl2vv285AKOkgvDz0jGS mDYOtMtmm9wIprZ40VyMLFVz0GpDEpQEZ7ivtujYW2/IOd16oHFFboC2wTuDPXx0Q8+a L91OAE6K+O3093acPxzNQY4UZfAr3twP9Mz8jxRxNhFqLj/y0yGqtZLIAxEInF6Vnhhq Q1QRQU92/8xvte0tESXanjpQyIsTifbTDwOB0ENDmErWvCSMviwQTFbnjcQiDoaYCAjM AGvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=KgPRsgSrxVNlEOyySaa1PIQm8JulpVoZGkS4WiKzu2Y=; fh=jHxYyDuyV6G+TNX9haDqMeT1LYyygqCVhEMPbiMpP74=; b=baLlwh6u+ybQ5s41v6tfkJQKLRnDtRU7XpRaAS83qhowhahBZj8gCeAXosGbVuM1oT fCcZoxDRJFcC624bA8PB8X0yhLbtvUE7vpzTIMmn1isDjGSJJ7Zy79sT1JQbYS2IFUee WjXyZ5Zqnocue7QttHK6PHiK0Z93qT2naa1R0BH04m2QKbVzG6iqfm3mC1OeEIuKwg5+ esbzWGGl/V1pbumuw96npoymdKCMaI0DZR+BIZAik+0jRr4Lnciycpe+4n9thPYSXeGB 47m5huX49IbviDCgAwpGOPbjEO0rt/2rwG819obQMcoyUfQY1Wkb2STiPoi0GlY7osdp 3ktQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Opufk+gW; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id w23-20020a639357000000b00563e6fd0bf6si2611463pgm.792.2023.09.14.22.23.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 22:23:04 -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=@linutronix.de header.s=2020 header.b=Opufk+gW; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 2DDF28282A1D; Thu, 14 Sep 2023 17:12:38 -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 S230446AbjIOAMh (ORCPT + 99 others); Thu, 14 Sep 2023 20:12:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230286AbjIOAMg (ORCPT ); Thu, 14 Sep 2023 20:12:36 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDD1D2102; Thu, 14 Sep 2023 17:12:32 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1694736750; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=KgPRsgSrxVNlEOyySaa1PIQm8JulpVoZGkS4WiKzu2Y=; b=Opufk+gWG3Yw6wgO+kfqspHQ/VgFO8K0Ud/Qg7tynRke3PDBgtKU+a460kKb/93gIiUO5L bzEoLG4ayaBS8fTrf6QlAolsiu8ly3FxA9C9EAuo7MZTffVz9n1bf7nSCIpvbZSVmXDYVW acMz0Jonv3RJ94KgCGiuk2sXBFifOrs6HKWprtunsu+B0FOomTyOogxJ0p7Ixnvh4aziKu tLsnvnhq16s2s3UxE26tnjrlvcrBGMLvc4cZsMLWD5evy/Gj658BwlQoIdcEyATUJU76k8 bO2+R+GllHweAzkZON5NLUw8Xa8uqPVH57q4oEFbEYqLFZJkCnw//4Xc6xac6w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1694736750; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=KgPRsgSrxVNlEOyySaa1PIQm8JulpVoZGkS4WiKzu2Y=; b=LCuwmEnex0B5wafWqEhRbYoFiiceeuNdckfK2gNVmqyd/yygxlcSv5V67wVBfndBTx2X5k Wq/zjvIpWJ6zjYDg== To: andrew.cooper3@citrix.com, Xin Li , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-edac@vger.kernel.org, linux-hyperv@vger.kernel.org, kvm@vger.kernel.org, xen-devel@lists.xenproject.org Cc: mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, luto@kernel.org, pbonzini@redhat.com, seanjc@google.com, peterz@infradead.org, jgross@suse.com, ravi.v.shankar@intel.com, mhiramat@kernel.org, jiangshanlai@gmail.com Subject: Re: [PATCH v10 03/38] x86/msr: Add the WRMSRNS instruction support In-Reply-To: <7ba4ae3e-f75d-66a8-7669-b6eb17c1aa1c@citrix.com> References: <20230914044805.301390-1-xin3.li@intel.com> <20230914044805.301390-4-xin3.li@intel.com> <6f5678ff-f8b1-9ada-c8c7-f32cfb77263a@citrix.com> <87y1h81ht4.ffs@tglx> <7ba4ae3e-f75d-66a8-7669-b6eb17c1aa1c@citrix.com> Date: Fri, 15 Sep 2023 02:12:29 +0200 Message-ID: <87v8cc1ehe.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain 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]); Thu, 14 Sep 2023 17:12:38 -0700 (PDT) On Fri, Sep 15 2023 at 00:46, andrew wrote: > On 15/09/2023 12:00 am, Thomas Gleixner wrote: >> So no. I'm fundamentally disagreeing with your recommendation. The way >> forward is: >> >> 1) Provide the native variant for wrmsrns(), i.e. rename the proposed >> wrmsrns() to native_wrmsr_ns() and have the X86_FEATURE_WRMSRNS >> safety net as you pointed out. >> >> That function can be used in code which is guaranteed to be not >> affected by the PV_XXL madness. >> >> 2) Come up with a sensible solution for the PV_XXL horrorshow >> >> 3) Implement a sane general variant of wrmsr_ns() which handles >> both X86_FEATURE_WRMSRNS and X86_MISFEATURE_PV_XXL >> >> 4) Convert other code which benefits from the non-serializing variant >> to wrmsr_ns() > > Well - point 1 is mostly work that needs reverting as part of completing > point 3, and point 2 clearly needs doing irrespective of anything else. No. #1 has a value on its own independent of the general variant in #3. >> That function can be used in code which is guaranteed to be not >> affected by the PV_XXL madness. That makes a lot of sense because it's guaranteed to generate better code than whatever we come up with for the PV_XXL nonsense. Thanks, tglx