* [PATCH] KVM: x86: fix TRACE_INCLUDE_PATH and remove -I. header search paths
@ 2019-01-25 7:32 Masahiro Yamada
2019-01-25 18:18 ` Paolo Bonzini
0 siblings, 1 reply; 2+ messages in thread
From: Masahiro Yamada @ 2019-01-25 7:32 UTC (permalink / raw)
To: Paolo Bonzini,
Radim
Kr���m������,
kvm
Cc: Masahiro Yamada, H. Peter Anvin, Borislav Petkov, x86,
linux-kernel, Thomas Gleixner, Ingo Molnar
The header search path -I. in kernel Makefiles is very suspicious;
it allows the compiler to search for headers in the top of $(srctree),
where obviously no header file exists.
The reason of having -I. here is to make the incorrectly set
TRACE_INCLUDE_PATH working.
As the comment block in include/trace/define_trace.h says,
TRACE_INCLUDE_PATH should be a relative path to the define_trace.h
Fix the TRACE_INCLUDE_PATH, and remove the iffy include paths.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
arch/x86/kvm/Makefile | 4 ----
arch/x86/kvm/trace.h | 2 +-
2 files changed, 1 insertion(+), 5 deletions(-)
diff --git a/arch/x86/kvm/Makefile b/arch/x86/kvm/Makefile
index 69b3a7c..31ecf7a 100644
--- a/arch/x86/kvm/Makefile
+++ b/arch/x86/kvm/Makefile
@@ -2,10 +2,6 @@
ccflags-y += -Iarch/x86/kvm
-CFLAGS_x86.o := -I.
-CFLAGS_svm.o := -I.
-CFLAGS_vmx.o := -I.
-
KVM := ../../../virt/kvm
kvm-y += $(KVM)/kvm_main.o $(KVM)/coalesced_mmio.o \
diff --git a/arch/x86/kvm/trace.h b/arch/x86/kvm/trace.h
index 705f40a..6432d08 100644
--- a/arch/x86/kvm/trace.h
+++ b/arch/x86/kvm/trace.h
@@ -1465,7 +1465,7 @@ TRACE_EVENT(kvm_hv_send_ipi_ex,
#endif /* _TRACE_KVM_H */
#undef TRACE_INCLUDE_PATH
-#define TRACE_INCLUDE_PATH arch/x86/kvm
+#define TRACE_INCLUDE_PATH ../../arch/x86/kvm
#undef TRACE_INCLUDE_FILE
#define TRACE_INCLUDE_FILE trace
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] KVM: x86: fix TRACE_INCLUDE_PATH and remove -I. header search paths
2019-01-25 7:32 [PATCH] KVM: x86: fix TRACE_INCLUDE_PATH and remove -I. header search paths Masahiro Yamada
@ 2019-01-25 18:18 ` Paolo Bonzini
0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2019-01-25 18:18 UTC (permalink / raw)
To: Masahiro Yamada,
Radim
Kr���m������,
kvm
Cc: H. Peter Anvin, Borislav Petkov, x86, linux-kernel,
Thomas Gleixner, Ingo Molnar
On 25/01/19 08:32, Masahiro Yamada wrote:
> The header search path -I. in kernel Makefiles is very suspicious;
> it allows the compiler to search for headers in the top of $(srctree),
> where obviously no header file exists.
>
> The reason of having -I. here is to make the incorrectly set
> TRACE_INCLUDE_PATH working.
>
> As the comment block in include/trace/define_trace.h says,
> TRACE_INCLUDE_PATH should be a relative path to the define_trace.h
>
> Fix the TRACE_INCLUDE_PATH, and remove the iffy include paths.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
>
> arch/x86/kvm/Makefile | 4 ----
> arch/x86/kvm/trace.h | 2 +-
> 2 files changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/arch/x86/kvm/Makefile b/arch/x86/kvm/Makefile
> index 69b3a7c..31ecf7a 100644
> --- a/arch/x86/kvm/Makefile
> +++ b/arch/x86/kvm/Makefile
> @@ -2,10 +2,6 @@
>
> ccflags-y += -Iarch/x86/kvm
>
> -CFLAGS_x86.o := -I.
> -CFLAGS_svm.o := -I.
> -CFLAGS_vmx.o := -I.
> -
> KVM := ../../../virt/kvm
>
> kvm-y += $(KVM)/kvm_main.o $(KVM)/coalesced_mmio.o \
> diff --git a/arch/x86/kvm/trace.h b/arch/x86/kvm/trace.h
> index 705f40a..6432d08 100644
> --- a/arch/x86/kvm/trace.h
> +++ b/arch/x86/kvm/trace.h
> @@ -1465,7 +1465,7 @@ TRACE_EVENT(kvm_hv_send_ipi_ex,
> #endif /* _TRACE_KVM_H */
>
> #undef TRACE_INCLUDE_PATH
> -#define TRACE_INCLUDE_PATH arch/x86/kvm
> +#define TRACE_INCLUDE_PATH ../../arch/x86/kvm
> #undef TRACE_INCLUDE_FILE
> #define TRACE_INCLUDE_FILE trace
>
>
Queued, thanks.
Paolo
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-01-25 18:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-25 7:32 [PATCH] KVM: x86: fix TRACE_INCLUDE_PATH and remove -I. header search paths Masahiro Yamada
2019-01-25 18:18 ` Paolo Bonzini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).