Cover Letter Detail
Show a cover letter.
GET /api/1.2/covers/2233288/?format=api
{ "id": 2233288, "url": "http://patchwork.ozlabs.org/api/1.2/covers/2233288/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/cover/20260506033642.3641390-1-jim.shu@sifive.com/", "project": { "id": 14, "url": "http://patchwork.ozlabs.org/api/1.2/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": "<20260506033642.3641390-1-jim.shu@sifive.com>", "list_archive_url": null, "date": "2026-05-06T03:36:37", "name": "[v3,0/5] Defer the IOMMU translation in the CPU path and support access_type", "submitter": { "id": 83153, "url": "http://patchwork.ozlabs.org/api/1.2/people/83153/?format=api", "name": "Jim Shu", "email": "jim.shu@sifive.com" }, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/cover/20260506033642.3641390-1-jim.shu@sifive.com/mbox/", "series": [ { "id": 502923, "url": "http://patchwork.ozlabs.org/api/1.2/series/502923/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=502923", "date": "2026-05-06T03:36:39", "name": "Defer the IOMMU translation in the CPU path and support access_type", "version": 3, "mbox": "http://patchwork.ozlabs.org/series/502923/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/covers/2233288/comments/", "headers": { "Return-Path": "<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=sifive.com header.i=@sifive.com header.a=rsa-sha256\n header.s=google header.b=b0YV6M6m;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists1p.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)" ], "Received": [ "from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g9Lh50MX9z1y04\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 06 May 2026 13:38:29 +1000 (AEST)", "from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists1p.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1wKT4M-0001lb-22; Tue, 05 May 2026 23:37:06 -0400", "from eggs.gnu.org ([2001:470:142:3::10])\n by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <jim.shu@sifive.com>)\n id 1wKT4F-0001j1-I9\n for qemu-devel@nongnu.org; Tue, 05 May 2026 23:37:00 -0400", "from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1) (envelope-from <jim.shu@sifive.com>)\n id 1wKT4C-0006Nt-Sa\n for qemu-devel@nongnu.org; Tue, 05 May 2026 23:36:58 -0400", "by mail-pj1-x102f.google.com with SMTP id\n 98e67ed59e1d1-35fb16e56efso4131702a91.2\n for <qemu-devel@nongnu.org>; Tue, 05 May 2026 20:36:55 -0700 (PDT)", "from hsinchu26.internal.sifive.com ([210.176.154.34])\n by smtp.gmail.com with ESMTPSA id\n d9443c01a7336-2ba7ca34cfdsm7666265ad.79.2026.05.05.20.36.47\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 05 May 2026 20:36:53 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=sifive.com; s=google; t=1778038614; x=1778643414; darn=nongnu.org;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:from:to:cc:subject:date:message-id:reply-to;\n bh=NmSBLcNJwbzykPdrUBPXLq5aVjtVgxVeir17yo2flxY=;\n b=b0YV6M6mwijuu8j+qNTcK/rI2MKwUFx/7Cw3p58kqsw9YJimyhTO/ASilsSONOR+It\n GBoI4SXQX2/gGbn8v+i6pujVbLIR+fpNDaBNDbPgWsgTg/8Ijhm5+NMA5eYiEoUEBw8s\n WQGrO6Wz93AhEbpXgYByWEGSThgLIRQ8ZzRi+GFgcbCW8dIxEqPEEmCKWrEljmJjfuPs\n SwJlofVvimRM8P07g/BkgQw6pllDSa0KnHIi4UpYdTEmF0bGCjEEfcTp5XX3r9ZfVtiO\n eMWd3uXB7o9wQHGETeYe91n9vk4jBXJ6j4A5Uj3vA0EFbs9VDESS/2wj4r5i5xPK21UY\n e17Q==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1778038614; x=1778643414;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=NmSBLcNJwbzykPdrUBPXLq5aVjtVgxVeir17yo2flxY=;\n b=KJg5R/ROMY+98yFWOdeWx2yUB2b01cqziMQT43PWNvORF6X1IblWT6Gkzhb4O/cZOE\n K9CatmIn17IOdN3iC1pvz4s4i4DO9DNANOVYrHNwYuVJ+YlNn/pEzb9RLSZFcMGsSgR7\n JC2/3yfJGZI0yHzPdHSk7EO32HpfVJcTaZT9mqeA5vF4/n7wotIAqFIGOTD8/kbZS9aZ\n fDJetM5/gkhZt2x3GlyihDYEUIIJCiRnw1GCvZNlHJ7Dqkrtv13vIayPIEbTGS+ncu3j\n JJt4TFNhWafkdvCAJSshPq8G/IQke6NR2C3ys34e/Vv+phvJQzUVgCTQJgZSM1TG9fVL\n HHTw==", "X-Gm-Message-State": "AOJu0YxYlDnUOVQg+/LfN7b2nYuom2BkibXH9wmv6OUo5AOT8Bvw3XEE\n 0W5jvadiTgfyU+rOW/ZSbAgnWkI1QYc2P3RKfEMfxQHs/xxcD+z9waSUwAHp1DZd1vRjvd2/bpB\n k+TipbjZ3SWSOMIivIiaNC9/ytrA29R+jeaENt8ozVR15tt7O5Qdhu/JobWWFu9M9CcBqpqKo2+\n uB8EIS6xEY+iGnRxIyY3yeKL98Wdl+dBNbjyayZBn4", "X-Gm-Gg": "AeBDieuS5PtM/7iNP5z9WcyL0CFp63d2B7eezzmevQDFYzYOfVgbhSlsLnbb8KEeKxl\n qohHyFeaNZ81mcmGqnvwoFSNorq6j+ZZuVX8JgS074MDDrgrlwrk3kNE4pzQNcFFwZ76EusaJ4d\n XIvSfiXOi2gUXOU/r1An0UaDzwtSTQYc89XTXN9P5Cz+kKflFi1Y3II6zqavuerBwVt375r2d9R\n ziFBo9J0YBrvb6bPsPHqr/UMtq9HOPG10WrmjN1GwNv7JvY+Q7EMVUIg7cmDsCIGaGrakQ89gkW\n kUKA7L/Isvwr8+/f9//OqXqxkFk1ua7QitzZCPHp7xF7yl44W00QslMOkpi1ENqbmA2Pk/6B/9l\n eGY590TobAuT3JN7MCxeCcIuC3MBTr2Q3ZNOj3WlFyL+s9rt8YWm9wY8xN1BMnvkOlK6QZ9osBH\n /t78fIgD0xwHO6npGm4LnJDeaBJUAf+knB13jSDJHEHfV/0G0UnLl++IY=", "X-Received": "by 2002:a17:903:13cf:b0:2b2:501c:bc0 with SMTP id\n d9443c01a7336-2ba79290f29mr15809285ad.7.1778038614073;\n Tue, 05 May 2026 20:36:54 -0700 (PDT)", "From": "Jim Shu <jim.shu@sifive.com>", "To": "qemu-devel@nongnu.org,\n\tqemu-riscv@nongnu.org", "Cc": "Richard Henderson <richard.henderson@linaro.org>,\n Paolo Bonzini <pbonzini@redhat.com>,\n =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <philmd@linaro.org>,\n Zhao Liu <zhao1.liu@intel.com>, Peter Xu <peterx@redhat.com>,\n Michael Rolnik <mrolnik@gmail.com>, Song Gao <gaosong@loongson.cn>,\n Laurent Vivier <laurent@vivier.eu>,\n \"Edgar E. Iglesias\" <edgar.iglesias@gmail.com>,\n Aurelien Jarno <aurelien@aurel32.net>, Jiaxun Yang <jiaxun.yang@flygoat.com>,\n Aleksandar Rikalo <arikalo@gmail.com>, Stafford Horne <shorne@gmail.com>,\n Nicholas Piggin <npiggin@gmail.com>, Chinmay Rath <rathc@linux.ibm.com>,\n Glenn Miles <milesg@linux.ibm.com>, Palmer Dabbelt <palmer@dabbelt.com>,\n Alistair Francis <alistair.francis@wdc.com>, Weiwei Li <liwei1518@gmail.com>,\n Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com>,\n Liu Zhiwei <zhiwei_liu@linux.alibaba.com>,\n Chao Liu <chao.liu.zevorn@gmail.com>,\n Yoshinori Sato <yoshinori.sato@nifty.com>,\n Ilya Leoshkevich <iii@linux.ibm.com>, David Hildenbrand <david@kernel.org>,\n Cornelia Huck <cohuck@redhat.com>, Eric Farman <farman@linux.ibm.com>,\n Matthew Rosato <mjrosato@linux.ibm.com>,\n Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,\n Artyom Tarasenko <atar4qemu@gmail.com>, Max Filippov <jcmvbkbc@gmail.com>,\n qemu-ppc@nongnu.org (open list:PowerPC TCG CPUs),\n qemu-s390x@nongnu.org (open list:S390 TCG CPUs),\n Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>,\n Mark Burton <mburton@qti.qualcomm.com>,\n Peter Maydell <peter.maydell@linaro.org>, Jim Shu <jim.shu@sifive.com>", "Subject": "[PATCH v3 0/5] Defer the IOMMU translation in the CPU path and\n support access_type", "Date": "Wed, 6 May 2026 11:36:37 +0800", "Message-ID": "<20260506033642.3641390-1-jim.shu@sifive.com>", "X-Mailer": "git-send-email 2.43.0", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Received-SPF": "pass client-ip=2607:f8b0:4864:20::102f;\n envelope-from=jim.shu@sifive.com; helo=mail-pj1-x102f.google.com", "X-Spam_score_int": "-20", "X-Spam_score": "-2.1", "X-Spam_bar": "--", "X-Spam_report": "(-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,\n DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,\n SPF_PASS=-0.001 autolearn=ham autolearn_force=no", "X-Spam_action": "no action", "X-BeenThere": "qemu-devel@nongnu.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "qemu development <qemu-devel.nongnu.org>", "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>", "List-Archive": "<https://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 <mailto:qemu-devel-request@nongnu.org?subject=subscribe>", "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org", "Sender": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org" }, "content": "Incoming security protection devices feature more complex IOMMUMemoryRegion\nimplementation in the CPU path than ARM MPC device. For example,\nRISC-V wgChecker [1] may permit the access with only RO/WO permissions.\nConsequently, the IOMMUMemoryRegion could return different sections for\nread & write access.\n\nTo support such IOMMUMemoryRegion behavior in the CPU path, the design\nof IOMMU translation must be updated:\n\n1. address_space_translate*() must now pass the access_type to\n IOMMUMemoryRegion.\n2. Since IOMMU translation results are too complex to be fully stored\n in the CPU TLB. we will defer the translation until the actual access\n occurs. Also, TLB is allowed to store the untranslated IOMMU region.\n\nTo implement deferred IOMMU translation, this patchset introduces the\nfollowing changes:\n\n1. tlb_set_page_full() no longer translates the IOMMU region\n immediately. Instead, it stores the untranslated region directly in\n the TLB. A new slow-path flag, TLB_IOMMU, is introduced to force\n access into the slow path when a region has not yet been translated\n in the TLB entry.\n\n2. When the CPU utilizes a TLB entry in the slow path, it should perform\n the lazy IOMMU translation of the access_type first. The resulting\n translated region and access type are stored in CPUTLBEntryFull.\n Since the slow path always performs lazy translation first, we can\n switch the CPUTLBEntryFull content to the correct access type before\n use.\n\n3. To accelerate memory access in the fast path, lazy translation can\n update the addend of the CPUTLBEntry when translating the region to a\n host memory region. We restrict the IOMMU region to have a single\n non-zero 'addend' across all permissions. If a second 'addend' is\n present for a CPUTLBEntry, QEMU will trigger an assertion. This\n limitation is sufficient for security devices, as their \"secondary\"\n region is typically an IO region used to emulate device error\n handling when access is rejected.\n\n4. To support non-slow TLB flags, lazy translation can update the TLB\n flags in the 'addr_idx' of the CPUTLBEntry. Lazy translation only\n updates the flags for the permissions specified in @prot. This\n ensures that each access_type of a translated region to maintains\n independent TLB flags. For example, TLB_DIRTY of memory region will\n not be \"polluted\" from other permission that translated to different\n region.\n\nBoth RISC-V wgChecker [1] and RISC-V IOPMP [2] devices require this\nfeature.\n\n[1] RISC-V WG:\nhttps://patchew.org/QEMU/20251021155548.584543-1-jim.shu@sifive.com/\n[2] RISC-V IOPMP:\nhttps://patchew.org/QEMU/20250312093735.1517740-1-ethan84@andestech.com/\n\nChanged since v2:\n- Fix unused initialized memory error\n\nChanged since v1:\n- Remove the ping-pong TLB entry behavior. Instead, defer the IOMMU\n translation until actual access in the CPU path. Provide a IOMMU\n lazy translation function with the special handling of 'addend'\n and 'addr_idx' fields of CPUTLBEntry.\n- Fix the checkpatch warning.\n\nJim Shu (5):\n accel/tcg: Pass access_type as an argument of tlb_set_page*()\n accel/tcg: address_space_translate*() will pass the correct\n iommu_flags\n accel/tcg: Provide early AS translate function\n accel/tcg: Add IOMMU lazy translation function\n accel/tcg: Support IOMMU lazy translation in CPU TLB\n\n accel/tcg/cputlb.c | 247 +++++++++++++++++++++++++--\n include/accel/tcg/iommu.h | 17 +-\n include/exec/cputlb.h | 11 +-\n include/exec/tlb-flags.h | 4 +-\n include/hw/core/cpu.h | 15 ++\n system/physmem.c | 60 ++++++-\n target/alpha/helper.c | 2 +-\n target/avr/helper.c | 3 +-\n target/i386/tcg/system/excp_helper.c | 3 +-\n target/loongarch/tcg/tlb_helper.c | 2 +-\n target/m68k/helper.c | 10 +-\n target/microblaze/helper.c | 8 +-\n target/mips/tcg/system/tlb_helper.c | 4 +-\n target/or1k/mmu.c | 2 +-\n target/ppc/mmu_helper.c | 2 +-\n target/riscv/cpu_helper.c | 2 +-\n target/rx/cpu.c | 3 +-\n target/s390x/tcg/excp_helper.c | 2 +-\n target/sh4/helper.c | 3 +-\n target/sparc/mmu_helper.c | 6 +-\n target/tricore/helper.c | 2 +-\n target/xtensa/helper.c | 3 +-\n 22 files changed, 354 insertions(+), 57 deletions(-)" }