* [PATCH kvm-kmod 0/5] update for 3.20-rc1 (roughly)
@ 2015-02-10 13:13 Paolo Bonzini
2015-02-10 13:13 ` [PATCH 1/5] add AVX512 features Paolo Bonzini
` (4 more replies)
0 siblings, 5 replies; 8+ messages in thread
From: Paolo Bonzini @ 2015-02-10 13:13 UTC (permalink / raw)
To: kvm; +Cc: jan.kiszka
The last patch is still mostly untested.
Paolo Bonzini (5):
add AVX512 features
fix missing get_xsave_addr in kernels 3.17-3.18.2
add CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT
add single_task_running
tweak replacement for POSTED_INTR_VECTOR
external-module-compat-comm.h | 6 +++++-
external-module-compat.c | 10 +++++++++-
sync | 13 +++++++++----
x86/external-module-compat.h | 20 ++++++++++++++++++++
4 files changed, 43 insertions(+), 6 deletions(-)
--
1.8.3.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/5] add AVX512 features
2015-02-10 13:13 [PATCH kvm-kmod 0/5] update for 3.20-rc1 (roughly) Paolo Bonzini
@ 2015-02-10 13:13 ` Paolo Bonzini
2015-02-10 13:13 ` [PATCH 2/5] fix missing get_xsave_addr in kernels 3.17-3.18.2 Paolo Bonzini
` (3 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: Paolo Bonzini @ 2015-02-10 13:13 UTC (permalink / raw)
To: kvm; +Cc: jan.kiszka
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
x86/external-module-compat.h | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/x86/external-module-compat.h b/x86/external-module-compat.h
index 94cdb45..475643a 100644
--- a/x86/external-module-compat.h
+++ b/x86/external-module-compat.h
@@ -428,6 +428,22 @@ static inline int rdmsrl_safe(unsigned msr, unsigned long long *p)
#define X86_FEATURE_MPX (9*32+14) /* Memory Protection Extension */
#endif
+#ifndef X86_FEATURE_AVX512F
+#define X86_FEATURE_AVX512F (9*32+16) /* AVX-512 Foundation */
+#endif
+
+#ifndef X86_FEATURE_AVX512PF
+#define X86_FEATURE_AVX512PF (9*32+26) /* AVX-512 Prefetch */
+#endif
+
+#ifndef X86_FEATURE_AVX512ER
+#define X86_FEATURE_AVX512ER (9*32+27) /* AVX-512 Exponential and Reciprocal */
+#endif
+
+#ifndef X86_FEATURE_AVX512CD
+#define X86_FEATURE_AVX512CD (9*32+28) /* AVX-512 Conflict Detection */
+#endif
+
#if X86_FEATURE_XSAVEOPT < 10 * 32
#undef X86_FEATURE_XSAVEOPT
#define X86_FEATURE_XSAVEOPT (10*32+0) /* XSAVEOPT instruction */
--
1.8.3.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/5] fix missing get_xsave_addr in kernels 3.17-3.18.2
2015-02-10 13:13 [PATCH kvm-kmod 0/5] update for 3.20-rc1 (roughly) Paolo Bonzini
2015-02-10 13:13 ` [PATCH 1/5] add AVX512 features Paolo Bonzini
@ 2015-02-10 13:13 ` Paolo Bonzini
2015-02-10 13:14 ` [PATCH 3/5] add CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT Paolo Bonzini
` (2 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: Paolo Bonzini @ 2015-02-10 13:13 UTC (permalink / raw)
To: kvm; +Cc: jan.kiszka
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
external-module-compat-comm.h | 2 +-
external-module-compat.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/external-module-compat-comm.h b/external-module-compat-comm.h
index 66cfde2..d683c30 100644
--- a/external-module-compat-comm.h
+++ b/external-module-compat-comm.h
@@ -1449,7 +1449,7 @@ static inline void pci_set_dev_assigned(struct pci_dev *pdev)
})
#endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,3)
void *get_xsave_addr(struct xsave_struct *xsave, int feature);
#endif
diff --git a/external-module-compat.c b/external-module-compat.c
index 068ab44..347d20e 100644
--- a/external-module-compat.c
+++ b/external-module-compat.c
@@ -363,7 +363,7 @@ u64 kvm_get_boot_base_ns(struct timekeeper *tk)
#endif
#endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,3)
void *get_xsave_addr(struct xsave_struct *xsave, int feature)
{
int index = fls64(feature) - 1;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 3/5] add CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT
2015-02-10 13:13 [PATCH kvm-kmod 0/5] update for 3.20-rc1 (roughly) Paolo Bonzini
2015-02-10 13:13 ` [PATCH 1/5] add AVX512 features Paolo Bonzini
2015-02-10 13:13 ` [PATCH 2/5] fix missing get_xsave_addr in kernels 3.17-3.18.2 Paolo Bonzini
@ 2015-02-10 13:14 ` Paolo Bonzini
2015-02-10 13:14 ` [PATCH 4/5] add single_task_running Paolo Bonzini
2015-02-10 13:14 ` [PATCH 5/5] tweak replacement for POSTED_INTR_VECTOR Paolo Bonzini
4 siblings, 0 replies; 8+ messages in thread
From: Paolo Bonzini @ 2015-02-10 13:14 UTC (permalink / raw)
To: kvm; +Cc: jan.kiszka
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
x86/external-module-compat.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/x86/external-module-compat.h b/x86/external-module-compat.h
index 475643a..79f2b76 100644
--- a/x86/external-module-compat.h
+++ b/x86/external-module-compat.h
@@ -51,6 +51,10 @@ static inline uint32_t hypervisor_cpuid_base(const char *sig, uint32_t leaves)
#define CONFIG_HAVE_KVM_EVENTFD 1
#endif
+#ifndef CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT
+#define CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT 1
+#endif
+
#ifndef CONFIG_KVM_APIC_ARCHITECTURE
#define CONFIG_KVM_APIC_ARCHITECTURE
#endif
--
1.8.3.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 4/5] add single_task_running
2015-02-10 13:13 [PATCH kvm-kmod 0/5] update for 3.20-rc1 (roughly) Paolo Bonzini
` (2 preceding siblings ...)
2015-02-10 13:14 ` [PATCH 3/5] add CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT Paolo Bonzini
@ 2015-02-10 13:14 ` Paolo Bonzini
2015-02-10 16:46 ` Jan Kiszka
2015-02-10 13:14 ` [PATCH 5/5] tweak replacement for POSTED_INTR_VECTOR Paolo Bonzini
4 siblings, 1 reply; 8+ messages in thread
From: Paolo Bonzini @ 2015-02-10 13:14 UTC (permalink / raw)
To: kvm; +Cc: jan.kiszka
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
external-module-compat-comm.h | 4 ++++
external-module-compat.c | 8 ++++++++
2 files changed, 12 insertions(+)
diff --git a/external-module-compat-comm.h b/external-module-compat-comm.h
index d683c30..456ebf8 100644
--- a/external-module-compat-comm.h
+++ b/external-module-compat-comm.h
@@ -1453,6 +1453,10 @@ static inline void pci_set_dev_assigned(struct pci_dev *pdev)
void *get_xsave_addr(struct xsave_struct *xsave, int feature);
#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0)
+bool single_task_running(void);
+#endif
+
#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0)
#define trace_seq_buffer_ptr(p) ((p)->buffer + (p)->len)
#endif
diff --git a/external-module-compat.c b/external-module-compat.c
index 347d20e..1d9a742 100644
--- a/external-module-compat.c
+++ b/external-module-compat.c
@@ -373,3 +373,11 @@ void *get_xsave_addr(struct xsave_struct *xsave, int feature)
return (u8 *)xsave + offset;
}
#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0)
+bool single_task_running(void)
+{
+ /* Not exactly the same... */
+ return !need_resched();
+}
+#endif
--
1.8.3.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 5/5] tweak replacement for POSTED_INTR_VECTOR
2015-02-10 13:13 [PATCH kvm-kmod 0/5] update for 3.20-rc1 (roughly) Paolo Bonzini
` (3 preceding siblings ...)
2015-02-10 13:14 ` [PATCH 4/5] add single_task_running Paolo Bonzini
@ 2015-02-10 13:14 ` Paolo Bonzini
4 siblings, 0 replies; 8+ messages in thread
From: Paolo Bonzini @ 2015-02-10 13:14 UTC (permalink / raw)
To: kvm; +Cc: jan.kiszka
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
Not tested with APICv!
---
sync | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/sync b/sync
index 3086b70..36bed39 100755
--- a/sync
+++ b/sync
@@ -341,13 +341,18 @@ def hack_content(fname, data):
if line == '\tif (!cpu_has_vmx_apicv())':
w('#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)')
w(line)
+ w('#else')
+ w('if (1)')
line = '#endif'
if line == '#if IS_ENABLED(CONFIG_KVM)':
line = '#if 1'
- if line == '\t\tapic->send_IPI_mask(get_cpu_mask(vcpu->cpu),':
- line = '\t\t;'
- if line == '\t\t\t\tPOSTED_INTR_VECTOR);':
- line = ''
+ if match(r'^\t+apic->send_IPI_mask\(get_cpu_mask\(vcpu->cpu\),$'):
+ w('#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)')
+ w('\t\t;')
+ w('#else')
+ if match(r'^\t+POSTED_INTR_VECTOR\);$'):
+ w(line)
+ line = '#endif'
if line == '\tif (!static_cpu_has_bug(X86_BUG_AMD_TLB_MMATCH))':
w('#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)')
w(line)
--
1.8.3.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 4/5] add single_task_running
2015-02-10 13:14 ` [PATCH 4/5] add single_task_running Paolo Bonzini
@ 2015-02-10 16:46 ` Jan Kiszka
2015-02-10 16:55 ` Paolo Bonzini
0 siblings, 1 reply; 8+ messages in thread
From: Jan Kiszka @ 2015-02-10 16:46 UTC (permalink / raw)
To: Paolo Bonzini, kvm
On 2015-02-10 14:14, Paolo Bonzini wrote:
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> external-module-compat-comm.h | 4 ++++
> external-module-compat.c | 8 ++++++++
> 2 files changed, 12 insertions(+)
>
> diff --git a/external-module-compat-comm.h b/external-module-compat-comm.h
> index d683c30..456ebf8 100644
> --- a/external-module-compat-comm.h
> +++ b/external-module-compat-comm.h
> @@ -1453,6 +1453,10 @@ static inline void pci_set_dev_assigned(struct pci_dev *pdev)
> void *get_xsave_addr(struct xsave_struct *xsave, int feature);
> #endif
>
> +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0)
> +bool single_task_running(void);
> +#endif
> +
> #if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0)
> #define trace_seq_buffer_ptr(p) ((p)->buffer + (p)->len)
> #endif
> diff --git a/external-module-compat.c b/external-module-compat.c
> index 347d20e..1d9a742 100644
> --- a/external-module-compat.c
> +++ b/external-module-compat.c
> @@ -373,3 +373,11 @@ void *get_xsave_addr(struct xsave_struct *xsave, int feature)
> return (u8 *)xsave + offset;
> }
> #endif
> +
> +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0)
> +bool single_task_running(void)
> +{
> + /* Not exactly the same... */
> + return !need_resched();
> +}
> +#endif
>
3.15 and earlier lacks ktime_before in addition, see e.g.
http://buildbot.kiszka.org/kvm-kmod/builders/3-next/builds/395/steps/3.15-x86-64/logs/stdio
I'm not yet sure where to cut backward support now, maybe 3.10 (LTS).
3.9 gives a strange warning in __do_insn_fetch_bytes though the involved
code should be identical to building for newer kernels:
http://buildbot.kiszka.org/kvm-kmod/builders/3-next/builds/395/steps/3.9-x86-64/logs/stdio
Jan
--
Siemens AG, Corporate Technology, CT RTC ITP SES-DE
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 4/5] add single_task_running
2015-02-10 16:46 ` Jan Kiszka
@ 2015-02-10 16:55 ` Paolo Bonzini
0 siblings, 0 replies; 8+ messages in thread
From: Paolo Bonzini @ 2015-02-10 16:55 UTC (permalink / raw)
To: Jan Kiszka, kvm
On 10/02/2015 17:46, Jan Kiszka wrote:
>> > +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0)
>> > +bool single_task_running(void)
>> > +{
>> > + /* Not exactly the same... */
>> > + return !need_resched();
>> > +}
>> > +#endif
>> >
> 3.15 and earlier lacks ktime_before in addition, see e.g.
> http://buildbot.kiszka.org/kvm-kmod/builders/3-next/builds/395/steps/3.15-x86-64/logs/stdio
Ah... indeed I tested with 3.16 (that's what I usually use when I'm not
compiling the whole kernel, because RHEL7.1's KVM is based on 3.16).
> I'm not yet sure where to cut backward support now, maybe 3.10 (LTS).
Yeah, either 3.2 or 3.10 I guess. (Is Debian still using 3.2?)
> 3.9 gives a strange warning in __do_insn_fetch_bytes though the involved
> code should be identical to building for newer kernels:
>
> http://buildbot.kiszka.org/kvm-kmod/builders/3-next/builds/395/steps/3.9-x86-64/logs/stdio
Weird...
Paolo
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2015-02-10 16:56 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-10 13:13 [PATCH kvm-kmod 0/5] update for 3.20-rc1 (roughly) Paolo Bonzini
2015-02-10 13:13 ` [PATCH 1/5] add AVX512 features Paolo Bonzini
2015-02-10 13:13 ` [PATCH 2/5] fix missing get_xsave_addr in kernels 3.17-3.18.2 Paolo Bonzini
2015-02-10 13:14 ` [PATCH 3/5] add CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT Paolo Bonzini
2015-02-10 13:14 ` [PATCH 4/5] add single_task_running Paolo Bonzini
2015-02-10 16:46 ` Jan Kiszka
2015-02-10 16:55 ` Paolo Bonzini
2015-02-10 13:14 ` [PATCH 5/5] tweak replacement for POSTED_INTR_VECTOR Paolo Bonzini
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.