Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/809850/?format=api
{ "id": 809850, "url": "http://patchwork.ozlabs.org/api/patches/809850/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/150456162500.17000.8195671755736683016.stgit@bahia.lan/", "project": { "id": 14, "url": "http://patchwork.ozlabs.org/api/projects/14/?format=api", "name": "QEMU Development", "link_name": "qemu-devel", "list_id": "qemu-devel.nongnu.org", "list_email": "qemu-devel@nongnu.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<150456162500.17000.8195671755736683016.stgit@bahia.lan>", "list_archive_url": null, "date": "2017-09-04T21:47:05", "name": "[2/4] spapr: introduce a helper to compute the address of the HPT", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "b0f6126ceb20a42efefc3aafcffae4cee01b45b9", "submitter": { "id": 69178, "url": "http://patchwork.ozlabs.org/api/people/69178/?format=api", "name": "Greg Kurz", "email": "groug@kaod.org" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/150456162500.17000.8195671755736683016.stgit@bahia.lan/mbox/", "series": [ { "id": 1458, "url": "http://patchwork.ozlabs.org/api/series/1458/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=1458", "date": "2017-09-04T21:46:44", "name": "ppc: fix migration with KVM PR (nested)", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/1458/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/809850/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/809850/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org", "Authentication-Results": "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)", "Received": [ "from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xmNks5mGvz9s8J\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 5 Sep 2017 07:48:21 +1000 (AEST)", "from localhost ([::1]:55804 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dozEB-00047A-Sa\n\tfor incoming@patchwork.ozlabs.org; Mon, 04 Sep 2017 17:48:19 -0400", "from eggs.gnu.org ([2001:4830:134:3::10]:47152)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <groug@kaod.org>) id 1dozD9-0003pk-Hd\n\tfor qemu-devel@nongnu.org; Mon, 04 Sep 2017 17:47:22 -0400", "from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <groug@kaod.org>) id 1dozD4-0002yy-R1\n\tfor qemu-devel@nongnu.org; Mon, 04 Sep 2017 17:47:15 -0400", "from 4.mo178.mail-out.ovh.net ([46.105.49.171]:37341)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <groug@kaod.org>) id 1dozD4-0002yA-KL\n\tfor qemu-devel@nongnu.org; Mon, 04 Sep 2017 17:47:10 -0400", "from player728.ha.ovh.net (b6.ovh.net [213.186.33.56])\n\tby mo178.mail-out.ovh.net (Postfix) with ESMTP id 85A0151124\n\tfor <qemu-devel@nongnu.org>; Mon, 4 Sep 2017 23:47:09 +0200 (CEST)", "from bahia.lan (gar31-1-82-66-74-139.fbx.proxad.net [82.66.74.139])\n\t(Authenticated sender: groug@kaod.org)\n\tby player728.ha.ovh.net (Postfix) with ESMTPA id 3B20654006C;\n\tMon, 4 Sep 2017 23:47:05 +0200 (CEST)" ], "From": "Greg Kurz <groug@kaod.org>", "To": "qemu-devel@nongnu.org", "Date": "Mon, 04 Sep 2017 23:47:05 +0200", "Message-ID": "<150456162500.17000.8195671755736683016.stgit@bahia.lan>", "In-Reply-To": "<150456160452.17000.3290192176290246589.stgit@bahia.lan>", "References": "<150456160452.17000.3290192176290246589.stgit@bahia.lan>", "User-Agent": "StGit/0.17.1-46-g6855-dirty", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"utf-8\"", "Content-Transfer-Encoding": "7bit", "X-Ovh-Tracer-Id": "14545782372532394290", "X-VR-SPAMSTATE": "OK", "X-VR-SPAMSCORE": "-100", "X-VR-SPAMCAUSE": "gggruggvucftvghtrhhoucdtuddrfeelledrvdejgddtjecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd", "X-detected-operating-system": "by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]", "X-Received-From": "46.105.49.171", "Subject": "[Qemu-devel] [PATCH 2/4] spapr: introduce a helper to compute the\n\taddress of the HPT", "X-BeenThere": "qemu-devel@nongnu.org", "X-Mailman-Version": "2.1.21", "Precedence": "list", "List-Id": "<qemu-devel.nongnu.org>", "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>", "List-Archive": "<http://lists.nongnu.org/archive/html/qemu-devel/>", "List-Post": "<mailto:qemu-devel@nongnu.org>", "List-Help": "<mailto:qemu-devel-request@nongnu.org?subject=help>", "List-Subscribe": "<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>", "Cc": "Thomas Huth <thuth@redhat.com>, qemu-ppc@nongnu.org,\n\tSuraj Jitindar Singh <sjitindarsingh@gmail.com>,\n\tDavid Gibson <david@gibson.dropbear.id.au>", "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org", "Sender": "\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>" }, "content": "The formula used to compute the address of the HPT allocated by QEMU is\nopen-coded in several places. This patch moves the magic to a dedicated\nhelper. While here, we also patch the callers to only pass the address\nto KVM if we indeed have a userland HPT (ie, KVM PR).\n\nSigned-off-by: Greg Kurz <groug@kaod.org>\n---\n hw/ppc/spapr.c | 9 +++++++++\n hw/ppc/spapr_cpu_core.c | 12 +++++++-----\n hw/ppc/spapr_hcall.c | 14 ++++++++------\n include/hw/ppc/spapr.h | 1 +\n 4 files changed, 25 insertions(+), 11 deletions(-)", "diff": "diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c\nindex caffa1276328..bf24c26b756d 100644\n--- a/hw/ppc/spapr.c\n+++ b/hw/ppc/spapr.c\n@@ -1290,6 +1290,15 @@ static void spapr_store_hpte(PPCVirtualHypervisor *vhyp, hwaddr ptex,\n }\n }\n \n+target_ulong spapr_get_hpt_pointer(sPAPRMachineState *spapr)\n+{\n+ if (!spapr->htab) {\n+ return 0;\n+ }\n+\n+ return (target_ulong)(uintptr_t)spapr->htab | (spapr->htab_shift - 18);\n+}\n+\n int spapr_hpt_shift_for_ramsize(uint64_t ramsize)\n {\n int shift;\ndiff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c\nindex 85037ef71e27..581eb4d92de9 100644\n--- a/hw/ppc/spapr_cpu_core.c\n+++ b/hw/ppc/spapr_cpu_core.c\n@@ -93,11 +93,13 @@ static void spapr_cpu_reset(void *opaque)\n * HPT\n */\n if (kvm_enabled()) {\n- env->spr[SPR_SDR1] = (target_ulong)(uintptr_t)spapr->htab\n- | (spapr->htab_shift - 18);\n- if (kvmppc_put_books_sregs(cpu) < 0) {\n- error_report(\"Unable to update SDR1 in KVM\");\n- exit(1);\n+ target_ulong sdr1 = spapr_get_hpt_pointer(spapr);\n+ if (sdr1) {\n+ env->spr[SPR_SDR1] = sdr1;\n+ if (kvmppc_put_books_sregs(cpu) < 0) {\n+ error_report(\"Unable to update SDR1 in KVM\");\n+ exit(1);\n+ }\n }\n }\n }\ndiff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c\nindex 6ab8c188f381..06059b44ab40 100644\n--- a/hw/ppc/spapr_hcall.c\n+++ b/hw/ppc/spapr_hcall.c\n@@ -735,9 +735,10 @@ static target_ulong h_resize_hpt_commit(PowerPCCPU *cpu,\n \n if (kvm_enabled()) {\n /* For KVM PR, update the HPT pointer */\n- target_ulong sdr1 = (target_ulong)(uintptr_t)spapr->htab\n- | (spapr->htab_shift - 18);\n- kvmppc_update_sdr1(sdr1);\n+ target_ulong sdr1 = spapr_get_hpt_pointer(spapr);\n+ if (sdr1) {\n+ kvmppc_update_sdr1(sdr1);\n+ }\n }\n \n pending->hpt = NULL; /* so it's not free()d */\n@@ -1566,9 +1567,10 @@ static target_ulong h_client_architecture_support(PowerPCCPU *cpu,\n spapr_reallocate_hpt(spapr, maxshift, &error_fatal);\n if (kvm_enabled()) {\n /* For KVM PR, update the HPT pointer */\n- target_ulong sdr1 = (target_ulong)(uintptr_t)spapr->htab\n- | (spapr->htab_shift - 18);\n- kvmppc_update_sdr1(sdr1);\n+ target_ulong sdr1 = spapr_get_hpt_pointer(spapr);\n+ if (sdr1) {\n+ kvmppc_update_sdr1(sdr1);\n+ }\n }\n }\n }\ndiff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h\nindex c1b365f56431..a1f5edc15018 100644\n--- a/include/hw/ppc/spapr.h\n+++ b/include/hw/ppc/spapr.h\n@@ -709,4 +709,5 @@ void spapr_do_system_reset_on_cpu(CPUState *cs, run_on_cpu_data arg);\n int spapr_vcpu_id(PowerPCCPU *cpu);\n PowerPCCPU *spapr_find_cpu(int vcpu_id);\n \n+target_ulong spapr_get_hpt_pointer(sPAPRMachineState *spapr);\n #endif /* HW_SPAPR_H */\n", "prefixes": [ "2/4" ] }