Skip to contentSkip to conversation

kvm-kmod: Compat fixes & enhancements

PATCH In review Jan Kiszka 4 participants 28 messages May 26, 2009 – May 27, 2009

Subsystems (2)
lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

cover kvm-kmod: Compat fixes & enhancements

The is a flush of my current queue against kvm-kmod. Some are reposts, some are split-ups, and a few are new (specifically the MCE fixes). I did not include patches that you reported to have already in your queue.

Find the patches also at git://git.kiszka.org/kvm-kmod.git queue

Jan Kiszka (8):
kvm-kmod: Allow to override sync source
kvm-kmod: Include asm/uaccess.h on pre-2.6.18 kernels
kvm-kmod: Include relayfs_fs.h on pre-2.6.17 kernels
kvm-kmod: Provide flush_work compat wrapper
kvm-kmod: Fix msi_enabled patching
kvm-kmod: Add eventfd.c to patch list
kvm-kmod: x86: Add MSR_IA32_TSC compat define
kvm-kmod: x86: Add MCE compat defines

 Makefile                      |    2 +-
 external-module-compat-comm.h |   17 +++++++++++++++++
 sync                          |   22 ++++++++++++++--------
 x86/external-module-compat.h  |   12 ++++++++++++
 4 files changed, 44 insertions(+), 9 deletions(-)

--
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux

author
#1 lore raw

PATCH 1/8 kvm-kmod: Allow to override sync source

In order to allow sync'ing the kmod dir against arbitrary kernels trees, extend the sync script to accept alternative paths and adjust the Makefile accordingly.

Changes in v2:
- drop KVM_VERSION override
- make use of set_defaults
- option help texts

---

 Makefile |    2 +-
 sync     |   16 +++++++++++-----
 2 files changed, 12 insertions(+), 6 deletions(-)
Makefile +1 -1
index 038f512..db44772 100644
@@ -38,7 +38,7 @@ include $(MAKEFILE_PRE)
 .PHONY: sync
 
 sync:
-	./sync $(KVM_VERSION)
+	./sync -v $(KVM_VERSION) -l $(LINUX)
 
 install:
 	mkdir -p $(DESTDIR)/$(INSTALLDIR)
sync +11 -5
index 4a89296..f3f4d6a 100755
@@ -1,6 +1,7 @@
 #!/usr/bin/python
 
 import sys, os, glob, os.path, shutil, re
+from optparse import OptionParser
 
 glob = glob.glob
 
@@ -8,11 +9,16 @@ def cmd(c):
     if os.system(c) != 0:
         raise Exception('command execution failed: ' + c)
 
-version = 'kvm-devel'
-if len(sys.argv) >= 2:
-    version = sys.argv[1]
-
-linux = 'linux-2.6'
+parser = OptionParser(usage = 'usage: %prog [-v VERSION][-l LINUX]')
+parser.add_option('-v', action = 'store', type = 'string', dest = 'version', \
+                  help = 'kvm-kmod release version', default = 'kvm-devel')
+parser.add_option('-l', action = 'store', type = 'string', dest = 'linux', \
+                  help = 'Linux kernel tree to sync from', \
+                  default = 'linux-2.6')
+parser.set_defaults()
+(options, args) = parser.parse_args()
+version = options.version
+linux = options.linux
 
 _re_cache = {}
 
author
#2 lore raw

PATCH 2/8 kvm-kmod: Include asm/uaccess.h on pre-2.6.18 kernels

In reply to Jan Kiszka

---

 external-module-compat-comm.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
external-module-compat-comm.h +4 -0
index d473ae7..e2342db 100644
@@ -302,7 +302,11 @@ static inline void pagefault_enable(void)
 
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
+#include <asm/uaccess.h>
+#else
 #include <linux/uaccess.h>
+#endif
 
 /* vm ops ->fault() was introduced in 2.6.23. */
 #include <linux/mm.h>
author
#3 lore raw

PATCH 3/8 kvm-kmod: Include relayfs_fs.h on pre-2.6.17 kernels

In reply to Jan Kiszka

---

 external-module-compat-comm.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
external-module-compat-comm.h +4 -0
index e2342db..dad43ef 100644
@@ -572,7 +572,11 @@ struct pci_dev *pci_get_bus_and_slot(unsigned int bus, unsigned int devfn);
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17)
+#include <linux/relayfs_fs.h>
+#else
 #include <linux/relay.h>
+#endif
 
 /* relay_open() interface has changed on 2.6.21 */
 
author
#4 lore raw

PATCH 4/8 kvm-kmod: Provide flush_work compat wrapper

In reply to Jan Kiszka

---

 external-module-compat-comm.h |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
external-module-compat-comm.h +9 -0
index dad43ef..131210a 100644
@@ -562,6 +562,15 @@ static inline int cancel_work_sync(struct work_struct *work)
 
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
+
+static inline void flush_work(struct work_struct *work)
+{
+	cancel_work_sync(work);
+}
+
+#endif
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
 
 struct pci_dev;
author
#5 lore raw

PATCH 5/8 kvm-kmod: Fix msi_enabled patching

In reply to Jan Kiszka

---

 sync |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
sync +2 -2
index f3f4d6a..fc4311e 100755
@@ -67,8 +67,8 @@ def __hack(data):
         if match(r'^}'): kvm_arch_init = False
         if match(r'MODULE_AUTHOR'):
             w('MODULE_INFO(version, "%s");' % (version,))
-        line = sub(r'match->dev->msi_enabled',
-                      'kvm_pcidev_msi_enabled(match->dev)', line)
+        line = sub(r'(\w+)->dev->msi_enabled',
+                   r'kvm_pcidev_msi_enabled(\1->dev)', line)
         if match(r'atomic_inc\(&kvm->mm->mm_count\);'):
             line = 'mmget(&kvm->mm->mm_count);'
         if match(r'^\t\.fault = '):
author
#6 lore raw

PATCH 6/8 kvm-kmod: Add eventfd.c to patch list

In reply to Jan Kiszka

eventfd.c has to be processed in order to wrap INIT_WORK.

---

 sync |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
sync +1 -1
index fc4311e..18f0200 100755
@@ -124,7 +124,7 @@ def hack(T, arch, file):
 
 hack_files = {
     'x86': str.split('kvm_main.c mmu.c vmx.c svm.c x86.c irq.h lapic.c'
-                     ' i8254.c kvm_trace.c timer.c'),
+                     ' i8254.c kvm_trace.c timer.c eventfd.c'),
     'ia64': str.split('kvm_main.c kvm_fw.c kvm_lib.c kvm-ia64.c'),
 }
 
author
#7 lore raw

PATCH 7/8 kvm-kmod: x86: Add MSR_IA32_TSC compat define

In reply to Jan Kiszka

---

 x86/external-module-compat.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
x86/external-module-compat.h +4 -0
index 3e6fc11..c33eb2e 100644
@@ -497,6 +497,10 @@ struct kvm_desc_ptr {
 #define FEATURE_CONTROL_VMXON_ENABLED	(1<<2)
 #endif
 
+#ifndef MSR_IA32_TSC
+#define MSR_IA32_TSC                    0x00000010
+#endif
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25) && defined(__x86_64__)
 
 #undef set_debugreg
#8 lore raw

Re: [PATCH 7/8] kvm-kmod: x86: Add MSR_IA32_TSC compat define

Hello Jan,

Quoted 11 lines · Jan Kiszka

---

 x86/external-module-compat.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
x86/external-module-compat.h +0 -0
index 3e6fc11..c33eb2e 100644

x86/external-module-compat.h struct kvm_desc_ptr { · line 503

Quoted 7 lines
x86/external-module-compat.h +4 -0
@@ -497,6 +497,10 @@ struct kvm_desc_ptr {
 #define FEATURE_CONTROL_VMXON_ENABLED	(1<<2)
 #endif
 
+#ifndef MSR_IA32_TSC
+#define MSR_IA32_TSC                    0x00000010
+#endif
+

AFAIK, MSR_IA32_TSC is defined in include/asm/msr-index.h which is available for kernel as well as user space and it is available from long time.

Can you please point me in which case MSR_IA32_TSC is not visible.

Thanks,
--
JSR

author
#9 lore raw

Re: [PATCH 7/8] kvm-kmod: x86: Add MSR_IA32_TSC compat define

Quoted 17 lines · Jaswinder Singh Rajput

Hello Jan,

Quoted 14 lines · Jan Kiszka

---

 x86/external-module-compat.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
x86/external-module-compat.h +0 -0
index 3e6fc11..c33eb2e 100644
@@ -497,6 +497,10 @@ struct kvm_desc_ptr {
 #define FEATURE_CONTROL_VMXON_ENABLED	(1<<2)
 #endif
 
Quoted 8 lines

x86/external-module-compat.h struct kvm_desc_ptr { · line 503

Quoted 4 lines
x86/external-module-compat.h +4 -0
+#ifndef MSR_IA32_TSC
+#define MSR_IA32_TSC                    0x00000010
+#endif
+

AFAIK, MSR_IA32_TSC is defined in include/asm/msr-index.h which is available for kernel as well as user space and it is available from long time.

msr-index.h is "fairly" new (keep in mind all the x86 unifications and renaming of msr.h to msr-index.h).

Quoted 2 lines

Can you please point me in which case MSR_IA32_TSC is not visible.

I'm about to loose overview of all those issues I ran into with older kernels (still more to fix, sigh), but I think to remember this was a 2.6.18 x86_32 problem. Wait... yes, 2.6.18 asm-i386 does not include this.

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
#10 lore raw

Re: [PATCH 7/8] kvm-kmod: x86: Add MSR_IA32_TSC compat define

Quoted 4 lines · Jan Kiszka

I'm about to loose overview of all those issues I ran into with older kernels (still more to fix, sigh), but I think to remember this was a 2.6.18 x86_32 problem. Wait... yes, 2.6.18 asm-i386 does not include this.

I have the same problem. I'll look at setting up automated build-testing of kvm-kmod.git+kvm.git for versions in range(16, 30) for arch in ['i386', 'x86_64'].

Signature · 1 line
error compiling committee.c: too many arguments to function
author
#11 lore raw

Re: [PATCH 7/8] kvm-kmod: x86: Add MSR_IA32_TSC compat define

Quoted 10 lines · Avi Kivity
Quoted 5 lines · Jan Kiszka

I'm about to loose overview of all those issues I ran into with older kernels (still more to fix, sigh), but I think to remember this was a 2.6.18 x86_32 problem. Wait... yes, 2.6.18 asm-i386 does not include this.

I have the same problem. I'll look at setting up automated build-testing of kvm-kmod.git+kvm.git for versions in range(16, 30) for arch in ['i386', 'x86_64'].

Applause in advance!

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
#12 lore raw

Re: [PATCH 7/8] kvm-kmod: x86: Add MSR_IA32_TSC compat define

Quoted 10 lines · Jan Kiszka
Quoted 8 lines · Avi Kivity
Quoted 6 lines · Jan Kiszka

I'm about to loose overview of all those issues I ran into with older kernels (still more to fix, sigh), but I think to remember this was a 2.6.18 x86_32 problem. Wait... yes, 2.6.18 asm-i386 does not include this.

Quoted 7 lines
Quoted 4 lines

I have the same problem. I'll look at setting up automated build-testing of kvm-kmod.git+kvm.git for versions in range(16, 30) for arch in ['i386', 'x86_64'].

Applause in advance!

Be careful, I might auto-mail you the results.

Signature · 1 line
error compiling committee.c: too many arguments to function
#13 lore raw

Re: [PATCH 7/8] kvm-kmod: x86: Add MSR_IA32_TSC compat define

In reply to Jan Kiszka
Quoted 31 lines · Jan Kiszka
Quoted 17 lines · Jaswinder Singh Rajput

Hello Jan,

Quoted 14 lines · Jan Kiszka

---

 x86/external-module-compat.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
x86/external-module-compat.h +0 -0
index 3e6fc11..c33eb2e 100644
@@ -497,6 +497,10 @@ struct kvm_desc_ptr {
 #define FEATURE_CONTROL_VMXON_ENABLED	(1<<2)
 #endif
 
Quoted 8 lines

x86/external-module-compat.h struct kvm_desc_ptr { · line 503

Quoted 4 lines
x86/external-module-compat.h +4 -0
+#ifndef MSR_IA32_TSC
+#define MSR_IA32_TSC                    0x00000010
+#endif
+

AFAIK, MSR_IA32_TSC is defined in include/asm/msr-index.h which is available for kernel as well as user space and it is available from long time.

msr-index.h is "fairly" new (keep in mind all the x86 unifications and renaming of msr.h to msr-index.h).

Quoted 1 line
Quoted 6 lines
Quoted 1 line

Can you please point me in which case MSR_IA32_TSC is not visible.

I'm about to loose overview of all those issues I ran into with older kernels (still more to fix, sigh), but I think to remember this was a 2.6.18 x86_32 problem. Wait... yes, 2.6.18 asm-i386 does not include this.

Ahh, for ancient kernels. Ok :-)

--
JSR

author
#14 lore raw

PATCH 8/8 kvm-kmod: x86: Add MCE compat defines

In reply to Jan Kiszka

---

 x86/external-module-compat.h |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
x86/external-module-compat.h +8 -0
index c33eb2e..cc984ab 100644
@@ -540,3 +540,11 @@ struct mtrr_state_type {
 #ifndef CONFIG_HAVE_KVM_IRQCHIP
 #define CONFIG_HAVE_KVM_IRQCHIP 1
 #endif
+
+#ifndef MCG_CTL_P
+#define MCG_CTL_P        (1ULL<<8)
+#define MCG_STATUS_MCIP  (1ULL<<2)
+#define MCI_STATUS_VAL   (1ULL<<63)
+#define MCI_STATUS_OVER  (1ULL<<62)
+#define MCI_STATUS_UC    (1ULL<<61)
+#endif
#15 lore raw

Re: [PATCH 8/8] kvm-kmod: x86: Add MCE compat defines

Quoted 14 lines · Jan Kiszka

---

 x86/external-module-compat.h |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
x86/external-module-compat.h +0 -0
index c33eb2e..cc984ab 100644
@@ -540,3 +540,11 @@ struct mtrr_state_type {
 #ifndef CONFIG_HAVE_KVM_IRQCHIP

x86/external-module-compat.h struct mtrr_state_type { · line 550

Quoted 10 lines
x86/external-module-compat.h +8 -0
 #define CONFIG_HAVE_KVM_IRQCHIP 1
 #endif
+
+#ifndef MCG_CTL_P
+#define MCG_CTL_P        (1ULL<<8)
+#define MCG_STATUS_MCIP  (1ULL<<2)
+#define MCI_STATUS_VAL   (1ULL<<63)
+#define MCI_STATUS_OVER  (1ULL<<62)
+#define MCI_STATUS_UC    (1ULL<<61)
+#endif

This breaks on recent kernels (redefinition), so I removed it. Suggest adding an include-compat/asm-x86/asm/mce.h and including that.

Signature · 1 line
error compiling committee.c: too many arguments to function
author
#16 lore raw

Re: [PATCH 8/8] kvm-kmod: x86: Add MCE compat defines

Quoted 20 lines · Avi Kivity
Quoted 19 lines · Jan Kiszka

---

 x86/external-module-compat.h |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
x86/external-module-compat.h +5 -0
index c33eb2e..cc984ab 100644
@@ -540,3 +540,11 @@ struct mtrr_state_type {
 #ifndef CONFIG_HAVE_KVM_IRQCHIP
 #define CONFIG_HAVE_KVM_IRQCHIP 1
 #endif
+
+#ifndef MCG_CTL_P
+#define MCG_CTL_P        (1ULL<<8)
+#define MCG_STATUS_MCIP  (1ULL<<2)
+#define MCI_STATUS_VAL   (1ULL<<63)
Quoted 8 lines

x86/external-module-compat.h struct mtrr_state_type { · line 550

Quoted 5 lines
x86/external-module-compat.h +3 -0
+#define MCI_STATUS_OVER  (1ULL<<62)
+#define MCI_STATUS_UC    (1ULL<<61)
+#endif

This breaks on recent kernels (redefinition), so I removed it. Suggest adding an include-compat/asm-x86/asm/mce.h and including that.

Non-empty mce.h will not work (but a patch to add an empty one was missing from my queue) - new kernel have that file, but with improper definitions for 32-bit. But what was that recent kernel and what was the precise problem? ATM I could only imagine that the block above is included before original mce.h, right? Then adding an explicit include here should cure the problem.

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
#17 lore raw

Re: [PATCH 8/8] kvm-kmod: x86: Add MCE compat defines

Quoted 15 lines · Jan Kiszka
Quoted 5 lines
Quoted 5 lines
x86/external-module-compat.h +5 -0
+
+#ifndef MCG_CTL_P
+#define MCG_CTL_P        (1ULL<<8)
+#define MCG_STATUS_MCIP  (1ULL<<2)
+#define MCI_STATUS_VAL   (1ULL<<63)
Quoted 9 lines

x86/external-module-compat.h struct mtrr_state_type { · line 550

Quoted 6 lines
x86/external-module-compat.h +3 -0
+#define MCI_STATUS_OVER  (1ULL<<62)
+#define MCI_STATUS_UC    (1ULL<<61)
+#endif

This breaks on recent kernels (redefinition), so I removed it. Suggest adding an include-compat/asm-x86/asm/mce.h and including that.

Quoted 4 lines

Non-empty mce.h will not work (but a patch to add an empty one was missing from my queue) - new kernel have that file, but with improper definitions for 32-bit. But what was that recent kernel and what was the precise problem?

2.6.27, those defines were redefined (by the subsequent include of mce.h)

Quoted 4 lines

ATM I could only imagine that the block above is
included before original mce.h, right? Then adding an explicit include here should cure the problem.

Yes.

Signature · 1 line
error compiling committee.c: too many arguments to function
author
#18 lore raw

PATCH v2 1/1 kvm-kmod: x86: Add MCE compat defines

In reply to Jan Kiszka

Changes in v2:
- added empty mce.h for 32-bit kernels
- fixed redefinition issue by pulling in mce.h early

---

 include-compat/asm-x86/mce.h |    1 +
 x86/external-module-compat.h |   10 ++++++++++
 2 files changed, 11 insertions(+), 0 deletions(-)
 create mode 100644 include-compat/asm-x86/mce.h
include-compat/asm-x86/mce.h new file +1 -0
new file mode 100644
index 0000000..1eb03c6
@@ -0,0 +1 @@
+/* empty file to keep #include happy */
x86/external-module-compat.h +10 -0
index c33eb2e..5add5c9 100644
@@ -540,3 +540,13 @@ struct mtrr_state_type {
 #ifndef CONFIG_HAVE_KVM_IRQCHIP
 #define CONFIG_HAVE_KVM_IRQCHIP 1
 #endif
+
+#include <asm/mce.h>
+
+#ifndef MCG_CTL_P
+#define MCG_CTL_P        (1ULL<<8)
+#define MCG_STATUS_MCIP  (1ULL<<2)
+#define MCI_STATUS_VAL   (1ULL<<63)
+#define MCI_STATUS_OVER  (1ULL<<62)
+#define MCI_STATUS_UC    (1ULL<<61)
+#endif
Applied
#19 lore raw

Re: [PATCH v2] kvm-kmod: x86: Add MCE compat defines

Quoted 5 lines · Jan Kiszka

Changes in v2:
- added empty mce.h for 32-bit kernels
- fixed redefinition issue by pulling in mce.h early

Applied, thanks.

Signature · 1 line
error compiling committee.c: too many arguments to function
#20 lore raw
In reply to Jan Kiszka
Quoted 6 lines · Jan Kiszka

The is a flush of my current queue against kvm-kmod. Some are reposts, some are split-ups, and a few are new (specifically the MCE fixes). I did not include patches that you reported to have already in your queue.

Find the patches also at git://git.kiszka.org/kvm-kmod.git queue

All applied, thanks.

Signature · 1 line
error compiling committee.c: too many arguments to function
author
#21 lore raw

PATCH 1/1 kvm-kmod: x86: Add MSR_K8_SYSCFG compat define

In reply to Jan Kiszka
Quoted 6 lines · Jan Kiszka

The is a flush of my current queue against kvm-kmod. Some are reposts, some are split-ups, and a few are new (specifically the MCE fixes). I did not include patches that you reported to have already in your queue.

Find the patches also at git://git.kiszka.org/kvm-kmod.git queue

Quoted 10 lines

Jan Kiszka (8):
kvm-kmod: Allow to override sync source
kvm-kmod: Include asm/uaccess.h on pre-2.6.18 kernels
kvm-kmod: Include relayfs_fs.h on pre-2.6.17 kernels
kvm-kmod: Provide flush_work compat wrapper
kvm-kmod: Fix msi_enabled patching
kvm-kmod: Add eventfd.c to patch list
kvm-kmod: x86: Add MSR_IA32_TSC compat define
kvm-kmod: x86: Add MCE compat defines

And one more (probably not the last one, build round-trip on for my legacy kernel environment is currently longer than posting round-trip). Or do you have this in your queue already, too?

-------->

---

 x86/external-module-compat.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
x86/external-module-compat.h +4 -0
index 66f3aea..3fc91a1 100644
@@ -512,6 +512,10 @@ struct kvm_desc_ptr {
 #define MSR_K7_HWCR                     0xc0010015
 #endif
 
+#ifndef MSR_K8_SYSCFG
+#define MSR_K8_SYSCFG                   0xc0010010
+#endif
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25) && defined(__x86_64__)
 
 #undef set_debugreg
#22 lore raw

PATCH 1/1 kvm-kmod: Add MSR_K7_HWCR and MSR_K8_SYSCFG compat definition

Reposted as joint patch as there is no MSR_K7 in your next queue.

-------->

---

 x86/external-module-compat.h |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
x86/external-module-compat.h +8 -0
index 445c7a1..0e26743 100644
@@ -496,6 +496,14 @@ struct kvm_desc_ptr {
 #define MSR_IA32_TSC                    0x00000010
 #endif
 
+#ifndef MSR_K7_HWCR
+#define MSR_K7_HWCR                     0xc0010015
+#endif
+
+#ifndef MSR_K8_SYSCFG
+#define MSR_K8_SYSCFG                   0xc0010010
+#endif
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25) && defined(__x86_64__)
 
 #undef set_debugreg
Applied
#23 lore raw

Re: [PATCH] kvm-kmod: Add MSR_K7_HWCR and MSR_K8_SYSCFG compat definition

Quoted 3 lines · Jan Kiszka

Reposted as joint patch as there is no MSR_K7 in your next queue.

Applied, thanks. Don't know why I though I had HWCR in there.

Signature · 1 line
error compiling committee.c: too many arguments to function
#24 lore raw

Re: [PATCH] kvm-kmod: Add MSR_K7_HWCR and MSR_K8_SYSCFG compat definition

In reply to Jan Kiszka

Hello Jan,

Quoted 16 lines · Jan Kiszka

Reposted as joint patch as there is no MSR_K7 in your next queue.

-------->

---

 x86/external-module-compat.h |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
x86/external-module-compat.h +0 -0
index 445c7a1..0e26743 100644
@@ -496,6 +496,14 @@ struct kvm_desc_ptr {
 #define MSR_IA32_TSC                    0x00000010

x86/external-module-compat.h struct kvm_desc_ptr { · line 506

Quoted 10 lines
x86/external-module-compat.h +8 -0
 #endif
 
+#ifndef MSR_K7_HWCR
+#define MSR_K7_HWCR                     0xc0010015
+#endif
+
+#ifndef MSR_K8_SYSCFG
+#define MSR_K8_SYSCFG                   0xc0010010
+#endif
+

It will look more beautiful if we arrange MSR addresses in some order (say increasing order) :

+#ifndef MSR_K8_SYSCFG
+#define MSR_K8_SYSCFG 0xc0010010
+#endif
+
+#ifndef MSR_K7_HWCR
+#define MSR_K7_HWCR 0xc0010015
+#endif
+

Thanks,
--
JSR

#25 lore raw

Re: [PATCH] kvm-kmod: Add MSR_K7_HWCR and MSR_K8_SYSCFG compat definition

Quoted 33 lines · Jaswinder Singh Rajput

Hello Jan,

Quoted 16 lines · Jan Kiszka

Reposted as joint patch as there is no MSR_K7 in your next queue.

-------->

---

 x86/external-module-compat.h |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
x86/external-module-compat.h +0 -0
index 445c7a1..0e26743 100644
@@ -496,6 +496,14 @@ struct kvm_desc_ptr {
 #define MSR_IA32_TSC                    0x00000010

x86/external-module-compat.h struct kvm_desc_ptr { · line 506

Quoted 10 lines
x86/external-module-compat.h +8 -0
 #endif
 
+#ifndef MSR_K7_HWCR
+#define MSR_K7_HWCR                     0xc0010015
+#endif
+
+#ifndef MSR_K8_SYSCFG
+#define MSR_K8_SYSCFG                   0xc0010010
+#endif
+

It will look more beautiful if we arrange MSR addresses in some order (say increasing order) :

x86/external-module-compat.h struct kvm_desc_ptr {

Quoted 8 lines
x86/external-module-compat.h +8 -0
+#ifndef MSR_K8_SYSCFG
+#define MSR_K8_SYSCFG                   0xc0010010
+#endif
+
+#ifndef MSR_K7_HWCR
+#define MSR_K7_HWCR                     0xc0010015
+#endif
+

Well, I just used a different sorting key: K7 vs. K8...

Jan

#26 lore raw

Re: [PATCH] kvm-kmod: Add MSR_K7_HWCR and MSR_K8_SYSCFG compat definition

Quoted 4 lines · Jan Kiszka
Quoted 3 lines · Jaswinder Singh Rajput

It will look more beautiful if we arrange MSR addresses in some order (say increasing order) :

Quoted 11 lines

x86/external-module-compat.h struct kvm_desc_ptr {

Quoted 8 lines
x86/external-module-compat.h +8 -0
+#ifndef MSR_K8_SYSCFG
+#define MSR_K8_SYSCFG                   0xc0010010
+#endif
+
+#ifndef MSR_K7_HWCR
+#define MSR_K7_HWCR                     0xc0010015
+#endif
+

Well, I just used a different sorting key: K7 vs. K8...

sorting with K7, K8 are not very helpful, on the other hand if we sort with MSR address it will be helpful in :
1. searching of MSR
2. adding new MSR
3. avoid duplicate MSR
4. of course looks beautiful ;-)

Thanks,
--
JSR

#27 lore raw

Re: [PATCH] kvm-kmod: Add MSR_K7_HWCR and MSR_K8_SYSCFG compat definition

Quoted 20 lines · Jaswinder Singh Rajput
Quoted 5 lines · Jan Kiszka
Quoted 3 lines · Jaswinder Singh Rajput

It will look more beautiful if we arrange MSR addresses in some order (say increasing order) :

Quoted 12 lines

x86/external-module-compat.h struct kvm_desc_ptr {

Quoted 9 lines
x86/external-module-compat.h +8 -0
+#ifndef MSR_K8_SYSCFG
+#define MSR_K8_SYSCFG                   0xc0010010
+#endif
+
+#ifndef MSR_K7_HWCR
+#define MSR_K7_HWCR                     0xc0010015
+#endif
+

Well, I just used a different sorting key: K7 vs. K8...

Quoted 7 lines

sorting with K7, K8 are not very helpful, on the other hand if we sort with MSR address it will be helpful in :
1. searching of MSR
2. adding new MSR
3. avoid duplicate MSR
4. of course looks beautiful ;-)

Let's not get carried away.

Signature · 1 line
error compiling committee.c: too many arguments to function