* [PATCH] x86: kvmclock: Do not setup kvmclock vsyscall in the absence of that clock
@ 2013-02-23 16:05 Jan Kiszka
2013-02-23 16:20 ` Jan Kiszka
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Jan Kiszka @ 2013-02-23 16:05 UTC (permalink / raw)
To: Marcelo Tosatti, Gleb Natapov; +Cc: kvm
[-- Attachment #1: Type: text/plain, Size: 1302 bytes --]
From: Jan Kiszka <jan.kiszka@siemens.com>
This fixes boot lockups with "no-kvmclock", when the host is not
exposing this particular feature (QEMU: -cpu ...,-kvmclock) or when
the kvmclock initialization failed for whatever reason.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
Should go to 3.8 as well, I presume.
arch/x86/kernel/kvmclock.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c
index 5bedbdd..b730efa 100644
--- a/arch/x86/kernel/kvmclock.c
+++ b/arch/x86/kernel/kvmclock.c
@@ -160,8 +160,12 @@ int kvm_register_clock(char *txt)
{
int cpu = smp_processor_id();
int low, high, ret;
- struct pvclock_vcpu_time_info *src = &hv_clock[cpu].pvti;
+ struct pvclock_vcpu_time_info *src;
+
+ if (!hv_clock)
+ return 0;
+ src = &hv_clock[cpu].pvti;
low = (int)__pa(src) | 1;
high = ((u64)__pa(src) >> 32);
ret = native_write_msr_safe(msr_kvm_system_time, low, high);
@@ -276,6 +280,9 @@ int __init kvm_setup_vsyscall_timeinfo(void)
struct pvclock_vcpu_time_info *vcpu_time;
unsigned int size;
+ if (!hv_clock)
+ return 0;
+
size = PAGE_ALIGN(sizeof(struct pvclock_vsyscall_time_info)*NR_CPUS);
preempt_disable();
--
1.7.3.4
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 263 bytes --]
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] x86: kvmclock: Do not setup kvmclock vsyscall in the absence of that clock
2013-02-23 16:05 [PATCH] x86: kvmclock: Do not setup kvmclock vsyscall in the absence of that clock Jan Kiszka
@ 2013-02-23 16:20 ` Jan Kiszka
2013-02-26 2:22 ` Marcelo Tosatti
2013-02-27 11:19 ` Gleb Natapov
2 siblings, 0 replies; 8+ messages in thread
From: Jan Kiszka @ 2013-02-23 16:20 UTC (permalink / raw)
To: Marcelo Tosatti, Gleb Natapov; +Cc: kvm
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Sorry, $subject reflects only half of the fix (v0.1, when I thought
hunk #2 would suffice). A better headline:
"x86: kvmclock: Fix boot with kvmclock disabled or not existing"
If you want me to resend, let me know.
Jan
On 2013-02-23 17:05, Jan Kiszka wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
>
> This fixes boot lockups with "no-kvmclock", when the host is not
> exposing this particular feature (QEMU: -cpu ...,-kvmclock) or
> when the kvmclock initialization failed for whatever reason.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> ---
>
> Should go to 3.8 as well, I presume.
>
> arch/x86/kernel/kvmclock.c | 9 ++++++++- 1 files changed, 8
> insertions(+), 1 deletions(-)
>
> diff --git a/arch/x86/kernel/kvmclock.c
> b/arch/x86/kernel/kvmclock.c index 5bedbdd..b730efa 100644 ---
> a/arch/x86/kernel/kvmclock.c +++ b/arch/x86/kernel/kvmclock.c @@
> -160,8 +160,12 @@ int kvm_register_clock(char *txt) { int cpu =
> smp_processor_id(); int low, high, ret; - struct
> pvclock_vcpu_time_info *src = &hv_clock[cpu].pvti; + struct
> pvclock_vcpu_time_info *src; + + if (!hv_clock) + return 0;
>
> + src = &hv_clock[cpu].pvti; low = (int)__pa(src) | 1; high =
> ((u64)__pa(src) >> 32); ret =
> native_write_msr_safe(msr_kvm_system_time, low, high); @@ -276,6
> +280,9 @@ int __init kvm_setup_vsyscall_timeinfo(void) struct
> pvclock_vcpu_time_info *vcpu_time; unsigned int size;
>
> + if (!hv_clock) + return 0; + size = PAGE_ALIGN(sizeof(struct
> pvclock_vsyscall_time_info)*NR_CPUS);
>
> preempt_disable();
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iEYEARECAAYFAlEo7DUACgkQitSsb3rl5xSZqACfX6CIIu4GtiAafeHAlDNAM1su
v9UAniQcdE/gRhgoILKfEk/THLHB26T2
=aW5W
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] x86: kvmclock: Do not setup kvmclock vsyscall in the absence of that clock
2013-02-23 16:05 [PATCH] x86: kvmclock: Do not setup kvmclock vsyscall in the absence of that clock Jan Kiszka
2013-02-23 16:20 ` Jan Kiszka
@ 2013-02-26 2:22 ` Marcelo Tosatti
2013-02-27 11:19 ` Gleb Natapov
2 siblings, 0 replies; 8+ messages in thread
From: Marcelo Tosatti @ 2013-02-26 2:22 UTC (permalink / raw)
To: Jan Kiszka; +Cc: Gleb Natapov, kvm
On Sat, Feb 23, 2013 at 05:05:29PM +0100, Jan Kiszka wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
>
> This fixes boot lockups with "no-kvmclock", when the host is not
> exposing this particular feature (QEMU: -cpu ...,-kvmclock) or when
> the kvmclock initialization failed for whatever reason.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>
> Should go to 3.8 as well, I presume.
>
> arch/x86/kernel/kvmclock.c | 9 ++++++++-
> 1 files changed, 8 insertions(+), 1 deletions(-)
>
> diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c
> index 5bedbdd..b730efa 100644
> --- a/arch/x86/kernel/kvmclock.c
> +++ b/arch/x86/kernel/kvmclock.c
> @@ -160,8 +160,12 @@ int kvm_register_clock(char *txt)
> {
> int cpu = smp_processor_id();
> int low, high, ret;
> - struct pvclock_vcpu_time_info *src = &hv_clock[cpu].pvti;
> + struct pvclock_vcpu_time_info *src;
> +
> + if (!hv_clock)
> + return 0;
>
> + src = &hv_clock[cpu].pvti;
> low = (int)__pa(src) | 1;
> high = ((u64)__pa(src) >> 32);
> ret = native_write_msr_safe(msr_kvm_system_time, low, high);
> @@ -276,6 +280,9 @@ int __init kvm_setup_vsyscall_timeinfo(void)
> struct pvclock_vcpu_time_info *vcpu_time;
> unsigned int size;
>
> + if (!hv_clock)
> + return 0;
> +
> size = PAGE_ALIGN(sizeof(struct pvclock_vsyscall_time_info)*NR_CPUS);
>
> preempt_disable();
> --
> 1.7.3.4
>
Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] x86: kvmclock: Do not setup kvmclock vsyscall in the absence of that clock
2013-02-23 16:05 [PATCH] x86: kvmclock: Do not setup kvmclock vsyscall in the absence of that clock Jan Kiszka
2013-02-23 16:20 ` Jan Kiszka
2013-02-26 2:22 ` Marcelo Tosatti
@ 2013-02-27 11:19 ` Gleb Natapov
2013-04-07 11:33 ` Jan Kiszka
2 siblings, 1 reply; 8+ messages in thread
From: Gleb Natapov @ 2013-02-27 11:19 UTC (permalink / raw)
To: Jan Kiszka; +Cc: Marcelo Tosatti, kvm
On Sat, Feb 23, 2013 at 05:05:29PM +0100, Jan Kiszka wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
>
> This fixes boot lockups with "no-kvmclock", when the host is not
> exposing this particular feature (QEMU: -cpu ...,-kvmclock) or when
> the kvmclock initialization failed for whatever reason.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Applied, thanks.
> ---
>
> Should go to 3.8 as well, I presume.
>
> arch/x86/kernel/kvmclock.c | 9 ++++++++-
> 1 files changed, 8 insertions(+), 1 deletions(-)
>
> diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c
> index 5bedbdd..b730efa 100644
> --- a/arch/x86/kernel/kvmclock.c
> +++ b/arch/x86/kernel/kvmclock.c
> @@ -160,8 +160,12 @@ int kvm_register_clock(char *txt)
> {
> int cpu = smp_processor_id();
> int low, high, ret;
> - struct pvclock_vcpu_time_info *src = &hv_clock[cpu].pvti;
> + struct pvclock_vcpu_time_info *src;
> +
> + if (!hv_clock)
> + return 0;
>
> + src = &hv_clock[cpu].pvti;
> low = (int)__pa(src) | 1;
> high = ((u64)__pa(src) >> 32);
> ret = native_write_msr_safe(msr_kvm_system_time, low, high);
> @@ -276,6 +280,9 @@ int __init kvm_setup_vsyscall_timeinfo(void)
> struct pvclock_vcpu_time_info *vcpu_time;
> unsigned int size;
>
> + if (!hv_clock)
> + return 0;
> +
> size = PAGE_ALIGN(sizeof(struct pvclock_vsyscall_time_info)*NR_CPUS);
>
> preempt_disable();
> --
> 1.7.3.4
>
--
Gleb.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] x86: kvmclock: Do not setup kvmclock vsyscall in the absence of that clock
2013-02-27 11:19 ` Gleb Natapov
@ 2013-04-07 11:33 ` Jan Kiszka
2013-04-07 11:37 ` Gleb Natapov
0 siblings, 1 reply; 8+ messages in thread
From: Jan Kiszka @ 2013-04-07 11:33 UTC (permalink / raw)
To: Gleb Natapov; +Cc: Marcelo Tosatti, kvm
[-- Attachment #1: Type: text/plain, Size: 1681 bytes --]
On 2013-02-27 12:19, Gleb Natapov wrote:
> On Sat, Feb 23, 2013 at 05:05:29PM +0100, Jan Kiszka wrote:
>> From: Jan Kiszka <jan.kiszka@siemens.com>
>>
>> This fixes boot lockups with "no-kvmclock", when the host is not
>> exposing this particular feature (QEMU: -cpu ...,-kvmclock) or when
>> the kvmclock initialization failed for whatever reason.
>>
>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> Applied, thanks.
Just noticed that this fix isn't in Linus tree yet, thus also not yet in
3.8.y. Which route does it take?
Jan
>
>> ---
>>
>> Should go to 3.8 as well, I presume.
>>
>> arch/x86/kernel/kvmclock.c | 9 ++++++++-
>> 1 files changed, 8 insertions(+), 1 deletions(-)
>>
>> diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c
>> index 5bedbdd..b730efa 100644
>> --- a/arch/x86/kernel/kvmclock.c
>> +++ b/arch/x86/kernel/kvmclock.c
>> @@ -160,8 +160,12 @@ int kvm_register_clock(char *txt)
>> {
>> int cpu = smp_processor_id();
>> int low, high, ret;
>> - struct pvclock_vcpu_time_info *src = &hv_clock[cpu].pvti;
>> + struct pvclock_vcpu_time_info *src;
>> +
>> + if (!hv_clock)
>> + return 0;
>>
>> + src = &hv_clock[cpu].pvti;
>> low = (int)__pa(src) | 1;
>> high = ((u64)__pa(src) >> 32);
>> ret = native_write_msr_safe(msr_kvm_system_time, low, high);
>> @@ -276,6 +280,9 @@ int __init kvm_setup_vsyscall_timeinfo(void)
>> struct pvclock_vcpu_time_info *vcpu_time;
>> unsigned int size;
>>
>> + if (!hv_clock)
>> + return 0;
>> +
>> size = PAGE_ALIGN(sizeof(struct pvclock_vsyscall_time_info)*NR_CPUS);
>>
>> preempt_disable();
>> --
>> 1.7.3.4
>>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 263 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] x86: kvmclock: Do not setup kvmclock vsyscall in the absence of that clock
2013-04-07 11:33 ` Jan Kiszka
@ 2013-04-07 11:37 ` Gleb Natapov
2013-04-07 11:38 ` Jan Kiszka
0 siblings, 1 reply; 8+ messages in thread
From: Gleb Natapov @ 2013-04-07 11:37 UTC (permalink / raw)
To: Jan Kiszka; +Cc: Marcelo Tosatti, kvm
On Sun, Apr 07, 2013 at 01:33:05PM +0200, Jan Kiszka wrote:
> On 2013-02-27 12:19, Gleb Natapov wrote:
> > On Sat, Feb 23, 2013 at 05:05:29PM +0100, Jan Kiszka wrote:
> >> From: Jan Kiszka <jan.kiszka@siemens.com>
> >>
> >> This fixes boot lockups with "no-kvmclock", when the host is not
> >> exposing this particular feature (QEMU: -cpu ...,-kvmclock) or when
> >> the kvmclock initialization failed for whatever reason.
> >>
> >> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> > Applied, thanks.
>
> Just noticed that this fix isn't in Linus tree yet, thus also not yet in
> 3.8.y. Which route does it take?
>
It is scheduled to go into 3.10. To get it into 3.8.y we need to send it
to stable@.
--
Gleb.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] x86: kvmclock: Do not setup kvmclock vsyscall in the absence of that clock
2013-04-07 11:37 ` Gleb Natapov
@ 2013-04-07 11:38 ` Jan Kiszka
2013-04-07 11:45 ` Gleb Natapov
0 siblings, 1 reply; 8+ messages in thread
From: Jan Kiszka @ 2013-04-07 11:38 UTC (permalink / raw)
To: Gleb Natapov; +Cc: Marcelo Tosatti, kvm
[-- Attachment #1: Type: text/plain, Size: 842 bytes --]
On 2013-04-07 13:37, Gleb Natapov wrote:
> On Sun, Apr 07, 2013 at 01:33:05PM +0200, Jan Kiszka wrote:
>> On 2013-02-27 12:19, Gleb Natapov wrote:
>>> On Sat, Feb 23, 2013 at 05:05:29PM +0100, Jan Kiszka wrote:
>>>> From: Jan Kiszka <jan.kiszka@siemens.com>
>>>>
>>>> This fixes boot lockups with "no-kvmclock", when the host is not
>>>> exposing this particular feature (QEMU: -cpu ...,-kvmclock) or when
>>>> the kvmclock initialization failed for whatever reason.
>>>>
>>>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>>> Applied, thanks.
>>
>> Just noticed that this fix isn't in Linus tree yet, thus also not yet in
>> 3.8.y. Which route does it take?
>>
> It is scheduled to go into 3.10. To get it into 3.8.y we need to send it
> to stable@.
Hmm, it's a bug fix for an ugly early kernel crash...
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 263 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] x86: kvmclock: Do not setup kvmclock vsyscall in the absence of that clock
2013-04-07 11:38 ` Jan Kiszka
@ 2013-04-07 11:45 ` Gleb Natapov
0 siblings, 0 replies; 8+ messages in thread
From: Gleb Natapov @ 2013-04-07 11:45 UTC (permalink / raw)
To: Jan Kiszka; +Cc: Marcelo Tosatti, kvm
On Sun, Apr 07, 2013 at 01:38:48PM +0200, Jan Kiszka wrote:
> On 2013-04-07 13:37, Gleb Natapov wrote:
> > On Sun, Apr 07, 2013 at 01:33:05PM +0200, Jan Kiszka wrote:
> >> On 2013-02-27 12:19, Gleb Natapov wrote:
> >>> On Sat, Feb 23, 2013 at 05:05:29PM +0100, Jan Kiszka wrote:
> >>>> From: Jan Kiszka <jan.kiszka@siemens.com>
> >>>>
> >>>> This fixes boot lockups with "no-kvmclock", when the host is not
> >>>> exposing this particular feature (QEMU: -cpu ...,-kvmclock) or when
> >>>> the kvmclock initialization failed for whatever reason.
> >>>>
> >>>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> >>> Applied, thanks.
> >>
> >> Just noticed that this fix isn't in Linus tree yet, thus also not yet in
> >> 3.8.y. Which route does it take?
> >>
> > It is scheduled to go into 3.10. To get it into 3.8.y we need to send it
> > to stable@.
>
> Hmm, it's a bug fix for an ugly early kernel crash...
>
It was not a regression introduced in 3.9 and this usually means that
fix is delayed to the next merge window. Severe bugs with simple fix
could be exceptions, and I probably misjudged this one. Note that the
patch is for 3.9 would have helped to avoid that. As it stands the patch
will go to 3.9 via stable.
--
Gleb.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2013-04-07 11:45 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-23 16:05 [PATCH] x86: kvmclock: Do not setup kvmclock vsyscall in the absence of that clock Jan Kiszka
2013-02-23 16:20 ` Jan Kiszka
2013-02-26 2:22 ` Marcelo Tosatti
2013-02-27 11:19 ` Gleb Natapov
2013-04-07 11:33 ` Jan Kiszka
2013-04-07 11:37 ` Gleb Natapov
2013-04-07 11:38 ` Jan Kiszka
2013-04-07 11:45 ` Gleb Natapov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox