From nobody Mon Apr 13 00:05:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1775836538; cv=none; d=zohomail.com; s=zohoarc; b=AGvP2Qi0jQG+UTO2DsHlpOkR4ZSsZPCzUCruNJTb75XLW6nsP/WXBnuUVBz1Gwu9BZ+Ls+IKlcKIk7BSeBNJrPEhgOkLLygwhA17LxAhkD10ow4c+c3YTu9DJgHdh0OqS9svm4M/8eHR9kJPc3ZKIfTfQG7ua3zBZY401VwBeVw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1775836538; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=djlyIF5R+CWEfFCif4JaIJrt1D+sAomgl/JLYjj3hDI=; b=NGR+e6IAC6Kt9c4IWLjtsaIlLqZKst4V6AaL28ZREcwNX6MtL7LJuMK8H/QKxm5p1wOslhuPMVkxVec/Py4CQ1wqE13ePxDUmhZsG5TmL7BLAiH1fK2jYfzB2Vm9LjfWjm0e8PXliStJywJwmZ0sRofSs5DynJ2JLDw8LXEPbMg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1775836538832369.91051181524983; Fri, 10 Apr 2026 08:55:38 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1279424.1563901 (Exim 4.92) (envelope-from ) id 1wBECX-0008WF-HM; Fri, 10 Apr 2026 15:55:21 +0000 Received: by outflank-mailman (output) from mailman id 1279424.1563901; Fri, 10 Apr 2026 15:55:21 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wBECX-0008VC-8Q; Fri, 10 Apr 2026 15:55:21 +0000 Received: by outflank-mailman (input) for mailman id 1279424; Fri, 10 Apr 2026 15:55:20 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) id 1wBECW-0008KK-Hl for xen-devel@lists.xenproject.org; Fri, 10 Apr 2026 15:55:20 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wBECV-00DRfX-Tj for xen-devel@lists.xenproject.org; Fri, 10 Apr 2026 17:55:19 +0200 Received: from [10.42.69.10] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 69d91d67-5cb7-0a2a0a5109dd-0a2a450a9f28-6 for ; Fri, 10 Apr 2026 17:55:19 +0200 Received: from [209.85.128.44] (helo=mail-wm1-f44.google.com) by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.56.0) (envelope-from ) id 69d91d67-ee98-0a2a450a0019-d155802cbde7-3 for ; Fri, 10 Apr 2026 17:55:19 +0200 Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-488b0046078so22060005e9.1 for ; Fri, 10 Apr 2026 08:55:19 -0700 (PDT) Received: from fedora (user-109-243-69-121.play-internet.pl. [109.243.69.121]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-488d5b3c597sm78285605e9.12.2026.04.10.08.55.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Apr 2026 08:55:18 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775836519; x=1776441319; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=djlyIF5R+CWEfFCif4JaIJrt1D+sAomgl/JLYjj3hDI=; b=MzwOTpZyxdQMxkyKRB+s4Eahz7Bn4RaUQupeQYnbX6nkmnGD89O6OU6vRGiHhXH15D bBGhMmkqZK/egAssnZQG77rOcT3ZiwQIrQewqVFH+XLQ5wVJlRPdXfB/tI07oc6pLv4r e9qzu4ZIUnVOvpHZ4unDMnjk0S5u9/NUrRLjkCsH638t8ZCqHs06iGdQO8CHKFmr2jXb 93Uf6PFfCsia9/QG4WDpn9z/8GdwbUO01u6+x1+7Sl0SkiEpoiSBmpjzpXRlr/OyL5r3 jCmDda2Df1AX81ODXZrilfuotLX5JYp4knFRTgcGOPL4AofM3ouGAS98sBVvATt6Ihz7 5J9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775836519; x=1776441319; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=djlyIF5R+CWEfFCif4JaIJrt1D+sAomgl/JLYjj3hDI=; b=C+EXeYRisuZWf3T52xP2gYUFBX3VQH69SHLNTx0plWhaeJravBeJhH/+DabnQKPzjR TC/Rf2C5o7QXZoZu0fI8zpfC5pCaUFx1CrMND34n9tCvWJHQFHoDOlFiXmsuBaj6c565 B6dbVuE0gZNjEYbi79k/HTR9yPL2JG9JItdK6DCXPvISUISYWKjRrFZ3AhFr0lPMHjoo bVnazuMZXpceHA7rJOaCIgQTRdlGtkUm3ul1ewcQZgcsarOrQ89BdOjbxPIzvWEdesia QKPZGHkA26VWcRnh+iiGArQQBFiTjfSiWXSik0bSwjllq7ER9JRYaEv5LNtT6fIypbRI BnUA== X-Gm-Message-State: AOJu0YxA6QyatpT6dtLLgnoWXS+YK9nbSVa7RKgwg+5UcueEpzXBzrt4 LxwQZK9dJEe6ICzix31f/noijo2SMVAavFNZAMNxKsshbqCaLKT/I7JyPg+YfQ== X-Gm-Gg: AeBDies4hv6mAJLJSqsPXwr3srBWKP3aShax0XiwO4F+mbSEAZ0sYjm3S6vO0yZ8SjS Zj/uLDKl8BBDMRBMR83/48Qt9RKcf0LrSIXHlIZxOVs0NAftpMGzqjIx5V2Z8VZUyZ2AsPKbcHg JZ9LCq3q9RmIDBJ93k3QjfhyOSA7lMxRRebAfQWlkTB3P+hak7Xk5QeVRMS9ATbMOlZSiLMEwJw fbNQrOSau9Fks7UxYjE8h7tIe3rIWJAVYfXsZnBEIE5WEhL9FmyM9b1JxoBTDXWEIx9F+tG3s1/ cjFfmECfFVMbIxPCx9rSL4dwr18CeeGcxlMgZjFeosJgNg5zbyAOyASfjZUAv0QROeZWzecckZz YwMnPrFnL9BHyzanIqZ4e3Oo8lS/Qy8JXWI29Gl2UxbalL2fVlgFUIGaEN0/uiFKbbPdI0eGUGz w3Hx6qAQzMEieUHHxqU4qJkLXqmf6L17VR+1u6ekGb+Fn0MrXZ0WYXC89jffFZ46IQVw== X-Received: by 2002:a05:600c:46cb:b0:488:c51f:e04e with SMTP id 5b1f17b1804b1-488d67f3a0fmr50197155e9.13.1775836518875; Fri, 10 Apr 2026 08:55:18 -0700 (PDT) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Romain Caritey , Oleksii Kurochko , Alistair Francis , Connor Davis , Andrew Cooper , Anthony PERARD , Michal Orzel , Jan Beulich , Julien Grall , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Stefano Stabellini Subject: [PATCH v3 08/12] xen/riscv: rework G-stage mode handling Date: Fri, 10 Apr 2026 17:54:54 +0200 Message-ID: <94c914766171b732524d2d64c283e566595a4d22.1775836193.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-4011c0/1775836519-BD3590B1-ACB91251/10/73395122804 X-purgate-type: spam X-purgate-size: 12904 X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1775836541094154100 Content-Type: text/plain; charset="utf-8" Rework G-stage mode handling to make the selected mode descriptor reusable outside of p2m initialization, both for filling CPU nodes in the device tree passed to dom0less guests and for per-domain G-stage mode selection at domain creation time. Promote modes[] from a local __initconst variable inside gstage_mode_detect() to a file-scope static const array, and convert max_gstage_mode from an embedded struct (assigned by value) to a global const pointer into modes[]. This allows referencing both the mode identifier and the mode name after init without copying the descriptor. Remove get_max_supported_mode(); its callers now dereference max_gstage_mode->mode directly. Change struct p2m_domain::mode from an embedded gstage_mode_desc to a const pointer into modes[], so each domain shares the descriptor rather than carrying its own copy. Adjust the modes[] entries in three ways: - Use lowercase names without the "x4" suffix (e.g. "sv39" instead of "Sv39x4"). The DT mmu-type binding [1] does not include the suffix, so the name can now be passed directly to the guest without transformation. The suffix is appended only in the diagnostic printk, where it remains informative. - Use "none" for Bare mode (HGATP_MODE_OFF) to match the DT binding. - Change paging_levels to represent the root page-table level index (i.e. total paging levels minus one) rather than the total count. P2M_ROOT_LEVEL() now returns the correct VPN index directly, without requiring callers to subtract one or use hardcoded offsets. Add gstage_mode[8] to xen_arch_domainconfig so the toolstack can request a specific G-stage mode at domain creation time. Introduce find_gstage_mode() to resolve a mode descriptor by name (case-insensitive), capping the result at max_gstage_mode to prevent requesting a mode the hardware does not support. Update p2m_init() to accept a xen_domctl_createdomain pointer and call find_gstage_mode() instead of hardcoding Sv39x4. Add arch_parse_dom0less_node() in a new dom0less-build.c to read the "mmu-type" DT property from a guest domain node and store it in boot_domain::create_cfg.arch.gstage_mode, falling back to maximum supported mode when the property is absent. [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree= /Documentation/devicetree/bindings/riscv/cpus.yaml?h=3Dv6.19-rc3#n82 Signed-off-by: Oleksii Kurochko --- Changes in v3: - New patch. Was taken from another patch series: https://lore.kernel.org/xen-devel/cover.1773157782.git.oleksii.kurochko@= gmail.com/T/#m6eb886bdf718b06b967d1688314b80e7374a8de5 --- xen/arch/riscv/Makefile | 1 + xen/arch/riscv/dom0less-build.c | 30 ++++++++ xen/arch/riscv/include/asm/p2m.h | 11 +-- xen/arch/riscv/p2m.c | 113 +++++++++++++++++++++---------- xen/arch/riscv/vmid.c | 2 +- xen/include/public/arch-riscv.h | 5 ++ 6 files changed, 121 insertions(+), 41 deletions(-) create mode 100644 xen/arch/riscv/dom0less-build.c diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile index eecdcbc76867..8f7fd625dddd 100644 --- a/xen/arch/riscv/Makefile +++ b/xen/arch/riscv/Makefile @@ -1,6 +1,7 @@ obj-y +=3D aplic.o obj-y +=3D cpufeature.o obj-y +=3D domain.o +obj-$(CONFIG_DOM0LESS_BOOT) +=3D dom0less-build.init.o obj-$(CONFIG_EARLY_PRINTK) +=3D early_printk.o obj-y +=3D entry.o obj-y +=3D extable.o diff --git a/xen/arch/riscv/dom0less-build.c b/xen/arch/riscv/dom0less-buil= d.c new file mode 100644 index 000000000000..11fa184d54be --- /dev/null +++ b/xen/arch/riscv/dom0less-build.c @@ -0,0 +1,30 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include +#include +#include + +#include + +int __init arch_parse_dom0less_node(struct dt_device_node *node, + struct boot_domain *bd) +{ + const char *mmu_type; + + if ( dt_property_read_string(node, "mmu-type", &mmu_type) ) + { + dprintk(XENLOG_WARNING, "mmu-type property is missing in guest dom= ain " + "node. %s will be used as fallback\n", max_gstage_mode->na= me); + + mmu_type =3D max_gstage_mode->name; + } + + if ( safe_strcpy(bd->create_cfg.arch.gstage_mode, mmu_type) ) + { + dprintk(XENLOG_ERR, "mmu-type value \"%s\" is too long\n", mmu_typ= e); + + return -EINVAL; + } + + return 0; +} diff --git a/xen/arch/riscv/include/asm/p2m.h b/xen/arch/riscv/include/asm/= p2m.h index 54ea67990f06..b5b6a996baeb 100644 --- a/xen/arch/riscv/include/asm/p2m.h +++ b/xen/arch/riscv/include/asm/p2m.h @@ -13,7 +13,7 @@ =20 #define P2M_ROOT_ORDER (ilog2(GSTAGE_ROOT_PAGE_TABLE_SIZE) - PAGE_SHIFT) #define P2M_ROOT_PAGES BIT(P2M_ROOT_ORDER, U) -#define P2M_ROOT_LEVEL(p2m) ((p2m)->mode.paging_levels) +#define P2M_ROOT_LEVEL(p2m) ((p2m)->mode->paging_levels) =20 /* * According to the RISC-V spec: @@ -55,6 +55,8 @@ struct gstage_mode_desc { char name[8]; }; =20 +extern const struct gstage_mode_desc *max_gstage_mode; + /* Per-p2m-table state */ struct p2m_domain { /* @@ -68,7 +70,7 @@ struct p2m_domain { /* The root of the p2m tree. May be concatenated */ struct page_info *root; =20 - struct gstage_mode_desc mode; + const struct gstage_mode_desc *mode; =20 /* Back pointer to domain */ struct domain *domain; @@ -215,9 +217,10 @@ static inline bool arch_acquire_resource_check(struct = domain *d) } =20 void guest_mm_init(void); -unsigned char get_max_supported_mode(void); =20 -int p2m_init(struct domain *d); +struct xen_domctl_createdomain; + +int p2m_init(struct domain *d, const struct xen_domctl_createdomain *confi= g); =20 static inline void p2m_write_lock(struct p2m_domain *p2m) { diff --git a/xen/arch/riscv/p2m.c b/xen/arch/riscv/p2m.c index d63697c89a1a..b0773083ff53 100644 --- a/xen/arch/riscv/p2m.c +++ b/xen/arch/riscv/p2m.c @@ -45,12 +45,27 @@ struct p2m_pte_ctx { unsigned int level; /* Paging level at which the PTE resides.= */ }; =20 -static struct gstage_mode_desc __ro_after_init max_gstage_mode =3D { - .mode =3D HGATP_MODE_OFF, - .paging_levels =3D 0, - .name =3D "Bare", +/* Values should be sorted by ->mode in this array */ +static const struct gstage_mode_desc modes[] =3D { + /* + * Based on the RISC-V spec: + * Bare mode is always supported, regardless of SXLEN. + * When SXLEN=3D32, the only other valid setting for MODE is Sv32. + * When SXLEN=3D64, three paged virtual-memory schemes are defined: + * Sv39, Sv48, and Sv57. + */ + { HGATP_MODE_OFF, 0, "none" }, +#ifdef CONFIG_RISCV_32 + { HGATP_MODE_SV32X4, 1, "sv32" }, +#else + { HGATP_MODE_SV39X4, 2, "sv39" }, + { HGATP_MODE_SV48X4, 3, "sv48" }, + { HGATP_MODE_SV57X4, 4, "sv57" }, +#endif }; =20 +const struct gstage_mode_desc * __ro_after_init max_gstage_mode =3D &modes= [0]; + static void p2m_free_page(struct p2m_domain *p2m, struct page_info *pg); =20 static inline void p2m_free_metadata_page(struct p2m_domain *p2m, @@ -63,11 +78,6 @@ static inline void p2m_free_metadata_page(struct p2m_dom= ain *p2m, } } =20 -unsigned char get_max_supported_mode(void) -{ - return max_gstage_mode.mode; -} - /* * If anything is changed here, it may also require updates to * p2m_{get,set}_type(). @@ -148,23 +158,6 @@ static pte_t *p2m_get_root_pointer(struct p2m_domain *= p2m, gfn_t gfn) =20 static void __init gstage_mode_detect(void) { - static const struct gstage_mode_desc modes[] __initconst =3D { - /* - * Based on the RISC-V spec: - * Bare mode is always supported, regardless of SXLEN. - * When SXLEN=3D32, the only other valid setting for MODE is Sv3= 2. - * When SXLEN=3D64, three paged virtual-memory schemes are defin= ed: - * Sv39, Sv48, and Sv57. - */ -#ifdef CONFIG_RISCV_32 - { HGATP_MODE_SV32X4, 2, "Sv32x4" } -#else - { HGATP_MODE_SV39X4, 3, "Sv39x4" }, - { HGATP_MODE_SV48X4, 4, "Sv48x4" }, - { HGATP_MODE_SV57X4, 5, "Sv57x4" }, -#endif - }; - for ( unsigned int mode_idx =3D ARRAY_SIZE(modes); mode_idx-- > 0; ) { unsigned long mode =3D modes[mode_idx].mode; @@ -173,16 +166,16 @@ static void __init gstage_mode_detect(void) =20 if ( MASK_EXTR(csr_read(CSR_HGATP), HGATP_MODE_MASK) =3D=3D mode ) { - max_gstage_mode =3D modes[mode_idx]; + max_gstage_mode =3D &modes[mode_idx]; =20 break; } } =20 - if ( max_gstage_mode.mode =3D=3D HGATP_MODE_OFF ) + if ( max_gstage_mode->mode =3D=3D HGATP_MODE_OFF ) panic("Xen expects that G-stage won't be Bare mode\n"); =20 - printk("Max supported G-stage mode is %s\n", max_gstage_mode.name); + printk("Max supported G-stage mode is %sx4\n", max_gstage_mode->name); =20 csr_write(CSR_HGATP, 0); =20 @@ -283,7 +276,7 @@ static void clear_and_clean_page(struct page_info *page= , bool clean_dcache) unsigned long construct_hgatp(const struct p2m_domain *p2m, uint16_t vmid) { return MASK_INSR(mfn_x(page_to_mfn(p2m->root)), HGATP_PPN_MASK) | - MASK_INSR(p2m->mode.mode, HGATP_MODE_MASK) | + MASK_INSR(p2m->mode->mode, HGATP_MODE_MASK) | MASK_INSR(vmid, HGATP_VMID_MASK); } =20 @@ -331,8 +324,40 @@ static int p2m_alloc_root_table(struct p2m_domain *p2m) return 0; } =20 -int p2m_init(struct domain *d) +static const struct gstage_mode_desc * find_gstage_mode(const char *mmu_ty= pe) { + for ( unsigned int mode_idx =3D 0; mode_idx < ARRAY_SIZE(modes); mode_= idx++ ) + { + if ( !strcasecmp(mmu_type, modes[mode_idx].name) ) + { + if ( modes[mode_idx].mode =3D=3D HGATP_MODE_OFF || + modes[mode_idx].mode > max_gstage_mode->mode ) + break; + + return &modes[mode_idx]; + } + } + + ASSERT(modes[0].mode =3D=3D HGATP_MODE_OFF); + + dprintk(XENLOG_ERR, "Requested G-stage mode (%s) isn't supported\n", + mmu_type); + + /* + * Return the Bare-mode sentinel. p2m_init() will reject it with + * -EINVAL, producing the appropriate domain-creation failure. + */ + return &modes[0]; +} + +int p2m_init(struct domain *d, const struct xen_domctl_createdomain *confi= g) +{ + /* + * TODO: This static is a temporary constraint: all guests must use the + * same MMU mode because p2m_gpa_bits is not yet per-domain. + * Drop this once per-domain p2m_gpa_bits is introduced. + */ + static const struct gstage_mode_desc *m =3D &modes[0]; struct p2m_domain *p2m =3D p2m_get_hostp2m(d); =20 /* @@ -341,6 +366,27 @@ int p2m_init(struct domain *d) */ p2m->domain =3D d; =20 + if ( !config ) + { + dprintk(XENLOG_ERR, "NULL config is passed\n"); + return -EINVAL; + } + + p2m->mode =3D find_gstage_mode(config->arch.gstage_mode); + + if ( p2m->mode->mode =3D=3D HGATP_MODE_OFF ) + return -EINVAL; + + if ( m->mode =3D=3D HGATP_MODE_OFF ) + m =3D p2m->mode; + + if ( m->mode !=3D p2m->mode->mode ) + { + dprintk(XENLOG_ERR, + "Mode should be the same for all guests at the moment\n"); + return -EINVAL; + } + paging_domain_init(d); =20 rwlock_init(&p2m->lock); @@ -362,11 +408,6 @@ int p2m_init(struct domain *d) # error "Add init of p2m->clean_dcache" #endif =20 - /* TODO: don't hardcode used for a domain g-stage mode. */ - p2m->mode.mode =3D HGATP_MODE_SV39X4; - p2m->mode.paging_levels =3D 2; - safe_strcpy(p2m->mode.name, "Sv39x4"); - return 0; } =20 diff --git a/xen/arch/riscv/vmid.c b/xen/arch/riscv/vmid.c index 8fbcd500f24d..11c7e9d6d6c8 100644 --- a/xen/arch/riscv/vmid.c +++ b/xen/arch/riscv/vmid.c @@ -52,7 +52,7 @@ static DEFINE_PER_CPU(struct vmid_data, vmid_data); static unsigned int vmidlen_detect(void) { unsigned int vmid_bits; - unsigned char gstage_mode =3D get_max_supported_mode(); + unsigned char gstage_mode =3D max_gstage_mode->mode; =20 /* * According to the RISC-V Privileged Architecture Spec: diff --git a/xen/include/public/arch-riscv.h b/xen/include/public/arch-risc= v.h index 360d8e6871ba..5faf8924d926 100644 --- a/xen/include/public/arch-riscv.h +++ b/xen/include/public/arch-riscv.h @@ -56,6 +56,11 @@ typedef struct vcpu_guest_context vcpu_guest_context_t; DEFINE_XEN_GUEST_HANDLE(vcpu_guest_context_t); =20 struct xen_arch_domainconfig { + /* + * G-stage MMU mode for the guest (e.g. "sv39", "sv48", "sv57"). + * Must be set; an empty string is invalid. + */ + char gstage_mode[8]; }; =20 #endif --=20 2.53.0