From nobody Mon Nov 23 04:34:31 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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; dmarc=pass(p=none dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1794485833; cv=none; d=zohomail.com; s=zohoarc; b=R+kuU7MQqJoVFAEm4uEl+T4+36y+6L1dfPiCN2I4rvaqQo+9qdnJ9teB/uhsNUBAXO8ih3Vm8s6oATQIxEfbEN7CsgoQgP0zO1NSBOXYT1yTq5juUjWp3ihtD5ldGQ1g0410wIEYszUMSRX9MnzgDhLrBA1TWDh0uACiR/XUCNE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794485833; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=nyRHXgmeRfJp7uChumkczt55UlW5hmRo4yOOlB6ipro=; b=ahCWoht29InHbF+ixALkI10U6AJZiwPNxd+65py4Gb4fnS73HcvpzzF4VcgG/2PfqXkEnLEFnDH/camGlYjQW1pIsjB0y51Rk9igZI8TUnYcY0xgVQx9+2le3F8OLKtzubYB6vIsPSfuFKimAefE+5bsyQ8YntqsuOF1Epnz6SY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794485833075720.7968165395769; Thu, 12 Nov 2026 04:17:13 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRTjV-0000Zp-BF; Thu, 12 Nov 2026 07:16:49 -0500 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 1xRTit-0007y3-Aa for qemu-devel@nongnu.org; Thu, 12 Nov 2026 07:16:13 -0500 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRTip-0002U1-PA for qemu-devel@nongnu.org; Thu, 12 Nov 2026 07:16:10 -0500 Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6AC7j0h1126169 for ; Thu, 12 Nov 2026 12:16:04 GMT Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4hw9a08xq1-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 12 Nov 2026 12:16:03 +0000 (GMT) Received: by mail-qt1-f199.google.com with SMTP id d75a77b69052e-5338c215ed2so64075721cf.0 for ; Thu, 12 Nov 2026 04:16:03 -0800 (PST) Received: from QCOM-UWl2o8bcGT.qualcomm.com (189-68-253-226.dsl.telesp.net.br. [189.68.253.226]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-5550af6096asm73538651cf.5.2026.11.12.04.15.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Nov 2026 04:16:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=nyRHXgmeRfJ p7uChumkczt55UlW5hmRo4yOOlB6ipro=; b=Kujsnu4QpLKAP1VxYIkLt8Jowp0 d7xSd67DT5LRqGn0fLvFl5NQJ9j2DK5Aw//nWkfIabt1ofhCS7YesshZF3VXrY7X 8I8Vh0gNJO8sXqwKUwNDOmIlq/mCVYV9QY3QjjI6+dW5A9F0dry8qfJWxlXFhMjZ dn1jdbRxi0UoAC7rGATtJHSaW6Lt4QjySm2/UcfARjo5voZ+9x5iAQnpkctTKKgU ECMHsDLOZ4zzwywjW2+Zp4pg6Fa9MY1Tc4MRx05qeEcqfu4yRKgztL/4QSqCdlN2 59xRucNjMEapWlLlZAvgTbwXAZm565ZgckxEmR+A7nmI53SCOFBCLY7LqYg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1794485763; x=1795090563; darn=nongnu.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:content-type; bh=nyRHXgmeRfJp7uChumkczt55UlW5hmRo4yOOlB6ipro=; b=flYR1/wwKkzT2bwiugNGrxwZRS7lqA2ZDhK36lUHw5Gasjyk9o1n8z8MkTBkk+fiWp mPCXYACt0QF3qTa2rLTxevYulTJx2/5Z3djvGh8afzCaDfMLiAPs5Wkfacz+H/w4vUYA ZvmMH9stkcb9lfM961yE1GkCKaCyCgADDde6W992CkK7vUoxL3zPNIB0VIx8L9UGRfHS Uqr6jSs0pGudsutoKmJpOCjMQH6auN9lPEOBLdteyWKTJCHQS/+goVXbPXW4pXdBj2oc NsZ8oxOg+/5CTJw64reHyPARN+08v7NjmF1lQBRx3IyP4cHGXlxZCKsYFdjcZSt1TiCV eoYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794485763; x=1795090563; 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:content-type; bh=nyRHXgmeRfJp7uChumkczt55UlW5hmRo4yOOlB6ipro=; b=e+GoGL1LQc48g/v6PPzQ5Jg2GJ3KP2nV4cXpjF2Zk4PAAjauFAQ1bq4T3PaKu+MidZ 7QIJB/2uzGZLM9s1Yob4vdiGMbvZBpq5xXWeQ1JRNF8MMo+/xK86IliNzUkOZQJ6h9pY v8JAsvtwnPL8wHPH5iFsH+e95BWSt0+Bj165eH1yc/nKo2mB5LTKAbpCSAeJ1FV4ZN7p eUt0LKXo40h8u26P8/rrUHSHJj9W/zf4P0Sq9B8QBzGD6MQ/0RdECcTdydVI3dBsB3Pf 8Sr/NTKLxIvWbpXunv5ZYLEgJI80weRFClGcIMNa5CY1LEnmOtonF3k/EgKDhkv9vM33 KTLw== X-Gm-Message-State: APuU4Z+VucYFRJKMTwTImtFAgkTA0GTVBgDf1AccEZgX2iIaWJM/BveG RwqpY1y0RqDNf6bkABoCljOHiOJlaJhrt8zyx+iY7mDtsNz3hTLd51H3USyBccahE9/mbAyc7rh oW/wk9GqXbe8aXqLpIeeiwuhzdQIMWPdXw18lUHZZZhBK7GNiDT3Z29RUN04l16jclQ== X-Gm-Gg: AYBFou1EAbv1hwUHa1wy4t2IUfl4V8jNu+wtzm3SMyYBa+MklzK4y+ytJ/zrydExqhX rxuC5vRLkLzlQRHupIbohqRazeF4f+ar9lSOHOlZOt8+I6v1BagmdQvdvWY8KR1YvzLiDszmFJ2 AFje1O2cUoLT1KSW19gXBPCJRCjE/l49v7vrsGMXnXdzflOcobPr0hP/YWpmrEpTvJ1aw4iEcvG fNbGvBkce+8/7smvfK9quyZXynRLI43d82rDeU98mjjJwOe22whaFKbYtP1s3DL38z0SfZFdZEl 3oshQTPkFssqv0tcHImuH57vHYEZOkY8pRG+4cybpQfGlc+BCL44v/CmqjxhLiF+GL0dp2uoAEa 2K+P/6cfXrvTgXSbA38+QKNM2jmdrRArD8OsqWxjUoK+29oGwuIdHrGWFwes3Pj6tNi36ceIFS3 0WdYWNOgVtQ7K82M8IuiNb9IBmycMotvvstyxEIXKiucbT X-Received: by 2002:a05:622a:4d44:b0:530:ea8c:1b6b with SMTP id d75a77b69052e-556bdbeba75mr86119671cf.3.1794485763089; Thu, 12 Nov 2026 04:16:03 -0800 (PST) X-Received: by 2002:a05:622a:4d44:b0:530:ea8c:1b6b with SMTP id d75a77b69052e-556bdbeba75mr86119181cf.3.1794485762446; Thu, 12 Nov 2026 04:16:02 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, alistair.francis@wdc.com, liwei1518@gmail.com, zhiwei_liu@linux.alibaba.com, chao.liu@processmission.com, Daniel Henrique Barboza , Palmer Dabbelt Subject: [PATCH v2 1/5] hw/riscv: allow machines to set 'hpm-counters' for riscv-iommu-sys Date: Thu, 12 Nov 2026 09:15:49 -0300 Message-ID: <20261112121553.485439-2-daniel.barboza@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261112121553.485439-1-daniel.barboza@oss.qualcomm.com> References: <20261112121553.485439-1-daniel.barboza@oss.qualcomm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: xlo0jy9IbWGEOKXUAPKYeH5fmV6cbrYu X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMTEyMDA0OCBTYWx0ZWRfX5nSlIJ0LUeIe EHkot1FJTT/34jR4ltakTfj0rOnT2VYeSsBv63vG4j8QsdQDXJtTm100cSVc/qYOcut+BuhImLz 1pYhOnRdYRH090EQWt0Rh5hoFpWJcJjh8TJEWmz8tuK1aaPCwzy8go4f4meGwN5nTIKMUh2gK+D f7SR41euKljXYZUUJxtJ2tKJuJKNp4bluiOscyk5S/vavO1qsx/tAuQ1qo6wEAQHGBGn+QwFEkH a9cZbXGQYVNqWXk//WuE/xTXPrYqYqcwWTsYYrhZxjes04TMqiw/bzXj6+0IBfW72qOfSu4CjJw nUuWjZhojJgqjOgcTCgdFJskIfhD8hQr8N06UD0/rVrSelUE3RUiyDKW2jRqTQjFFv3/TXkgnE6 xVZSZv0taUIpZmPkcBmfM0/XHotVZyZlLGSeWcPg8yFJMYCuDNSrDDEciab3I5J1TdahngVtXTo Kfh15zLwok/LNfUwiTg== X-Proofpoint-ORIG-GUID: xlo0jy9IbWGEOKXUAPKYeH5fmV6cbrYu X-Proofpoint-Spam-Info: AW1haW4tMjYxMTEyMDA0OCBTYWx0ZWRfXx1v1rxqWPlIK +H/QE8FMalTfahCH1bevqxRaDCTE5HTlhWw1+UoVt0LAyvqnFi/fiITUURpz2Pmv0N42BO81a32 WgYeYGi4v0l8+Fr2Wk7jKbil4oC/P7c= X-Authority-Analysis: v=2.4 cv=COG/zhrD c=1 sm=1 tr=0 ts=6af5ae03 cx=c_pps a=WeENfcodrlLV9YRTxbY/uA==:117 a=xcxBfRYLw5hNHjR815/AfA==:17 a=zJRp6_cAMcgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=HwFc7jivAAAA:8 a=EUspDBNiAAAA:8 a=48PXcFng3gF8bjtwisEA:9 a=kacYvNCVWA4VmyqE58fU:22 a=kr7TZk85JJIQSqC0cl8G:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-11-12_01,2026-11-11_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 suspectscore=0 adultscore=0 spamscore=0 phishscore=0 lowpriorityscore=0 bulkscore=0 clxscore=1015 malwarescore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2611120048 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=205.220.180.131; envelope-from=daniel.barboza@oss.qualcomm.com; helo=mx0b-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, 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-ZohoMail-DKIM: pass (identity @qualcomm.com) X-ZM-MESSAGEID: 1794485834370158501 Content-Type: text/plain; charset="utf-8" The riscv server soc requirements [1] dictates in rule "IOM_200" that the IOMMU must have at least 4 event counters. As it stands today we're creating an iommu-sys device with RISCV_IOMMU_IOCOUNT_NUM (31) counters. Following the design of setting just the minimal spec requirements, set hpm-counters to 4. We're doing that by adding a new argument in riscv_create_iommu_sys(). In case more IOMMU parameters need to tweaked in the device we might consider a different approach, but for now this suffices. The hpm-counters value used in the 'virt' board is default val from riscv-iommu, i.e. there's no change in 'virt' board configuration with this patch. [1] https://docs.riscv.org/reference/server-soc/v1.0/server_soc_requirement= s.html Signed-off-by: Daniel Henrique Barboza --- hw/riscv/riscv-iommu-sys.c | 4 ++++ hw/riscv/riscv-iommu.h | 1 + hw/riscv/server_platform_ref.c | 2 ++ hw/riscv/virt.c | 3 ++- 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/hw/riscv/riscv-iommu-sys.c b/hw/riscv/riscv-iommu-sys.c index 258c171efd..3a9e22080a 100644 --- a/hw/riscv/riscv-iommu-sys.c +++ b/hw/riscv/riscv-iommu-sys.c @@ -219,6 +219,7 @@ static void riscv_iommu_sys_init(Object *obj) =20 DeviceState *riscv_create_iommu_sys(DeviceState *mmio_irqchip, hwaddr addr, int base_irq, + int hpm_counters, bool is_32_bit) { DeviceState *iommu_sys =3D qdev_new(TYPE_RISCV_IOMMU_SYS); @@ -237,6 +238,9 @@ DeviceState *riscv_create_iommu_sys(DeviceState *mmio_i= rqchip, is_32_bit ? 34 : 56, &error_fatal); =20 + object_property_set_int(OBJECT(iommu_sys), "hpm-counters", + hpm_counters, &error_abort); + sysbus_realize_and_unref(SYS_BUS_DEVICE(iommu_sys), &error_fatal); =20 return iommu_sys; diff --git a/hw/riscv/riscv-iommu.h b/hw/riscv/riscv-iommu.h index 403d10b321..0f755b0992 100644 --- a/hw/riscv/riscv-iommu.h +++ b/hw/riscv/riscv-iommu.h @@ -107,6 +107,7 @@ void riscv_iommu_notify(RISCVIOMMUState *s, int vec_typ= e); void riscv_iommu_fault(RISCVIOMMUState *s, struct riscv_iommu_fq_record *e= v); DeviceState *riscv_create_iommu_sys(DeviceState *mmio_irqchip, hwaddr addr, int base_irq, + int hpm_counters, bool is_32_bit); =20 typedef struct RISCVIOMMUContext RISCVIOMMUContext; diff --git a/hw/riscv/server_platform_ref.c b/hw/riscv/server_platform_ref.c index 5f485b1c79..f8016e14b0 100644 --- a/hw/riscv/server_platform_ref.c +++ b/hw/riscv/server_platform_ref.c @@ -67,6 +67,7 @@ #define SYSCON_POWEROFF 0x2 =20 #define RVSERVER_PLATFORM_BUS_NUM_IRQS 8 +#define RVSERVER_IOMMU_HPM_COUNTERS 4 =20 #define TYPE_RISCV_SERVER_REF_MACHINE MACHINE_TYPE_NAME("riscv-server-ref") OBJECT_DECLARE_SIMPLE_TYPE(RISCVServerRefMachineState, RISCV_SERVER_REF_MA= CHINE) @@ -636,6 +637,7 @@ static void rvserver_ref_machine_init(MachineState *mac= hine) } =20 riscv_create_iommu_sys(mmio_irqchip, s->memmap[RVSERVER_IOMMU_SYS].bas= e, + RVSERVER_IOMMU_HPM_COUNTERS, IOMMU_SYS_IRQ, false); =20 s->machine_done.notify =3D rvserver_ref_machine_done; diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index 8bc5a7b072..88de49aa6e 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -947,7 +947,8 @@ static void virt_machine_init(MachineState *machine) =20 if (virt_is_iommu_sys_enabled(s)) { riscv_create_iommu_sys(mmio_irqchip, s->memmap[VIRT_IOMMU_SYS].bas= e, - IOMMU_SYS_IRQ, riscv_is_32bit(&s->soc[0])); + IOMMU_SYS_IRQ, RISCV_IOMMU_IOCOUNT_NUM, + riscv_is_32bit(&s->soc[0])); } =20 s->machine_done.notify =3D virt_machine_done; --=20 2.43.0 From nobody Mon Nov 23 04:34:31 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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; dmarc=pass(p=none dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1794485810; cv=none; d=zohomail.com; s=zohoarc; b=VqBx+HF4YnWYGDLj2mdbGi6+VtQs99gQukoDAF//L4GiLzXMwtwIV7tJz2n6rCl2KWAAXR6NcmJ8G1H7wGmi6dwUjxk10Fjq7QxlZ34vatbJAReA9SEUMCQlZbDODHCyyfE/EpF2gyF2L16ddcMjDiAPc6S7zhH+KxYqvRn/bsI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794485810; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=e4q7jxEweG9hpBMyv1buFc3LQm/Vfhh6LoFFh9SWwwM=; b=m1E4dEVqaZcAizLHGj1F6wbNRJWqlLFvYRYVf6yPz9u9onlLJOp1afesMoYoORxYm3ysJhnfQPxu6O+twxzMOF9V90v1+4WaiqE+OMdx+Zpttdy9FXrEBbeaQvXPnXdyfKDBTItMwoC2ZBeQWV/VX8kkkPKfAwaKoql7rN4tifk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794485810945809.833623565233; Thu, 12 Nov 2026 04:16:50 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRTjI-00007H-1N; Thu, 12 Nov 2026 07:16:37 -0500 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 1xRTiu-0007zg-6T for qemu-devel@nongnu.org; Thu, 12 Nov 2026 07:16:13 -0500 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRTiq-0002UY-Lu for qemu-devel@nongnu.org; Thu, 12 Nov 2026 07:16:11 -0500 Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6AC7jDio126929 for ; Thu, 12 Nov 2026 12:16:07 GMT Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4hw9a08xqd-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 12 Nov 2026 12:16:07 +0000 (GMT) Received: by mail-qt1-f199.google.com with SMTP id d75a77b69052e-542fc61841eso87935381cf.0 for ; Thu, 12 Nov 2026 04:16:07 -0800 (PST) Received: from QCOM-UWl2o8bcGT.qualcomm.com (189-68-253-226.dsl.telesp.net.br. [189.68.253.226]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-5550af6096asm73538651cf.5.2026.11.12.04.16.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Nov 2026 04:16:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=e4q7jxEweG9 hpBMyv1buFc3LQm/Vfhh6LoFFh9SWwwM=; b=EUC/teeJuT8SzhOXnprZLhuBIMI OJxZp2hKBSc9Fiez+DX4saR+t9HAMUE7KD33vrhqjMINJq/18WR2h2nWhA1Pz/aA h6uiMOMk1Jhi9l6CBzNimaaJcZCllGvEPgO+UIRJ3e/HozzrsAaFunQZdGWQ7mk8 9d1uO7hSa9crep9qZyb22a2h2yRHJrbZe5nkmjaUC2MrRV8cIJzYKJYDi338FPlW k5wymQvvuQSIc/rc/quJcLKt9FqDuXNpo1Jko7dffoGeL54SS6C/D8Nrl7xUGuwe tkvuiL5KFcYzkM3r29PtAy+4GrpskPKi2JAbAQ8K0hp7fy2wEEBp95g3NYw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1794485767; x=1795090567; darn=nongnu.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:content-type; bh=e4q7jxEweG9hpBMyv1buFc3LQm/Vfhh6LoFFh9SWwwM=; b=f08FxPiZOjNrtoBD3BXT6um9Dh5JW5ggBSCSLHXOGbDzOF67rfXEINXk2ZxSEnwGyK sSpmoc8rgq9Kp1+KdCOvXZs+WPMJIyoPAdwg0lhAztIjag5Eg5HaFGGQWFPU3ptRQLss bd9Es86zW6LsRuDt2z0lu0YUhb8ZCgeRoJw9vAawi010Q40cJSHFak+FsVwdd2QXkY6i OWPD/vc/H76UAym5JtT1zzhqX0PhFKB9obKcj8EwCSX4AS8H2VejzM1rgzlbpydejIJy fsbbUtqZ1UhSk3wwdQC4WCiH3C67H5XnvjsrkkFfIg4J7FCP8mG+/E058q4x+50dFhTQ eSwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794485767; x=1795090567; 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:content-type; bh=e4q7jxEweG9hpBMyv1buFc3LQm/Vfhh6LoFFh9SWwwM=; b=OaDGxXs1F5AOsQQFPjWBUogUkrrWsmK9mN5pbkCzSR533tUgjNWW6fPWGwCof4wkJx Q+rMxw/IaFRBOuuqIPShubuZPVZ2OQ57+jT+r4rucNW/wEpfPLZVwH7+nkNKvo2JGgX+ oNaQCEfh/+xLTL+egGlYp+oMxaHrR25xR5z8YVtpBmcwk0/JZG1XWdCtuPZx4YJwJo1u 1aU2ytXbrieGcb6WE7JGvOROHtHGnBf710eBugsJdSa/MoFs65R6cXfn5Ku9Z0O5Papk VdKbN8SPsL+dmT2Lw0PJpg7JqDxxW1mNwPaWtO3ztMi5EjVHaEctkojZWpAc7Ze8Konu sWYA== X-Gm-Message-State: APuU4Z8C/uA1FO7bCXc/Cf+ZUwJiEfeOSfYZ314mp12C4YZ0s+rCHEsw y9DRijYB6/1QR/+IR2UbAcYhcQwPzB6RlYE3oRTzfiBNmRT9ld1Rs2dNpN4iV6hjEzRuiKg+25y I38lujzAlVMTbHmkJUebWjHlbGmWJ0Ql9jWYeF5iPD0rIsIU+yQjWbEVWi2Mr/FPexQ== X-Gm-Gg: AYBFou15EhO5OlzaJ2Y7K/Lqoe0XV36WgZ2qPfsrfPsNwORji3+VXREkgWbP9fMq5mp SyETdIvkl/4mY4pmqMjgY7ncEWTERkBy9g9aeUyn1xxbW3OIwWqX/Tjcl8AtqE38miPOZaGlhEi TZpO+VCQ0kIYWSlzud7erZt27ecvQOOgCbPYYZefoaRpSLZ+23ntVR9JGZATq9anR71okHA8i1v d7ug+5KIG05aoxlEHpN9Ipy5v/DzmewljBzhLrI4YZTACFC1hWrvSloYn2CabXTFmEx4o/FN+kD A0CgQTq8SXnGE6MQdmG1QvtIS3PLg+UMw4l+IcGXC2gORoEYZ1a7xVDSqkoSw8z1Jn6dl6G2T7T oXYY61EjKVSD2Te4pEAm/YsqOZkYin15T7EcuSf88UFn9Fa9o+DEoVUeyBS0GMhogHzJnhKy6R5 RNAKPMuZzHiJy7vUR54tk1gWS90e3fYseNuBE8usiVRkai X-Received: by 2002:a05:622a:1651:b0:537:dea7:adb1 with SMTP id d75a77b69052e-556bdce0a89mr85838001cf.4.1794485766872; Thu, 12 Nov 2026 04:16:06 -0800 (PST) X-Received: by 2002:a05:622a:1651:b0:537:dea7:adb1 with SMTP id d75a77b69052e-556bdce0a89mr85837581cf.4.1794485766340; Thu, 12 Nov 2026 04:16:06 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, alistair.francis@wdc.com, liwei1518@gmail.com, zhiwei_liu@linux.alibaba.com, chao.liu@processmission.com, Daniel Henrique Barboza , Palmer Dabbelt Subject: [PATCH v2 2/5] hw/riscv: make UART FDT helper consider baud rate Date: Thu, 12 Nov 2026 09:15:50 -0300 Message-ID: <20261112121553.485439-3-daniel.barboza@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261112121553.485439-1-daniel.barboza@oss.qualcomm.com> References: <20261112121553.485439-1-daniel.barboza@oss.qualcomm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: RK4GdZZcNdCzIGsD4fBMj66kfhXnRO34 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMTEyMDA0OCBTYWx0ZWRfX4aJ/hWB35ayo G/hr355KdUa4Bk4pzWSqRgBWKo8ipo8PIfI0QcDMLz3SQHCgXinIi0NY35LFGC3zVzFZ5Bm/Tx6 Va2Om/Ew4f7bVxddoZOLWq+WFswKNh3qKx+uq1Q5xPF1s9LRdwvLF9u0u1Im58TSnqGYLU5QH4z kw0YAFvU1HrK8IIyPFqX3ZabodeoKD5St5u8nYy3nLSoAiAQ0flgurNOsZuOoS1GEzwE36EuBhA 6VAgPovA9MBht01IRMEwy8K3kkIp376wdnmWJAgnYzLwG6xjycc3abIjDZkT/+5B4VqJHXbi811 B6B3AA1eMXNw3UL2vciALeXrYQLb2gsrgHS/SdJ7MAFBHsFZqe27h8tHl0HkF/pXWRV9xmGIlCH gUbzb8rhhh4F/5TNG6IBZ452JTTtTA0p5JVkm3ZcNrUAbcbTXHV0vhk/OLBYViHGvEoCGCvrqri IarpHs4IfUBE46Rk39Q== X-Proofpoint-ORIG-GUID: RK4GdZZcNdCzIGsD4fBMj66kfhXnRO34 X-Proofpoint-Spam-Info: AW1haW4tMjYxMTEyMDA0OCBTYWx0ZWRfX1mfXzOU5WCok b9SxhQamxKW7fI2WYPNlTgnfYlG3hwEJA173NPMVBJTNDnmModPUCNaOai/RtO1tj9ebIijNd59 yAxFJONdZJE9jFbCtTFOnS3jusacUl4= X-Authority-Analysis: v=2.4 cv=COG/zhrD c=1 sm=1 tr=0 ts=6af5ae07 cx=c_pps a=WeENfcodrlLV9YRTxbY/uA==:117 a=xcxBfRYLw5hNHjR815/AfA==:17 a=zJRp6_cAMcgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=EUspDBNiAAAA:8 a=JF9118EUAAAA:8 a=uxJGSlK6fkZaI5NcCCYA:9 a=kacYvNCVWA4VmyqE58fU:22 a=xVlTc564ipvMDusKsbsT:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-11-12_01,2026-11-11_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 suspectscore=0 adultscore=0 spamscore=0 phishscore=0 lowpriorityscore=0 bulkscore=0 clxscore=1015 malwarescore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2611120048 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=205.220.180.131; envelope-from=daniel.barboza@oss.qualcomm.com; helo=mx0b-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, 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-ZohoMail-DKIM: pass (identity @qualcomm.com) X-ZM-MESSAGEID: 1794485812463158500 Content-Type: text/plain; charset="utf-8" riscv_create_fdt_uart() is defaulting to a 3.6864 Mhz clock, which Linux will interpret as a 230400 base baud serial. We need more flexibility to set a different baud rate for UART devices. Add an optional 'base_baud' parameter that allows callers to set a baud rate for the related device. We're keeping the existing default in case the caller does not care to provide a base baud. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Alistair Francis ` --- hw/riscv/fdt-common.c | 19 +++++++++++++++++-- hw/riscv/server_platform_ref.c | 1 + hw/riscv/virt.c | 4 ++-- include/hw/riscv/fdt-common.h | 1 + 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/hw/riscv/fdt-common.c b/hw/riscv/fdt-common.c index ce2dcb43b4..abb913faec 100644 --- a/hw/riscv/fdt-common.c +++ b/hw/riscv/fdt-common.c @@ -22,7 +22,11 @@ #include "hw/pci/pcie_host.h" #include "hw/riscv/aia.h" =20 -#define UART_STD_CLOCK_FREQ 3686400 /* 3.6864 MHz */ + /* + * This 3.6864 MHz default clock results in a base + * baud of 230400 symbols/second. + */ +#define UART_STD_CLOCK_FREQ 3686400 =20 void *riscv_create_board_device_tree(const char *model, const char *compat= ible, int *fdt_size) @@ -807,11 +811,14 @@ char *riscv_fdt_get_uart_nodename(hwaddr addr) return g_strdup_printf("/soc/serial@%"HWADDR_PRIx, addr); } =20 +/* If base_baud =3D 0 this function assumes a base baud of 230400. */ void riscv_create_fdt_uart(void *fdt, const MemMapEntry *uart_mem, int uart_irq, int aia_type, + int base_baud, uint32_t irq_phandle) { g_autofree char *name =3D riscv_fdt_get_uart_nodename(uart_mem->base); + uint64_t clock_freq =3D UART_STD_CLOCK_FREQ; =20 qemu_fdt_add_subnode(fdt, name); qemu_fdt_setprop_string(fdt, name, "compatible", "ns16550a"); @@ -819,7 +826,15 @@ void riscv_create_fdt_uart(void *fdt, const MemMapEntr= y *uart_mem, 2, uart_mem->base, 2, uart_mem->size); =20 - qemu_fdt_setprop_cell(fdt, name, "clock-frequency", UART_STD_CLOCK_FRE= Q); + if (base_baud !=3D 0) { + /* + * The base baud formula is base_baud =3D clock_freq / 16, + * ergo clock_freq =3D base_baud * 16. + */ + clock_freq =3D base_baud * 16; + } + + qemu_fdt_setprop_cell(fdt, name, "clock-frequency", clock_freq); qemu_fdt_setprop_cell(fdt, name, "interrupt-parent", irq_phandle); =20 if (aia_type =3D=3D AIA_TYPE_NONE) { diff --git a/hw/riscv/server_platform_ref.c b/hw/riscv/server_platform_ref.c index f8016e14b0..d727ea6c41 100644 --- a/hw/riscv/server_platform_ref.c +++ b/hw/riscv/server_platform_ref.c @@ -315,6 +315,7 @@ static void finalize_fdt(RISCVServerRefMachineState *s) =20 riscv_create_fdt_uart(ms->fdt, &rvserver_ref_memmap[RVSERVER_UART0], RVSERVER_UART0_IRQ, AIA_TYPE_APLIC_IMSIC, + 0, irq_mmio_phandle); name =3D riscv_fdt_get_uart_nodename(rvserver_ref_memmap[RVSERVER_UART= 0].base); qemu_fdt_setprop_string(ms->fdt, "/chosen", "stdout-path", name); diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index 88de49aa6e..dd1b02a7b3 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -391,11 +391,11 @@ static void create_fdt_uarts(RISCVVirtState *s, uint3= 2_t irq_mmio_phandle) =20 if (s->uart1_present) { riscv_create_fdt_uart(ms->fdt, &s->memmap[VIRT_UART1], - UART1_IRQ, s->aia_type, irq_mmio_phandle); + UART1_IRQ, 0, s->aia_type, irq_mmio_phandle); } =20 riscv_create_fdt_uart(ms->fdt, &s->memmap[VIRT_UART0], UART0_IRQ, - s->aia_type, irq_mmio_phandle); + s->aia_type, 0, irq_mmio_phandle); =20 name =3D riscv_fdt_get_uart_nodename(s->memmap[VIRT_UART0].base); qemu_fdt_setprop_string(ms->fdt, "/chosen", "stdout-path", name); diff --git a/include/hw/riscv/fdt-common.h b/include/hw/riscv/fdt-common.h index eb9db8278d..ee664983f4 100644 --- a/include/hw/riscv/fdt-common.h +++ b/include/hw/riscv/fdt-common.h @@ -132,6 +132,7 @@ void riscv_create_fdt_socket_aclint(void *fdt, ACLINTFd= tProps *props, char *riscv_fdt_get_uart_nodename(hwaddr addr); void riscv_create_fdt_uart(void *fdt, const MemMapEntry *uart_mem, int uart_irq, int aia_type, + int base_baud, uint32_t irq_phandle); void riscv_create_fdt_rtc(void *fdt, const MemMapEntry *rtc_mem, int rtc_irq, int aia_type, --=20 2.43.0 From nobody Mon Nov 23 04:34:31 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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; dmarc=pass(p=none dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1794485854; cv=none; d=zohomail.com; s=zohoarc; b=etfjaaDMoUitfXWVnFz3ydmTjpVTzpfM1gjRwdH2EKTm90yFwcqeY9p+RmzvaIzHZ12Ehio5hZqtXGj50yGRWURlNmhj+qJQ54+90js+r5V77JBur/zEDeYE/2J2qrfZDPmd2cbfx+oKIyFq3NvVRzsh51qF6RtoKxtbdqsESeY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794485854; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=NxI1+DZPSHm2OBNcqU8iwN27qQ+ivTMTIzJsHGReJeI=; b=RJiVZvEL6TmbYsmfetBm8xLuV55EL0iPBn1AXgGhLJnGgBymwWkBEK+QBVcUauuQVylE57LPI0EsXPBI7ECaHK0BZMq5htoHIQcUGff0W3vaZJYjBq8OCaQdprg8OhQ68oAYIi3OlFnY6mT9L4QMDEozyd6v+JMlpOTAhOIkVLM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794485854275421.51603841888596; Thu, 12 Nov 2026 04:17:34 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRTjV-0000a8-Jf; Thu, 12 Nov 2026 07:16:49 -0500 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 1xRTiw-00081Q-QB for qemu-devel@nongnu.org; Thu, 12 Nov 2026 07:16:17 -0500 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRTiu-0002VO-R2 for qemu-devel@nongnu.org; Thu, 12 Nov 2026 07:16:14 -0500 Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6AC9CU294092378 for ; Thu, 12 Nov 2026 12:16:11 GMT Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4hw0m8jra7-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 12 Nov 2026 12:16:11 +0000 (GMT) Received: by mail-qv1-f70.google.com with SMTP id 6a1803df08f44-91c7bf2d734so93067076d6.3 for ; Thu, 12 Nov 2026 04:16:11 -0800 (PST) Received: from QCOM-UWl2o8bcGT.qualcomm.com (189-68-253-226.dsl.telesp.net.br. [189.68.253.226]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-5550af6096asm73538651cf.5.2026.11.12.04.16.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Nov 2026 04:16:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=NxI1+DZPSHm 2OBNcqU8iwN27qQ+ivTMTIzJsHGReJeI=; b=GZTCrA0xIHlGRzP2uwLxzDeHi4k b3lE/t470dnZgSHmChX5gT9UlH8quAOLQeZVJG43Zico+yPsDYLciXB4VRWY4sBv 5ir6jWvgk7Kh56+VDvyAAVOE6WNd+79UHNUyv61tsvU0eNmbe5c5IyH30rX6XJ2r eCuOvxWA0uUjrjRE1cnRmx7egnjdmGSPvBPMdod2taBp91JN3h5vdQRFQQxZfweV qLXRVvJFBnaNHlkxVtQqnvaYElPhcyLXVUt2DQDLlk0y5AsRJ5nxhXGRfoyHV6PQ 0PuUwc8drb0PNGE62RMb4ZYchtMKGxCtldDwn7MWqrGHgBi8st2D25YPqjw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1794485770; x=1795090570; darn=nongnu.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:content-type; bh=NxI1+DZPSHm2OBNcqU8iwN27qQ+ivTMTIzJsHGReJeI=; b=R+OdQ+3uNZkJ1zznx1dFIKJ/Ut+6T4EVRBheC8AwOHOKnozjl/lO3uZQ/HtPpIUaP2 AYqmSOmjP13D39ZxDIyWY94eWxl+Gyh10/4PksKEVHMOPZXUL5+zyuAzhVh3g9Bkou0T Ozsiq5NeMenZw2El9SHvYoRJXWMGi9lU3L1hc+Ws+CQO7gXpbz1LCoLzDqFnbh68DUwb p88HnPhJ8GuvfciTUMylR0m4jUMwRSlAyXSwfRRvbhgfa5i4rwyvwVECy046CZ/CaOps hvd3saKZBH1/3v4Z2SCeq/HkkQBcsazH/wb5NwNEZwrUfVDAmrYlkiBuvN9uHNelCwkp +6GQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794485770; x=1795090570; 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:content-type; bh=NxI1+DZPSHm2OBNcqU8iwN27qQ+ivTMTIzJsHGReJeI=; b=A8i/ZI65IoM/tHny45EbxOLvoenjj1B54Byz/7u5HjinF1SKTtZZbNegH9uF7lFEBD v2podg9FgtwrrHYCBC2g0DZuuuuaRkvDwS3eKLXNyo6ADhQlyOZJIrnM1kgrrOERPo0k Kg/85iR9JCeg0Dme0X9+1JZZ64eOCDvfJ+3MGWgFIyl3X5TYelegHo/eygZiT2tkXAl0 tu/yxmXmfpa7/j7GlW9NodNXiFnVx3yhZI5UcQ2e5TK8SnABrAJUg8C5uRoY5EXgJApu YeYpPdI765MQPwRZkcoQVS2fvEHiSqYqKc3LoyVdY4+DaM2lg1uBazmLM75HXwjD74WS PZpQ== X-Gm-Message-State: APuU4Z+RB/hAYHl7N0OQ9rEFTcoDgcqHA0jY1cJQ1AtMeuYaFYzqZBY/ bAOhu8MXzVmr2aEKunVwjFTTXCyg1W0Padyl8men+n9411/JK7zKwy1VvFZ11Azr4tCJgCMQJMZ W3qBplu6jRDFQSh1gmuEWH+7CZTymO8JRB1kY5XKQzRIkf71CC71Om1AJq6MzOMg6iQ== X-Gm-Gg: AYBFou3/g5m1JY/KW0lyIIzDou9/F9CczP8Cixaqow5zugjzspT6jNZsw0vvUQflUkC HR0x6RiRsbPXdd0cH5Ki7QjmKv+u2sB8zq/asWsPGM5Qtgk41fqKGmy9LGRgvC5ohndheA0v2un dc5GFqMRvB+JOCEFrDOGcnVxNC2Wogj5J22o1VGfYYPUZxvEYF1XClxIuqtZTyvagMx6AKth41p ARBFTKMJ2iVoJduT7QgbbfivFKXTFNnT9UH+WS8M+ow6VxTfhokkZ66kiZaPj/K988NEm6a8Q0s ADgEdcm/4jzoEOseLU3QrrKcA8J0OSqXKyTtZl/D0zJ+wQlkCYJ/cEYkE5XLD3EmDcXuKvrRrqo UM69uT84O2/UCCpIwW1EjFCAjmU4Op7KeuDR4FPmcSlb06rU43U4hxGhK2aPPtzdQ4ALJQNVdl/ NOk/wldxr18LxQY84FNpxaBl8KdGMVnqZghmX6rcNNQ9hK X-Received: by 2002:a05:622a:1c1a:b0:536:6902:daea with SMTP id d75a77b69052e-556c0ea78f7mr90885281cf.23.1794485770298; Thu, 12 Nov 2026 04:16:10 -0800 (PST) X-Received: by 2002:a05:622a:1c1a:b0:536:6902:daea with SMTP id d75a77b69052e-556c0ea78f7mr90884791cf.23.1794485769676; Thu, 12 Nov 2026 04:16:09 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, alistair.francis@wdc.com, liwei1518@gmail.com, zhiwei_liu@linux.alibaba.com, chao.liu@processmission.com, Daniel Henrique Barboza , Palmer Dabbelt Subject: [PATCH v2 3/5] hw/riscv/server_platform_ref: fix UART baud rate Date: Thu, 12 Nov 2026 09:15:51 -0300 Message-ID: <20261112121553.485439-4-daniel.barboza@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261112121553.485439-1-daniel.barboza@oss.qualcomm.com> References: <20261112121553.485439-1-daniel.barboza@oss.qualcomm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Info: AW1haW4tMjYxMTEyMDA0OCBTYWx0ZWRfX6ldTQ0TgSFZR dL8qHelIv4+h2yijdkJ2xQv3oLC/owA35eXvMpXcXAcLTZ3ijteO/GdED38OSro9/34WnkXAzwi WuuHLDIflnkmkZmVn4USZGdmQc2YVOs= X-Proofpoint-GUID: 2JG7D83ZSxifUgYh2h01g6GPA_g9_3Qg X-Proofpoint-ORIG-GUID: 2JG7D83ZSxifUgYh2h01g6GPA_g9_3Qg X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMTEyMDA0OCBTYWx0ZWRfXydwGnqWH160c AJ9ll76qAIiaCAXEAqk4Z7QTjLyEJtif/toN0Eb9M9u+NTTIiEXHGqJlnlduT9VB2T8YR1NFKWa YDskWUKWEgbZh4biQuzsetp1LuS8baWfZScz9tdg59+iVMG7xLaS9z0xHn1z/4BPVSAetjby8Tr Mp7KHABK69dpzFIB+YZCnS7DjWaLmlDUW7GfmXF2BlrA/4uC4a5s9IFoL/lyHqhlCIyZmgmvg9o fS7UK+NFrIhTubALg5byuevrk06sHwQVgE3YE1tCqRHV2Xv0k186pVE51+uV4Y3KiZBWFCggK5I r1NjKucLKfu11uWM6e85xcxXS13wd3szoPMBeKRekjqGQQNPNb9X8nuGUST/nnUkqhCiwGGjvsF l8WTSzjbRFee0wLK/VbPjxulePT3S3vhDoKOKAgugRmd8LFwtRsei0vtD5RAduUp/P8zcFPrTI+ Oy4TlUz/5T6cpWzfvUw== X-Authority-Analysis: v=2.4 cv=Q9dHcI2a c=1 sm=1 tr=0 ts=6af5ae0b cx=c_pps a=oc9J++0uMp73DTRD5QyR2A==:117 a=xcxBfRYLw5hNHjR815/AfA==:17 a=zJRp6_cAMcgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yOCtJkima9RkubShWh1s:22 a=HwFc7jivAAAA:8 a=EUspDBNiAAAA:8 a=JF9118EUAAAA:8 a=HyuSmn1QhchWdNVMt-0A:9 a=iYH6xdkBrDN1Jqds4HTS:22 a=kr7TZk85JJIQSqC0cl8G:22 a=xVlTc564ipvMDusKsbsT:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-11-12_01,2026-11-11_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 phishscore=0 impostorscore=0 adultscore=0 bulkscore=0 suspectscore=0 priorityscore=1501 spamscore=0 clxscore=1015 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2611120048 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=205.220.168.131; envelope-from=daniel.barboza@oss.qualcomm.com; helo=mx0a-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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-ZohoMail-DKIM: pass (identity @qualcomm.com) X-ZM-MESSAGEID: 1794485856624158500 Content-Type: text/plain; charset="utf-8" The riscv-server 1.0 spec requires an UART with 115200 baud, per rule "HPER_020" described in [1]. At this moment we're doing two things: the FDT is being created using the default UART base baud of 230400, and the device itself is being created using a baud of 399193. This odd value was inherited from the RISC-V 'virt' machine when implementing the first interaction of the riscv-server-ref board. Linux doesn't seem to care: dmesg reports a base baud of 230400, a value derived from what we're writing in the DT, and the serial seems to work fine. Straight everything up by setting the required base baud of 115200 everywhere applicable. And for good measure let's also change the boot test to be sure that userpace is reading the intended serial base baud. [1] https://docs.riscv.org/reference/server-soc/v1.0/server_soc_requirement= s.html Fixes: c2fa4320803b ("hw/riscv: server platform reference machine") Signed-off-by: Daniel Henrique Barboza Reviewed-by: Alistair Francis --- hw/riscv/server_platform_ref.c | 8 +++++--- tests/functional/riscv64/test_server_ref.py | 3 +++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/hw/riscv/server_platform_ref.c b/hw/riscv/server_platform_ref.c index d727ea6c41..af5114ac09 100644 --- a/hw/riscv/server_platform_ref.c +++ b/hw/riscv/server_platform_ref.c @@ -68,6 +68,7 @@ =20 #define RVSERVER_PLATFORM_BUS_NUM_IRQS 8 #define RVSERVER_IOMMU_HPM_COUNTERS 4 +#define RVSERVER_UART_BASE_BAUD 115200 =20 #define TYPE_RISCV_SERVER_REF_MACHINE MACHINE_TYPE_NAME("riscv-server-ref") OBJECT_DECLARE_SIMPLE_TYPE(RISCVServerRefMachineState, RISCV_SERVER_REF_MA= CHINE) @@ -315,7 +316,7 @@ static void finalize_fdt(RISCVServerRefMachineState *s) =20 riscv_create_fdt_uart(ms->fdt, &rvserver_ref_memmap[RVSERVER_UART0], RVSERVER_UART0_IRQ, AIA_TYPE_APLIC_IMSIC, - 0, + RVSERVER_UART_BASE_BAUD, irq_mmio_phandle); name =3D riscv_fdt_get_uart_nodename(rvserver_ref_memmap[RVSERVER_UART= 0].base); qemu_fdt_setprop_string(ms->fdt, "/chosen", "stdout-path", name); @@ -613,8 +614,9 @@ static void rvserver_ref_machine_init(MachineState *mac= hine) RVSERVER_PLATFORM_BUS_= NUM_IRQS); =20 serial_mm_init(system_memory, memmap[RVSERVER_UART0].base, - 0, qdev_get_gpio_in(mmio_irqchip, RVSERVER_UART0_IRQ), 399193, - serial_hd(0), DEVICE_LITTLE_ENDIAN); + 0, qdev_get_gpio_in(mmio_irqchip, RVSERVER_UART0_IRQ), + RVSERVER_UART_BASE_BAUD, + serial_hd(0), DEVICE_LITTLE_ENDIAN); =20 sysbus_create_simple("goldfish_rtc", memmap[RVSERVER_RTC].base, qdev_get_gpio_in(mmio_irqchip, RVSERVER_RTC_IRQ)); diff --git a/tests/functional/riscv64/test_server_ref.py b/tests/functional= /riscv64/test_server_ref.py index ad29094dbe..fa7225ccc1 100755 --- a/tests/functional/riscv64/test_server_ref.py +++ b/tests/functional/riscv64/test_server_ref.py @@ -71,6 +71,9 @@ def do_test_boot_linux_test(self, tpmstate_dir=3DNone): wait_for_console_pattern(self, 'Linux version') wait_for_console_pattern(self, 'Machine model: RISC-V Server Platf= orm') =20 + # Check that we have the intended base baud for the serial + wait_for_console_pattern(self, 'base_baud =3D 115200') + # Test e1000e network card functionality wait_for_console_pattern(self, 'e1000e') wait_for_console_pattern(self, 'Network Connection') --=20 2.43.0 From nobody Mon Nov 23 04:34:31 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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; dmarc=pass(p=none dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1794485825; cv=none; d=zohomail.com; s=zohoarc; b=Z/WCrMjmcBO6oCMz1lDZ3jDFQgX304kVptYshySreMF8ahoMXqQPSq5DeTyP3mBp7X8BBdGshPktMXX/Vh38JRYEYTwIANC8nSx+oDwPApd3W5CGRNimGULCwVbHW/GQTORSHVW8mz5Qv6cBPN8O24CADYvOwhYFZAwkqHa3eQk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794485825; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=uQX4PMKh7dMhXSe32oSNpxkmTAwd5otkRrgQIcHy3tM=; b=fl5TwEwVBowr1f75hiI4QpWsmpp+u14QHQqyHsKKKRNyjkJIdVbLqJQKt1KjTn9ZfwZWuIKtNsZ9p7Jg9y0qMP58BIAYWY3J5OAZw+y6FY3BDqc+Iye0NvHETB5EEGemq3ntvf9BXjT0djQ7wrDDa9Qs2hgrWlj4YP1oXKZyN2U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794485825472668.1246168454783; Thu, 12 Nov 2026 04:17:05 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRTjR-0000UJ-Ap; Thu, 12 Nov 2026 07:16:45 -0500 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 1xRTj0-00082j-NF for qemu-devel@nongnu.org; Thu, 12 Nov 2026 07:16:20 -0500 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRTix-0002Vz-DK for qemu-devel@nongnu.org; Thu, 12 Nov 2026 07:16:17 -0500 Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6ACAUVkA1629181 for ; Thu, 12 Nov 2026 12:16:14 GMT Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4hwbs00ax5-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 12 Nov 2026 12:16:14 +0000 (GMT) Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-535252004e9so81648981cf.1 for ; Thu, 12 Nov 2026 04:16:14 -0800 (PST) Received: from QCOM-UWl2o8bcGT.qualcomm.com (189-68-253-226.dsl.telesp.net.br. [189.68.253.226]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-5550af6096asm73538651cf.5.2026.11.12.04.16.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Nov 2026 04:16:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=uQX4PMKh7dM hXSe32oSNpxkmTAwd5otkRrgQIcHy3tM=; b=FwIOB1ICrntXKpwZANvwANw6IeV FxQBG3UAUTX2YojpXOx9z0I6UNNM2mM0HiV2U+mIaIUSKfl5OJE4FoKNhBn4w9Re 9I7KD854ml/KyIGl7wGf3UPmpL9/5O0Jl5UemJ6qAUd8pry+mKuvG6h3WahjFIDg THK8M6SjAh43Y14D3YgaFrPg4BbckGAadl8tKxNU14lZEVlb3MbEKaiYRHB5uDRi Q2QD4YiTjaPy+V9vsW8MuCY+64XparUuTXpas5hRFSf5u04Q82rGUzxy+SStGfN+ yXM7WJoeP5KNySLXVd5b5VSLMQGrw0WsZrpnKJEJPjtlelagIKbCEmX9yPw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1794485774; x=1795090574; darn=nongnu.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:content-type; bh=uQX4PMKh7dMhXSe32oSNpxkmTAwd5otkRrgQIcHy3tM=; b=aOYcj5F4M8teS+whP0BMsu9HpXzpD2QvWw5LJD7sxKkXHqP7Vy03DjW6DwNv/9x/D9 Cov+/PEQZHn3DZRW8GRPYvCgCyiB+6/yn4lRuwpvmnMxNBwkB17WwDLFLOJdOOjAP3eD ZbOyJiwygI2pLbSyGyYzH8qyNm30YtTjXC3dscjU3hJEfPaPqpRyjK3fApCTSerA6igH rxgNeuPA3/JMg/MGCDkWFKvHbsb+jlhmq1DQFG7bFTU0dFcOrXGaSgH+J9iBwiM+RoTC tPmCsNTJLybb+SznnssZc77exyD4U7vkrS2ZyxXVCY8UWAucAXvPIM7j3jELWnnWWaUz Rnzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794485774; x=1795090574; 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:content-type; bh=uQX4PMKh7dMhXSe32oSNpxkmTAwd5otkRrgQIcHy3tM=; b=1ZQsGm0OhbTS7YvQ4nhRn4oxoSIOBWc5cMSMPXbHwBydICduQ8z516ydsBdLPYM83q /jljVLtGDL6qNNdch3drx6M003StPYJFmmJXXpdmGvUZOpmeq31AcAyOvhNQCLUm88QZ VvD8pl995F4pk1ZYkG9tJIg7cIj8mzzoqv/AM69gxLbEgvXifgSBHFoFGpRROyqnya3o lZbIbAFExThU33hcUC8f0RwPpduvdMcNQQDstC9B3cTQPxa9LG3qzQvcu5MinXkcQ47u SJrs3LB3/iBKV4UK/wP4ZdocpUJDKbhtH5e8PSW13wN+B1D8CRfsMFlx0moFdqRVX6wx m1tA== X-Gm-Message-State: APuU4Z/ZhUEK4fhIBuhhAtcsHjf5V+SZhAyUygpLtVXy0983RyZlHf1q 0WOkqcahQ9HotRmY4kLcOza1WCMJQOeTHnD8qIa1YBWkFobRt3y50+8irC84baOfV4DNJhfut8F rPWDHeBnLNW/GB4lzpEL2+OgYHEumih3Xe4W4r7et1g7SXetAR2YkLfCY/ZijutTwOQ== X-Gm-Gg: AYBFou3Vb1NeHdeEKfxW2Qyu2UZnIJCUG0DmQs76DKRge2GcsgVOxD40Il1o+o8T85I 21n6lbHbfT/KxJgVssSgNVm4vFEfhZcgdo7C23ZksLh9QETVLp03lV4JA39Q24x1NdZRsPixORe +debAUSzY4SamxWwwMJJcUraNZ+B/XFoW9Tw+TANyhvuaw5bDVpJwkGn/M9URt5d5zHv1kQ2fha heH+ELj9DMKFfQ2b9qIArWxgvVpem1xo/LOTAnVLQbOzwJsfgnIH9RrPXV3B7wy0eokrvmAqalM NNSm64s0a7T9a30KxcLySEqFN+fyy7cqreHrxE4vxlr5Rl55bdR2M136sXdZ+tGPdarLh/gCKQV UZ0du8pIX9rhKRpdJ2nPtayCfBs39lURNHv5uAHFpE2FCFKbFRklaxgY3JJS+UvzJeL+KoA/tFe 5DfTTKfhRrPmo/uQzBx5OeFPFtgGVITosd6xr2HuHRrDPG X-Received: by 2002:a05:622b:82:20b0:559:af0d:a4e9 with SMTP id d75a77b69052e-559af0dad13mr18052151cf.51.1794485773579; Thu, 12 Nov 2026 04:16:13 -0800 (PST) X-Received: by 2002:a05:622b:82:20b0:559:af0d:a4e9 with SMTP id d75a77b69052e-559af0dad13mr18051811cf.51.1794485772930; Thu, 12 Nov 2026 04:16:12 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, alistair.francis@wdc.com, liwei1518@gmail.com, zhiwei_liu@linux.alibaba.com, chao.liu@processmission.com, Daniel Henrique Barboza , Palmer Dabbelt Subject: [PATCH v2 4/5] hw/riscv/virt.c: fix base baud in serial_mm_init() Date: Thu, 12 Nov 2026 09:15:52 -0300 Message-ID: <20261112121553.485439-5-daniel.barboza@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261112121553.485439-1-daniel.barboza@oss.qualcomm.com> References: <20261112121553.485439-1-daniel.barboza@oss.qualcomm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMTEyMDA0OCBTYWx0ZWRfX55vZzKHrMTlm E0U+psW5BtlvOyjAYxUhEywRf+CGPAp46oMBdHRVroLFDu4esJGRz9sv+egY3CGnjhNg+RZqEYB B4g/1vMbLnppXPUxcUdYUhe4/p/tmaPpPNqjzkRb1BCDWTyAgqTo9OIbDFV5lFLJ6Bgy4PI8ZSi N/oh6vp4pah82Pz6J6Vp1o/NVqvCuTurZ0kvvg8ufjeNOP0McrylJPf8QXZbcfdzrUczOU0JKV6 zYV7whPTfxpEMmbdqnKibbn3W4wlJMLLXvmuvN8iWBDBFe561zKLK7MAZfUJvEXo0lqTSPAp0PX 7BtaCNEF7neEvAwS5QUr8ITjtAfcVuuMiH9mLLI1IFIqsxaqprjYmNT9K/D6AnJb9vdYCv1q52/ A4QhJzTPWlexyPrs+HLaNs8CZLUqEm3yoETACaoMpAMNRQkvomn/JgjrVD99pVHlhP98g6Us3Mw nQtqRrqqfpZrzIGjhDw== X-Authority-Analysis: v=2.4 cv=AsF7T+9P c=1 sm=1 tr=0 ts=6af5ae0e cx=c_pps a=EVbN6Ke/fEF3bsl7X48z0g==:117 a=xcxBfRYLw5hNHjR815/AfA==:17 a=zJRp6_cAMcgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22 a=EUspDBNiAAAA:8 a=JF9118EUAAAA:8 a=YBD5noFLO0MiZe3rPCsA:9 a=a_PwQJl-kcHnX1M80qC6:22 a=xVlTc564ipvMDusKsbsT:22 X-Proofpoint-Spam-Info: AW1haW4tMjYxMTEyMDA0OCBTYWx0ZWRfXwihrOxubHUbp KEOw9oTdTbPHsadcNqWkFeeBdOTUEtC2VIxMfrW6qQcRTvNjOCEubqG0cGxwcDQklIbPoN9Eofu RdP+AiLEBv6GYywqBHAMGVd0CljKT+8= X-Proofpoint-GUID: 1s5vohukd2MSiaF4H1eI5Udl6MaKDGtC X-Proofpoint-ORIG-GUID: 1s5vohukd2MSiaF4H1eI5Udl6MaKDGtC X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-11-12_01,2026-11-11_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 suspectscore=0 phishscore=0 impostorscore=0 bulkscore=0 adultscore=0 lowpriorityscore=0 spamscore=0 priorityscore=1501 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2611120048 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=205.220.180.131; envelope-from=daniel.barboza@oss.qualcomm.com; helo=mx0b-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, 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-ZohoMail-DKIM: pass (identity @qualcomm.com) X-ZM-MESSAGEID: 1794485826523158500 Content-Type: text/plain; charset="utf-8" We've been using a base baud of 399193 to create the UART devices while, at the same time, reporting a clock frequency that represents a 230400 baud rate. This pattern dates back to the initial RISC-V port and so far seems to be doing okay. Linux thinks that we have a 230400 baud serials and nothing seems of. Or better yet: no one has complained about a potential bug in the UART devices since 2018. All this said, set the UARTs baud rate in serial_mm_init() to match what Linux has been seeing all this time. Fixes: 04331d0b56a0 ("RISC-V VirtIO Machine") Signed-off-by: Daniel Henrique Barboza Reviewed-by: Alistair Francis --- hw/riscv/virt.c | 10 ++++++---- include/hw/riscv/virt.h | 2 ++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index dd1b02a7b3..08dee967ae 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -914,13 +914,15 @@ static void virt_machine_init(MachineState *machine) VIRT_PLATFORM_BUS_NUM_IRQS); =20 serial_mm_init(system_memory, s->memmap[VIRT_UART0].base, - 0, qdev_get_gpio_in(mmio_irqchip, UART0_IRQ), 399193, - serial_hd(0), DEVICE_LITTLE_ENDIAN); + 0, qdev_get_gpio_in(mmio_irqchip, UART0_IRQ), + RISCV_VIRT_UART_BASE_BAUD, + serial_hd(0), DEVICE_LITTLE_ENDIAN); =20 if (serial_hd(1)) { serial_mm_init(system_memory, s->memmap[VIRT_UART1].base, - 0, qdev_get_gpio_in(mmio_irqchip, UART1_IRQ), 399193, - serial_hd(1), DEVICE_LITTLE_ENDIAN); + 0, qdev_get_gpio_in(mmio_irqchip, UART1_IRQ), + RISCV_VIRT_UART_BASE_BAUD, + serial_hd(1), DEVICE_LITTLE_ENDIAN); s->uart1_present =3D true; } =20 diff --git a/include/hw/riscv/virt.h b/include/hw/riscv/virt.h index 6e4fbf4b64..63907d7362 100644 --- a/include/hw/riscv/virt.h +++ b/include/hw/riscv/virt.h @@ -121,6 +121,8 @@ enum { #define VIRT_PLIC_SIZE(__num_context) \ (VIRT_PLIC_CONTEXT_BASE + (__num_context) * VIRT_PLIC_CONTEXT_STRIDE) =20 +#define RISCV_VIRT_UART_BASE_BAUD 230400 + bool virt_is_iommu_sys_enabled(RISCVVirtState *s); void riscv_virt_acpi_setup(RISCVVirtState *vms); =20 --=20 2.43.0 From nobody Mon Nov 23 04:34:31 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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; dmarc=pass(p=none dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1794485857; cv=none; d=zohomail.com; s=zohoarc; b=QhuZ9PKwMAEjJB9w3VwkGZJG2aoAxEWXMzibNPvJk3yoHz3JG5lVvwqU7A/kY/dFjZDZAfUvdlDUup9272g6SwH+VPqqdjbZbV8W2XA/74N+ANFSMH3cxejOrSp5qkDBepohvLgOc8OvAP6fAK0ivtNZ3+eEnL2zr5TCyCa4IB4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794485857; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=V1v4b/976D2ImNBHl+96m2amRGObR4ZYuZXr8rKD0lM=; b=LUKGsDYWChadPHQboX3UOmgGp8fN7nk/zeAvd/LMp2Sxi8XElJ/yxh2OY9hslqP8luqmOzuiMw6Ya1cdq3kUbGSBoQN98kIipAI1mnJXy7nhV7gv+nQ5K0pX+ibHuFbxKD6iyZPPRdeDTwp4FDGU1k9QClZ21M0XqlKLpSiL4f0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 179448585745373.33964392315602; Thu, 12 Nov 2026 04:17:37 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRTjV-0000as-MT; Thu, 12 Nov 2026 07:16:49 -0500 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 1xRTj3-00086B-Cr for qemu-devel@nongnu.org; Thu, 12 Nov 2026 07:16:23 -0500 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRTj0-0002WM-Fn for qemu-devel@nongnu.org; Thu, 12 Nov 2026 07:16:20 -0500 Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6AC8uhpb4149288 for ; Thu, 12 Nov 2026 12:16:17 GMT Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4hvxc63bj4-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 12 Nov 2026 12:16:17 +0000 (GMT) Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-542fc619afaso55976691cf.2 for ; Thu, 12 Nov 2026 04:16:17 -0800 (PST) Received: from QCOM-UWl2o8bcGT.qualcomm.com (189-68-253-226.dsl.telesp.net.br. [189.68.253.226]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-5550af6096asm73538651cf.5.2026.11.12.04.16.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Nov 2026 04:16:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=V1v4b/976D2 ImNBHl+96m2amRGObR4ZYuZXr8rKD0lM=; b=aNppQp43FDUYFXHYZDYDpJwSAvM 2N/CtpzuOkT3t5a8SoKH9IwWNVGdQT32mYn1IPKBEMkk/YFvCdjutrUR6hiRR9Vr e7DsQQ8tChTBOmUBYiXr6GJJVg2Jv1qkd2/OIAJBOEWs5k6gn4FqMIivFdkY+Ncp DIDpv8a50G4X7OkKKxyn764Cd11ik6qpTBqDpCyce0gPrIhXVS+PKCjBcr8EuTOD 2dxTI5FKLdmxsI1iuP98zQ7L/aJWjnnaKeyJtVynSQ/ZCuxDIqRl38U6uz/3JRpn SoJZqw8/ExXGphYmAFeKpeiUgIMANOaR/PjYU8HUTzTV2GtTO4iqo4oM0sw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1794485777; x=1795090577; darn=nongnu.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:content-type; bh=V1v4b/976D2ImNBHl+96m2amRGObR4ZYuZXr8rKD0lM=; b=FARruheOcwjfDPlxuOMwNtwrZOgXu6CFCifQzBGyruv/Yz+KHYLCa8u/RZ5KPHPMfT vcrrnuuRcs8Hw675HuuKa3IADAoOnNF6IVjRGwJ7RDulc6ptYnFwMj5Z1S6BJy+70U9S ZcjJG0rq219IQlKlRePzQU7Bh7CZ5qs0nEhyMUaOAYN0v8Oer/uhSzH/F8OoKYLWB+lv nkmDgtTCMOgajdLkreMRonTkBndZmCj1sERhXAiIvDhzfMnWnp3wpWT4T+HEwSBRwkU/ 5FNnrNgM8opBm1iMd4zjvjgWY/4CEBz9/y9A37yGOunYmXjLw9SyihcDQwI86yYq/BBu m+zA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794485777; x=1795090577; 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:content-type; bh=V1v4b/976D2ImNBHl+96m2amRGObR4ZYuZXr8rKD0lM=; b=kEbelyqBgR/vLWxwX+uaMJGxiAeA43fivkat78qu/417SjVLfkzf9hrE6zBqwQfhBZ nVQjbfDQiOJ+PLC5ciGBHkKGwxbtIyJa2kHRoMQRsgoKV1fMMYq+mI5IplkU6F09GzXE 9K7qeKnckazoFaPKcUrWg3Tpzh4x+EgsB7GopS0pB1tNm5KG0UDSrYV1fP/CNja6eCFh TbL28VfpkKfhVxT67aKU4o1Yzj7v7VQXMzeCuYeW1rVHLFNEjhQ2ZarUhBOMuuz/1Wgc 4PhCAWacvTLHV62vkJbNRp2ViS13TPiQfj7KLoKEyw6gl+tfdYMPbcGOQqaKfHYwu91j jyqw== X-Gm-Message-State: APuU4Z/T1Ck40bc397LmQQhR99deyoHmjeg6HZfpnEc91H0MNFHG5wtt 2yHJpuMPcFnzDnRQSAjw6XSpVawF3mLeOOkKkRWmgKNsguHF1pk/N19o8WwCukDzWOPz9G4VX0l ugIAOiGqXhBAi85WoVZoua5PV7MHRtZvRJ85gZ4Um/iFZFvoSRSbNs+BxcB8emL9r6A== X-Gm-Gg: AYBFou3K8bAuYLTz8hXYSd6aSegtHN327mi9NVuMxoaKs5Ytu4LcKZ6LOVx2cboJs6F dj1YmQgcD/vB2Sj+sbLFQTsCZ2v9XLgcOm9O7TzBSwG3nhYQ+ardILPOXduLmMmjqXGjwNgWVYs MR256AvBs28eHNmDin4raf7VaBg2FjMVvMkCUp/trQL/WI5VUpY9JfUBPX7Q6UGyJzh1CjD6jX5 c5SCfThK7WHKymF6xnCTT/bxZAS5YZbih+bcm5CSRTQY/IF5O7Ftqn48i1uGOMLv+rTo8XeX1BT cVCuugFGu/egrhDFolNFzShZmNVGUO9iIMLZAB8vdWw8wjZ3nsTGicvjhf8lmUPrFIuDyjC7Afl NgSx86yH9tC99HXpwtzF/j1b/gCndnnH7oLJ7+Tig61P7yBKIT4W3Bqsm9KMCTOoAEl5mwBkW9z KMrIQ3vfW21VEG071whfqOi11gy5j+aAsys4wpdvQSPTX2 X-Received: by 2002:a05:622a:a13:b0:533:8bf0:e6 with SMTP id d75a77b69052e-556c06e354amr83624901cf.35.1794485776457; Thu, 12 Nov 2026 04:16:16 -0800 (PST) X-Received: by 2002:a05:622a:a13:b0:533:8bf0:e6 with SMTP id d75a77b69052e-556c06e354amr83624471cf.35.1794485775904; Thu, 12 Nov 2026 04:16:15 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, alistair.francis@wdc.com, liwei1518@gmail.com, zhiwei_liu@linux.alibaba.com, chao.liu@processmission.com, Daniel Henrique Barboza Subject: [PATCH v2 5/5] MAINTAINERS: add contact for the RISC-V server-ref machine Date: Thu, 12 Nov 2026 09:15:53 -0300 Message-ID: <20261112121553.485439-6-daniel.barboza@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261112121553.485439-1-daniel.barboza@oss.qualcomm.com> References: <20261112121553.485439-1-daniel.barboza@oss.qualcomm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-ORIG-GUID: ELprgLhjPDb18A1HOMh2W5FJGX8KMJpH X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMTEyMDA0OCBTYWx0ZWRfX7ME1Hf733ryO SG3+Y2TA7/ecA6lZF8a1w/lwlLNlBvcqSSMBVT+IkSEXSL7ONarsITTolEhzj6JNtytQqpn1uAp 7M3JCv+bd/7iucXT1hhbwNacJZc54sTzHwBjXE2BchMDiJ9WdU+VP9zCAtrwjEzgoOy+qfaHGVI LfPhMIOb/tmWjTWSqzKoZ6webInJbb35BGZ1qcvvtIiV5prgzgqQLFGLUKXIkUUOGoOgohL8u5e Vd0SwYyJFAl/2MPwnW5Az+E3EnqGtgKnyA93nmFv5rIUW+xOHZwA54nzpx0SJbrv5BEQLxUVHZI NGM+KkRV09DVx65PFxlkBJDWrZHYj+2AknTokWhKANVDcLpQj4SXi4dWd0pj9YBvZWRpTOoH1ow Ku8yn0TJJ1LH7JN8px5AZSrlR2uRDbNxhDhHsS7MhOOvoQq7sEjlFeg5gBXCZEbCivw3grx0iDT C9RttQA74dOySebn+HA== X-Proofpoint-Spam-Info: AW1haW4tMjYxMTEyMDA0OCBTYWx0ZWRfX9VUxlKVFLoE9 Oa+Vm4qVvFf4gSZhdeFo7x+0YO1EUs7NdIwxWXPeoDFsghwmt237yxSQs5ObxYBMDhlee11ASYZ 0h5w4bm2Nx0zH6jIWju73dUEcLJic/o= X-Proofpoint-GUID: ELprgLhjPDb18A1HOMh2W5FJGX8KMJpH X-Authority-Analysis: v=2.4 cv=O/ysLx9W c=1 sm=1 tr=0 ts=6af5ae11 cx=c_pps a=EVbN6Ke/fEF3bsl7X48z0g==:117 a=xcxBfRYLw5hNHjR815/AfA==:17 a=zJRp6_cAMcgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=gowsoOTTUOVcmtlkKump:22 a=EUspDBNiAAAA:8 a=FRSEYCzRAAAA:8 a=JF9118EUAAAA:8 a=69wJf7TsAAAA:8 a=MOatoMk4zhW8oBTF--8A:9 a=a_PwQJl-kcHnX1M80qC6:22 a=H4N_Y-AU75W7NKDNhZlT:22 a=xVlTc564ipvMDusKsbsT:22 a=Fg1AiH1G6rFz08G2ETeA:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-11-12_01,2026-11-11_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 suspectscore=0 lowpriorityscore=0 priorityscore=1501 bulkscore=0 adultscore=0 malwarescore=0 impostorscore=0 phishscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2611120048 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=205.220.180.131; envelope-from=daniel.barboza@oss.qualcomm.com; helo=mx0b-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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-ZohoMail-DKIM: pass (identity @qualcomm.com) X-ZM-MESSAGEID: 1794485858539158500 Content-Type: text/plain; charset="utf-8" Make it clearer that this is a board that is actively maintained. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Chao Liu Reviewed-by: Alistair Francis --- MAINTAINERS | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index fa0c6d0c9b..9a3f8eb8a4 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1913,6 +1913,14 @@ F: include/hw/riscv/cv1800b.h F: tests/functional/riscv64/test_milkv_duo.py F: tests/qtest/milkv-duo-test.c =20 +RISC-V Server Reference Platform (riscv-server-ref) machines +M: Daniel Henrique Barboza +L: qemu-riscv@nongnu.org +S: Maintained +F: docs/system/riscv/riscv-server-ref.rst +F: hw/riscv/server_platform_ref.c +F: tests/functional/riscv64/test_server_ref.py + RX Machines ----------- rx-gdbsim --=20 2.43.0