From patchwork Wed Mar 27 11:54:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sukrit Bhatnagar X-Patchwork-Id: 1066906 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44Tmdn2Rrxz9sSh for ; Wed, 27 Mar 2019 22:55:07 +1100 (AEDT) Received: from localhost ([127.0.0.1]:46180 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h9797-0001Af-SD for incoming@patchwork.ozlabs.org; Wed, 27 Mar 2019 07:55:05 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33363) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h978Q-00018z-AW for qemu-devel@nongnu.org; Wed, 27 Mar 2019 07:54:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h978P-0001HI-7H for qemu-devel@nongnu.org; Wed, 27 Mar 2019 07:54:22 -0400 Received: from smtp1.iitb.ac.in ([103.21.127.13]:40278) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h978O-0001GH-Lg for qemu-devel@nongnu.org; Wed, 27 Mar 2019 07:54:21 -0400 Received: from ldns1.iitb.ac.in (ldns1.iitb.ac.in [10.200.12.1]) by smtp1.iitb.ac.in (Postfix) with SMTP id CFF24104ADCA for ; Wed, 27 Mar 2019 17:24:18 +0530 (IST) Received: (qmail 26136 invoked by uid 510); 27 Mar 2019 17:24:18 +0530 X-Qmail-Scanner-Diagnostics: from 10.200.1.25 by ldns1 (envelope-from , uid 501) with qmail-scanner-2.11 spamassassin: 3.4.1. mhr: 1.0. {clamdscan: 0.100.0/25401} Clear:RC:1(10.200.1.25):SA:0(0.0/7.0):. Processed in 2.176943 secs; 27 Mar 2019 17:24:18 +0530 X-Envelope-From: skrtbhtngr@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received: from unknown (HELO ldns1.iitb.ac.in) (10.200.1.25) by ldns1.iitb.ac.in with SMTP; 27 Mar 2019 17:24:16 +0530 Received: from jeeves.cse.iitb.ac.in (miller.cse.iitb.ac.in [10.129.3.1]) by ldns1.iitb.ac.in (Postfix) with ESMTP id 5B01D360063 for ; Wed, 27 Mar 2019 17:24:16 +0530 (IST) Received: by jeeves.cse.iitb.ac.in (Postfix, from userid 51934) id 4D5D58C2BD8; Wed, 27 Mar 2019 17:24:16 +0530 (IST) Received: from localhost.localdomain (unknown [10.130.4.191]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by jeeves.cse.iitb.ac.in (Postfix) with ESMTPSA id 1E4318C2BDD; Wed, 27 Mar 2019 17:24:12 +0530 (IST) From: Sukrit Bhatnagar To: qemu-devel@nongnu.org Date: Wed, 27 Mar 2019 17:24:16 +0530 Message-Id: <20190327115416.17353-3-skrtbhtngr@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190327115416.17353-1-skrtbhtngr@gmail.com> References: <20190327115416.17353-1-skrtbhtngr@gmail.com> MIME-Version: 1.0 X-Qmail-Scanner-2.11: added fake Content-Type header X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 103.21.127.13 Subject: [Qemu-devel] [PATCH v2 2/2] cpus: move hvf_cpu_synchronize* calls to cpu_synchronize* functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Richard Henderson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Keep the calls made to synchronize cpu by all hypervisors in one place inside cpu_synchronize_* functions in include/sysemu/hw_accel.h Cc: Richard Henderson Cc: Paolo Bonzini Signed-off-by: Sukrit Bhatnagar --- cpus.c | 12 ------------ include/sysemu/hw_accel.h | 10 ++++++++++ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/cpus.c b/cpus.c index e83f72b48b..026df0dc5f 100644 --- a/cpus.c +++ b/cpus.c @@ -1021,10 +1021,6 @@ void cpu_synchronize_all_states(void) CPU_FOREACH(cpu) { cpu_synchronize_state(cpu); - /* TODO: move to cpu_synchronize_state() */ - if (hvf_enabled()) { - hvf_cpu_synchronize_state(cpu); - } } } @@ -1034,10 +1030,6 @@ void cpu_synchronize_all_post_reset(void) CPU_FOREACH(cpu) { cpu_synchronize_post_reset(cpu); - /* TODO: move to cpu_synchronize_post_reset() */ - if (hvf_enabled()) { - hvf_cpu_synchronize_post_reset(cpu); - } } } @@ -1047,10 +1039,6 @@ void cpu_synchronize_all_post_init(void) CPU_FOREACH(cpu) { cpu_synchronize_post_init(cpu); - /* TODO: move to cpu_synchronize_post_init() */ - if (hvf_enabled()) { - hvf_cpu_synchronize_post_init(cpu); - } } } diff --git a/include/sysemu/hw_accel.h b/include/sysemu/hw_accel.h index d2ddfb5ad0..bf081b4026 100644 --- a/include/sysemu/hw_accel.h +++ b/include/sysemu/hw_accel.h @@ -15,6 +15,7 @@ #include "sysemu/hax.h" #include "sysemu/kvm.h" #include "sysemu/whpx.h" +#include "sysemu/hvf.h" static inline void cpu_synchronize_state(CPUState *cpu) { @@ -27,6 +28,9 @@ static inline void cpu_synchronize_state(CPUState *cpu) if (whpx_enabled()) { whpx_cpu_synchronize_state(cpu); } + if (hvf_enabled()) { + hvf_cpu_synchronize_state(cpu); + } } static inline void cpu_synchronize_post_reset(CPUState *cpu) @@ -40,6 +44,9 @@ static inline void cpu_synchronize_post_reset(CPUState *cpu) if (whpx_enabled()) { whpx_cpu_synchronize_post_reset(cpu); } + if (hvf_enabled()) { + hvf_cpu_synchronize_post_reset(cpu); + } } static inline void cpu_synchronize_post_init(CPUState *cpu) @@ -53,6 +60,9 @@ static inline void cpu_synchronize_post_init(CPUState *cpu) if (whpx_enabled()) { whpx_cpu_synchronize_post_init(cpu); } + if (hvf_enabled()) { + hvf_cpu_synchronize_post_init(cpu); + } } static inline void cpu_synchronize_pre_loadvm(CPUState *cpu)