Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/816998/?format=api
{ "id": 816998, "url": "http://patchwork.ozlabs.org/api/patches/816998/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/150600965332.30533.14702405809647835716.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": "<150600965332.30533.14702405809647835716.stgit@bahia.lan>", "list_archive_url": null, "date": "2017-09-21T16:00:53", "name": "[v2,1/2] kvm: check KVM_CAP_SYNC_MMU with kvm_vm_check_extension()", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "d290d7b365bc40d9861b593d31878e158f2d8d9a", "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/150600965332.30533.14702405809647835716.stgit@bahia.lan/mbox/", "series": [ { "id": 4429, "url": "http://patchwork.ozlabs.org/api/series/4429/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=4429", "date": "2017-09-21T16:00:41", "name": "kvm: use kvm_vm_check_extension() with VM capabilities", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/4429/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/816998/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/816998/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 3xyhLQ6gZPz9t4B\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 22 Sep 2017 02:06:22 +1000 (AEST)", "from localhost ([::1]:54486 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 1dv3zY-0004XX-5K\n\tfor incoming@patchwork.ozlabs.org; Thu, 21 Sep 2017 12:06:20 -0400", "from eggs.gnu.org ([2001:4830:134:3::10]:48773)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <groug@kaod.org>) id 1dv3uR-0007gl-P6\n\tfor qemu-devel@nongnu.org; Thu, 21 Sep 2017 12:01:07 -0400", "from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <groug@kaod.org>) id 1dv3uN-0005D8-ON\n\tfor qemu-devel@nongnu.org; Thu, 21 Sep 2017 12:01:03 -0400", "from 5.mo173.mail-out.ovh.net ([46.105.40.148]:47773)\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 1dv3uN-0005CS-Iy\n\tfor qemu-devel@nongnu.org; Thu, 21 Sep 2017 12:00:59 -0400", "from player687.ha.ovh.net (b9.ovh.net [213.186.33.59])\n\tby mo173.mail-out.ovh.net (Postfix) with ESMTP id D4DAB73737\n\tfor <qemu-devel@nongnu.org>; Thu, 21 Sep 2017 18:00:57 +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 player687.ha.ovh.net (Postfix) with ESMTPA id 88A0E2C008C;\n\tThu, 21 Sep 2017 18:00:53 +0200 (CEST)" ], "From": "Greg Kurz <groug@kaod.org>", "To": "qemu-devel@nongnu.org", "Date": "Thu, 21 Sep 2017 18:00:53 +0200", "Message-ID": "<150600965332.30533.14702405809647835716.stgit@bahia.lan>", "In-Reply-To": "<150600964184.30533.472565821627831467.stgit@bahia.lan>", "References": "<150600964184.30533.472565821627831467.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": "16301060328624986574", "X-VR-SPAMSTATE": "OK", "X-VR-SPAMSCORE": "-100", "X-VR-SPAMCAUSE": "gggruggvucftvghtrhhoucdtuddrfeelledriedvgdellecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd", "X-detected-operating-system": "by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]", "X-Received-From": "46.105.40.148", "Subject": "[Qemu-devel] [PATCH v2 1/2] kvm: check KVM_CAP_SYNC_MMU with\n\tkvm_vm_check_extension()", "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": "Paolo Bonzini <pbonzini@redhat.com>, Thomas Huth <thuth@redhat.com>,\n\tqemu-ppc@nongnu.org, David 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": "On a server-class ppc host, this capability depends on the KVM type,\nie, HV or PR. If both KVM are present in the kernel, we will always\nget the HV specific value, even if we explicitely requested PR on\nthe command line.\n\nThis can have an impact if we're using hugepages or a balloon device.\n\nSince we've already created the VM at the time any user calls\nkvm_has_sync_mmu(), switching to kvm_vm_check_extension() is\nenough to fix any potential issue.\n\nIt is okay for the other archs that also implement KVM_CAP_SYNC_MMU,\nie, mips, s390, x86 and arm, because they don't depend on the VM being\ncreated or not.\n\nWhile here, let's cache the state of this extension in a bool variable,\nsince it has several users in the code, as suggested by Thomas Huth.\n\nSigned-off-by: Greg Kurz <groug@kaod.org>\n---\n accel/kvm/kvm-all.c | 8 +++++---\n accel/stubs/kvm-stub.c | 4 ++--\n include/sysemu/kvm.h | 2 +-\n 3 files changed, 8 insertions(+), 6 deletions(-)", "diff": "diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c\nindex b0181d722083..4d96c1fee9fe 100644\n--- a/accel/kvm/kvm-all.c\n+++ b/accel/kvm/kvm-all.c\n@@ -87,6 +87,7 @@ struct KVMState\n #endif\n int many_ioeventfds;\n int intx_set_mask;\n+ bool sync_mmu;\n /* The man page (and posix) say ioctl numbers are signed int, but\n * they're not. Linux, glibc and *BSD all treat ioctl numbers as\n * unsigned, and treating them as signed here can break things */\n@@ -1665,6 +1666,8 @@ static int kvm_init(MachineState *ms)\n \n s->many_ioeventfds = kvm_check_many_ioeventfds();\n \n+ s->sync_mmu = !!kvm_vm_check_extension(kvm_state, KVM_CAP_SYNC_MMU);\n+\n return 0;\n \n err:\n@@ -2131,10 +2134,9 @@ int kvm_device_access(int fd, int group, uint64_t attr,\n return err;\n }\n \n-/* Return 1 on success, 0 on failure */\n-int kvm_has_sync_mmu(void)\n+bool kvm_has_sync_mmu(void)\n {\n- return kvm_check_extension(kvm_state, KVM_CAP_SYNC_MMU);\n+ return kvm_state->sync_mmu;\n }\n \n int kvm_has_vcpu_events(void)\ndiff --git a/accel/stubs/kvm-stub.c b/accel/stubs/kvm-stub.c\nindex 3965c528d348..c964af3e1c97 100644\n--- a/accel/stubs/kvm-stub.c\n+++ b/accel/stubs/kvm-stub.c\n@@ -64,9 +64,9 @@ int kvm_cpu_exec(CPUState *cpu)\n abort();\n }\n \n-int kvm_has_sync_mmu(void)\n+bool kvm_has_sync_mmu(void)\n {\n- return 0;\n+ return false;\n }\n \n int kvm_has_many_ioeventfds(void)\ndiff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h\nindex 3a458f50e9f4..bbf12a172339 100644\n--- a/include/sysemu/kvm.h\n+++ b/include/sysemu/kvm.h\n@@ -207,7 +207,7 @@ extern KVMState *kvm_state;\n /* external API */\n \n bool kvm_has_free_slot(MachineState *ms);\n-int kvm_has_sync_mmu(void);\n+bool kvm_has_sync_mmu(void);\n int kvm_has_vcpu_events(void);\n int kvm_has_robust_singlestep(void);\n int kvm_has_debugregs(void);\n", "prefixes": [ "v2", "1/2" ] }