All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kvm: remove redundant registration of BSP's hv_clock area
@ 2014-02-14  7:37 Fernando Luis Vázquez Cao
  2014-02-18  9:12 ` Paolo Bonzini
  0 siblings, 1 reply; 4+ messages in thread
From: Fernando Luis Vázquez Cao @ 2014-02-14  7:37 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: kvm

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.

Signed-off-by: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
---

diff -urNp linux-3.14-rc2-orig/arch/x86/kernel/kvm.c linux-3.14-rc2/arch/x86/kernel/kvm.c
--- linux-3.14-rc2-orig/arch/x86/kernel/kvm.c	2014-02-12 15:49:32.359727407 +0900
+++ linux-3.14-rc2/arch/x86/kernel/kvm.c	2014-02-14 14:39:15.657337787 +0900
@@ -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
--- linux-3.14-rc2-orig/arch/x86/kernel/kvmclock.c	2014-01-20 11:40:07.000000000 +0900
+++ linux-3.14-rc2/arch/x86/kernel/kvmclock.c	2014-02-14 14:20:10.546961060 +0900
@@ -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;




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] kvm: remove redundant registration of BSP's hv_clock area
  2014-02-14  7:37 [PATCH] kvm: remove redundant registration of BSP's hv_clock area Fernando Luis Vázquez Cao
@ 2014-02-18  9:12 ` Paolo Bonzini
  2014-02-18 10:09   ` [PATCH v2] " Fernando Luis Vázquez Cao
  0 siblings, 1 reply; 4+ messages in thread
From: Paolo Bonzini @ 2014-02-18  9:12 UTC (permalink / raw)
  To: Fernando Luis Vázquez Cao, Marcelo Tosatti; +Cc: kvm

Il 14/02/2014 08:37, Fernando Luis Vázquez Cao ha scritto:
> 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.
>
> Signed-off-by: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
> ---
>
> diff -urNp linux-3.14-rc2-orig/arch/x86/kernel/kvm.c linux-3.14-rc2/arch/x86/kernel/kvm.c
> --- linux-3.14-rc2-orig/arch/x86/kernel/kvm.c	2014-02-12 15:49:32.359727407 +0900
> +++ linux-3.14-rc2/arch/x86/kernel/kvm.c	2014-02-14 14:39:15.657337787 +0900
> @@ -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
> --- linux-3.14-rc2-orig/arch/x86/kernel/kvmclock.c	2014-01-20 11:40:07.000000000 +0900
> +++ linux-3.14-rc2/arch/x86/kernel/kvmclock.c	2014-02-14 14:20:10.546961060 +0900
> @@ -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,

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

Can you post v2?

Thanks,

Paolo

>  		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 majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] kvm: remove redundant registration of BSP's hv_clock area
  2014-02-18  9:12 ` Paolo Bonzini
@ 2014-02-18 10:09   ` Fernando Luis Vázquez Cao
  2014-02-18 11:06     ` Paolo Bonzini
  0 siblings, 1 reply; 4+ messages in thread
From: Fernando Luis Vázquez Cao @ 2014-02-18 10:09 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Marcelo Tosatti, kvm

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.

Signed-off-by: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
---

diff -urNp linux-3.14-rc3-orig/arch/x86/kernel/kvm.c linux-3.14-rc3/arch/x86/kernel/kvm.c
--- linux-3.14-rc3-orig/arch/x86/kernel/kvm.c	2014-02-18 19:01:08.103189324 +0900
+++ linux-3.14-rc3/arch/x86/kernel/kvm.c	2014-02-18 19:01:45.412494366 +0900
@@ -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
--- linux-3.14-rc3-orig/arch/x86/kernel/kvmclock.c	2014-01-20 11:40:07.000000000 +0900
+++ linux-3.14-rc3/arch/x86/kernel/kvmclock.c	2014-02-18 19:02:51.966823212 +0900
@@ -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;



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] kvm: remove redundant registration of BSP's hv_clock area
  2014-02-18 10:09   ` [PATCH v2] " Fernando Luis Vázquez Cao
@ 2014-02-18 11:06     ` Paolo Bonzini
  0 siblings, 0 replies; 4+ messages in thread
From: Paolo Bonzini @ 2014-02-18 11:06 UTC (permalink / raw)
  To: Fernando Luis Vázquez Cao; +Cc: Marcelo Tosatti, kvm

Il 18/02/2014 11:09, Fernando Luis Vázquez Cao ha scritto:
> 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.
>
> Signed-off-by: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
> ---
>
> diff -urNp linux-3.14-rc3-orig/arch/x86/kernel/kvm.c linux-3.14-rc3/arch/x86/kernel/kvm.c
> --- linux-3.14-rc3-orig/arch/x86/kernel/kvm.c	2014-02-18 19:01:08.103189324 +0900
> +++ linux-3.14-rc3/arch/x86/kernel/kvm.c	2014-02-18 19:01:45.412494366 +0900
> @@ -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
> --- linux-3.14-rc3-orig/arch/x86/kernel/kvmclock.c	2014-01-20 11:40:07.000000000 +0900
> +++ linux-3.14-rc3/arch/x86/kernel/kvmclock.c	2014-02-18 19:02:51.966823212 +0900
> @@ -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;
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

Thanks, applying to kvm/queue.

Paolo

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-02-18 11:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-14  7:37 [PATCH] kvm: remove redundant registration of BSP's hv_clock area Fernando Luis Vázquez Cao
2014-02-18  9:12 ` Paolo Bonzini
2014-02-18 10:09   ` [PATCH v2] " Fernando Luis Vázquez Cao
2014-02-18 11:06     ` 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.