From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0C82379CD; Wed, 25 Feb 2026 19:02:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772046139; cv=none; b=PlaejVceHFBLKdtWxsNESRIZTUDQ0QAqoX8540f5ZZmKJtutDNfmQN/z/JUysUrgvictUtvwwESCTHK9v0IA31iespmgnMPzu6qT3r2SKTRWhZAa/nZyK1RGTEgXOxaLJcuNYSnfCj6oGflT8uro5D+Pj8aj+SGpH4IA3AHUbz8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772046139; c=relaxed/simple; bh=3J4m6I+NeRwNMzOIEpLwkf6TJbT4imOT5nxMDbUiIY0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=sRvx5pVgLP//4+9NyPLcRA9KXpabpwGCrjXYjTtsBsdCinr7chtDffKhdpFkLiQbjFsg4mJ4fj26CMkNKPCiYK7gu78zP5oslF9QtnpD3Ri1Do852OWs4q2nfaLBfPAiUgKsbjDTLzoaTLBLChnHIlUxsPUU3Ynap0Nh1L89mnI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=M+50fg56; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="M+50fg56" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8084EC116D0; Wed, 25 Feb 2026 19:02:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772046138; bh=3J4m6I+NeRwNMzOIEpLwkf6TJbT4imOT5nxMDbUiIY0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=M+50fg56vT1gIJGSECq3oBEd//N3hMT6tdT8LNST7/95uNVkTuxZlsPPCd8wa8jhW 9UMnrhC2HFq0a/aYwfjL4UFbOVc/c2YpGhf40XCcuFr3wuVdSTYJ8x7enIXY23/Xcr 2OKjLV8JsIZwWZ144IyqzSKVumniJBGqxmmav+GiHgbXChuGw/s97YK3eJGDTetkP2 h/sWuHkbcxtigZ1aDkXShRykWu4e8MjN1+kmpYtn77qeIcWpnASrcQOdKl7BMrivdH Y9I0MzVwTz1f6A8TWTcxTO3Z3QOxQ+wpMOTd8xoKTEwqRPQbtGwJgtidzsHTMhhJtd Av9Jbm/SpgA2Q== Date: Wed, 25 Feb 2026 12:02:13 -0700 From: Nathan Chancellor To: Uros Bizjak Cc: kvm@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, Sean Christopherson , Paolo Bonzini , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , llvm@lists.linux.dev Subject: Re: [PATCH 2/2] KVM: VMX: Use ASM_INPUT_RM in __vmcs_writel Message-ID: <20260225190213.GA2755431@ax162> References: <20260211102928.100944-1-ubizjak@gmail.com> <20260211102928.100944-2-ubizjak@gmail.com> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260211102928.100944-2-ubizjak@gmail.com> On Wed, Feb 11, 2026 at 11:28:50AM +0100, Uros Bizjak wrote: > Use the ASM_INPUT_RM macro for VMCS write operation in vmx_ops.h to > work around clang problems with "rm" asm constraint. clang seems to > always chose the memory input, while it is almost always the worst > choice. > > Signed-off-by: Uros Bizjak > Cc: Sean Christopherson > Cc: Paolo Bonzini > Cc: Thomas Gleixner > Cc: Ingo Molnar > Cc: Borislav Petkov > Cc: Dave Hansen > Cc: "H. Peter Anvin" Acked-by: Nathan Chancellor FWIW, I hope this issue will soon be fixed in clang properly so we can add a version check to this workaround: https://github.com/llvm/llvm-project/pull/181973 > --- > arch/x86/kvm/vmx/vmx_ops.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/x86/kvm/vmx/vmx_ops.h b/arch/x86/kvm/vmx/vmx_ops.h > index 1000d37f5b0c..81784befaaf4 100644 > --- a/arch/x86/kvm/vmx/vmx_ops.h > +++ b/arch/x86/kvm/vmx/vmx_ops.h > @@ -221,7 +221,7 @@ fault: \ > > static __always_inline void __vmcs_writel(unsigned long field, unsigned long value) > { > - vmx_asm2(vmwrite, "r"(field), "rm"(value), field, value); > + vmx_asm2(vmwrite, "r" (field), ASM_INPUT_RM (value), field, value); > } > > static __always_inline void vmcs_write16(unsigned long field, u16 value) > -- > 2.53.0 >