From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fernando Luis =?ISO-8859-1?Q?V=E1zquez?= Cao Subject: [PATCH v2] kvm: remove redundant registration of BSP's hv_clock area Date: Tue, 18 Feb 2014 19:09:11 +0900 Message-ID: <1392718151.12070.2.camel@nexus> References: <1392363424.24711.2.camel@nexus> <530323EC.2030800@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: Marcelo Tosatti , kvm@vger.kernel.org To: Paolo Bonzini Return-path: Received: from tama50.ecl.ntt.co.jp ([129.60.39.147]:58357 "EHLO tama50.ecl.ntt.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755114AbaBRKJQ (ORCPT ); Tue, 18 Feb 2014 05:09:16 -0500 In-Reply-To: <530323EC.2030800@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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 --- 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;