Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/831032/?format=api
{ "id": 831032, "url": "http://patchwork.ozlabs.org/api/1.2/patches/831032/?format=api", "web_url": "http://patchwork.ozlabs.org/project/kvm-ppc/patch/20171027030008.17200-1-aik@ozlabs.ru/", "project": { "id": 23, "url": "http://patchwork.ozlabs.org/api/1.2/projects/23/?format=api", "name": "KVM PowerPC development", "link_name": "kvm-ppc", "list_id": "kvm-ppc.vger.kernel.org", "list_email": "kvm-ppc@vger.kernel.org", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20171027030008.17200-1-aik@ozlabs.ru>", "list_archive_url": null, "date": "2017-10-27T03:00:08", "name": "[kernel] vfio/spapr: Add trace points for map/unmap", "commit_ref": null, "pull_url": null, "state": "not-applicable", "archived": false, "hash": "b0d950e6bfb032938424354cf0b258d9a5b03caf", "submitter": { "id": 7621, "url": "http://patchwork.ozlabs.org/api/1.2/people/7621/?format=api", "name": "Alexey Kardashevskiy", "email": "aik@ozlabs.ru" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/kvm-ppc/patch/20171027030008.17200-1-aik@ozlabs.ru/mbox/", "series": [ { "id": 10478, "url": "http://patchwork.ozlabs.org/api/1.2/series/10478/?format=api", "web_url": "http://patchwork.ozlabs.org/project/kvm-ppc/list/?series=10478", "date": "2017-10-27T03:00:08", "name": "[kernel] vfio/spapr: Add trace points for map/unmap", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/10478/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/831032/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/831032/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<kvm-ppc-owner@vger.kernel.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org", "Authentication-Results": "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=kvm-ppc-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)", "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3yNTBm213vz9t30\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 27 Oct 2017 14:00:16 +1100 (AEDT)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751399AbdJ0DAO (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tThu, 26 Oct 2017 23:00:14 -0400", "from ozlabs.ru ([107.173.13.209]:51116 \"EHLO ozlabs.ru\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1751263AbdJ0DAO (ORCPT <rfc822;kvm-ppc@vger.kernel.org>);\n\tThu, 26 Oct 2017 23:00:14 -0400", "from vpl1.ozlabs.ibm.com (localhost [IPv6:::1])\n\tby ozlabs.ru (Postfix) with ESMTP id 611FB3A60125;\n\tThu, 26 Oct 2017 22:59:05 -0400 (EDT)" ], "From": "Alexey Kardashevskiy <aik@ozlabs.ru>", "To": "linuxppc-dev@lists.ozlabs.org", "Cc": "Alexey Kardashevskiy <aik@ozlabs.ru>,\n\tAlex Williamson <alex.williamson@redhat.com>,\n\tDavid Gibson <david@gibson.dropbear.id.au>,\n\tkvm-ppc@vger.kernel.org, kvm@vger.kernel.org", "Subject": "[PATCH kernel] vfio/spapr: Add trace points for map/unmap", "Date": "Fri, 27 Oct 2017 14:00:08 +1100", "Message-Id": "<20171027030008.17200-1-aik@ozlabs.ru>", "X-Mailer": "git-send-email 2.11.0", "Sender": "kvm-ppc-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<kvm-ppc.vger.kernel.org>", "X-Mailing-List": "kvm-ppc@vger.kernel.org" }, "content": "This adds trace_map/trace_unmap tracepoints to spapr driver. Type1 already\nuses these via the IOMMU API (iommu_map/__iommu_unmap).\n\nSigned-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>\n---\n\nExample:\n qemu-system-ppc-8655 [096] 724.662740: unmap: IOMMU: iova=0x000000003ffff000 size=4096 unmapped_size=4096\n qemu-system-ppc-8656 [104] 724.970912: map: IOMMU: iova=0x0800000000000000 paddr=0x00007ffef7ff0000 size=65536\n---\n drivers/vfio/vfio_iommu_spapr_tce.c | 12 ++++++++++--\n 1 file changed, 10 insertions(+), 2 deletions(-)", "diff": "diff --git a/drivers/vfio/vfio_iommu_spapr_tce.c b/drivers/vfio/vfio_iommu_spapr_tce.c\nindex 63112c36ab2d..4531486c77c6 100644\n--- a/drivers/vfio/vfio_iommu_spapr_tce.c\n+++ b/drivers/vfio/vfio_iommu_spapr_tce.c\n@@ -22,6 +22,7 @@\n #include <linux/vmalloc.h>\n #include <linux/sched/mm.h>\n #include <linux/sched/signal.h>\n+#include <trace/events/iommu.h>\n \n #include <asm/iommu.h>\n #include <asm/tce.h>\n@@ -502,17 +503,19 @@ static int tce_iommu_clear(struct tce_container *container,\n \t\tstruct iommu_table *tbl,\n \t\tunsigned long entry, unsigned long pages)\n {\n-\tunsigned long oldhpa;\n+\tunsigned long oldhpa, unmapped, firstentry = entry, totalpages = pages;\n \tlong ret;\n \tenum dma_data_direction direction;\n \n-\tfor ( ; pages; --pages, ++entry) {\n+\tfor (unmapped = 0; pages; --pages, ++entry) {\n \t\tdirection = DMA_NONE;\n \t\toldhpa = 0;\n \t\tret = iommu_tce_xchg(tbl, entry, &oldhpa, &direction);\n \t\tif (ret)\n \t\t\tcontinue;\n \n+\t\t++unmapped;\n+\n \t\tif (direction == DMA_NONE)\n \t\t\tcontinue;\n \n@@ -523,6 +526,9 @@ static int tce_iommu_clear(struct tce_container *container,\n \n \t\ttce_iommu_unuse_page(container, oldhpa);\n \t}\n+\ttrace_unmap(firstentry << tbl->it_page_shift,\n+\t\t\ttotalpages << tbl->it_page_shift,\n+\t\t\tunmapped << tbl->it_page_shift);\n \n \treturn 0;\n }\n@@ -965,6 +971,8 @@ static long tce_iommu_ioctl(void *iommu_data,\n \t\t\t\t\tdirection);\n \n \t\tiommu_flush_tce(tbl);\n+\t\tif (!ret)\n+\t\t\ttrace_map(param.iova, param.vaddr, param.size);\n \n \t\treturn ret;\n \t}\n", "prefixes": [ "kernel" ] }