* [PATCH] x86/tdx: Explicitly include <linux/errno.h> in <asm/tdx.h>
@ 2023-06-06 3:40 Kai Huang
2023-06-06 8:56 ` Kirill A. Shutemov
2023-06-06 13:10 ` Sathyanarayanan Kuppuswamy
0 siblings, 2 replies; 6+ messages in thread
From: Kai Huang @ 2023-06-06 3:40 UTC (permalink / raw)
To: linux-kernel
Cc: Kai Huang, Dave Hansen, Kuppuswamy Sathyanarayanan,
Kirill A . Shutemov, Isaku Yamahata
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.
Fixes: cfb8ec7a31f2 ("x86/tdx: Wire up KVM hypercalls")
Suggested-by: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Isaku Yamahata <isaku.yamahata@intel.com>
Signed-off-by: Kai Huang <kai.huang@intel.com>
---
arch/x86/include/asm/tdx.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/x86/include/asm/tdx.h b/arch/x86/include/asm/tdx.h
index 28d889c9aa16..0f303c9abee8 100644
--- a/arch/x86/include/asm/tdx.h
+++ b/arch/x86/include/asm/tdx.h
@@ -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
--
2.40.1
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] x86/tdx: Explicitly include <linux/errno.h> in <asm/tdx.h>
2023-06-06 3:40 [PATCH] x86/tdx: Explicitly include <linux/errno.h> in <asm/tdx.h> Kai Huang
@ 2023-06-06 8:56 ` Kirill A. Shutemov
2023-06-06 13:10 ` Sathyanarayanan Kuppuswamy
1 sibling, 0 replies; 6+ messages in thread
From: Kirill A. Shutemov @ 2023-06-06 8:56 UTC (permalink / raw)
To: Kai Huang
Cc: linux-kernel, Dave Hansen, Kuppuswamy Sathyanarayanan,
Kirill A . Shutemov, Isaku Yamahata
On Tue, Jun 06, 2023 at 03:40:00PM +1200, Kai Huang wrote:
> 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.
>
> Fixes: cfb8ec7a31f2 ("x86/tdx: Wire up KVM hypercalls")
> Suggested-by: Dave Hansen <dave.hansen@linux.intel.com>
> Cc: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
> Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> Cc: Dave Hansen <dave.hansen@linux.intel.com>
> Cc: Isaku Yamahata <isaku.yamahata@intel.com>
> Signed-off-by: Kai Huang <kai.huang@intel.com>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
--
Kiryl Shutsemau / Kirill A. Shutemov
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] x86/tdx: Explicitly include <linux/errno.h> in <asm/tdx.h>
2023-06-06 3:40 [PATCH] x86/tdx: Explicitly include <linux/errno.h> in <asm/tdx.h> Kai Huang
2023-06-06 8:56 ` Kirill A. Shutemov
@ 2023-06-06 13:10 ` Sathyanarayanan Kuppuswamy
2023-06-06 22:17 ` Huang, Kai
1 sibling, 1 reply; 6+ messages in thread
From: Sathyanarayanan Kuppuswamy @ 2023-06-06 13:10 UTC (permalink / raw)
To: Kai Huang, linux-kernel; +Cc: Dave Hansen, Kirill A . Shutemov, Isaku Yamahata
On 6/5/23 8:40 PM, Kai Huang wrote:
> 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>
Maybe you can explicitly say "CONFIG_INTEL_TDX_GUEST is not enabled"
> 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.
Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
>
> Fixes: cfb8ec7a31f2 ("x86/tdx: Wire up KVM hypercalls")
> Suggested-by: Dave Hansen <dave.hansen@linux.intel.com>
> Cc: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
> Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> Cc: Dave Hansen <dave.hansen@linux.intel.com>
> Cc: Isaku Yamahata <isaku.yamahata@intel.com>
> Signed-off-by: Kai Huang <kai.huang@intel.com>
> ---
> arch/x86/include/asm/tdx.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/x86/include/asm/tdx.h b/arch/x86/include/asm/tdx.h
> index 28d889c9aa16..0f303c9abee8 100644
> --- a/arch/x86/include/asm/tdx.h
> +++ b/arch/x86/include/asm/tdx.h
> @@ -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
--
Sathyanarayanan Kuppuswamy
Linux Kernel Developer
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] x86/tdx: Explicitly include <linux/errno.h> in <asm/tdx.h>
2023-06-06 13:10 ` Sathyanarayanan Kuppuswamy
@ 2023-06-06 22:17 ` Huang, Kai
2023-06-06 22:45 ` Kirill A. Shutemov
0 siblings, 1 reply; 6+ messages in thread
From: Huang, Kai @ 2023-06-06 22:17 UTC (permalink / raw)
To: sathyanarayanan.kuppuswamy, linux-kernel
Cc: kirill.shutemov, dave.hansen, Yamahata, Isaku
On Tue, 2023-06-06 at 06:10 -0700, Sathyanarayanan Kuppuswamy wrote:
>
> On 6/5/23 8:40 PM, Kai Huang wrote:
> > 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>
>
> Maybe you can explicitly say "CONFIG_INTEL_TDX_GUEST is not enabled"
It also can be disabled by !CONFIG_KVM_GUEST.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] x86/tdx: Explicitly include <linux/errno.h> in <asm/tdx.h>
2023-06-06 22:17 ` Huang, Kai
@ 2023-06-06 22:45 ` Kirill A. Shutemov
2023-06-06 22:50 ` Huang, Kai
0 siblings, 1 reply; 6+ messages in thread
From: Kirill A. Shutemov @ 2023-06-06 22:45 UTC (permalink / raw)
To: Huang, Kai
Cc: sathyanarayanan.kuppuswamy, linux-kernel, kirill.shutemov,
dave.hansen, Yamahata, Isaku, Borislav Petkov
On Tue, Jun 06, 2023 at 10:17:53PM +0000, Huang, Kai wrote:
> On Tue, 2023-06-06 at 06:10 -0700, Sathyanarayanan Kuppuswamy wrote:
> >
> > On 6/5/23 8:40 PM, Kai Huang wrote:
> > > 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>
> >
> > Maybe you can explicitly say "CONFIG_INTEL_TDX_GUEST is 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
--
Kiryl Shutsemau / Kirill A. Shutemov
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] x86/tdx: Explicitly include <linux/errno.h> in <asm/tdx.h>
2023-06-06 22:45 ` Kirill A. Shutemov
@ 2023-06-06 22:50 ` Huang, Kai
0 siblings, 0 replies; 6+ messages in thread
From: Huang, Kai @ 2023-06-06 22:50 UTC (permalink / raw)
To: kirill
Cc: sathyanarayanan.kuppuswamy, kirill.shutemov, linux-kernel, bp,
dave.hansen, Yamahata, Isaku
On Wed, 2023-06-07 at 01:45 +0300, Kirill A. Shutemov wrote:
> On Tue, Jun 06, 2023 at 10:17:53PM +0000, Huang, Kai wrote:
> > On Tue, 2023-06-06 at 06:10 -0700, Sathyanarayanan Kuppuswamy wrote:
> > >
> > > On 6/5/23 8:40 PM, Kai Huang wrote:
> > > > 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>
> > >
> > > Maybe you can explicitly say "CONFIG_INTEL_TDX_GUEST is 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
>
Wonderful, then we can drop this one :)
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-06-06 22:51 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-06 3:40 [PATCH] x86/tdx: Explicitly include <linux/errno.h> in <asm/tdx.h> Kai Huang
2023-06-06 8:56 ` Kirill A. Shutemov
2023-06-06 13:10 ` Sathyanarayanan Kuppuswamy
2023-06-06 22:17 ` Huang, Kai
2023-06-06 22:45 ` Kirill A. Shutemov
2023-06-06 22:50 ` Huang, Kai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®