From nobody Mon Nov 23 05:00:16 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1791217179255307.49383177491757; Mon, 5 Oct 2026 09:19:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xDlPB-0007sl-PK; Mon, 05 Oct 2026 12:19:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xDlP9-0007sZ-3c; Mon, 05 Oct 2026 12:19:07 -0400 Received: from bambi.snowrabbit.org ([182.48.54.220]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xDlP6-0007cL-Gx; Mon, 05 Oct 2026 12:19:06 -0400 Received: by bambi.snowrabbit.org (Postfix, from userid 3001) id 3119EC92F0; Tue, 6 Oct 2026 01:18:59 +0900 (JST) From: Showta Ishizaki To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org Cc: Nicholas Piggin , Harsh Prateek Bora , Amit Machhiwal , zakinko@snowrabbit.org Subject: [PATCH v2] hw/ppc/spapr: Add the "rtas-version" property to /rtas Message-Id: <20261005161859.3119EC92F0@bambi.snowrabbit.org> Date: Tue, 6 Oct 2026 01:18:59 +0900 (JST) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=182.48.54.220; envelope-from=zakinko@snowrabbit.org; helo=bambi.snowrabbit.org X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1791217184591158500 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" PAPR requires every property listed in its table of /rtas device tree properties to be present before the OS is booted (R-7.2.6-3 and Table 20 in PAPR v10.60; the same requirement is in LoPAR 2.9 and LoPAPR 1.1). One of them is "rtas-version", an integer encoding of the RTAS interface version, and PAPR says it describes version 1 of that interface. spapr_dt_rtas() sets "rtas-size", "rtas-error-log-max" and "rtas-event-scan-rate" but never "rtas-version", so a client that reads it finds no RTAS: NetBSD's RTAS driver fails to attach when the property is absent. Set it to 1, the version PAPR describes. Reviewed-by: Amit Machhiwal Tested-by: Amit Machhiwal Signed-off-by: Showta Ishizaki --- v2: - Cite PAPR v10.60 first, as the rest of the spapr code does, and keep LoPAR and LoPAPR as secondary references. - Reword the comment on RTAS_VERSION as Amit suggested. - Add Amit's Reviewed-by and Tested-by. v1: https://lists.gnu.org/archive/html/qemu-devel/2026-09/msg08739.html hw/ppc/spapr.c | 1 + include/hw/ppc/spapr.h | 3 +++ 2 files changed, 4 insertions(+) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 6d99464486..8a1b5b37b6 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -1068,6 +1068,7 @@ static void spapr_dt_rtas(SpaprMachineState *spapr, v= oid *fdt) RTAS_ERROR_LOG_MAX)); _FDT(fdt_setprop_cell(fdt, rtas, "rtas-event-scan-rate", RTAS_EVENT_SCAN_RATE)); + _FDT(fdt_setprop_cell(fdt, rtas, "rtas-version", RTAS_VERSION)); =20 g_assert(msi_nonbroken); _FDT(fdt_setprop(fdt, rtas, "ibm,change-msix-capable", NULL, 0)); diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h index 9acda15d4f..98a9099b8a 100644 --- a/include/hw/ppc/spapr.h +++ b/include/hw/ppc/spapr.h @@ -830,6 +830,9 @@ void spapr_load_rtas(SpaprMachineState *spapr, void *fd= t, hwaddr addr); =20 #define RTAS_EVENT_SCAN_RATE 1 =20 +/* RTAS interface version, as defined by PAPR v10.60 Table 20 */ +#define RTAS_VERSION 1 + /* This helper should be used to encode interrupt specifiers when the rela= ted * "interrupt-controller" node has its "#interrupt-cells" property set to = 2 (ie, * VIO devices, RTAS event sources and PHBs). --=20 2.54.0 (Apple Git-157)