From nobody Mon Feb 2 09:27:45 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.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; dmarc=pass(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1767841858; cv=none; d=zohomail.com; s=zohoarc; b=A7g0xa2CctOmZAvZDaDAzxw/lhLkfLCTKI6kEFqPv/+lZhnTB/bD42zb/gy0NaVLRaUid91ESVrBQ0dM2/QecHwDhvGXMZp6du7vJiSYMN6RfYVSXhEk0wA6olqAnPEhswGA3k1XE8MX7sltUIowGvV3xCBAMQLkiWiIIjE+UTg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1767841858; h=Content-Type: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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=7SX3MXrzPGzpZk3a/01wb1eJKoDlX28pSPjgt+inWY4=; b=Rw9L2N6MI5S1f2bUX/qxWHCHgkU2JIFmSs288STgoiTyQsph9+UIow5KMqqD/F2y+5MjZNG8qg3WZUXrl8ZDypJOaBuCAD+F1pglvGwq9onGkwpIrX8PXf9TbhNwsGlrIAOs+ISKTvjjUUwp3n691BQMQv8j78AVI1I+HmYqonU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1767841858085908.454855162012; Wed, 7 Jan 2026 19:10:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vdgPx-0001Kp-8d; Wed, 07 Jan 2026 22:10:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vdgPI-0006gX-Pb; Wed, 07 Jan 2026 22:09:56 -0500 Received: from mgamail.intel.com ([198.175.65.9]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vdgPG-0005gA-NS; Wed, 07 Jan 2026 22:09:52 -0500 Received: from orviesa006.jf.intel.com ([10.64.159.146]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jan 2026 19:09:48 -0800 Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.39]) by orviesa006.jf.intel.com with ESMTP; 07 Jan 2026 19:09:39 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1767841790; x=1799377790; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=eQl80wcJOArtg5jzbHQMtHiWAJNWb57OsGNNd3OKlKw=; b=IpSS62znFYZ1GWG0lhmvp0HUxkvIUpKepUHrDjx8nX2lte02XSmPfhPP EJwms6A8S0IrBt3ukg6KUMRtTyp2/jNzSUHESwnBSADla4ECy+y4euBng opiZwa5r8/We0UC1ChCByfKvbKiXuuI3n51qOTDuYStML1Bt03PFgokqY 2111YStZl7HB9yWLhlKM54jaBceA/k8/7/7x3Y8GNqqRhBFGcwHS4J5m0 FKruMIiCkOafUZpBWkmC9kNOcgLNDMrhKk/D5kqsdUotj5xp55zQ+E3W6 jabUmxPDGJMspR5e17MIk7+mb/aVtTFV12mVrtRDotH46HI2Sshs4AIwF A==; X-CSE-ConnectionGUID: V584+F/tSuOgOWXxD9fCOA== X-CSE-MsgGUID: /9KAUKlwTuOBUOIZLtLyxw== X-IronPort-AV: E=McAfee;i="6800,10657,11664"; a="91877724" X-IronPort-AV: E=Sophos;i="6.21,209,1763452800"; d="scan'208";a="91877724" X-CSE-ConnectionGUID: kIWWhqTxQGmT66gxvRoqEQ== X-CSE-MsgGUID: KlFeMH7URR2pjppFfeN6xA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,209,1763452800"; d="scan'208";a="202211287" From: Zhao Liu To: Paolo Bonzini , "Michael S . Tsirkin" , Igor Mammedov , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Marcel Apfelbaum , Thomas Huth Cc: qemu-devel@nongnu.org, devel@lists.libvirt.org, kvm@vger.kernel.org, qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Richard Henderson , Sergio Lopez , Gerd Hoffmann , Peter Maydell , Laurent Vivier , Jiaxun Yang , Yi Liu , Eduardo Habkost , Alistair Francis , Daniel Henrique Barboza , Marcelo Tosatti , Weiwei Li , Amit Shah , Xiaoyao Li , Yanan Wang , Helge Deller , Palmer Dabbelt , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Ani Sinha , Fabiano Rosas , Liu Zhiwei , =?UTF-8?q?Cl=C3=A9ment=20Mathieu--Drif?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Huacai Chen , Jason Wang , Mark Cave-Ayland , BALATON Zoltan , Peter Krempa , Jiri Denemark , Zhao Liu Subject: [PATCH v6 27/27] hw/char/virtio-serial: Do not expose the 'emergency-write' property Date: Thu, 8 Jan 2026 11:30:51 +0800 Message-Id: <20260108033051.777361-28-zhao1.liu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260108033051.777361-1-zhao1.liu@intel.com> References: <20260108033051.777361-1-zhao1.liu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=lists.gnu.org; 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=lists.gnu.org; Received-SPF: pass client-ip=198.175.65.9; envelope-from=zhao1.liu@intel.com; helo=mgamail.intel.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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: 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 @intel.com) X-ZM-MESSAGEID: 1767841858592158501 From: Philippe Mathieu-Daud=C3=A9 The VIRTIO_CONSOLE_F_EMERG_WRITE feature bit was only set in the hw_compat_2_7[] array, via the 'emergency-write=3Doff' property. We removed all machines using that array, lets remove that property. All instances have this feature bit set and it can not be disabled. VirtIOSerial::host_features mask is now unused, remove it. Reviewed-by: Mark Cave-Ayland Reviewed-by: Zhao Liu Reviewed-by: Igor Mammedov Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Zhao Liu --- hw/char/virtio-serial-bus.c | 9 +++------ include/hw/virtio/virtio-serial.h | 2 -- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/hw/char/virtio-serial-bus.c b/hw/char/virtio-serial-bus.c index 5ec5f5313b21..b7c57ea9678c 100644 --- a/hw/char/virtio-serial-bus.c +++ b/hw/char/virtio-serial-bus.c @@ -557,7 +557,7 @@ static uint64_t get_features(VirtIODevice *vdev, uint64= _t features, =20 vser =3D VIRTIO_SERIAL(vdev); =20 - features |=3D vser->host_features; + features |=3D BIT_ULL(VIRTIO_CONSOLE_F_EMERG_WRITE); if (vser->bus.max_nr_ports > 1) { virtio_add_feature(&features, VIRTIO_CONSOLE_F_MULTIPORT); } @@ -587,8 +587,7 @@ static void set_config(VirtIODevice *vdev, const uint8_= t *config_data) VirtIOSerialPortClass *vsc; uint8_t emerg_wr_lo; =20 - if (!virtio_has_feature(vser->host_features, - VIRTIO_CONSOLE_F_EMERG_WRITE) || !config->emerg_wr) { + if (!config->emerg_wr) { return; } =20 @@ -1040,7 +1039,7 @@ static void virtio_serial_device_realize(DeviceState = *dev, Error **errp) return; } =20 - if (!virtio_has_feature(vser->host_features, + if (!virtio_has_feature(vdev->host_features, VIRTIO_CONSOLE_F_EMERG_WRITE)) { config_size =3D offsetof(struct virtio_console_config, emerg_wr); } @@ -1156,8 +1155,6 @@ static const VMStateDescription vmstate_virtio_consol= e =3D { static const Property virtio_serial_properties[] =3D { DEFINE_PROP_UINT32("max_ports", VirtIOSerial, serial.max_virtserial_po= rts, 31), - DEFINE_PROP_BIT64("emergency-write", VirtIOSerial, host_features, - VIRTIO_CONSOLE_F_EMERG_WRITE, true), }; =20 static void virtio_serial_class_init(ObjectClass *klass, const void *data) diff --git a/include/hw/virtio/virtio-serial.h b/include/hw/virtio/virtio-s= erial.h index 60641860bf83..da0c91e1a403 100644 --- a/include/hw/virtio/virtio-serial.h +++ b/include/hw/virtio/virtio-serial.h @@ -186,8 +186,6 @@ struct VirtIOSerial { struct VirtIOSerialPostLoad *post_load; =20 virtio_serial_conf serial; - - uint64_t host_features; }; =20 /* Interface to the virtio-serial bus */ --=20 2.34.1