Skip to contentSkip to conversation

x86/asm/msr: Retract msr-index.h

PATCH In review Borislav Petkov 4 participants 9 messages Jun 3, 2015 – Jul 16, 2015

Subsystems (2)
lore
Share & tools
lore

Borislav Petkov

author maintainer
#0 lore raw

PATCH 1/1 x86/asm/msr: Retract msr-index.h

From: Borislav Petkov <[email protected]>

This header containing all MSRs and respective bit definitions got exported to userspace in conjunction with the big uapi shuffle.

But, it doesn't have anything to do in the uapi headers because userspace can do its own MSR defines and exporting them from the kernel blocks us from doing cleanups/renames in that header. Which is ridiculous - it is not kernel's job to export such a header and keep MSRs list and their names stable.

Cc Andrew Morton <[email protected]>
Cc Andy Lutomirski <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc "Peter Zijlstra (Intel)" <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 arch/x86/include/{uapi => }/asm/msr-index.h | 0
 tools/power/x86/turbostat/Makefile          | 2 +-
 2 files changed, 1 insertion(+), 1 deletion(-)
 rename arch/x86/include/{uapi => }/asm/msr-index.h (100%)
arch/x86/include/asm/msr-index.h renamed from arch/x86/include/uapi/asm/msr-index.h +0 -0
similarity index 100%
rename from arch/x86/include/uapi/asm/msr-index.h
rename to arch/x86/include/asm/msr-index.h
tools/power/x86/turbostat/Makefile +1 -1
index 4039854560d0..e367b1a85d70 100644
@@ -9,7 +9,7 @@ endif
 
 turbostat : turbostat.c
 CFLAGS +=	-Wall
-CFLAGS +=	-DMSRHEADER='"../../../../arch/x86/include/uapi/asm/msr-index.h"'
+CFLAGS +=	-DMSRHEADER='"../../../../arch/x86/include/asm/msr-index.h"'
 
 %: %.c
 	@mkdir -p $(BUILD_OUTPUT)
Signature · 1 line
2.3.5
author maintainer
#1 lore raw
Quoted 8 lines · Borislav Petkov

This header containing all MSRs and respective bit definitions got exported to userspace in conjunction with the big uapi shuffle.

But, it doesn't have anything to do in the uapi headers because userspace can do its own MSR defines and exporting them from the kernel blocks us from doing cleanups/renames in that header. Which is ridiculous - it is not kernel's job to export such a header and keep MSRs list and their names stable.

Here's v2. Needed to *not* include it into uapi/asm/msr.h either.

---
From: Borislav Petkov <[email protected]>
Date: Wed, 3 Jun 2015 14:37:05 +0200
Subject: [PATCH] x86/asm/msr: Retract msr-index.h

This header containing all MSRs and respective bit definitions got exported to userspace in conjunction with the big uapi shuffle.

But, it doesn't have anything to do in the uapi headers because userspace can do its own MSR defines and exporting them from the kernel blocks us from doing cleanups/renames in that header. Which is ridiculous - it is not kernel's job to export such a header and keep MSRs list and their names stable.

Cc Andrew Morton <[email protected]>
Cc Andy Lutomirski <[email protected]>
Cc David Howells <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc "Peter Zijlstra (Intel)" <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 arch/x86/include/{uapi => }/asm/msr-index.h | 0
 arch/x86/include/asm/msr.h                  | 3 ++-
 arch/x86/include/uapi/asm/msr.h             | 2 --
 tools/power/x86/turbostat/Makefile          | 2 +-
 4 files changed, 3 insertions(+), 4 deletions(-)
 rename arch/x86/include/{uapi => }/asm/msr-index.h (100%)
arch/x86/include/asm/msr-index.h renamed from arch/x86/include/uapi/asm/msr-index.h +0 -0
similarity index 100%
rename from arch/x86/include/uapi/asm/msr-index.h
rename to arch/x86/include/asm/msr-index.h
arch/x86/include/asm/msr.h +2 -1
index de36f22eb0b9..441ecf83d81a 100644
@@ -1,13 +1,14 @@
 #ifndef _ASM_X86_MSR_H
 #define _ASM_X86_MSR_H
 
-#include <uapi/asm/msr.h>
+#include "msr-index.h"
 
 #ifndef __ASSEMBLY__
 
 #include <asm/asm.h>
 #include <asm/errno.h>
 #include <asm/cpumask.h>
+#include <uapi/asm/msr.h>
 
 struct msr {
 	union {
arch/x86/include/uapi/asm/msr.h +0 -2
index 155e51048fa4..c41f4fe25483 100644
@@ -1,8 +1,6 @@
 #ifndef _UAPI_ASM_X86_MSR_H
 #define _UAPI_ASM_X86_MSR_H
 
-#include <asm/msr-index.h>
-
 #ifndef __ASSEMBLY__
 
 #include <linux/types.h>
tools/power/x86/turbostat/Makefile +1 -1
index 4039854560d0..e367b1a85d70 100644
@@ -9,7 +9,7 @@ endif
 
 turbostat : turbostat.c
 CFLAGS +=	-Wall
-CFLAGS +=	-DMSRHEADER='"../../../../arch/x86/include/uapi/asm/msr-index.h"'
+CFLAGS +=	-DMSRHEADER='"../../../../arch/x86/include/asm/msr-index.h"'
 
 %: %.c
 	@mkdir -p $(BUILD_OUTPUT)
Signature · 8 lines
2.3.5

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.
--
#2 lore raw
Quoted 11 lines · Borislav Petkov
Quoted 8 lines · Borislav Petkov

This header containing all MSRs and respective bit definitions got exported to userspace in conjunction with the big uapi shuffle.

But, it doesn't have anything to do in the uapi headers because userspace can do its own MSR defines and exporting them from the kernel blocks us from doing cleanups/renames in that header. Which is ridiculous - it is not kernel's job to export such a header and keep MSRs list and their names stable.

Here's v2. Needed to *not* include it into uapi/asm/msr.h either.

I really like the patch, but the description is awful.

How about: "x86/uapi: <asm/msr.h> is not a UAPI"

-hpa

author maintainer
#3 lore raw
Quoted 3 lines · H. Peter Anvin

I really like the patch, but the description is awful.

How about: "x86/uapi: <asm/msr.h> is not a UAPI"

Sure. Commit text needs improvement too?

Signature · 5 lines
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.
--
#4 lore raw
Quoted 7 lines · Borislav Petkov
Quoted 3 lines · H. Peter Anvin

I really like the patch, but the description is awful.

How about: "x86/uapi: <asm/msr.h> is not a UAPI"

Sure. Commit text needs improvement too?

The commit text is fine, IMO.

-hpa

#5 lore raw
In reply to H. Peter Anvin
Quoted 11 lines · H. Peter Anvin
Quoted 10 lines · Borislav Petkov
Quoted 8 lines · Borislav Petkov

This header containing all MSRs and respective bit definitions got exported to userspace in conjunction with the big uapi shuffle.

But, it doesn't have anything to do in the uapi headers because userspace can do its own MSR defines and exporting them from the kernel blocks us from doing cleanups/renames in that header. Which is ridiculous - it is not kernel's job to export such a header and keep MSRs list and their names stable.

Quoted 5 lines
Quoted 1 line

Here's v2. Needed to *not* include it into uapi/asm/msr.h either.

I really like the patch, but the description is awful.

How about: "x86/uapi: <asm/msr.h> is not a UAPI"

So a small nit: a simple statement of fact is not really a proper commit title. A commit title should express what the patch _does_.

Missing leading verbs are really passive-aggressive on the reader of a flow of commit titles - such as when reading a short log or a one-line git log.

Something like:

x86/uapi: Remove <asm/msr.h> from the list of exported UAPI headers

or so would work fine with me.

Thanks!

Ingo

author maintainer
#6 lore raw
Quoted 5 lines · Ingo Molnar

Something like:

x86/uapi: Remove <asm/msr.h> from the list of exported UAPI headers

or so would work fine with me.

I did this - this is maximally descriptive IMO. :-)

---
From: Borislav Petkov <[email protected]>
Date: Wed, 3 Jun 2015 14:37:05 +0200
Subject: [PATCH] x86/uapi: Do not export <asm/msr-index.h> as part of the user API headers

This header containing all MSRs and respective bit definitions got exported to userspace in conjunction with the big UAPI shuffle.

But, it doesn't belong in the UAPI headers because userspace can do its own MSR defines and exporting them from the kernel blocks us from doing cleanups/renames in that header. Which is ridiculous - it is not kernel's job to export such a header and keep MSRs list and their names stable.

Cc Andrew Morton <[email protected]>
Cc Andy Lutomirski <[email protected]>
Cc David Howells <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc "Peter Zijlstra (Intel)" <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 arch/x86/include/{uapi => }/asm/msr-index.h | 0
 arch/x86/include/asm/msr.h                  | 3 ++-
 arch/x86/include/uapi/asm/msr.h             | 2 --
 tools/power/x86/turbostat/Makefile          | 2 +-
 4 files changed, 3 insertions(+), 4 deletions(-)
 rename arch/x86/include/{uapi => }/asm/msr-index.h (100%)
arch/x86/include/asm/msr-index.h renamed from arch/x86/include/uapi/asm/msr-index.h +0 -0
similarity index 100%
rename from arch/x86/include/uapi/asm/msr-index.h
rename to arch/x86/include/asm/msr-index.h
arch/x86/include/asm/msr.h +2 -1
index de36f22eb0b9..441ecf83d81a 100644
@@ -1,13 +1,14 @@
 #ifndef _ASM_X86_MSR_H
 #define _ASM_X86_MSR_H
 
-#include <uapi/asm/msr.h>
+#include "msr-index.h"
 
 #ifndef __ASSEMBLY__
 
 #include <asm/asm.h>
 #include <asm/errno.h>
 #include <asm/cpumask.h>
+#include <uapi/asm/msr.h>
 
 struct msr {
 	union {
arch/x86/include/uapi/asm/msr.h +0 -2
index 155e51048fa4..c41f4fe25483 100644
@@ -1,8 +1,6 @@
 #ifndef _UAPI_ASM_X86_MSR_H
 #define _UAPI_ASM_X86_MSR_H
 
-#include <asm/msr-index.h>
-
 #ifndef __ASSEMBLY__
 
 #include <linux/types.h>
tools/power/x86/turbostat/Makefile +1 -1
index 4039854560d0..e367b1a85d70 100644
@@ -9,7 +9,7 @@ endif
 
 turbostat : turbostat.c
 CFLAGS +=	-Wall
-CFLAGS +=	-DMSRHEADER='"../../../../arch/x86/include/uapi/asm/msr-index.h"'
+CFLAGS +=	-DMSRHEADER='"../../../../arch/x86/include/asm/msr-index.h"'
 
 %: %.c
 	@mkdir -p $(BUILD_OUTPUT)
Signature · 8 lines
2.3.5

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.
--
#7 lore raw
Quoted 5 lines · Borislav Petkov
Quoted 4 lines · Ingo Molnar

Something like:

x86/uapi: Remove <asm/msr.h> from the list of exported UAPI headers

Quoted 8 lines
Quoted 1 line

or so would work fine with me.

I did this - this is maximally descriptive IMO. :-)

---
From: Borislav Petkov <[email protected]>
Date: Wed, 3 Jun 2015 14:37:05 +0200
Subject: [PATCH] x86/uapi: Do not export <asm/msr-index.h> as part of the user API headers

This sounds good to me too.

Thanks,

Ingo

maintainer Acked-by
#8 lore raw
In reply to Borislav Petkov
Quoted 1 line
 tools/power/x86/turbostat/Makefile          | 2 +-

One of the reasons I put turbostat in the kernel tree was so that it would be easy
to have 1 copy of the truth for MSR definitions. I'm okay with treating it like a kernel file
and following any MSR name changes in the kernel.
That is much more attractive to me than managing a 2nd set of definitions in user-space that would diverge.

thanks,
-Len Brown
Intel Open Source Technology Center