From nobody Wed Jun 17 05:27:56 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 7B40B366072; Mon, 27 Apr 2026 22:26:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777328805; cv=none; b=UChorbSlVvWwv/zp3ichg+buLzFk1t0p2Z8BlKnlAZG6o9nEgckCwkJ/SJ1crei2c8wD4SAxbRx/b+Xzzhl/gAorntaLiR7tAGrtQKSJ755KD68sObiJVeJOSA5elFkqkoO6nsw54uHjwVjUC5e6LQ/2uLJLFzCz1Zh7iApbh7M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777328805; c=relaxed/simple; bh=ie4wNfXUtXoihybiclCnflE6mDDEBBbNEBb+1O4OMws=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=h3j1J3ROmBZmYWSo3Z+vBuu3kXT1vsq1MEPBmPMuRufbgtLTe5cXffrAryAMw9ZlcsgK5on/6205u+8Q1HJPHDAduAG0R4Aa5TwlMb2lSP0i8ORwsykWoF5gFmgdp19ToryvODYEjqC5egavXq4KTGKsVs8Q0K4QFLRha/ulmLU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=HzVH4zy8; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=AnYqrBoB; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="HzVH4zy8"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="AnYqrBoB" Date: Mon, 27 Apr 2026 22:26:40 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1777328801; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wfrH1YVzgvqL8YcIvKtowBb4VSQfq9lMoQ6rKPblw/U=; b=HzVH4zy8sJ/rat65K0HJM0EyBXyKQIGwLpB5QyTVKvkx5raOG1XO9dpbWTB0PY2+sZbDPy Xn+oQJHn6P9k8eF1cLIxC+0RfAg3BwEVCIr4ko/rnPjkcUfjOgxY2mDN0q1GIC8HL++KO6 6LXObrkyLBLLgS3zD3t1dizw7ZRW+kJGf5/aa9znRV4g4paxCE7XuYarDQ2M2oIAq2F2Zw aeWlljxiEabvHYWGDGg7FySpsEdoHwhqdJK3IxkNsm6B1JASmXogyothGXiCu56at61AFp PwhTSvSJUOE+617zNVoJsosvY6SMr84UHdWQCkYLM+GG2RQ7FZf2mqB2aZ/5oA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1777328801; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wfrH1YVzgvqL8YcIvKtowBb4VSQfq9lMoQ6rKPblw/U=; b=AnYqrBoBmuGhafrk/1kbE0DF8yR7k+GEOwVYFjc1XxDMqQT62r88PjmNTlrshTKsyQmrJc wrBQY+stRgeUOfCA== From: "tip-bot2 for Kirill A. Shutemov" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/tdx] x86/tdx: Move TDX architectural error codes into Cc: "Kirill A. Shutemov" , Rick Edgecombe , Vishal Verma , Dave Hansen , Chao Gao , Sean Christopherson , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260402-fuller_tdx_kexec_support-v3-1-34438d7094bf@intel.com> References: <20260402-fuller_tdx_kexec_support-v3-1-34438d7094bf@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <177732880028.3521451.7381333263543794681.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the x86/tdx branch of tip: Commit-ID: 53642715861e838f328a3fbef99a1d315955221a Gitweb: https://git.kernel.org/tip/53642715861e838f328a3fbef99a1d315= 955221a Author: Kirill A. Shutemov AuthorDate: Thu, 02 Apr 2026 00:32:01 -06:00 Committer: Dave Hansen CommitterDate: Mon, 27 Apr 2026 15:13:38 -07:00 x86/tdx: Move TDX architectural error codes into Today there are two separate locations where TDX error codes are defined: arch/x86/include/asm/tdx.h arch/x86/kvm/vmx/tdx_errno.h They have some overlap that is already defined similarly. Reduce the duplication by unifying the architectural error codes at: asm/shared/tdx_errno.h ...and update the headers that contained the duplicated definitions to include the new unified header. "asm/shared" is used for sharing TDX code between the early compressed code and the normal kernel code. While the compressed code for the guest doesn't use these error code header definitions today, it does make the types of calls that return the values they define. So place the defines in "shared" location so that it can, but leave such cleanups for future changes. [Rick: enhance log] [Vishal: reduce to a simple move of architectural defines only] Signed-off-by: Kirill A. Shutemov Signed-off-by: Rick Edgecombe Signed-off-by: Vishal Verma Signed-off-by: Dave Hansen Reviewed-by: Chao Gao Acked-by: Sean Christopherson Link: https://patch.msgid.link/20260402-fuller_tdx_kexec_support-v3-1-34438= d7094bf@intel.com --- arch/x86/include/asm/shared/tdx.h | 1 +- arch/x86/include/asm/shared/tdx_errno.h | 39 +++++++++++++++++++++++- arch/x86/kvm/vmx/tdx.h | 1 +- arch/x86/kvm/vmx/tdx_errno.h | 40 +------------------------ 4 files changed, 40 insertions(+), 41 deletions(-) create mode 100644 arch/x86/include/asm/shared/tdx_errno.h delete mode 100644 arch/x86/kvm/vmx/tdx_errno.h diff --git a/arch/x86/include/asm/shared/tdx.h b/arch/x86/include/asm/share= d/tdx.h index 049638e..f20e91d 100644 --- a/arch/x86/include/asm/shared/tdx.h +++ b/arch/x86/include/asm/shared/tdx.h @@ -4,6 +4,7 @@ =20 #include #include +#include =20 #define TDX_HYPERCALL_STANDARD 0 =20 diff --git a/arch/x86/include/asm/shared/tdx_errno.h b/arch/x86/include/asm= /shared/tdx_errno.h new file mode 100644 index 0000000..3c1e8ce --- /dev/null +++ b/arch/x86/include/asm/shared/tdx_errno.h @@ -0,0 +1,39 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* architectural status code for SEAMCALL */ +#ifndef _ASM_X86_SHARED_TDX_ERRNO_H +#define _ASM_X86_SHARED_TDX_ERRNO_H + +#define TDX_SEAMCALL_STATUS_MASK 0xFFFFFFFF00000000ULL + +/* + * TDX SEAMCALL Status Codes (returned in RAX) + */ +#define TDX_NON_RECOVERABLE_VCPU 0x4000000100000000ULL +#define TDX_NON_RECOVERABLE_TD 0x4000000200000000ULL +#define TDX_NON_RECOVERABLE_TD_NON_ACCESSIBLE 0x6000000500000000ULL +#define TDX_NON_RECOVERABLE_TD_WRONG_APIC_MODE 0x6000000700000000ULL +#define TDX_INTERRUPTED_RESUMABLE 0x8000000300000000ULL +#define TDX_OPERAND_INVALID 0xC000010000000000ULL +#define TDX_OPERAND_BUSY 0x8000020000000000ULL +#define TDX_PREVIOUS_TLB_EPOCH_BUSY 0x8000020100000000ULL +#define TDX_PAGE_METADATA_INCORRECT 0xC000030000000000ULL +#define TDX_VCPU_NOT_ASSOCIATED 0x8000070200000000ULL +#define TDX_KEY_GENERATION_FAILED 0x8000080000000000ULL +#define TDX_KEY_STATE_INCORRECT 0xC000081100000000ULL +#define TDX_KEY_CONFIGURED 0x0000081500000000ULL +#define TDX_NO_HKID_READY_TO_WBCACHE 0x0000082100000000ULL +#define TDX_FLUSHVP_NOT_DONE 0x8000082400000000ULL +#define TDX_EPT_WALK_FAILED 0xC0000B0000000000ULL +#define TDX_EPT_ENTRY_STATE_INCORRECT 0xC0000B0D00000000ULL +#define TDX_METADATA_FIELD_NOT_READABLE 0xC0000C0200000000ULL + +/* + * TDX module operand ID, appears in 31:0 part of error code as + * detail information + */ +#define TDX_OPERAND_ID_RCX 0x01 +#define TDX_OPERAND_ID_TDR 0x80 +#define TDX_OPERAND_ID_SEPT 0x92 +#define TDX_OPERAND_ID_TD_EPOCH 0xa9 + +#endif /* _ASM_X86_SHARED_TDX_ERRNO_H */ diff --git a/arch/x86/kvm/vmx/tdx.h b/arch/x86/kvm/vmx/tdx.h index b5cd2ff..ac8323a 100644 --- a/arch/x86/kvm/vmx/tdx.h +++ b/arch/x86/kvm/vmx/tdx.h @@ -3,7 +3,6 @@ #define __KVM_X86_VMX_TDX_H =20 #include "tdx_arch.h" -#include "tdx_errno.h" =20 #ifdef CONFIG_KVM_INTEL_TDX #include "common.h" diff --git a/arch/x86/kvm/vmx/tdx_errno.h b/arch/x86/kvm/vmx/tdx_errno.h deleted file mode 100644 index 6ff4672..0000000 --- a/arch/x86/kvm/vmx/tdx_errno.h +++ /dev/null @@ -1,40 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* architectural status code for SEAMCALL */ - -#ifndef __KVM_X86_TDX_ERRNO_H -#define __KVM_X86_TDX_ERRNO_H - -#define TDX_SEAMCALL_STATUS_MASK 0xFFFFFFFF00000000ULL - -/* - * TDX SEAMCALL Status Codes (returned in RAX) - */ -#define TDX_NON_RECOVERABLE_VCPU 0x4000000100000000ULL -#define TDX_NON_RECOVERABLE_TD 0x4000000200000000ULL -#define TDX_NON_RECOVERABLE_TD_NON_ACCESSIBLE 0x6000000500000000ULL -#define TDX_NON_RECOVERABLE_TD_WRONG_APIC_MODE 0x6000000700000000ULL -#define TDX_INTERRUPTED_RESUMABLE 0x8000000300000000ULL -#define TDX_OPERAND_INVALID 0xC000010000000000ULL -#define TDX_OPERAND_BUSY 0x8000020000000000ULL -#define TDX_PREVIOUS_TLB_EPOCH_BUSY 0x8000020100000000ULL -#define TDX_PAGE_METADATA_INCORRECT 0xC000030000000000ULL -#define TDX_VCPU_NOT_ASSOCIATED 0x8000070200000000ULL -#define TDX_KEY_GENERATION_FAILED 0x8000080000000000ULL -#define TDX_KEY_STATE_INCORRECT 0xC000081100000000ULL -#define TDX_KEY_CONFIGURED 0x0000081500000000ULL -#define TDX_NO_HKID_READY_TO_WBCACHE 0x0000082100000000ULL -#define TDX_FLUSHVP_NOT_DONE 0x8000082400000000ULL -#define TDX_EPT_WALK_FAILED 0xC0000B0000000000ULL -#define TDX_EPT_ENTRY_STATE_INCORRECT 0xC0000B0D00000000ULL -#define TDX_METADATA_FIELD_NOT_READABLE 0xC0000C0200000000ULL - -/* - * TDX module operand ID, appears in 31:0 part of error code as - * detail information - */ -#define TDX_OPERAND_ID_RCX 0x01 -#define TDX_OPERAND_ID_TDR 0x80 -#define TDX_OPERAND_ID_SEPT 0x92 -#define TDX_OPERAND_ID_TD_EPOCH 0xa9 - -#endif /* __KVM_X86_TDX_ERRNO_H */