From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f73.google.com (mail-pj1-f73.google.com [209.85.216.73]) (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 6A39525D216 for ; Thu, 29 Jan 2026 20:35:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769718915; cv=none; b=sk5mVO5iYpTmcSHCcwAwsdVpQvqHtZ8imCsqahH+5EpTU0zhsbqrdznQIw/baDKPaBPwdtg9eEorzcLcopbiSQQ3kGG/gv7gowNO/9Bdf/a7wXCe0XtyaWBO1lQsl+XRA5yojwoXIex2CiNr4Ry6jIpwSMaWWu6Ny3990D5l/tU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769718915; c=relaxed/simple; bh=MyNIcHQ3AtOtHcDNc7t7dV+X3P1pPKihf3RCfVQvvwI=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=Lq4oCadMNtJbgUdG78YkR/mv7h3OenXsm2WuftrFBgKS0zcHIavaUS4ObGNTLQYh4QonVKCWS6jPLM2Dsu+NW7JEfYYuZOehzkhmmzK6jh2T634Rn6iEP5zOk8tsZF2qWmmMPbNFHia7jq0gGbeb1bQZ/AllJXLewf9x8LERvo4= 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=ZLiN8dIL; arc=none smtp.client-ip=209.85.216.73 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="ZLiN8dIL" Received: by mail-pj1-f73.google.com with SMTP id 98e67ed59e1d1-34ac814f308so2139080a91.3 for ; Thu, 29 Jan 2026 12:35:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1769718914; x=1770323714; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=nRr0fknTEEftcLLsSBELlvbzRGlEtPa009sOBZT15IA=; b=ZLiN8dILaqotTFpIUbvSkzYgVoLyZmdQE6e+5qAXZWcjRBxCX7v+pDCogwank5TPU8 6YXiPpPMNx0fC7b3xqBH6IPXdrUJgeIS7w6sS3dhthXXB3SQg/EElwZWU6P27svyQg7J TRE0XFI6xeU3gPwT4GHAD0gCzovTcUgEoKGz8Grg9IRINNu+OdSSOkPznOr1KuKQps0a XNNqQIdan87hnDwgCZmfontDQBII6nAHDUYEkJZoXS+LWFi5x23IKgQ+g5J+uCHmha66 ts/lJcH1rRMZzTvUMNYpzNH601KwAzlOMGe6quxBnUWe9jbTUI0G8jIIZSUazIVltVrI dipQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769718914; x=1770323714; h=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; bh=nRr0fknTEEftcLLsSBELlvbzRGlEtPa009sOBZT15IA=; b=ACNUTwWhyr9dJsvRWGbIF1pAT8LIl76XRak6BboEid/wH7FeT9tjv+q/iO/zBWSXq2 ZgrdE8ZTUCNHHGnKajyvS1E79W35RIaxxxTPrUNKCI8H0rqNEelnxJdaphmofOkfdzqb 192s8X7l0dH1ri+fKIkPy3dCY4+/Gd8kfLkygRWSEIXcSPLfn9k2wUtvgFMB/G5c6LmC +C8mF5k/zNk2flSL5XjiNCFZeaBrYXa9a+93p9A9wrfyDSpGysziRbH5Erp7blaHIoPb 6eqqU6v2fiGhyU4qK5GuX8e45AAnnOJ/LiTLWS7qv3BlI+7XNLq+XpoBcyZOj2B3UCEn KdKA== X-Forwarded-Encrypted: i=1; AJvYcCXfzKY84Yw/Kgxjs/1mGZvCL6JvBDWwU+oFLCkY/gJY8S14LvOAabe+akqpfU9pUba5j/jIrO6lWTuq5rM=@vger.kernel.org X-Gm-Message-State: AOJu0Yy/CLFOjaKEBzuQVGMPajDfnl8WyYE9+aXxwDgr7/JRQT3iNc3O qGoFbq4n5bGSUjQSqMvBtYTrCrO0ek5qyx00SzqvxbSzFupKUOzEygHd7e5+ybks1ZpUbmTlmcA 2G3rZpg== X-Received: from pjbov11.prod.google.com ([2002:a17:90b:258b:b0:350:fe17:1110]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:3bc6:b0:34c:99d6:175d with SMTP id 98e67ed59e1d1-3543b2e0022mr605496a91.2.1769718913806; Thu, 29 Jan 2026 12:35:13 -0800 (PST) Date: Thu, 29 Jan 2026 12:35:12 -0800 In-Reply-To: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260129011517.3545883-1-seanjc@google.com> <20260129011517.3545883-12-seanjc@google.com> Message-ID: Subject: Re: [RFC PATCH v5 11/45] x86/tdx: Add helpers to check return status codes From: Sean Christopherson To: Dave Hansen Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, Kiryl Shutsemau , Paolo Bonzini , linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, kvm@vger.kernel.org, Kai Huang , Rick Edgecombe , Yan Zhao , Vishal Annapurve , Ackerley Tng , Sagi Shahar , Binbin Wu , Xiaoyao Li , Isaku Yamahata Content-Type: text/plain; charset="us-ascii" On Thu, Jan 29, 2026, Dave Hansen wrote: > On 1/28/26 17:14, Sean Christopherson wrote: > ... > > err = tdh_mng_vpflushdone(&kvm_tdx->td); > > - if (err == TDX_FLUSHVP_NOT_DONE) > > + if (IS_TDX_FLUSHVP_NOT_DONE(err)) > > goto out; > > if (TDX_BUG_ON(err, TDH_MNG_VPFLUSHDONE, kvm)) { > > I really despise the non-csopeable, non-ctaggable, non-greppable names > like this. Sometimes it's unavoidable. Is it really unavoidable here? > > Something like this is succinct enough and doesn't have any magic ## > macro definitions: > > TDX_ERR_EQ(err, TDX_FLUSHVP_NOT_DONE) FWIW, I have zero preference on this. I included the patch purely because it was already there. > But, honestly, if I were trying to push a 45-patch series, I probably > wouldn't tangle this up as part of it. It's not _that_ desperately in > need of munging it a quarter of the way into this series. For sure. The 45 patches are definitely not intended to land as one. I posted the mega-series to propose an end-to-end design for DPAMT + S-EPT hugepage support. I don't have the bandwidth or brainpower to hash out a KVM design in two different series.