Cover Letter Detail
Show a cover letter.
GET /api/covers/2217721/?format=api
{ "id": 2217721, "url": "http://patchwork.ozlabs.org/api/covers/2217721/?format=api", "web_url": "http://patchwork.ozlabs.org/project/kvm-riscv/cover/20260330122601.22140-1-fangyu.yu@linux.alibaba.com/", "project": { "id": 70, "url": "http://patchwork.ozlabs.org/api/projects/70/?format=api", "name": "Linux KVM RISC-V", "link_name": "kvm-riscv", "list_id": "kvm-riscv.lists.infradead.org", "list_email": "kvm-riscv@lists.infradead.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "http://lists.infradead.org/pipermail/kvm-riscv/", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260330122601.22140-1-fangyu.yu@linux.alibaba.com>", "list_archive_url": null, "date": "2026-03-30T12:25:57", "name": "[v6,0/4] Support runtime configuration for per-VM's HGATP mode", "submitter": { "id": 91416, "url": "http://patchwork.ozlabs.org/api/people/91416/?format=api", "name": null, "email": "fangyu.yu@linux.alibaba.com" }, "mbox": "http://patchwork.ozlabs.org/project/kvm-riscv/cover/20260330122601.22140-1-fangyu.yu@linux.alibaba.com/mbox/", "series": [ { "id": 498017, "url": "http://patchwork.ozlabs.org/api/series/498017/?format=api", "web_url": "http://patchwork.ozlabs.org/project/kvm-riscv/list/?series=498017", "date": "2026-03-30T12:25:57", "name": "Support runtime configuration for per-VM's HGATP mode", "version": 6, "mbox": "http://patchwork.ozlabs.org/series/498017/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/covers/2217721/comments/", "headers": { "Return-Path": "\n <kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.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 secure) header.d=lists.infradead.org header.i=@lists.infradead.org\n header.a=rsa-sha256 header.s=bombadil.20210309 header.b=zaeP1/Th;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n unprotected) header.d=linux.alibaba.com header.i=@linux.alibaba.com\n header.a=rsa-sha256 header.s=default header.b=G8N4pp8p;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=none (no SPF record) smtp.mailfrom=lists.infradead.org\n (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org;\n envelope-from=kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n receiver=patchwork.ozlabs.org)" ], "Received": [ "from bombadil.infradead.org (bombadil.infradead.org\n [IPv6:2607:7c80:54:3::133])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fkr8k1Bmqz1yG8\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 30 Mar 2026 23:26:46 +1100 (AEDT)", "from localhost ([::1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1w7Bhc-0000000BFmI-1wBH;\n\tMon, 30 Mar 2026 12:26:44 +0000", "from out30-97.freemail.mail.aliyun.com ([115.124.30.97])\n\tby bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1w7BhY-0000000BFjh-2Yq5;\n\tMon, 30 Mar 2026 12:26:42 +0000", "from localhost.localdomain(mailfrom:fangyu.yu@linux.alibaba.com\n fp:SMTPD_---0X.zfcHH_1774873586 cluster:ay36)\n by smtp.aliyun-inc.com;\n Mon, 30 Mar 2026 20:26:28 +0800" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20210309; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc\n\t:To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:\n\tResent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:\n\tList-Owner; bh=VzbcxseROzDA/hqZqiZAhHYQZSdgMe5UocRstbtlrW8=; b=zaeP1/ThQrtmo9\n\tAsvO5Ecm4Ftrw04sD+0SMRaBCAF6PLm2H2M1iwUOX99gAWHVyD2snJz9Mo4P+wmT4Zq3vOL3H/Oqd\n\tcz7xG3bbLAsCC0hRcJxPW0wClK7Z3iHAY8FUzzPaQkyKf6dRdoCo+uDjkS64Qsq59WAo+oMrJ/vSk\n\tAN/qHtFdmxlUFvxwOoLj7QdZF9p1vexeUqmSD3WO6E8N6AWZqvrXGSl6ngl4AdpUvI7xTqwD3qVT7\n\txeH5rWrn9yL2WyQkpGbz78dW/iEBZKX1irgkLdYKz1yGnpGQqnzfMFkqn6kI3T2aaYfAEcswWX+hF\n\t6j/KlIdQ6GlSbYcWRnaQ==;", "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=linux.alibaba.com; s=default;\n\tt=1774873594; h=From:To:Subject:Date:Message-Id:MIME-Version;\n\tbh=e3bSMhi6+wVEeJDisGEe9u8O9wBAMD6ULsYIH98k5xg=;\n\tb=G8N4pp8p66w02Fa0ntkmDhbLOT0if3RXDGefnbY0s2TRwKS4ssWt2ouZD8YmM4oueicGuk1zO+k8gq7D/8wqwdnxKTvZO9FsTFAxwm2kGK7pjYlcG5EtnQWho8okNWG70BSJ3HaBDKEPH6+7tqXxceFHXQqZOGJ7PnzMcX7FEAM=" ], "X-Alimail-AntiSpam": "\n AC=PASS;BC=-1|-1;BR=01201311R691e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033037033178;MF=fangyu.yu@linux.alibaba.com;NM=1;PH=DS;RN=18;SR=0;TI=SMTPD_---0X.zfcHH_1774873586;", "From": "fangyu.yu@linux.alibaba.com", "To": "pbonzini@redhat.com,\n\tcorbet@lwn.net,\n\tanup@brainfault.org,\n\tatish.patra@linux.dev,\n\tpjw@kernel.org,\n\tpalmer@dabbelt.com,\n\taou@eecs.berkeley.edu,\n\talex@ghiti.fr,\n\tskhan@linuxfoundation.org", "Cc": "guoren@kernel.org,\n\tradim.krcmar@oss.qualcomm.com,\n\tandrew.jones@oss.qualcomm.com,\n\tlinux-doc@vger.kernel.org,\n\tkvm@vger.kernel.org,\n\tkvm-riscv@lists.infradead.org,\n\tlinux-riscv@lists.infradead.org,\n\tlinux-kernel@vger.kernel.org,\n\tFangyu Yu <fangyu.yu@linux.alibaba.com>", "Subject": "[PATCH v6 0/4] Support runtime configuration for per-VM's HGATP mode", "Date": "Mon, 30 Mar 2026 20:25:57 +0800", "Message-Id": "<20260330122601.22140-1-fangyu.yu@linux.alibaba.com>", "X-Mailer": "git-send-email 2.39.3 (Apple Git-146)", "MIME-Version": "1.0", "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ", "X-CRM114-CacheID": "sfid-20260330_052640_898364_810A1709 ", "X-CRM114-Status": "UNSURE ( 9.32 )", "X-CRM114-Notice": "Please train this message.", "X-Spam-Score": "-14.6 (--------------)", "X-Spam-Report": "Spam detection software,\n running on the system \"bombadil.infradead.org\",\n has NOT identified this incoming email as spam. The original\n message has been attached to this so you can view it or label\n similar future email. If you have any questions, see\n the administrator of that system for details.\n Content preview: From: Fangyu Yu <fangyu.yu@linux.alibaba.com> Currently,\n RISC-V\n KVM hardcodes the G-stage page table format (HGATP mode) to the maximum\n mode\n detected at boot time (e.g., SV57x4 if supported). but often such a wide\n GPA is unnecessary, just as a ho [...]\n Content analysis details: (-14.6 points, 5.0 required)\n pts rule name description\n ---- ----------------------\n --------------------------------------------------\n -7.5 USER_IN_DEF_DKIM_WL From: address is in the default DKIM welcome-list\n -7.5 USER_IN_DEF_SPF_WL From: address is in the default SPF welcome-list\n 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record\n -0.0 SPF_PASS SPF: sender matches SPF record\n 0.1 DKIM_SIGNED Message has a DKIM or DK signature,\n not necessarily valid\n -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from\n envelope-from domain\n -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from\n author's\n domain\n -0.1 DKIM_VALID Message has at least one valid DKIM or DK\n signature\n -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1%\n [score: 0.0000]\n 1.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE: The\n query to Validity was blocked. See\n https://knowledge.validity.com/hc/en-us/articles/20961730681243\n for more information.\n [115.124.30.97 listed in\n sa-trusted.bondedsender.org]\n 1.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to\n Validity was blocked. See\n https://knowledge.validity.com/hc/en-us/articles/20961730681243\n for more information.\n [115.124.30.97 listed in sa-accredit.habeas.com]\n -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no\n trust\n [115.124.30.97 listed in list.dnswl.org]\n 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay\n lines\n -0.5 ENV_AND_HDR_SPF_MATCH Env and Hdr From used in default SPF WL Match\n 1.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to\n Validity was blocked. See\n https://knowledge.validity.com/hc/en-us/articles/20961730681243\n for more information.\n [115.124.30.97 listed in\n bl.score.senderscore.com]", "X-BeenThere": "kvm-riscv@lists.infradead.org", "X-Mailman-Version": "2.1.34", "Precedence": "list", "List-Id": "<kvm-riscv.lists.infradead.org>", "List-Unsubscribe": "<http://lists.infradead.org/mailman/options/kvm-riscv>,\n <mailto:kvm-riscv-request@lists.infradead.org?subject=unsubscribe>", "List-Archive": "<http://lists.infradead.org/pipermail/kvm-riscv/>", "List-Post": "<mailto:kvm-riscv@lists.infradead.org>", "List-Help": "<mailto:kvm-riscv-request@lists.infradead.org?subject=help>", "List-Subscribe": "<http://lists.infradead.org/mailman/listinfo/kvm-riscv>,\n <mailto:kvm-riscv-request@lists.infradead.org?subject=subscribe>", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Sender": "\"kvm-riscv\" <kvm-riscv-bounces@lists.infradead.org>", "Errors-To": "kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org" }, "content": "From: Fangyu Yu <fangyu.yu@linux.alibaba.com>\n\nCurrently, RISC-V KVM hardcodes the G-stage page table format (HGATP mode)\nto the maximum mode detected at boot time (e.g., SV57x4 if supported). but\noften such a wide GPA is unnecessary, just as a host sometimes doesn't need\nsv57.\n\nThis patch introduces per-VM configurability of the G-stage mode via a new\nKVM capability: KVM_CAP_RISCV_SET_HGATP_MODE. User-space can now explicitly\nrequest a specific HGATP mode (SV39x4, SV48x4, SV57x4 or SV32x4) during\nVM creation.\n\n---\nChanges in v6 (Anup's suggestions):\n - Reworked kvm_riscv_gstage_gpa_bits() and kvm_riscv_gstage_gpa_size() to\n take \"unsigned long pgd_levels\" instead of \"struct kvm_arch *\".\n - Moved kvm_riscv_gstage_mode() helper from kvm_host.h to kvm_gstage.h.\n - Renamed kvm->arch.kvm_riscv_gstage_pgd_levels to kvm->arch.pgd_levels.\n - Added pgd_levels to struct kvm_gstage to avoid repeated\n gstage->kvm->arch pointer chasing.\n - Link to v5:\n https://lore.kernel.org/linux-riscv/20260204134507.33912-1-fangyu.yu@linux.alibaba.com/\n---\nChanges in v5:\n - Use architectural HGATP.MODE encodings as the bit index for the supported-mode\n bitmap and for the VM-mode selection UAPI; no new UAPI mode/bit defines are\n introduced(per Radim).\n - Allow KVM_CAP_RISCV_SET_HGATP_MODE on RV32 as well(per Drew).\n - Link to v4:\n https://lore.kernel.org/linux-riscv/20260202140716.34323-1-fangyu.yu@linux.alibaba.com/\n---\nChanges in v4:\n - Extend kvm_riscv_gstage_mode_detect() to probe all HGATP.MODE values\n supported by the host and record them in a bitmask.\n - Treat unexpected pgd_levels in kvm_riscv_gstage_mode() as an internal error\n (e.g. WARN_ON_ONCE())(per Radim).\n - Move kvm_riscv_gstage_gpa_bits() and kvm_riscv_gstage_gpa_size() to header\n as static inline helpers(per Radim).\n - Drop gstage_mode_user_initialized and Remove the kvm_debug() message from\n KVM_CAP_RISCV_SET_HGATP_MODE(per Radim).\n - Link to v3:\n https://lore.kernel.org/linux-riscv/20260125150450.27068-1-fangyu.yu@linux.alibaba.com/\n---\nChanges in v3:\n - Reworked the patch formatting (per Drew).\n - Dropped kvm->arch.kvm_riscv_gstage_mode and derive HGATP.MODE from\n kvm_riscv_gstage_pgd_levels via a helper, avoiding redundant per-VM state(per Drew).\n - Removed kvm_riscv_gstage_max_mode and keep only kvm_riscv_gstage_max_pgd_levels\n for host capability detection(per Drew).\n - Other initialization and return value issues(per Drew).\n - Enforce that KVM_CAP_RISCV_SET_HGATP_MODE can only be enabled before any vCPUs\n are created by rejecting the ioctl once kvm->created_vcpus is non-zero(per Radim).\n - Add a memslot safety check and reject the capability unless\n kvm_are_all_memslots_empty(kvm) is true, ensuring the G-stage format is not\n changed after any memslots have been installed(per Radim).\n - Link to v2:\n https://lore.kernel.org/linux-riscv/20260105143232.76715-1-fangyu.yu@linux.alibaba.com/\n\nFangyu Yu (4):\n RISC-V: KVM: Support runtime configuration for per-VM's HGATP mode\n RISC-V: KVM: Cache gstage pgd_levels in struct kvm_gstage\n RISC-V: KVM: Detect and expose supported HGATP G-stage modes\n RISC-V: KVM: add KVM_CAP_RISCV_SET_HGATP_MODE\n\n Documentation/virt/kvm/api.rst | 27 ++++++++\n arch/riscv/include/asm/kvm_gstage.h | 58 ++++++++++++++--\n arch/riscv/include/asm/kvm_host.h | 1 +\n arch/riscv/kvm/gstage.c | 102 ++++++++++++++--------------\n arch/riscv/kvm/main.c | 12 ++--\n arch/riscv/kvm/mmu.c | 70 ++++++-------------\n arch/riscv/kvm/vm.c | 20 +++++-\n arch/riscv/kvm/vmid.c | 3 +-\n include/uapi/linux/kvm.h | 1 +\n 9 files changed, 178 insertions(+), 116 deletions(-)" }