From nobody Fri Dec 12 14:05:25 2025 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=1764692938; cv=none; d=zohomail.com; s=zohoarc; b=l6b5am875hAOSTSLinIyGQVp1q2PU+/fhinYCmYa8j0vPy7v/k+3W5BJUvlWbDNyHJ9oVRdog0sjgu+O2E7JjIr1SxSqSP8xb03C3+Q3GTUAJ7FyWbwyzkxKCYkfhdqyx7KzO2U7nErjhqc5ubGOsssexehAYKHnqq7TUz7Ukgo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1764692938; 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=pg8fCNQTM6a1fOX1EHkjsyn5lrHCVvH9nlPiZ1+J3q8=; b=WRYnJ5OZ7Hk4Iwz5ucaVvaVn3HxKza/5udzRc6bMIE7lUmQke2zW4imYKswiJqEpMKDIFk6CjD+YsVp6kJdhgrIhLpeA1qskbawYwN+KP44vMQoB28JLcaqjZbnMC8lyYsBL/fqjfKKAW8Aw40v5q0uJHWLjsCVJlZy8C2AW6zs= 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 1764692938748331.775329660637; Tue, 2 Dec 2025 08:28:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vQSy0-0007GF-CF; Tue, 02 Dec 2025 11:11:04 -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 1vQSvT-0004c6-0l; Tue, 02 Dec 2025 11:08:32 -0500 Received: from mgamail.intel.com ([192.198.163.7]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vQSvQ-0008Qy-Il; Tue, 02 Dec 2025 11:08:26 -0500 Received: from orviesa005.jf.intel.com ([10.64.159.145]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Dec 2025 08:08:22 -0800 Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.39]) by orviesa005.jf.intel.com with ESMTP; 02 Dec 2025 08:08:13 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1764691705; x=1796227705; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jqtFvxj+10vNXec+3ARQzdivBUizNnzSIyg2+TGZekw=; b=J0E4XsqEqJjp4Llw93tfEZ9w9RmD2jFYkfNKar8LgA8tj1/KIs7Z8yNR CY7YrRe3Pt0r9bXeiZfSMolDbwn7nIByzjnVqCsyGnz7J62jbM8vsTUK8 2B+8Y+75GmSL9XTQ7cuL9Unkvwby/vKtzMctJH1GiNrr1JOk+shuFJDWa aRNeuzSXXskyPOGSjWIudXRBEg4guMdyZEnxVUgt16vGskNi3/zdyjX6W g84GoQYuc4wgMRvgPq9BkqXY6SXQDnHaXIYjNFTngWY6DU4YToJ68Paqs 9UkOwriJeXTA2l/t9uwAgr+R+uUY1mCA+ygL7LYIpf/Kf2XpvEJjHsnSY Q==; X-CSE-ConnectionGUID: NAoEKpb3Tn2S22CUQStQfA== X-CSE-MsgGUID: hbPihsjuRgCLEIm7HP1u5w== X-IronPort-AV: E=McAfee;i="6800,10657,11630"; a="92143176" X-IronPort-AV: E=Sophos;i="6.20,243,1758610800"; d="scan'208";a="92143176" X-CSE-ConnectionGUID: SjU4LmDdQTiDLSlfpBYPSQ== X-CSE-MsgGUID: ZAw4+8F8SNSUfxJX7KFWXA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.20,243,1758610800"; d="scan'208";a="199538081" 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 v5 28/28] hw/char/virtio-serial: Do not expose the 'emergency-write' property Date: Wed, 3 Dec 2025 00:28:35 +0800 Message-Id: <20251202162835.3227894-29-zhao1.liu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20251202162835.3227894-1-zhao1.liu@intel.com> References: <20251202162835.3227894-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 client-ip=192.198.163.7; 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_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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: 1764692939800019200 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. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Mark Cave-Ayland Reviewed-by: Zhao Liu 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 673c50f0be08..7abb7b5e31bf 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