Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/809852/?format=api
{ "id": 809852, "url": "http://patchwork.ozlabs.org/api/patches/809852/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/150456164425.17000.14656319266821117631.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": "<150456164425.17000.14656319266821117631.stgit@bahia.lan>", "list_archive_url": null, "date": "2017-09-04T21:47:24", "name": "[4/4] ppc: kvm: update HPT pointer in KVM PR after migration", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "659c05c3d229df173d3ef62f1b5ae97105d524fb", "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/150456164425.17000.14656319266821117631.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/809852/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/809852/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 3xmNnd434zz9s9Y\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 5 Sep 2017 07:50:44 +1000 (AEST)", "from localhost ([::1]:55816 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 1dozGV-0006DO-1D\n\tfor incoming@patchwork.ozlabs.org; Mon, 04 Sep 2017 17:50:43 -0400", "from eggs.gnu.org ([2001:4830:134:3::10]:47313)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <groug@kaod.org>) id 1dozDT-00040q-2d\n\tfor qemu-devel@nongnu.org; Mon, 04 Sep 2017 17:47:39 -0400", "from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <groug@kaod.org>) id 1dozDO-0003DF-9U\n\tfor qemu-devel@nongnu.org; Mon, 04 Sep 2017 17:47:35 -0400", "from 3.mo178.mail-out.ovh.net ([46.105.44.197]:59569)\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 1dozDO-0003C9-3L\n\tfor qemu-devel@nongnu.org; Mon, 04 Sep 2017 17:47:30 -0400", "from player728.ha.ovh.net (b6.ovh.net [213.186.33.56])\n\tby mo178.mail-out.ovh.net (Postfix) with ESMTP id BE85A512D6\n\tfor <qemu-devel@nongnu.org>; Mon, 4 Sep 2017 23:47:28 +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 77275540079;\n\tMon, 4 Sep 2017 23:47:24 +0200 (CEST)" ], "From": "Greg Kurz <groug@kaod.org>", "To": "qemu-devel@nongnu.org", "Date": "Mon, 04 Sep 2017 23:47:24 +0200", "Message-ID": "<150456164425.17000.14656319266821117631.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": "14551130398363523378", "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.44.197", "Subject": "[Qemu-devel] [PATCH 4/4] ppc: kvm: update HPT pointer in KVM PR\n\tafter migration", "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": "When running with KVM PR, a pseries machine needs to allocate an HPT in\nuserspace and pass its address to KVM. This is done by hijacking the SDR1\nslot.\n\nIt is very likely that the destination QEMU will allocate the HPT at\na different address, ie, the SDR1 value we get from the migration\nstream is wrong and the guest ends up badly broken.\n\nLet's fix this by re-computing the appropriate value for SDR1 and pushing\nit to KVM at CPU post load. This is achieved by extending the PPC virtual\nhypervisor interface.\n\nSigned-off-by: Greg Kurz <groug@kaod.org>\n---\n hw/ppc/spapr.c | 6 ++++++\n target/ppc/cpu.h | 1 +\n target/ppc/machine.c | 7 +++++++\n 3 files changed, 14 insertions(+)", "diff": "diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c\nindex bf24c26b756d..11c65563bb6e 100644\n--- a/hw/ppc/spapr.c\n+++ b/hw/ppc/spapr.c\n@@ -1299,6 +1299,11 @@ target_ulong spapr_get_hpt_pointer(sPAPRMachineState *spapr)\n return (target_ulong)(uintptr_t)spapr->htab | (spapr->htab_shift - 18);\n }\n \n+static target_ulong get_spapr_hpt_pointer(PPCVirtualHypervisor *vhyp)\n+{\n+ return spapr_get_hpt_pointer(SPAPR_MACHINE(vhyp));\n+}\n+\n int spapr_hpt_shift_for_ramsize(uint64_t ramsize)\n {\n int shift;\n@@ -3613,6 +3618,7 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data)\n vhc->unmap_hptes = spapr_unmap_hptes;\n vhc->store_hpte = spapr_store_hpte;\n vhc->get_patbe = spapr_get_patbe;\n+ vhc->get_hpt_pointer = get_spapr_hpt_pointer;\n xic->ics_get = spapr_ics_get;\n xic->ics_resend = spapr_ics_resend;\n xic->icp_get = spapr_icp_get;\ndiff --git a/target/ppc/cpu.h b/target/ppc/cpu.h\nindex c9d3ffa89bcb..bb1d61c9358c 100644\n--- a/target/ppc/cpu.h\n+++ b/target/ppc/cpu.h\n@@ -1243,6 +1243,7 @@ struct PPCVirtualHypervisorClass {\n void (*store_hpte)(PPCVirtualHypervisor *vhyp, hwaddr ptex,\n uint64_t pte0, uint64_t pte1);\n uint64_t (*get_patbe)(PPCVirtualHypervisor *vhyp);\n+ target_ulong (*get_hpt_pointer)(PPCVirtualHypervisor *vhyp);\n };\n \n #define TYPE_PPC_VIRTUAL_HYPERVISOR \"ppc-virtual-hypervisor\"\ndiff --git a/target/ppc/machine.c b/target/ppc/machine.c\nindex e36b7100cb66..6ec4b3214a2d 100644\n--- a/target/ppc/machine.c\n+++ b/target/ppc/machine.c\n@@ -294,6 +294,13 @@ static int cpu_post_load(void *opaque, int version_id)\n \n if (!cpu->vhyp) {\n ppc_store_sdr1(env, env->spr[SPR_SDR1]);\n+ } else if (kvm_enabled()) {\n+ PPCVirtualHypervisorClass *vhc =\n+ PPC_VIRTUAL_HYPERVISOR_GET_CLASS(cpu->vhyp);\n+ target_ulong sdr1 = vhc->get_hpt_pointer(cpu->vhyp);\n+ if (sdr1) {\n+ kvmppc_update_sdr1(cpu, sdr1);\n+ }\n }\n \n /* Invalidate all msr bits except MSR_TGPR/MSR_HVB before restoring */\n", "prefixes": [ "4/4" ] }