From patchwork Wed Mar 6 06:06:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suraj Jitindar Singh X-Patchwork-Id: 10840407 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3BE81139A for ; Wed, 6 Mar 2019 06:07:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 232722BE0F for ; Wed, 6 Mar 2019 06:07:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 14B822CB42; Wed, 6 Mar 2019 06:07:27 +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=-2.7 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A82752BE0F for ; Wed, 6 Mar 2019 06:07:26 +0000 (UTC) Received: from localhost ([127.0.0.1]:54945 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1PiA-0006b0-1h for patchwork-qemu-devel@patchwork.kernel.org; Wed, 06 Mar 2019 01:07:26 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46383) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1PhS-0006FM-Ir for qemu-devel@nongnu.org; Wed, 06 Mar 2019 01:06:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1PhO-000519-Mh for qemu-devel@nongnu.org; Wed, 06 Mar 2019 01:06:42 -0500 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]:40041) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h1PhB-0004WC-Ix; Wed, 06 Mar 2019 01:06:27 -0500 Received: by mail-pg1-x542.google.com with SMTP id u9so7472006pgo.7; Tue, 05 Mar 2019 22:06:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=5UR0H8uyYfG2fMYw3i1PEMCOVXPkBErvA7dktDv0j/w=; b=bmM7VbJkwPZ+Vnh3X0lzrw8GsihhVf19zkmeCeY+6ZVydoZ44CN+KVFGGZjDqXmmhP dWZFYRZg7TTzsveVaGGTA996eZwlb8FukLF1Uyxlj/jfyi2EwebmLcVeBCfGRUcbFrdJ rKwDyeRUk9WtTmHcJQwSvR+mqONT9xjfmoq569X0T0nZ0bP03NafzPDkhWUuFHxtHbEg SjVUOJ50Mx2kSc1ekmGg5JFi0TrVHL3Z1rRcPw22zdYNwWqc79pS3TZi18AqomzEBSdR M/fCZSkI2toyhPwT3ywZmCqK1ePzj3nq3fZf636wdAAczNvIeGQScxgWNEWkFJnAyG/g ZVew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=5UR0H8uyYfG2fMYw3i1PEMCOVXPkBErvA7dktDv0j/w=; b=DxcorDKUy3TE0vsWE8DRGY+3aEYpDsmexsF5zEjVo6W1QeyeAVRPG5tLqleLfIMxDN 7wfnyYoLmd/cXjaP7K3yZAfm25A34cuqCsHmaDvQgkSdBVJ6mHqKrriPlpffiDNJl3oh HkRxpmieAuzXUV/ULEV6PJdVn0jgOy3Sqemwecih7UCCgbDEYZcxRmDSWAv4iMwh9Qy+ ytM1rHX3jF2+4bhS/24/yDfHWJMhGAKFUimhwOFXQs9r/WEeefAKOZONG0MAJBuRyhVq 1YiuZd7sq6182X4SIUL7ZteYTMLTbEy0VLyG8IZT7gt1WcEhDkWmoFbnmnCcqmRjwxUT SVKQ== X-Gm-Message-State: APjAAAVenCgVa3Pd9Fg/96zWMCJCJYR/n5avF1Xm/ZU5jppHrgiazYh3 WLa2c2YSuaZw3MIjnU66n5eaH4d7 X-Google-Smtp-Source: APXvYqxKYBeszZPirW4lVPzPd7FiW21Pa9gYKoefAYGFi4RPSeXMkqYS3KsuFOqhqsDRFSZhshN9sw== X-Received: by 2002:a17:902:5ac9:: with SMTP id g9mr5293884plm.205.1551852375974; Tue, 05 Mar 2019 22:06:15 -0800 (PST) Received: from surajjs2.ozlabs.ibm.com.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id n15sm2082541pfi.173.2019.03.05.22.06.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Mar 2019 22:06:15 -0800 (PST) From: Suraj Jitindar Singh To: qemu-ppc@nongnu.org Date: Wed, 6 Mar 2019 17:06:08 +1100 Message-Id: <20190306060608.19935-1-sjitindarsingh@gmail.com> X-Mailer: git-send-email 2.13.6 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::542 Subject: [Qemu-devel] [QEMU-PPC] [PATCH] 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: qemu-devel@nongnu.org, Suraj Jitindar Singh , david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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 cf1ef9ebd4..8ce97ff1e7 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -2822,6 +2822,9 @@ static void spapr_machine_init(MachineState *machine) /* 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(); } /* 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); } +void kvmppc_enable_h_page_init(void) +{ + kvmppc_enable_hcall(kvm_state, H_PAGE_INIT); +} + void kvmppc_set_papr(PowerPCCPU *cpu) { CPUState *cs = 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 level); 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) { } +static inline void kvmppc_enable_h_page_init(void) +{ +} + static inline void kvmppc_set_papr(PowerPCCPU *cpu) { }