x86/tdx: Explicitly include <linux/errno.h> in <asm/tdx.h>
Subsystems (2)
PATCH 1/1 x86/tdx: Explicitly include <linux/errno.h> in <asm/tdx.h>
Currently, in <asm/tdx.h> tdx_kvm_hypercall() simply returns -ENODEV when TDX guest isn't enabled in the Kconfig w/o having <linux/errno.h> header explicitly included. Although the current code doesn't have build error, in general it is a good practice to explicitly include the header to make sure any future patch which uses <asm/tdx.h> won't get build error due to error code not being defined.
--- arch/x86/include/asm/tdx.h | 1 + 1 file changed, 1 insertion(+)
arch/x86/include/asm/tdx.h +1 -0
@@ -5,6 +5,7 @@#include <linux/init.h> #include <linux/bits.h> +#include <linux/errno.h> #include <asm/ptrace.h> #include <asm/shared/tdx.h>
base-commit: 122333d6bd229af279cdb35d1b874b71b3b9ccfb
Signature · 1 line
2.40.1
Quoted 7 lines · Kai Huang
Currently, in <
asm/tdx.h>tdx_kvm_hypercall()simply returns-ENODEVwhen TDX guest isn't enabled in theKconfigw/o having <linux/errno.h> header explicitly included. Although the current code doesn't have build error, in general it is a good practice to explicitly include the header to make sure any future patch which uses <asm/tdx.h> won't get build error due to error code not being defined.
Quoted 7 lines
Fixes cfb8ec7a31f2 ("x86/tdx: Wire up KVM hypercalls")Suggested-by Dave Hansen <[email protected]>Cc Kuppuswamy Sathyanarayanan <[email protected]>Cc Kirill A. Shutemov <[email protected]>Cc Dave Hansen <[email protected]>Cc Isaku Yamahata <[email protected]>Signed-off-by Kai Huang <[email protected]>
Signature · 1 line
Kiryl Shutsemau / Kirill A. Shutemov
Quoted 2 lines · Kai Huang
Currently, in <
asm/tdx.h>tdx_kvm_hypercall()simply returns-ENODEVwhen TDX guest isn't enabled in theKconfigw/o having <linux/errno.h>
Maybe you can explicitly say "CONFIG_INTEL_TDX_GUEST is not enabled"
Quoted 4 lines
header explicitly included. Although the current code doesn't have build error, in general it is a good practice to explicitly include the header to make sure any future patch which uses <
asm/tdx.h> won't get build error due to error code not being defined.
Otherwise, it looks fine.
Quoted 26 lines
Fixes cfb8ec7a31f2 ("x86/tdx: Wire up KVM hypercalls")Suggested-by Dave Hansen <[email protected]>Cc Kuppuswamy Sathyanarayanan <[email protected]>Cc Kirill A. Shutemov <[email protected]>Cc Dave Hansen <[email protected]>Cc Isaku Yamahata <[email protected]>Signed-off-by Kai Huang <[email protected]>--- arch/x86/include/asm/tdx.h | 1 + 1 file changed, 1 insertion(+)arch/x86/include/asm/tdx.h +1
-0@@ -5,6 +5,7 @@#include <linux/init.h> #include <linux/bits.h> +#include <linux/errno.h> #include <asm/ptrace.h> #include <asm/shared/tdx.h> base-commit:
122333d6bd229af279cdb35d1b874b71b3b9ccfb
Signature · 2 lines
Sathyanarayanan Kuppuswamy Linux Kernel Developer
Quoted 6 lines · Sathyanarayanan Kuppuswamy
Quoted 2 lines · Kai Huang
Currently, in <
asm/tdx.h>tdx_kvm_hypercall()simply returns-ENODEVwhen TDX guest isn't enabled in theKconfigw/o having <linux/errno.h>Maybe you can explicitly say "
CONFIG_INTEL_TDX_GUESTis not enabled"
It also can be disabled by !CONFIG_KVM_GUEST.
Quoted 9 lines · Kai
Quoted 6 lines · Sathyanarayanan Kuppuswamy
Quoted 2 lines · Kai Huang
Currently, in <
asm/tdx.h>tdx_kvm_hypercall()simply returns-ENODEVwhen TDX guest isn't enabled in theKconfigw/o having <linux/errno.h>Maybe you can explicitly say "
CONFIG_INTEL_TDX_GUESTis not enabled"It also can be disabled by !CONFIG_KVM_GUEST.
Borislav has already fixed it during unaccepted memory patchset application. He used <asm/errno.h>, not <linux/errno.h>.
See [1] and [2].
[1] https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?id=75d090fd167acab4d7eda7e2b65729e877c0fd64
[2] https://lore.kernel.org/all/20230606161606.GDZH9bxhrGnFkaLl2A@fat_crate.local
Signature · 1 line
Kiryl Shutsemau / Kirill A. Shutemov
Quoted 11 lines · Kirill A. Shutemov
Quoted 9 lines · Kai
Quoted 6 lines · Sathyanarayanan Kuppuswamy
Quoted 2 lines · Kai Huang
Currently, in <
asm/tdx.h>tdx_kvm_hypercall()simply returns-ENODEVwhen TDX guest isn't enabled in theKconfigw/o having <linux/errno.h>Maybe you can explicitly say "
CONFIG_INTEL_TDX_GUESTis not enabled"It also can be disabled by !CONFIG_KVM_GUEST.
Quoted 8 lines
Borislav has already fixed it during unaccepted memory patchset application. He used <
asm/errno.h>, not <linux/errno.h>.See [1] and [2].
[1] https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?id=75d090fd167acab4d7eda7e2b65729e877c0fd64
[2] https://lore.kernel.org/all/20230606161606.GDZH9bxhrGnFkaLl2A@fat_crate.local
Wonderful, then we can drop this one :)