From patchwork Thu May 8 13:35:49 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 888609 Delivered-To: patch@linaro.org Received: by 2002:adf:b60d:0:b0:3a1:f579:ae88 with SMTP id f13csp10522wre; Thu, 8 May 2025 06:46:17 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX05ibt4XuMdSSpuOPusaK04yeOpDuUpVQa6qWZCYD4Fcykivh3B13OHnO01MKC9/7D7fpRlg==@linaro.org X-Google-Smtp-Source: AGHT+IGZmE9QPUeGIrV14kVYANvMg51F8j0vU7XVVDNimZadilDzfe3qrPmP8Hn0GaIyEeQ7zYbB X-Received: by 2002:ac8:5846:0:b0:476:78a8:435c with SMTP id d75a77b69052e-49225b38036mr114897051cf.16.1746711977284; Thu, 08 May 2025 06:46:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1746711977; cv=none; d=google.com; s=arc-20240605; b=WwB5iqxXnZSGEGbXSYNrjm1zn8E2UIEGN5PN64wThDTXkQ0cJ8J/pJnKixyRZRRsvL mmGBjXqB0x0+jAVE93ENoSZtXo/M2153b/CdOloTQxlFeW2V7kdFnBY8TYZy8ap4WAWV mUT8S9iMnO1Z/6myUu2iXsoxSMOMQtqCSW1AbhqGtCynrixkvfd9RYIjXKLzWV6A2PJX dvkLazIHKhY5aozhRq87Oqj6s6mwdvlKOsOTCu0tBYBGG5SnBRQtVvW/UrgKrhSrZDeE EjqCuiDCDzACGCdPtmz+rmpwaB1IWnQVutlaDgj6z7wosVMchVONk0ymOJ29aeZ/OsXF rswQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ns6abkUGaM6ukyij9Yk70LzU+Vns27nmI4rpIretkkk=; fh=t4sCPXSJJxzszaJF+1Mm6mpQfCAwhf2cujSX+L6g5pY=; b=llx9zqCY0A4tapAMH9rO0sAUGNaQeWreG4sVyK5WTyiw5pbmDV9oVZeQI9vajwwDAw maTJyyhTqOatsNhUpinRySC6WI7iy+kM4z1AxBbrpbjibSf4JhKxK9wQxS5xi+Bs+kAt GX7DE0sdy1P1RAT/s8v9Ojk92aN489lGDDTVWCFWMM47SabQQ6xiepu83iTviVxvhO73 dHE05aUwsA4R/wybH9oPTSyzRmEthRkDv3xjwkGHQbqq4jltcmQtkeSWQv6axN83S+im 7PPaXnyVexnxFfuIia80Nz9wypVTIjbTQ2QBU821dRAzpePyhF6Vm0PKPN8YSms5XPUW FqbQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kdHczDAt; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-49220f82faasi43924151cf.70.2025.05.08.06.46.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 May 2025 06:46:17 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kdHczDAt; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uD1Zc-0003xU-EQ; Thu, 08 May 2025 09:46:04 -0400 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 1uD1ZS-0003i8-3x for qemu-devel@nongnu.org; Thu, 08 May 2025 09:46:02 -0400 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uD1ZO-0005GV-Mg for qemu-devel@nongnu.org; Thu, 08 May 2025 09:45:53 -0400 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-736ab1c43c4so1054284b3a.1 for ; Thu, 08 May 2025 06:45:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1746711948; x=1747316748; 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; bh=ns6abkUGaM6ukyij9Yk70LzU+Vns27nmI4rpIretkkk=; b=kdHczDAtzYUdFYPmu5hfBEzLvF8wmfwBN7007LSkfLejx1VFYJc3Rj8sfhm/JHrhcg Np695U8C98kezeliXhUr8sC/vp5MPaGRsIux+inELLMievxcJl8EcrNO1Qwu7dgCLUE6 1aXCL/4dWmwoTpsnsSmJSrN3gRv9wp8tKAsP8vZdIrXj3CD8up8kfNjOlEHS7fMqKKUX Q8I8F9HnyBM2Iv7QtsurhJZBe8jGbuz1ESdtl1u028bAYvEk7f0ZxLDWYjO/eqLK2Ev/ 4NFTkA12MeaY5TrdVS3H/iARZiI/jUDdZ+92BaNGvABScFDocg5aPAKc45yfAdJ53Da9 I7sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746711949; x=1747316749; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ns6abkUGaM6ukyij9Yk70LzU+Vns27nmI4rpIretkkk=; b=XPs10ABV2bPMJqdHmbRNpNhR6ocQ3jXkndTnQruVvmCSs6Ri3Nsx/mDO6NGtVXmWPe wkxqZgtKD8G9OebHoUK0L3H3/c7FfBrDcrt/b4zxWoInXJuBopS1JjGmbZ+uuTu+/L5P UT6ApTKtWK/PP8kgCeYLLauKpptG8MWfh9JI0UK8ek8C9kP4SIZgEm08oY8reDi/feN/ lR0tvvtXbtDygBLQog03trncEu+pDXDb+QCz947alXSvUc8DE19Hs80x0cW8/aqtg5xN PFgvzmowox7I2bW0+IL64Jzf4uE+3qXapz9LTG7lN+NGrhPpLkXgzJxDu4iuFrCAUHyU PBTA== X-Gm-Message-State: AOJu0YzyrJlznWZkTfudek5MA3ljw/9MqUU8+tSe3kYF1IWO2Gs8V6F+ +gMirk28eSB6NqPn62wUPQH/f3D2RhyFE63K8DY6gfKN4qDK4ri1Bb1wPo6VHOX/+MZOz6QCcxh 6hMFkyg== X-Gm-Gg: ASbGncuhy+J2cJJWj/zJ40PnlIX+fUEcplwVr6yjaFE78jCKD3SeknU855+bymWxyg8 lRsyzTqsB4dBqNABUeC+cLysOyrGRCckJuPhtrodiHkFB3DeLSPwwMz46EzSON0atCFmPtdY2m5 4nfSt/mH5QwoxOmV/YQTjvWxjD9FNpY6QBqyid5uettLM9tTvLvvxmu22qLC3Vc1OTfRukC+P9B Xqiwl500Bw4e9aSl4yoJuXVyTuj63Vv2sasD/nx2/+Otul82LMGSdVZ3ZzqEZ91DASQfTzDFeVa c/384J8vTCvByUoCzCnEFhA0h1hCobv6ZbIon4qj7Z03v7KPDIDCB/3xQrOsJDvPjejhcrSZgqN luEJSj0itycT46cM= X-Received: by 2002:a05:6a00:1308:b0:740:a879:4f7b with SMTP id d2e1a72fcca58-740a8794fcamr6118097b3a.18.1746711948529; Thu, 08 May 2025 06:45:48 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7405906372fsm13690156b3a.148.2025.05.08.06.45.33 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 08 May 2025 06:45:48 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , kvm@vger.kernel.org, Sergio Lopez , Gerd Hoffmann , Peter Maydell , Laurent Vivier , Jiaxun Yang , Yi Liu , "Michael S. Tsirkin" , Eduardo Habkost , Marcel Apfelbaum , Alistair Francis , Daniel Henrique Barboza , Marcelo Tosatti , qemu-riscv@nongnu.org, Weiwei Li , Amit Shah , Zhao Liu , Yanan Wang , Helge Deller , Palmer Dabbelt , Ani Sinha , Igor Mammedov , Fabiano Rosas , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Liu Zhiwei , =?utf-8?q?Cl=C3=A9ment_Mathieu--?= =?utf-8?q?Drif?= , qemu-arm@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Huacai Chen , Jason Wang Subject: [PATCH v4 26/27] hw/char/virtio-serial: Do not expose the 'emergency-write' property Date: Thu, 8 May 2025 15:35:49 +0200 Message-ID: <20250508133550.81391-27-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250508133550.81391-1-philmd@linaro.org> References: <20250508133550.81391-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::430; envelope-from=philmd@linaro.org; helo=mail-pf1-x430.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org The VIRTIO_CONSOLE_F_EMERG_WRITE feature bit was only set in the hw_compat_2_7[] array, via the 'emergency-write=off' 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é --- include/hw/virtio/virtio-serial.h | 2 -- hw/char/virtio-serial-bus.c | 9 +++------ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/include/hw/virtio/virtio-serial.h b/include/hw/virtio/virtio-serial.h index d87c62eab7a..e6ceacec309 100644 --- a/include/hw/virtio/virtio-serial.h +++ b/include/hw/virtio/virtio-serial.h @@ -185,8 +185,6 @@ struct VirtIOSerial { struct VirtIOSerialPostLoad *post_load; virtio_serial_conf serial; - - uint64_t host_features; }; /* Interface to the virtio-serial bus */ diff --git a/hw/char/virtio-serial-bus.c b/hw/char/virtio-serial-bus.c index eb79f5258b6..cfc8fa42186 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, vser = VIRTIO_SERIAL(vdev); - features |= vser->host_features; + features |= 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; - if (!virtio_has_feature(vser->host_features, - VIRTIO_CONSOLE_F_EMERG_WRITE) || !config->emerg_wr) { + if (!config->emerg_wr) { return; } @@ -1039,7 +1038,7 @@ static void virtio_serial_device_realize(DeviceState *dev, Error **errp) return; } - if (!virtio_has_feature(vser->host_features, + if (!virtio_has_feature(vdev->host_features, VIRTIO_CONSOLE_F_EMERG_WRITE)) { config_size = offsetof(struct virtio_console_config, emerg_wr); } @@ -1155,8 +1154,6 @@ static const VMStateDescription vmstate_virtio_console = { static const Property virtio_serial_properties[] = { DEFINE_PROP_UINT32("max_ports", VirtIOSerial, serial.max_virtserial_ports, 31), - DEFINE_PROP_BIT64("emergency-write", VirtIOSerial, host_features, - VIRTIO_CONSOLE_F_EMERG_WRITE, true), }; static void virtio_serial_class_init(ObjectClass *klass, const void *data)