From patchwork Thu Jul 20 16:04:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 9855299 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3C0BC60392 for ; Thu, 20 Jul 2017 16:07:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2D27228678 for ; Thu, 20 Jul 2017 16:07:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 21F5C286DE; Thu, 20 Jul 2017 16:07:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CAF4928678 for ; Thu, 20 Jul 2017 16:07:01 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dYDwJ-0000ET-2w; Thu, 20 Jul 2017 16:04:35 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dYDwH-0000DT-Fe for xen-devel@lists.xenproject.org; Thu, 20 Jul 2017 16:04:33 +0000 Received: from [85.158.139.211] by server-16.bemta-5.messagelabs.com id 2A/65-01712-094D0795; Thu, 20 Jul 2017 16:04:32 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprEIsWRWlGSWpSXmKPExsXitHRDpO6EKwW RBr/6+Cy+b5nM5MDocfjDFZYAxijWzLyk/IoE1owVO/cyF3wVqjjy9i1TA2M/fxcjJ4eEgL/E lUVnmUBsNgFliZ+dvWwgtoiAnkTTgeeMXYxcHMwCcxglps7tYgRJCAt4SEz8sh6sgUVAVWLz8 33MIDavgLnE2xVXWSCGykvsarvICmJzClhIrPn1FaxeCKhm8/75LBC2gkTH9GNMEL2CEidnPg GLMwtISBx88YJ5AiPvLCSpWUhSCxiZVjFqFKcWlaUW6Roa6CUVZaZnlOQmZuYAeaZ6uanFxYn pqTmJScV6yfm5mxiB4cMABDsY10x1PsQoycGkJMrLElgQKcSXlJ9SmZFYnBFfVJqTWnyIUYaD Q0mCt/IyUE6wKDU9tSItMwcYyDBpCQ4eJRGING9xQWJucWY6ROoUoy7Hqwn/vzEJseTl56VKi fNWgBQJgBRllObBjYBF1SVGWSlhXkago4R4ClKLcjNLUOVfMYpzMCoJ8/aCTOHJzCuB2/QK6A gmoCMeuYEdUZKIkJJqYJyp37l9Eo8As+27uR2nz4u3+m9+2MG1dJPkFOk33+5OOXtM5J/WHbG ya06ZXA6tE1OZfc7Pk1O3n3KU/eHhnme+fb8YclZsE1iyMbZs97tUvVlMaV4ra3iVr54KX5o8 R/By+smVnXHrS3+urMwTWnXFLnPJ6V/NYnEX7zl1PpP63NltYeDgdUSJpTgj0VCLuag4EQC5a AOGpQIAAA== X-Env-Sender: prvs=3674d857a=wei.liu2@citrix.com X-Msg-Ref: server-2.tower-206.messagelabs.com!1500566670!83190143!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 9.4.25; banners=-,-,- X-VirusChecked: Checked Received: (qmail 9029 invoked from network); 20 Jul 2017 16:04:31 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-2.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 20 Jul 2017 16:04:31 -0000 X-IronPort-AV: E=Sophos;i="5.40,384,1496102400"; d="scan'208";a="432307683" From: Wei Liu To: Xen-devel Date: Thu, 20 Jul 2017 17:04:11 +0100 Message-ID: <20170720160426.2343-7-wei.liu2@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170720160426.2343-1-wei.liu2@citrix.com> References: <20170720160426.2343-1-wei.liu2@citrix.com> MIME-Version: 1.0 Cc: George Dunlap , Andrew Cooper , Wei Liu , Jan Beulich Subject: [Xen-devel] [PATCH v3 06/21] x86: move pv_emul_is_mem_write to pv/emulate.c X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Export it via pv/emulate.h. In the mean time it is required to include pv/emulate.h in x86/mm.c. The said function will be used later by different emulation handlers in later patches. Signed-off-by: Wei Liu --- xen/arch/x86/mm.c | 9 ++------- xen/arch/x86/pv/emulate.c | 7 +++++++ xen/arch/x86/pv/emulate.h | 3 +++ 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index 141d1fc046..102b607c78 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -126,6 +126,8 @@ #include #include +#include "pv/emulate.h" + /* Mapping of the fixmap space needed early. */ l1_pgentry_t __section(".bss.page_aligned") __aligned(PAGE_SIZE) l1_fixmap[L1_PAGETABLE_ENTRIES]; @@ -5366,13 +5368,6 @@ static int ptwr_emulated_cmpxchg( container_of(ctxt, struct ptwr_emulate_ctxt, ctxt)); } -static int pv_emul_is_mem_write(const struct x86_emulate_state *state, - struct x86_emulate_ctxt *ctxt) -{ - return x86_insn_is_mem_write(state, ctxt) ? X86EMUL_OKAY - : X86EMUL_UNHANDLEABLE; -} - static const struct x86_emulate_ops ptwr_emulate_ops = { .read = ptwr_emulated_read, .insn_fetch = ptwr_emulated_read, diff --git a/xen/arch/x86/pv/emulate.c b/xen/arch/x86/pv/emulate.c index 5750c7699b..1c4d6eab28 100644 --- a/xen/arch/x86/pv/emulate.c +++ b/xen/arch/x86/pv/emulate.c @@ -87,6 +87,13 @@ void pv_emul_instruction_done(struct cpu_user_regs *regs, unsigned long rip) } } +int pv_emul_is_mem_write(const struct x86_emulate_state *state, + struct x86_emulate_ctxt *ctxt) +{ + return x86_insn_is_mem_write(state, ctxt) ? X86EMUL_OKAY + : X86EMUL_UNHANDLEABLE; +} + /* * Local variables: * mode: C diff --git a/xen/arch/x86/pv/emulate.h b/xen/arch/x86/pv/emulate.h index b2b1192d48..89abbe010f 100644 --- a/xen/arch/x86/pv/emulate.h +++ b/xen/arch/x86/pv/emulate.h @@ -7,4 +7,7 @@ int pv_emul_read_descriptor(unsigned int sel, const struct vcpu *v, void pv_emul_instruction_done(struct cpu_user_regs *regs, unsigned long rip); +int pv_emul_is_mem_write(const struct x86_emulate_state *state, + struct x86_emulate_ctxt *ctxt); + #endif /* __PV_EMULATE_H__ */