Skip to contentSkip to conversation

KVM: x86: disable kvmclock on non constant TSC hosts

PATCH Applied Marcelo Tosatti 4 participants 11 messages Feb 10, 2009 – Feb 12, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Currently, this code path is posing us big troubles, and we won't have a decent patch in time. So, temporarily disable it.

There's a module parameter for the adventurous who want to force it.

---
 arch/x86/kvm/x86.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
arch/x86/kvm/x86.c +6 -1
index e96edda..6286f08 100644
@@ -979,6 +979,9 @@ out:
 	return r;
 }
 
+static int force_kvmclock = 0;
+module_param(force_kvmclock, bool, 0644);
+
 int kvm_dev_ioctl_check_extension(long ext)
 {
 	int r;
@@ -989,7 +992,6 @@ int kvm_dev_ioctl_check_extension(long ext)
 	case KVM_CAP_MMU_SHADOW_CACHE_CONTROL:
 	case KVM_CAP_SET_TSS_ADDR:
 	case KVM_CAP_EXT_CPUID:
-	case KVM_CAP_CLOCKSOURCE:
 	case KVM_CAP_PIT:
 	case KVM_CAP_NOP_IO_DELAY:
 	case KVM_CAP_MP_STATE:
@@ -1015,6 +1017,9 @@ int kvm_dev_ioctl_check_extension(long ext)
 	case KVM_CAP_IOMMU:
 		r = iommu_found();
 		break;
+	case KVM_CAP_CLOCKSOURCE:
+		r = force_kvmclock || boot_cpu_has(X86_FEATURE_CONSTANT_TSC);
+		break;
 	default:
 		r = 0;
 		break;
#1 lore raw

This is better.

Currently, this code path is posing us big troubles, and we won't have a decent patch in time. So, temporarily disable it.

arch/x86/kvm/x86.c +3 -1
Index: kvm/arch/x86/kvm/x86.c
===================================================================
@@ -989,7 +989,6 @@ int kvm_dev_ioctl_check_extension(long e
 	case KVM_CAP_MMU_SHADOW_CACHE_CONTROL:
 	case KVM_CAP_SET_TSS_ADDR:
 	case KVM_CAP_EXT_CPUID:
-	case KVM_CAP_CLOCKSOURCE:
 	case KVM_CAP_PIT:
 	case KVM_CAP_NOP_IO_DELAY:
 	case KVM_CAP_MP_STATE:
@@ -1015,6 +1014,9 @@ int kvm_dev_ioctl_check_extension(long e
 	case KVM_CAP_IOMMU:
 		r = iommu_found();
 		break;
+	case KVM_CAP_CLOCKSOURCE:
+		r = boot_cpu_has(X86_FEATURE_CONSTANT_TSC);
+		break;
 	default:
 		r = 0;
 		break;
Applied
#2 lore raw
Quoted 7 lines · Marcelo Tosatti

This is better.

Currently, this code path is posing us big troubles, and we won't have a decent patch in time. So, temporarily disable it.

Applied to master and kvm-updates/2.6.29, thanks.

Signature · 1 line
error compiling committee.c: too many arguments to function
#3 lore raw
Quoted 10 lines · Avi Kivity
Quoted 7 lines · Marcelo Tosatti

This is better.

Currently, this code path is posing us big troubles, and we won't have a decent patch in time. So, temporarily disable it.

Applied to master and kvm-updates/2.6.29, thanks.

Should we add:

Cheers,
Mark.

#4 lore raw
Quoted 10 lines · Mark McLoughlin
Quoted 9 lines · Avi Kivity
Quoted 7 lines · Marcelo Tosatti

This is better.

Currently, this code path is posing us big troubles, and we won't have a decent patch in time. So, temporarily disable it.

Quoted 5 lines
Quoted 1 line

Applied to master and kvm-updates/2.6.29, thanks.

Should we add:

I suppose Avi prefers the master->stable route so it can get autotested?

But some sort of flag in the commit, like "Stable:Y" would help. Could setup a robot to monitor kvm-commits and maintain kvm-updates/2.6.2current (the queue to Linus), with human intervention when necessary.

Then autotest can run continuously on that.

#5 lore raw
Quoted 21 lines · Marcelo Tosatti
Quoted 12 lines · Mark McLoughlin
Quoted 10 lines · Avi Kivity
Quoted 8 lines · Marcelo Tosatti

This is better.

Currently, this code path is posing us big troubles, and we won't have a decent patch in time. So, temporarily disable it.

Quoted 6 lines
Quoted 2 lines

Applied to master and kvm-updates/2.6.29, thanks.

Should we add:

Quoted 9 lines

I suppose Avi prefers the master->stable route so it can get autotested?

But some sort of flag in the commit, like "Stable:Y" would help. Could setup a robot to monitor kvm-commits and maintain kvm-updates/2.6.2current (the queue to Linus), with human intervention when necessary.

Then autotest can run continuously on that.

Does 'Cc: stable' mean -stable picks it up automatically? That doesn't seem right.

Signature · 1 line
error compiling committee.c: too many arguments to function
#6 lore raw
Quoted 25 lines · Avi Kivity
Quoted 24 lines · Marcelo Tosatti
Quoted 12 lines · Mark McLoughlin
Quoted 10 lines · Avi Kivity
Quoted 8 lines · Marcelo Tosatti

This is better.

Currently, this code path is posing us big troubles, and we won't have a decent patch in time. So, temporarily disable it.

Quoted 6 lines
Quoted 2 lines

Applied to master and kvm-updates/2.6.29, thanks.

Should we add:

I suppose Avi prefers the master->stable route so it can get autotested?

Quoted 6 lines
Quoted 6 lines

But some sort of flag in the commit, like "Stable:Y" would help. Could setup a robot to monitor kvm-commits and maintain kvm-updates/2.6.2current (the queue to Linus), with human intervention when necessary.

Then autotest can run continuously on that.

I'm not really following Marcelo here ...

Quoted 2 lines

Does 'Cc: stable' mean -stable picks it up automatically? That doesn't seem right.

Yeah, I think if you CC: stable it gets pulled into the stable queue by scripts once linus merges it.

Cheers,
Mark.

#7 lore raw
In reply to Avi Kivity
Quoted 2 lines · * Avi Kivity ([email protected]) wrote:

Does 'Cc: stable' mean -stable picks it up automatically? That doesn't seem right.

Yes. If you add "Cc: [email protected]" to the commit message, it will get routed to stable when it's committed upstream (still gets human touch, it's not automatically committed to stable).

thanks,
-chris

#8 lore raw
Quoted 9 lines · Chris Wright
Quoted 2 lines · * Avi Kivity ([email protected]) wrote:

Does 'Cc: stable' mean -stable picks it up automatically? That doesn't seem right.

Yes. If you add "Cc: [email protected]" to the commit message, it will get routed to stable when it's committed upstream (still gets human touch, it's not automatically committed to stable).

What about porting the patch? And testing it?

Signature · 1 line
error compiling committee.c: too many arguments to function
#9 lore raw
Quoted 11 lines · * Avi Kivity ([email protected]) wrote:
Quoted 8 lines · Chris Wright
Quoted 2 lines · * Avi Kivity ([email protected]) wrote:

Does 'Cc: stable' mean -stable picks it up automatically? That doesn't seem right.

Yes. If you add "Cc: [email protected]" to the commit message, it will get routed to stable when it's committed upstream (still gets human touch, it's not automatically committed to stable).

What about porting the patch? And testing it?

Porting is done by stable maintainers if it's trivial, push back to developer/subsytem maintainer if it's not. Testing depends again, in most cases the upstream testing is still valid. If not..."please verify"

#10 lore raw
Quoted 5 lines · Chris Wright

Porting is done by stable maintainers if it's trivial, push back to developer/subsytem maintainer if it's not. Testing depends again, in most cases the upstream testing is still valid. If not..."please verify"

Warm, fuzzy feeling.

Signature · 2 lines
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.