All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] tools headers UAPI: Sync linux/kvm.h with the kernel sources
@ 2022-02-06 12:01 arnaldo.melo
  0 siblings, 0 replies; 7+ messages in thread
From: arnaldo.melo @ 2022-02-06 12:01 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Janosch Frank, Linux Kernel Mailing List

Just FYI, I'm carrying this in the perf tools tree.

---

To pick the changes in:

  f6c6804c43fa18d3 ("kvm: Move KVM_GET_XSAVE2 IOCTL definition at the end of kvm.h")

That just rebuilds perf, as these patches don't add any new KVM ioctl to
be harvested for the the 'perf trace' ioctl syscall argument
beautifiers.

This is also by now used by tools/testing/selftests/kvm/, a simple test
build succeeded.

This silences this perf build warning:

  Warning: Kernel ABI header at 'tools/include/uapi/linux/kvm.h' differs from latest version at 'include/uapi/linux/kvm.h'
  diff -u tools/include/uapi/linux/kvm.h include/uapi/linux/kvm.h

Cc: Janosch Frank <frankja@linux.ibm.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/include/uapi/linux/kvm.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/include/uapi/linux/kvm.h b/tools/include/uapi/linux/kvm.h
index b46bcdb0cab1a369..5191b57e156220bd 100644
--- a/tools/include/uapi/linux/kvm.h
+++ b/tools/include/uapi/linux/kvm.h
@@ -1624,9 +1624,6 @@ struct kvm_enc_region {
 #define KVM_S390_NORMAL_RESET	_IO(KVMIO,   0xc3)
 #define KVM_S390_CLEAR_RESET	_IO(KVMIO,   0xc4)
 
-/* Available with KVM_CAP_XSAVE2 */
-#define KVM_GET_XSAVE2		  _IOR(KVMIO,  0xcf, struct kvm_xsave)
-
 struct kvm_s390_pv_sec_parm {
 	__u64 origin;
 	__u64 length;
@@ -2048,4 +2045,7 @@ struct kvm_stats_desc {
 
 #define KVM_GET_STATS_FD  _IO(KVMIO,  0xce)
 
+/* Available with KVM_CAP_XSAVE2 */
+#define KVM_GET_XSAVE2		  _IOR(KVMIO,  0xcf, struct kvm_xsave)
+
 #endif /* __LINUX_KVM_H */
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/1] tools headers UAPI: Sync linux/kvm.h with the kernel sources
  2022-07-19 14:45   ` Arnaldo Carvalho de Melo
@ 2022-07-19 15:55     ` Ian Rogers
  0 siblings, 0 replies; 7+ messages in thread
From: Ian Rogers @ 2022-07-19 15:55 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Paolo Bonzini, Adrian Hunter, Jiri Olsa, Namhyung Kim, linux-kernel

On Tue, Jul 19, 2022 at 7:45 AM Arnaldo Carvalho de Melo
<acme@kernel.org> wrote:
>
> Em Tue, Jul 19, 2022 at 03:15:58PM +0200, Paolo Bonzini escreveu:
> > On 7/17/22 15:13, Arnaldo Carvalho de Melo wrote:
> > > tldr; Just FYI, I'm carrying this on the perf tools tree.
> >
> > Thanks, I'll add a sync patch myself to the KVM tree.  Do you have a script
> > to do that?
>
> we have tools/perf/check-headers.sh that flags differences, then to
> address it I copy and send a message, yeah, some scripting here would
> help some.

In the past I've copied things over and there have been complaints
that the commit history isn't copied over. If we script this could we
also scrape the commit messages?

Thanks,
Ian

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/1] tools headers UAPI: Sync linux/kvm.h with the kernel sources
  2022-07-19 13:15 ` Paolo Bonzini
@ 2022-07-19 14:45   ` Arnaldo Carvalho de Melo
  2022-07-19 15:55     ` Ian Rogers
  0 siblings, 1 reply; 7+ messages in thread
From: Arnaldo Carvalho de Melo @ 2022-07-19 14:45 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Adrian Hunter, Ian Rogers, Jiri Olsa, Namhyung Kim, linux-kernel

Em Tue, Jul 19, 2022 at 03:15:58PM +0200, Paolo Bonzini escreveu:
> On 7/17/22 15:13, Arnaldo Carvalho de Melo wrote:
> > tldr; Just FYI, I'm carrying this on the perf tools tree.
> 
> Thanks, I'll add a sync patch myself to the KVM tree.  Do you have a script
> to do that?

we have tools/perf/check-headers.sh that flags differences, then to
address it I copy and send a message, yeah, some scripting here would
help some.

- Arnaldo

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/1] tools headers UAPI: Sync linux/kvm.h with the kernel sources
  2022-07-17 13:13 Arnaldo Carvalho de Melo
@ 2022-07-19 13:15 ` Paolo Bonzini
  2022-07-19 14:45   ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 7+ messages in thread
From: Paolo Bonzini @ 2022-07-19 13:15 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Adrian Hunter, Ian Rogers, Jiri Olsa, Namhyung Kim, linux-kernel

On 7/17/22 15:13, Arnaldo Carvalho de Melo wrote:
> tldr; Just FYI, I'm carrying this on the perf tools tree.

Thanks, I'll add a sync patch myself to the KVM tree.  Do you have a 
script to do that?

Paolo


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/1] tools headers UAPI: Sync linux/kvm.h with the kernel sources
@ 2022-07-17 13:13 Arnaldo Carvalho de Melo
  2022-07-19 13:15 ` Paolo Bonzini
  0 siblings, 1 reply; 7+ messages in thread
From: Arnaldo Carvalho de Melo @ 2022-07-17 13:13 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Adrian Hunter, Ian Rogers, Jiri Olsa, Namhyung Kim, linux-kernel

tldr; Just FYI, I'm carrying this on the perf tools tree.

- Arnaldo

Full explanation:

There used not to be copies, with tools/ code using kernel headers
directly. From time to time tools/perf/ broke due to legitimate kernel
hacking. At some point Linus complained about such direct usage. Then we
adopted the current model.

The way these headers are used in perf are not restricted to just
including them to compile something.

There are sometimes used in scripts that convert defines into string
tables, etc, so some change may break one of these scripts, or new MSRs
may use some different #define pattern, etc.

E.g.:

  $ ls -1 tools/perf/trace/beauty/*.sh | head -5
  tools/perf/trace/beauty/arch_errno_names.sh
  tools/perf/trace/beauty/drm_ioctl.sh
  tools/perf/trace/beauty/fadvise.sh
  tools/perf/trace/beauty/fsconfig.sh
  tools/perf/trace/beauty/fsmount.sh
  $
  $ tools/perf/trace/beauty/fadvise.sh
  static const char *fadvise_advices[] = {
  	[0] = "NORMAL",
  	[1] = "RANDOM",
  	[2] = "SEQUENTIAL",
  	[3] = "WILLNEED",
  	[4] = "DONTNEED",
  	[5] = "NOREUSE",
  };
  $

The tools/perf/check-headers.sh script, part of the tools/ build
process, points out changes in the original files.

So its important not to touch the copies in tools/ when doing changes in
the original kernel headers, that will be done later, when
check-headers.sh inform about the change to the perf tools hackers.

---

To pick the changes in:

  1b870fa5573e260b ("kvm: stats: tell userspace which values are boolean")

That just rebuilds perf, as these patches don't add any new KVM ioctl to
be harvested for the the 'perf trace' ioctl syscall argument
beautifiers.

This is also by now used by tools/testing/selftests/kvm/, a simple test
build succeeded.

This silences this perf build warning:

  Warning: Kernel ABI header at 'tools/include/uapi/linux/kvm.h' differs from latest version at 'include/uapi/linux/kvm.h'
  diff -u tools/include/uapi/linux/kvm.h include/uapi/linux/kvm.h

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Link: http://lore.kernel.org/lkml/YnE5BIweGmCkpOTN@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/include/uapi/linux/kvm.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/include/uapi/linux/kvm.h b/tools/include/uapi/linux/kvm.h
index 5088bd9f1922851f..811897dadcae259f 100644
--- a/tools/include/uapi/linux/kvm.h
+++ b/tools/include/uapi/linux/kvm.h
@@ -2083,6 +2083,7 @@ struct kvm_stats_header {
 #define KVM_STATS_UNIT_BYTES		(0x1 << KVM_STATS_UNIT_SHIFT)
 #define KVM_STATS_UNIT_SECONDS		(0x2 << KVM_STATS_UNIT_SHIFT)
 #define KVM_STATS_UNIT_CYCLES		(0x3 << KVM_STATS_UNIT_SHIFT)
+#define KVM_STATS_UNIT_BOOLEAN		(0x4 << KVM_STATS_UNIT_SHIFT)
 #define KVM_STATS_UNIT_MAX		KVM_STATS_UNIT_CYCLES
 
 #define KVM_STATS_BASE_SHIFT		8
-- 
2.36.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/1] tools headers UAPI: Sync linux/kvm.h with the kernel sources
  2022-05-03 14:15 Arnaldo Carvalho de Melo
@ 2022-05-03 14:16 ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 7+ messages in thread
From: Arnaldo Carvalho de Melo @ 2022-05-03 14:16 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Adrian Hunter, Jiri Olsa, Namhyung Kim, Linux Kernel Mailing List

Em Tue, May 03, 2022 at 11:15:32AM -0300, Arnaldo Carvalho de Melo escreveu:
> To pick the changes in:
> 
>   d495f942f40aa412 ("KVM: fix bad user ABI for KVM_EXIT_SYSTEM_EVENT")

Ah, this is just FYI, I'm carrying it in the perf tools tree already.

- Arnaldo
 
> That just rebuilds perf, as these patches don't add any new KVM ioctl to
> be harvested for the the 'perf trace' ioctl syscall argument
> beautifiers.
> 
> This is also by now used by tools/testing/selftests/kvm/, a simple test
> build succeeded.
> 
> This silences this perf build warning:
> 
>   Warning: Kernel ABI header at 'tools/include/uapi/linux/kvm.h' differs from latest version at 'include/uapi/linux/kvm.h'
>   diff -u tools/include/uapi/linux/kvm.h include/uapi/linux/kvm.h
> 
> Cc: Adrian Hunter <adrian.hunter@intel.com>
> Cc: Jiri Olsa <jolsa@kernel.org>
> Cc: Namhyung Kim <namhyung@kernel.org>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Link: http://lore.kernel.org/lkml/
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> ---
>  tools/include/uapi/linux/kvm.h | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/include/uapi/linux/kvm.h b/tools/include/uapi/linux/kvm.h
> index 91a6fe4e02c08c4b..6a184d260c7f2e17 100644
> --- a/tools/include/uapi/linux/kvm.h
> +++ b/tools/include/uapi/linux/kvm.h
> @@ -445,7 +445,13 @@ struct kvm_run {
>  #define KVM_SYSTEM_EVENT_RESET          2
>  #define KVM_SYSTEM_EVENT_CRASH          3
>  			__u32 type;
> -			__u64 flags;
> +			__u32 ndata;
> +			union {
> +#ifndef __KERNEL__
> +				__u64 flags;
> +#endif
> +				__u64 data[16];
> +			};
>  		} system_event;
>  		/* KVM_EXIT_S390_STSI */
>  		struct {
> @@ -1144,6 +1150,8 @@ struct kvm_ppc_resize_hpt {
>  #define KVM_CAP_S390_MEM_OP_EXTENSION 211
>  #define KVM_CAP_PMU_CAPABILITY 212
>  #define KVM_CAP_DISABLE_QUIRKS2 213
> +/* #define KVM_CAP_VM_TSC_CONTROL 214 */
> +#define KVM_CAP_SYSTEM_EVENT_DATA 215
>  
>  #ifdef KVM_CAP_IRQ_ROUTING
>  
> -- 
> 2.35.1
> 

-- 

- Arnaldo

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/1] tools headers UAPI: Sync linux/kvm.h with the kernel sources
@ 2022-05-03 14:15 Arnaldo Carvalho de Melo
  2022-05-03 14:16 ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 7+ messages in thread
From: Arnaldo Carvalho de Melo @ 2022-05-03 14:15 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Adrian Hunter, Jiri Olsa, Namhyung Kim, Linux Kernel Mailing List

To pick the changes in:

  d495f942f40aa412 ("KVM: fix bad user ABI for KVM_EXIT_SYSTEM_EVENT")

That just rebuilds perf, as these patches don't add any new KVM ioctl to
be harvested for the the 'perf trace' ioctl syscall argument
beautifiers.

This is also by now used by tools/testing/selftests/kvm/, a simple test
build succeeded.

This silences this perf build warning:

  Warning: Kernel ABI header at 'tools/include/uapi/linux/kvm.h' differs from latest version at 'include/uapi/linux/kvm.h'
  diff -u tools/include/uapi/linux/kvm.h include/uapi/linux/kvm.h

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Link: http://lore.kernel.org/lkml/
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/include/uapi/linux/kvm.h | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/tools/include/uapi/linux/kvm.h b/tools/include/uapi/linux/kvm.h
index 91a6fe4e02c08c4b..6a184d260c7f2e17 100644
--- a/tools/include/uapi/linux/kvm.h
+++ b/tools/include/uapi/linux/kvm.h
@@ -445,7 +445,13 @@ struct kvm_run {
 #define KVM_SYSTEM_EVENT_RESET          2
 #define KVM_SYSTEM_EVENT_CRASH          3
 			__u32 type;
-			__u64 flags;
+			__u32 ndata;
+			union {
+#ifndef __KERNEL__
+				__u64 flags;
+#endif
+				__u64 data[16];
+			};
 		} system_event;
 		/* KVM_EXIT_S390_STSI */
 		struct {
@@ -1144,6 +1150,8 @@ struct kvm_ppc_resize_hpt {
 #define KVM_CAP_S390_MEM_OP_EXTENSION 211
 #define KVM_CAP_PMU_CAPABILITY 212
 #define KVM_CAP_DISABLE_QUIRKS2 213
+/* #define KVM_CAP_VM_TSC_CONTROL 214 */
+#define KVM_CAP_SYSTEM_EVENT_DATA 215
 
 #ifdef KVM_CAP_IRQ_ROUTING
 
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-07-19 15:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-06 12:01 [PATCH 1/1] tools headers UAPI: Sync linux/kvm.h with the kernel sources arnaldo.melo
2022-05-03 14:15 Arnaldo Carvalho de Melo
2022-05-03 14:16 ` Arnaldo Carvalho de Melo
2022-07-17 13:13 Arnaldo Carvalho de Melo
2022-07-19 13:15 ` Paolo Bonzini
2022-07-19 14:45   ` Arnaldo Carvalho de Melo
2022-07-19 15:55     ` Ian Rogers

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.