Skip to contentSkip to conversation

kvm: remove redundant registration of BSP's hv_clock area

PATCH Superseded Fernando Luis Vázquez Cao 2 participants 4 messages Feb 14, 2014 – Feb 18, 2014

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

PATCH 1/1 kvm: remove redundant registration of BSP's hv_clock area

These days hv_clock allocation is memblock based (i.e. the percpu allocator is not involved), which means that the physical address of each of the per-cpu hv_clock areas is guaranteed to remain unchanged through all its lifetime and we do not need to update its location after CPU bring-up.

---

arch/x86/kernel/kvm.c +0 -1
diff -urNp linux-3.14-rc2-orig/arch/x86/kernel/kvm.c linux-3.14-rc2/arch/x86/kernel/kvm.c
@@ -417,7 +417,6 @@ void kvm_disable_steal_time(void)
 #ifdef CONFIG_SMP
 static void __init kvm_smp_prepare_boot_cpu(void)
 {
-	WARN_ON(kvm_register_clock("primary cpu clock"));
 	kvm_guest_cpu_init();
 	native_smp_prepare_boot_cpu();
 	kvm_spinlock_init();
arch/x86/kernel/kvmclock.c +1 -1
diff -urNp linux-3.14-rc2-orig/arch/x86/kernel/kvmclock.c linux-3.14-rc2/arch/x86/kernel/kvmclock.c
@@ -242,7 +248,7 @@ void __init kvmclock_init(void)
 	hv_clock = __va(mem);
 	memset(hv_clock, 0, size);
 
-	if (kvm_register_clock("boot clock")) {
+	if (kvm_register_clock("boot/primary cpu clock")) {
 		hv_clock = NULL;
 		memblock_free(mem, size);
 		return;
maintainer Reviewed-by on v1 1/1
#1 lore raw

Il 14/02/2014 08:37, Fernando Luis Vázquez Cao ha scritto:

Quoted 24 lines

These days hv_clock allocation is memblock based (i.e. the percpu allocator is not involved), which means that the physical address of each of the per-cpu hv_clock areas is guaranteed to remain unchanged through all its lifetime and we do not need to update its location after CPU bring-up.

---

diff -urNp linux-3.14-rc2-orig/arch/x86/kernel/kvm.c linux-3.14-rc2/arch/x86/kernel/kvm.c

arch/x86/kernel/kvm.c +0 -1
@@ -417,7 +417,6 @@ void kvm_disable_steal_time(void)
 #ifdef CONFIG_SMP
 static void __init kvm_smp_prepare_boot_cpu(void)
 {
-	WARN_ON(kvm_register_clock("primary cpu clock"));
 	kvm_guest_cpu_init();
 	native_smp_prepare_boot_cpu();
 	kvm_spinlock_init();

diff -urNp linux-3.14-rc2-orig/arch/x86/kernel/kvmclock.c linux-3.14-rc2/arch/x86/kernel/kvmclock.c

arch/x86/kernel/kvmclock.c void __init kvmclock_init(void) · line 251

Quoted 5 lines
arch/x86/kernel/kvmclock.c +1 -1
@@ -242,7 +248,7 @@ void __init kvmclock_init(void)
 	hv_clock = __va(mem);
 	memset(hv_clock, 0, size);
 
-	if (kvm_register_clock("boot clock")) {
+	if (kvm_register_clock("boot/primary cpu clock")) {

We can remove the "boot" part of the string and just use "primary cpu clock".

Apart from this,

Can you post v2?

Thanks,

Paolo

Quoted 11 lines
arch/x86/kernel/kvmclock.c +0 -1
 		hv_clock = NULL;
 		memblock_free(mem, size);
 		return;
 
 
 
--

To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw

PATCH v2 1/1 kvm: remove redundant registration of BSP's hv_clock area

These days hv_clock allocation is memblock based (i.e. the percpu allocator is not involved), which means that the physical address of each of the per-cpu hv_clock areas is guaranteed to remain unchanged through all its lifetime and we do not need to update its location after CPU bring-up.

---

arch/x86/kernel/kvm.c +0 -1
diff -urNp linux-3.14-rc3-orig/arch/x86/kernel/kvm.c linux-3.14-rc3/arch/x86/kernel/kvm.c
@@ -417,7 +417,6 @@ void kvm_disable_steal_time(void)
 #ifdef CONFIG_SMP
 static void __init kvm_smp_prepare_boot_cpu(void)
 {
-	WARN_ON(kvm_register_clock("primary cpu clock"));
 	kvm_guest_cpu_init();
 	native_smp_prepare_boot_cpu();
 	kvm_spinlock_init();
arch/x86/kernel/kvmclock.c +1 -1
diff -urNp linux-3.14-rc3-orig/arch/x86/kernel/kvmclock.c linux-3.14-rc3/arch/x86/kernel/kvmclock.c
@@ -242,7 +242,7 @@ void __init kvmclock_init(void)
 	hv_clock = __va(mem);
 	memset(hv_clock, 0, size);
 
-	if (kvm_register_clock("boot clock")) {
+	if (kvm_register_clock("primary cpu clock")) {
 		hv_clock = NULL;
 		memblock_free(mem, size);
 		return;
maintainer
#3 lore raw

Il 18/02/2014 11:09, Fernando Luis Vázquez Cao ha scritto:

Quoted 35 lines

These days hv_clock allocation is memblock based (i.e. the percpu allocator is not involved), which means that the physical address of each of the per-cpu hv_clock areas is guaranteed to remain unchanged through all its lifetime and we do not need to update its location after CPU bring-up.

---

diff -urNp linux-3.14-rc3-orig/arch/x86/kernel/kvm.c linux-3.14-rc3/arch/x86/kernel/kvm.c

arch/x86/kernel/kvm.c +0 -1
@@ -417,7 +417,6 @@ void kvm_disable_steal_time(void)
 #ifdef CONFIG_SMP
 static void __init kvm_smp_prepare_boot_cpu(void)
 {
-	WARN_ON(kvm_register_clock("primary cpu clock"));
 	kvm_guest_cpu_init();
 	native_smp_prepare_boot_cpu();
 	kvm_spinlock_init();

diff -urNp linux-3.14-rc3-orig/arch/x86/kernel/kvmclock.c linux-3.14-rc3/arch/x86/kernel/kvmclock.c

arch/x86/kernel/kvmclock.c +1 -2
@@ -242,7 +242,7 @@ void __init kvmclock_init(void)
 	hv_clock = __va(mem);
 	memset(hv_clock, 0, size);
 
-	if (kvm_register_clock("boot clock")) {
+	if (kvm_register_clock("primary cpu clock")) {
 		hv_clock = NULL;
 		memblock_free(mem, size);
 		return;
 
 
--
Quoted 4 lines

To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Thanks, applying to kvm/queue.

Paolo