From nobody Mon Feb 9 19:54:01 2026 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; dkim=fail; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1552207182723578.3427902364803; Sun, 10 Mar 2019 00:39:42 -0800 (PST) Received: from localhost ([127.0.0.1]:41846 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2tzd-0002DZ-M5 for importer@patchew.org; Sun, 10 Mar 2019 04:39:37 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42678) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2to2-0000rT-A6 for qemu-devel@nongnu.org; Sun, 10 Mar 2019 04:27:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h2to1-0001GE-Cn for qemu-devel@nongnu.org; Sun, 10 Mar 2019 04:27:38 -0400 Received: from ozlabs.org ([203.11.71.1]:51119) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h2tnw-00019A-MU; Sun, 10 Mar 2019 04:27:34 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 44HDqn0ZrGz9sNk; Sun, 10 Mar 2019 19:27:15 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1552206437; bh=qhPd3eCfyKu8LdLgWnn/EYEEwEk/8WjmjME7WsITpOo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HpbVfLP3ALtdvJ6WOXM87J/ndxz8Y5I2KAfFqLUxiL+d1vDHj+0TMfr/q7i+bH6Jm mppCuRZXAnZrLPblvyyQUNhKM9gDqMaKxSrjpEgCvmr4DiO3WE+q+Lk3LKYu6LscQw F57cCfV2wUmZkWi83NJnavGn530H5o1y+6mpN0MQ= From: David Gibson To: peter.maydell@linaro.org Date: Sun, 10 Mar 2019 19:26:22 +1100 Message-Id: <20190310082703.1245-20-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190310082703.1245-1-david@gibson.dropbear.id.au> References: <20190310082703.1245-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 19/60] target/ppc/spapr: Enable H_PAGE_INIT in-kernel handling 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: lvivier@redhat.com, groug@kaod.org, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, Suraj Jitindar Singh , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Suraj Jitindar Singh The H_CALL H_PAGE_INIT can be used to zero or copy a page of guest memory. Enable the in-kernel H_PAGE_INIT handler. The in-kernel handler takes half the time to complete compared to handling the H_CALL in userspace. Signed-off-by: Suraj Jitindar Singh Message-Id: <20190306060608.19935-1-sjitindarsingh@gmail.com> Signed-off-by: David Gibson --- hw/ppc/spapr.c | 3 +++ target/ppc/kvm.c | 5 +++++ target/ppc/kvm_ppc.h | 5 +++++ 3 files changed, 13 insertions(+) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 755056875c..e764e89806 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -2822,6 +2822,9 @@ static void spapr_machine_init(MachineState *machine) =20 /* H_CLEAR_MOD/_REF are mandatory in PAPR, but off by default */ kvmppc_enable_clear_ref_mod_hcalls(); + + /* Enable H_PAGE_INIT */ + kvmppc_enable_h_page_init(); } =20 /* allocate RAM */ diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c index 4e3f1e4b78..d0bfb076df 100644 --- a/target/ppc/kvm.c +++ b/target/ppc/kvm.c @@ -2043,6 +2043,11 @@ void kvmppc_enable_clear_ref_mod_hcalls(void) kvmppc_enable_hcall(kvm_state, H_CLEAR_MOD); } =20 +void kvmppc_enable_h_page_init(void) +{ + kvmppc_enable_hcall(kvm_state, H_PAGE_INIT); +} + void kvmppc_set_papr(PowerPCCPU *cpu) { CPUState *cs =3D CPU(cpu); diff --git a/target/ppc/kvm_ppc.h b/target/ppc/kvm_ppc.h index 2937b36cae..2c2ea30e87 100644 --- a/target/ppc/kvm_ppc.h +++ b/target/ppc/kvm_ppc.h @@ -23,6 +23,7 @@ int kvmppc_set_interrupt(PowerPCCPU *cpu, int irq, int le= vel); void kvmppc_enable_logical_ci_hcalls(void); void kvmppc_enable_set_mode_hcall(void); void kvmppc_enable_clear_ref_mod_hcalls(void); +void kvmppc_enable_h_page_init(void); void kvmppc_set_papr(PowerPCCPU *cpu); int kvmppc_set_compat(PowerPCCPU *cpu, uint32_t compat_pvr); void kvmppc_set_mpic_proxy(PowerPCCPU *cpu, int mpic_proxy); @@ -138,6 +139,10 @@ static inline void kvmppc_enable_clear_ref_mod_hcalls(= void) { } =20 +static inline void kvmppc_enable_h_page_init(void) +{ +} + static inline void kvmppc_set_papr(PowerPCCPU *cpu) { } --=20 2.20.1