From nobody Tue May 7 08:34:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1554638458233258.18033764515985; Sun, 7 Apr 2019 05:00:58 -0700 (PDT) Received: from localhost ([127.0.0.1]:38272 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hD6Tk-0000mX-Mk for importer@patchew.org; Sun, 07 Apr 2019 08:00:52 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46286) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hD6S7-0008PR-Jv for qemu-devel@nongnu.org; Sun, 07 Apr 2019 07:59:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hD6S6-0007KU-IA for qemu-devel@nongnu.org; Sun, 07 Apr 2019 07:59:11 -0400 Received: from smtp4.iitb.ac.in ([103.21.127.18]:35308 helo=smtp1.iitb.ac.in) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hD6S6-0007JR-63 for qemu-devel@nongnu.org; Sun, 07 Apr 2019 07:59:10 -0400 Received: from ldns1.iitb.ac.in (ldns1.iitb.ac.in [10.200.12.1]) by smtp1.iitb.ac.in (Postfix) with SMTP id 47CA71027500 for ; Sun, 7 Apr 2019 17:29:06 +0530 (IST) Received: (qmail 3764 invoked by uid 510); 7 Apr 2019 17:29:06 +0530 Received: from unknown (HELO ldns1.iitb.ac.in) (10.200.1.25) by ldns1.iitb.ac.in with SMTP; 7 Apr 2019 17:29:03 +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 AB38A360033 for ; Sun, 7 Apr 2019 17:29:03 +0530 (IST) Received: by jeeves.cse.iitb.ac.in (Postfix, from userid 51934) id 9FD858C2BD1; Sun, 7 Apr 2019 17:29:03 +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 1FD4D8C2BC6; Sun, 7 Apr 2019 17:29:03 +0530 (IST) 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/25412} Clear:RC:1(10.200.1.25):SA:0(0.0/7.0):. Processed in 2.284111 secs; 07 Apr 2019 17:29:06 +0530 X-Envelope-From: skrtbhtngr@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | From: Sukrit Bhatnagar To: qemu-devel@nongnu.org Date: Sun, 7 Apr 2019 17:28:38 +0530 Message-Id: <20190407115839.25054-2-skrtbhtngr@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190407115839.25054-1-skrtbhtngr@gmail.com> References: <20190407115839.25054-1-skrtbhtngr@gmail.com> MIME-Version: 1.0 X-Qmail-Scanner-2.11: added fake Content-Type header Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 103.21.127.18 Subject: [Qemu-devel] [PATCH RESEND v2 1/2] hvf: declare hvf_handle_io if NEED_CPU_H is defined 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 , Roman Bolshakov Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" hvf_handle_io needs the poisoned type CPUArchState as its argument. Declaring it if NEED_CPU_H is defined enables include/sysemu/hvf.h to be included for common object compilation as well. Cc: Roman Bolshakov Cc: Paolo Bonzini Signed-off-by: Sukrit Bhatnagar Reviewed-by: Roman Bolshakov Tested-by: Roman Bolshakov --- include/sysemu/hvf.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/sysemu/hvf.h b/include/sysemu/hvf.h index aaa51d2c51..7eca3ec7be 100644 --- a/include/sysemu/hvf.h +++ b/include/sysemu/hvf.h @@ -63,8 +63,12 @@ typedef struct HVFState { extern HVFState *hvf_state; =20 void hvf_set_phys_mem(MemoryRegionSection *, bool); + +#ifdef NEED_CPU_H void hvf_handle_io(CPUArchState *, uint16_t, void *, int, int, int); +#endif + hvf_slot *hvf_find_overlap_slot(uint64_t, uint64_t); =20 /* Disable HVF if |disable| is 1, otherwise, enable it iff it is supported= by --=20 2.20.1 From nobody Tue May 7 08:34:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1554638458731618.5947735825025; Sun, 7 Apr 2019 05:00:58 -0700 (PDT) Received: from localhost ([127.0.0.1]:38278 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hD6Tn-0000pO-DA for importer@patchew.org; Sun, 07 Apr 2019 08:00:55 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46301) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hD6S8-0008PT-0R for qemu-devel@nongnu.org; Sun, 07 Apr 2019 07:59:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hD6S6-0007Kg-NU for qemu-devel@nongnu.org; Sun, 07 Apr 2019 07:59:11 -0400 Received: from smtp4.iitb.ac.in ([103.21.127.18]:35310 helo=smtp1.iitb.ac.in) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hD6S6-0007Jg-3j for qemu-devel@nongnu.org; Sun, 07 Apr 2019 07:59:10 -0400 Received: from ldns1.iitb.ac.in (ldns1.iitb.ac.in [10.200.12.1]) by smtp1.iitb.ac.in (Postfix) with SMTP id 20EFE1027501 for ; Sun, 7 Apr 2019 17:29:07 +0530 (IST) Received: (qmail 3774 invoked by uid 510); 7 Apr 2019 17:29:07 +0530 Received: from unknown (HELO ldns1.iitb.ac.in) (10.200.1.25) by ldns1.iitb.ac.in with SMTP; 7 Apr 2019 17:29:05 +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 4E866360036 for ; Sun, 7 Apr 2019 17:29:05 +0530 (IST) Received: by jeeves.cse.iitb.ac.in (Postfix, from userid 51934) id 4126B8C2BBF; Sun, 7 Apr 2019 17:29:05 +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 6BADD8C2BCD; Sun, 7 Apr 2019 17:29:03 +0530 (IST) 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/25412} Clear:RC:1(10.200.1.25):SA:0(0.0/7.0):. Processed in 1.512199 secs; 07 Apr 2019 17:29:07 +0530 X-Envelope-From: skrtbhtngr@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | From: Sukrit Bhatnagar To: qemu-devel@nongnu.org Date: Sun, 7 Apr 2019 17:28:39 +0530 Message-Id: <20190407115839.25054-3-skrtbhtngr@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190407115839.25054-1-skrtbhtngr@gmail.com> References: <20190407115839.25054-1-skrtbhtngr@gmail.com> MIME-Version: 1.0 X-Qmail-Scanner-2.11: added fake Content-Type header Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 103.21.127.18 Subject: [Qemu-devel] [PATCH RESEND 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" 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) =20 CPU_FOREACH(cpu) { cpu_synchronize_state(cpu); - /* TODO: move to cpu_synchronize_state() */ - if (hvf_enabled()) { - hvf_cpu_synchronize_state(cpu); - } } } =20 @@ -1034,10 +1030,6 @@ void cpu_synchronize_all_post_reset(void) =20 CPU_FOREACH(cpu) { cpu_synchronize_post_reset(cpu); - /* TODO: move to cpu_synchronize_post_reset() */ - if (hvf_enabled()) { - hvf_cpu_synchronize_post_reset(cpu); - } } } =20 @@ -1047,10 +1039,6 @@ void cpu_synchronize_all_post_init(void) =20 CPU_FOREACH(cpu) { cpu_synchronize_post_init(cpu); - /* TODO: move to cpu_synchronize_post_init() */ - if (hvf_enabled()) { - hvf_cpu_synchronize_post_init(cpu); - } } } =20 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" =20 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); + } } =20 static inline void cpu_synchronize_post_reset(CPUState *cpu) @@ -40,6 +44,9 @@ static inline void cpu_synchronize_post_reset(CPUState *c= pu) if (whpx_enabled()) { whpx_cpu_synchronize_post_reset(cpu); } + if (hvf_enabled()) { + hvf_cpu_synchronize_post_reset(cpu); + } } =20 static inline void cpu_synchronize_post_init(CPUState *cpu) @@ -53,6 +60,9 @@ static inline void cpu_synchronize_post_init(CPUState *cp= u) if (whpx_enabled()) { whpx_cpu_synchronize_post_init(cpu); } + if (hvf_enabled()) { + hvf_cpu_synchronize_post_init(cpu); + } } =20 static inline void cpu_synchronize_pre_loadvm(CPUState *cpu) --=20 2.20.1