From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A23323E0C76 for ; Mon, 17 Aug 2026 18:06:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.200 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786989962; cv=none; b=JPdlssJjcn1Ptgi2eRDxuslLuNX8G+O2sGgV/fHTlbQvOQ/oWQ7JEqeeOwfMI1SYERCYQgC9bv+H9S7AlBqjU79Wkol7B+kWi67WUXtrc4eORbdJVkMIDwCrR8z8d+VluKSsuVfrm2OlGFUaDCWlHddSCNIF7zqD4Pz7A38tu6c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786989962; c=relaxed/simple; bh=FGUMDOgcOkl98gJszN7Sm/3/hHjQkI7CnxUDvMb9QvU=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=qw2PJvD0dOxt9JQbvWNyXr2T1vG36hHWytrRZ1EPXpnxcGdU2Sh4SLoS6Itwi7kZZDO2LEO1s5vLJUOhlE5bE10NuK5UcF3LX68b7AGWjp/yix79sRVaY3Ed/GuAQfGPrr4a+xRvgJHNuab2rh7QMTDIElnwBbOyCFZQsK0Bad4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=Ephlr/P2; arc=none smtp.client-ip=209.85.210.200 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Ephlr/P2" Received: by mail-pf1-f200.google.com with SMTP id d2e1a72fcca58-8484ba00601so3748516b3a.1 for ; Mon, 17 Aug 2026 11:06:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1786989961; x=1787594761; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=3wgkmOaK7dMi31fjCigxw9/SOFHhN8te1ABKHYJcTbc=; b=Ephlr/P2slPGeOeBRs2MA6piBAKDVsfl/J/8xaKl0iTg/UaHpN64BCnkBTu5UZOdcn 4G1lSvtL6YJjmgxCN/OT7cmT1HmTzvQ271JbNX8ZccmniMlw20cjEI5Z9t854Hq+jBN8 stfGz9hPP+3Tg44a9v9OZHSoTqVKMaURmVmrAd1Xcqz7tmzTI5koIRxOzyyyaiucBhxS FMdvfhgyjS/kGha3T4CkelPYAFJMlDgMnYJznXrzP37vVMRO94UMJMXX5CmRSmPNGw8q ssb75ppdRspOaYXlWDojd7zAkKXXoiWJmbg5zRl7aH7vBZ9QhAqqG6GEi7nZE5HGgwz9 88rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786989961; x=1787594761; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=3wgkmOaK7dMi31fjCigxw9/SOFHhN8te1ABKHYJcTbc=; b=B3QMm4ZO8ZHx0efzEGXb7z+sb0ncLyz5Wvf16j9b2e21Dno5ll6Ix3OQfKj5Y4mV+u NZrK3Z67JfcHFKQiXUFnhMz3fbiNBu0epk84ArFTfAmyj9URj8yFWrih/kA9MC+dYHUi G6q0h4uoCLT4kipJDK/rTQ3Xt8KLcYPDyBjZEgpbTrcjyoMoWp76hbh3Yr6EhtPn7/ql mM0CkPGg6Zx1S1wPnpeLSZ2Jdlvc+5UocIMQPQfNtRqxAoG6O/xA7ygUPPC2HTM7bHcI 4DjPryu6kib9qiVKIp+BB6f9Wtly4L4bMBAYBEZUid2kysBvUU+Fn0SKTP4fY7KYzWjQ Y8qw== X-Forwarded-Encrypted: i=1; AHgh+RqHi48RE+jQaX1iINoRGyL85WJOHKM9xpUwtB1DIK2Fq/YBUW+qOtPRdxJghovHX3Jz2hczQVSyis6/wJY=@vger.kernel.org X-Gm-Message-State: AOJu0YyEXQfBfEShBH0JwfWGrigK+UEbzaF+C41jeyZ6t+JRmYglO9zp onFlOs6gruIFSoWT7QRHVuQ5vLz2JULAESeSn4LR+INUBApBeiA7flVLnVmoE1BO4TGQcOO8xMk bAGjFdQ== X-Received: from pfwz3.prod.google.com ([2002:a05:6a00:1d83:b0:84a:6b32:7768]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:14ca:b0:84e:216d:7e4e with SMTP id d2e1a72fcca58-84fde14ffb3mr21192194b3a.1.1786989960782; Mon, 17 Aug 2026 11:06:00 -0700 (PDT) Date: Mon, 17 Aug 2026 11:06:00 -0700 In-Reply-To: <1dcbf1b2-dc89-4624-b98e-d34f40558cfb@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260812080229.2481439-1-xiaoyao.li@intel.com> <20260812080229.2481439-5-xiaoyao.li@intel.com> <868c0d3c792d789347c767031612977c31cc227f.camel@intel.com> <1cf47118-2a19-44d5-ab74-b4c7ffa8890c@intel.com> <77567574-d26c-4d2c-b5ce-5da28a7178d6@intel.com> <1dcbf1b2-dc89-4624-b98e-d34f40558cfb@intel.com> Message-ID: Subject: Re: [PATCH v3 4/4] KVM: TDX: Enable Bus Lock VM exit From: Sean Christopherson To: Xiaoyao Li Cc: Rick P Edgecombe , "pbonzini@redhat.com" , "kvm@vger.kernel.org" , "linux-coco@lists.linux.dev" , "kas@kernel.org" , "linux-kernel@vger.kernel.org" , "nik.borisov@suse.com" Content-Type: text/plain; charset="us-ascii" On Sat, Aug 15, 2026, Xiaoyao Li wrote: > On 8/14/2026 11:46 PM, Sean Christopherson wrote: > > On Fri, Aug 14, 2026, Xiaoyao Li wrote: > > > On 8/13/2026 10:43 PM, Sean Christopherson wrote: > > > > On Thu, Aug 13, 2026, Xiaoyao Li wrote: > > > > > On 8/13/2026 6:58 AM, Edgecombe, Rick P wrote: > > > > ... > > > > > > The more I look at this, the more I'm against shoving garbage into vt->exit_reasons. > > > > With tdx_is_exit_reason_valid(), this is trivially easy to handle, *and* explicitly > > > > captures the logic instead of subtly rerouting KVM away from meaningful handling. > > > > > > tdx_is_exit_reason_valid() doesn't work unless we update the vp_enter_ret to > > > one that isn't one of the status code with valid Exit Reason. See below. > > > > Correct. > > > > > About the idea, isn't the purpose of setting the Exit Reason to a synthesized > > > one is to avoid the undefined Exit Reason causing false-positives when it > > > happens to match one of the existing ones? > > > > Yes. The nuance is that I'm against clobbering the *full* exit reason. I am > > not against setting exit_reason.basic to something like EXIT_REASON_INVALID_STATE. > > I'm not sure why you are not OK with setting the bit[31:16] to 0 ... I'm all for that. I'm against setting them to 1, which is what using -1u does. Ah, I'm guessing my use of "clobbering" is confusing. I was mentally viewing setting them to '1' as clobbering, versus setting them to '0' as "doing the right thing. E.g. the VM-Exit (that didn't happen) wasn't due to a failed guest consistency check; it certainly wasn't an SMI from VMX Root, nor was an MTF pending at the time of the SMI that didn't happen; the guest wasn't in enclave mode; there was no concident bus lock; all other bits are reserved to zero. Sorry, I should have clarified that writing the full exit reason is ok, but setting arbitrary bits in a way that isn't consistent with reality is not.