{"id":2222799,"url":"http://patchwork.ozlabs.org/api/patches/2222799/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20260413170407.57574-1-mohamed@unpredictable.fr/","project":{"id":14,"url":"http://patchwork.ozlabs.org/api/projects/14/?format=json","name":"QEMU Development","link_name":"qemu-devel","list_id":"qemu-devel.nongnu.org","list_email":"qemu-devel@nongnu.org","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20260413170407.57574-1-mohamed@unpredictable.fr>","list_archive_url":null,"date":"2026-04-13T17:04:07","name":"hw: q35: fix VGA text console with SMM disabled","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"94c0c5ca347385d2cb52657189c492ef5abd39a2","submitter":{"id":91318,"url":"http://patchwork.ozlabs.org/api/people/91318/?format=json","name":"Mohamed Mediouni","email":"mohamed@unpredictable.fr"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20260413170407.57574-1-mohamed@unpredictable.fr/mbox/","series":[{"id":499733,"url":"http://patchwork.ozlabs.org/api/series/499733/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/list/?series=499733","date":"2026-04-13T17:04:07","name":"hw: q35: fix VGA text console with SMM disabled","version":1,"mbox":"http://patchwork.ozlabs.org/series/499733/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2222799/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2222799/checks/","tags":{},"related":[],"headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=unpredictable.fr header.i=@unpredictable.fr\n header.a=rsa-sha256 header.s=sig1 header.b=FZ/7OKDs;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists1p.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"],"Received":["from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fvYgM3G42z1xtJ\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 14 Apr 2026 03:05:01 +1000 (AEST)","from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists1p.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1wCKhv-0006wQ-DQ; Mon, 13 Apr 2026 13:04:20 -0400","from eggs.gnu.org ([2001:470:142:3::10])\n by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <mohamed@unpredictable.fr>)\n id 1wCKhu-0006wH-II\n for qemu-devel@nongnu.org; Mon, 13 Apr 2026 13:04:18 -0400","from p-west3-cluster1-host10-snip4-10.eps.apple.com ([57.103.73.231]\n helo=outbound.ms.icloud.com)\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <mohamed@unpredictable.fr>)\n id 1wCKhr-0000No-Qf\n for qemu-devel@nongnu.org; Mon, 13 Apr 2026 13:04:18 -0400","from outbound.ms.icloud.com (unknown [127.0.0.2])\n by p00-icloudmta-asmtp-us-west-3a-60-percent-3 (Postfix) with ESMTPS id\n B78AC18001DA; Mon, 13 Apr 2026 17:04:11 +0000 (UTC)","from localhost.localdomain (unknown [17.57.154.37])\n by p00-icloudmta-asmtp-us-west-3a-60-percent-3 (Postfix) with ESMTPSA id\n 498C31800201; Mon, 13 Apr 2026 17:04:10 +0000 (UTC)"],"Dkim-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=unpredictable.fr;\n s=sig1; t=1776099853; x=1778691853;\n bh=0/fpAPP5PLzFLXvq8GPcE+h9tIAhBl3FyIhWttyKd5A=;\n h=From:To:Subject:Date:Message-ID:MIME-Version:x-icloud-hme;\n b=FZ/7OKDs57Bae3EkzJYql/Y89gYWv5HL32/vAmKPeqeSV9q7XW0O2sX/dRg39gv+cFU/sEQ8vYoHKZlwWTX7iVaATT2aWM81NR3rBrQsMcQPNpskkB0KLmIQ7TD89EQszx0GX5MEaqJOPhkuH2Emj6Pps424YzEwpqcSqVfsC55rkBhg/uIHjcWKGVBaz1/MDSRmsHdoreLMls/ejEkF8WgTOdhaAII6gcj2x8PlGuHS+KI/MAHFANFY0LqlRwIqU2WH/NtEW3e6Qd1Xofg5xyNwdry5njynl/mA+HDaFjhpb85QyzRVYDIPjhPaikJDFBn4o/0AIqod4iA3wz06Fg==","mail-alias-created-date":"1752046281608","From":"Mohamed Mediouni <mohamed@unpredictable.fr>","To":"qemu-devel@nongnu.org","Cc":"Marcel Apfelbaum <marcel.apfelbaum@gmail.com>,\n \"Michael S. Tsirkin\" <mst@redhat.com>,\n Mohamed Mediouni <mohamed@unpredictable.fr>","Subject":"[PATCH] hw: q35: fix VGA text console with SMM disabled","Date":"Mon, 13 Apr 2026 19:04:07 +0200","Message-ID":"<20260413170407.57574-1-mohamed@unpredictable.fr>","X-Mailer":"git-send-email 2.50.1","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","X-Proofpoint-ORIG-GUID":"soYKR_QXwpT_QwrzzNeaAMNN-TB-2PmN","X-Authority-Info-Out":"v=2.4 cv=NIfYOk6g c=1 sm=1 tr=0 ts=69dd220b\n cx=c_apl:c_pps:t_out a=qkKslKyYc0ctBTeLUVfTFg==:117 a=A5OVakUREuEA:10\n a=VkNPw1HP01LnGYTKEx00:22 a=_ctWjzdLAAAA:8 a=p0WdMEafAAAA:8\n a=WqM1to31ecf1YN0a6F4A:9 a=WoGCsytTnHKj16XvecxK:22","X-Proofpoint-Spam-Details-Enc":"AW1haW4tMjYwNDEzMDE2OCBTYWx0ZWRfX18FV+ZJk3EI4\n Q2HphuByYe7TXjzG0GJqMcb9z+vVoBO078FlK3F+0eqHeqE+I0sXkvVrAYW1GnfJO7OgmkzBtoe\n hOguGI+K6Ga1Pt0OzM9+TGN0snZiHj46Qzrpagrvc8abv1+W4rCnSLFQ9YHPwTURmxIV+97/T52\n VYVqo6z5HGsSQR6ftlrnC6HveRtNElKaZUjJftLEjWj/YKbrNkDfFsHKmB6UgT1w/eoOF3M6beh\n B0gsTPie4n7A2NK2RKHg5E7J55xGrZ0+NmetnGJENF5j4GVDO1B9aUXS9v8y3tIU2xqXjg591iv\n /9FIDC+/wiDeHXT5KEaxsDwIVya+eUZ/YVlFwiYDSge/4nXCh1j3046HdSv3nY=","X-Proofpoint-GUID":"soYKR_QXwpT_QwrzzNeaAMNN-TB-2PmN","X-Proofpoint-Virus-Version":"vendor=baseguard\n engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49\n definitions=2026-04-13_03,2026-04-13_04,2025-10-01_01","X-Proofpoint-Spam-Details":"rule=notspam policy=default score=0 bulkscore=0\n suspectscore=0 malwarescore=0 spamscore=0 mlxscore=0 adultscore=0\n phishscore=0 clxscore=1030 mlxlogscore=999 lowpriorityscore=0 classifier=spam\n authscore=0 adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000\n definitions=main-2604130168","Received-SPF":"pass client-ip=57.103.73.231;\n envelope-from=mohamed@unpredictable.fr; helo=outbound.ms.icloud.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,\n DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001,\n RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001,\n SPF_HELO_PASS=-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 <qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<https://lists.nongnu.org/archive/html/qemu-devel>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"},"content":"Work around black screen in VGA mode with SMM disabled.\n\nRequired by NVMM, HVF and WHPX backends.\n\nhttps://gnats.NetBSD.org/59721\nhttps://gitlab.com/qemu-project/qemu/-/issues/2608\nhttps://gitlab.com/qemu-project/qemu/-/work_items/3085\n\nPatch written by Taylor R Campbell <riastradh@NetBSD.org>\n\nSigned-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>\n---\n hw/pci-host/q35.c | 22 +++++++++++++---------\n 1 file changed, 13 insertions(+), 9 deletions(-)","diff":"diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c\nindex e85e4227b3..05ef5222f7 100644\n--- a/hw/pci-host/q35.c\n+++ b/hw/pci-host/q35.c\n@@ -372,6 +372,10 @@ static void mch_update_smram(MCHPCIState *mch)\n         memory_region_set_enabled(&mch->high_smram, false);\n     }\n \n+    if (!mch->has_smm_ranges) {\n+        goto out;\n+    }\n+\n     if ((pd->config[MCH_HOST_BRIDGE_ESMRAMC] & MCH_HOST_BRIDGE_ESMRAMC_T_EN) &&\n         (pd->config[MCH_HOST_BRIDGE_SMRAM] & SMRAM_G_SMRAME)) {\n         switch (pd->config[MCH_HOST_BRIDGE_ESMRAMC] &\n@@ -405,7 +409,7 @@ static void mch_update_smram(MCHPCIState *mch)\n                               mch->below_4g_mem_size - tseg_size);\n     memory_region_set_alias_offset(&mch->tseg_window,\n                                    mch->below_4g_mem_size - tseg_size);\n-\n+out:\n     memory_region_transaction_commit();\n }\n \n@@ -474,15 +478,15 @@ static void mch_write_config(PCIDevice *d,\n         mch_update_pciexbar(mch);\n     }\n \n-    if (!mch->has_smm_ranges) {\n-        return;\n-    }\n-\n     if (ranges_overlap(address, len, MCH_HOST_BRIDGE_SMRAM,\n                        MCH_HOST_BRIDGE_SMRAM_SIZE)) {\n         mch_update_smram(mch);\n     }\n \n+    if (!mch->has_smm_ranges) {\n+        return;\n+    }\n+\n     if (ranges_overlap(address, len, MCH_HOST_BRIDGE_EXT_TSEG_MBYTES,\n                        MCH_HOST_BRIDGE_EXT_TSEG_MBYTES_SIZE)) {\n         mch_update_ext_tseg_mbytes(mch);\n@@ -585,10 +589,6 @@ static void mch_realize(PCIDevice *d, Error **errp)\n                  PAM_EXPAN_BASE + i * PAM_EXPAN_SIZE, PAM_EXPAN_SIZE);\n     }\n \n-    if (!mch->has_smm_ranges) {\n-        return;\n-    }\n-\n     /* if *disabled* show SMRAM to all CPUs */\n     memory_region_init_alias(&mch->smram_region, OBJECT(mch), \"smram-region\",\n                              mch->pci_address_space, MCH_HOST_BRIDGE_SMRAM_C_BASE,\n@@ -604,6 +604,10 @@ static void mch_realize(PCIDevice *d, Error **errp)\n                                         &mch->open_high_smram, 1);\n     memory_region_set_enabled(&mch->open_high_smram, false);\n \n+    if (!mch->has_smm_ranges) {\n+        return;\n+    }\n+\n     /* smram, as seen by SMM CPUs */\n     memory_region_init(&mch->smram, OBJECT(mch), \"smram\", 4 * GiB);\n     memory_region_set_enabled(&mch->smram, true);\n","prefixes":[]}