From patchwork Tue Apr 16 00:46:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 2447201 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 5037D3FD8C for ; Tue, 16 Apr 2013 00:47:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935183Ab3DPArb (ORCPT ); Mon, 15 Apr 2013 20:47:31 -0400 Received: from cantor2.suse.de ([195.135.220.15]:55495 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934544Ab3DPArb (ORCPT ); Mon, 15 Apr 2013 20:47:31 -0400 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 8D731A687B; Tue, 16 Apr 2013 02:47:29 +0200 (CEST) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Cc: Igor Mammedov , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Gleb Natapov , Marcelo Tosatti , kvm@vger.kernel.org (open list:Overall) Subject: [PATCH 10/12] cpu: Pass CPUState to *cpu_synchronize_post*() Date: Tue, 16 Apr 2013 02:46:47 +0200 Message-Id: <1366073209-27119-11-git-send-email-afaerber@suse.de> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1366073209-27119-1-git-send-email-afaerber@suse.de> References: <1366073209-27119-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Igor Mammedov ... so it could be called without requiring CPUArchState. Signed-off-by: Igor Mammedov Reviewed-by: Eduardo Habkost Signed-off-by: Andreas Färber Acked-by: Gleb Natapov --- cpus.c | 4 ++-- include/sysemu/kvm.h | 12 ++++++------ kvm-all.c | 8 ++------ kvm-stub.c | 4 ++-- 4 files changed, 12 insertions(+), 16 deletions(-) diff --git a/cpus.c b/cpus.c index 97e9ab4..c15ff6c 100644 --- a/cpus.c +++ b/cpus.c @@ -419,7 +419,7 @@ void cpu_synchronize_all_post_reset(void) CPUArchState *cpu; for (cpu = first_cpu; cpu; cpu = cpu->next_cpu) { - cpu_synchronize_post_reset(cpu); + cpu_synchronize_post_reset(ENV_GET_CPU(cpu)); } } @@ -428,7 +428,7 @@ void cpu_synchronize_all_post_init(void) CPUArchState *cpu; for (cpu = first_cpu; cpu; cpu = cpu->next_cpu) { - cpu_synchronize_post_init(cpu); + cpu_synchronize_post_init(ENV_GET_CPU(cpu)); } } diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index f2d97b5..495e6f8 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -250,8 +250,8 @@ int kvm_check_extension(KVMState *s, unsigned int extension); uint32_t kvm_arch_get_supported_cpuid(KVMState *env, uint32_t function, uint32_t index, int reg); void kvm_cpu_synchronize_state(CPUArchState *env); -void kvm_cpu_synchronize_post_reset(CPUArchState *env); -void kvm_cpu_synchronize_post_init(CPUArchState *env); +void kvm_cpu_synchronize_post_reset(CPUState *cpu); +void kvm_cpu_synchronize_post_init(CPUState *cpu); /* generic hooks - to be moved/refactored once there are more users */ @@ -262,17 +262,17 @@ static inline void cpu_synchronize_state(CPUArchState *env) } } -static inline void cpu_synchronize_post_reset(CPUArchState *env) +static inline void cpu_synchronize_post_reset(CPUState *cpu) { if (kvm_enabled()) { - kvm_cpu_synchronize_post_reset(env); + kvm_cpu_synchronize_post_reset(cpu); } } -static inline void cpu_synchronize_post_init(CPUArchState *env) +static inline void cpu_synchronize_post_init(CPUState *cpu) { if (kvm_enabled()) { - kvm_cpu_synchronize_post_init(env); + kvm_cpu_synchronize_post_init(cpu); } } diff --git a/kvm-all.c b/kvm-all.c index 9b433d3..fc4e17c 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -1510,18 +1510,14 @@ void kvm_cpu_synchronize_state(CPUArchState *env) } } -void kvm_cpu_synchronize_post_reset(CPUArchState *env) +void kvm_cpu_synchronize_post_reset(CPUState *cpu) { - CPUState *cpu = ENV_GET_CPU(env); - kvm_arch_put_registers(cpu, KVM_PUT_RESET_STATE); cpu->kvm_vcpu_dirty = false; } -void kvm_cpu_synchronize_post_init(CPUArchState *env) +void kvm_cpu_synchronize_post_init(CPUState *cpu) { - CPUState *cpu = ENV_GET_CPU(env); - kvm_arch_put_registers(cpu, KVM_PUT_FULL_STATE); cpu->kvm_vcpu_dirty = false; } diff --git a/kvm-stub.c b/kvm-stub.c index f6137d3..723a813 100644 --- a/kvm-stub.c +++ b/kvm-stub.c @@ -41,11 +41,11 @@ void kvm_cpu_synchronize_state(CPUArchState *env) { } -void kvm_cpu_synchronize_post_reset(CPUArchState *env) +void kvm_cpu_synchronize_post_reset(CPUState *cpu) { } -void kvm_cpu_synchronize_post_init(CPUArchState *env) +void kvm_cpu_synchronize_post_init(CPUState *cpu) { }