From nobody Sat Apr 5 01:02:06 2025 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1739032856; cv=none; d=zohomail.com; s=zohoarc; b=IQll85t3jnh9Z/WdOOajp+qt5WWsnst2F0PnNQN032Pg0D65tatA/k/JCrXV7xfU9Dqh4w8ucOgYeg+/ZYOwG9zxbcN5KxWfSbkvzn4qjq1GCT4ESjEOEIHcOsVcaUGevtfkgbXqjkIMU37rR5MBS7rX0l+xzHIEmiNlXAGAEJ8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1739032856; 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=pnDfQ0pDNHjagyoidO1nQy0wbrzE23spPhP9nSEJCp0=; b=h61Wp+r5hCve5oIkGGI/yTO57U2fvIUT2NuTsaouOjJUAZYjJHFM7M2QEP57Wvli0r4XYHwFz7JxBrgquepgctPvbCrOnrrA9LraBxXtW80vfk9fdUxTUYaEutNS9LpelA+KnYJBjp88+0DNjAMgivAoRq0PHd30HctdihRjtL0= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1739032856586510.25817835252474; Sat, 8 Feb 2025 08:40:56 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tgnrX-00010f-OO; Sat, 08 Feb 2025 11:39:23 -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 1tgnrW-00010N-Cn for qemu-devel@nongnu.org; Sat, 08 Feb 2025 11:39:22 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tgnrU-0008NL-TP for qemu-devel@nongnu.org; Sat, 08 Feb 2025 11:39:22 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-43934d41730so4090305e9.2 for ; Sat, 08 Feb 2025 08:39:20 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38dbdd54624sm7410071f8f.45.2025.02.08.08.39.17 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 08 Feb 2025 08:39:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739032759; x=1739637559; 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=pnDfQ0pDNHjagyoidO1nQy0wbrzE23spPhP9nSEJCp0=; b=M2GYL5VJbm3fLpUbuaP+A2IqSlhhpa3F1nFe/LltDcWNRdRaBZsGyX8hOTWbzjTNZK Qwo375LO45k2qrXXu0t52+12WuMzhpAxxQ0GVCLC3lG4X7L6QZ7YNd/+tDwrrNTd65Xh Du5dCy9ADLHcTxybYGmguEWiRNwwa3k1P16Q6RppbGs6JF5X20jO9XAG6gMjd3h5cw4G Wn8litcw+1x+osRn9gV94MR8JB5annIC7pMQCULRJvcBARdfp1K6nQ4tokib6+pdwC5N PG9MOL4yKeM9mQoHaG2ilUJCKldwylOMfFnI/yeiFkLf4iRQj6UcyKhpUsoG+E2zjf/8 /Vxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739032759; x=1739637559; 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=pnDfQ0pDNHjagyoidO1nQy0wbrzE23spPhP9nSEJCp0=; b=NVFXsCt8J+hOp9pBDtovE/TFwvnruvthk+w7CFXORnYadNYTpzqTxUrj5oc+suXo6c YzjbTckdhLPmTqWBplW+hhJqIpxdvunWqy6zM1z6H5qRFGwMoVzmM2wtCrBSUuqZq3J/ aqZ3K1ywCo+kXcwxjr8mbLslFsVDb62AhoBKFn1MHd9FUN/BPSqf9dWkuBBleg8trHvJ onZx7W+1gRBqc2LTy6OCbCyobp2Ml8wSCFuuX6j9TqbS9++PAk4v5h68HvpJy0pQvp1e cokhm/j22A2IfqlEiKDm2Z1OD5QjCv/enxKVz6uLpfojL1noV70ySu3Ua8gMv5kjMBuW EyOw== X-Gm-Message-State: AOJu0Yy9MvDzp6zgctooD2m/TscsNhMKx073ErQWtEDtl/KwsRqFdjFE jZ41Fa4nk/5h6qJJKS7CpcZQ6ImQJ4JS0Is0d24aM5wv47HonMJnqfY2KIDfScFM1yTY1FnbPkw u0zY= X-Gm-Gg: ASbGnctW3F143Wk8DbyAmnK8V8yDGsQptRBcFfXVGX5t+vGUVj43uIEArkX0OFMWs/Q TcH0LfJfrbzs6XEJ6Trjt7C8xlcL83OifXmk+kuaJ3nZN/LGw0mMa6ZjrzbCHHG4pfcUp4wXn3j usBngtPEfOgMug8eOCKvK0m8ff7mhACwmQ/O/A18DJO5vev1kaOQvhHaUSJKAxaSrlac1WSDc07 e54vIPlHTS/Ha9tSjT9/e2BTQq9+lFC9r8oc5U8AWoNYaUrwpi0jbfP99pVmuc+v4WcNToOpVwq QydRahpBf8TSqeOrtVddqYbey3rTwXkHJZX3BLahUKbZskdxa5V+zvPYlGCoiaDNbA== X-Google-Smtp-Source: AGHT+IGtem7OP/J+ciEP6t1sttj6uUucFHKFy2ilA0KO9IbGMYq37p+5gV+Q9tzUmRYGQPuY0zZLXQ== X-Received: by 2002:a05:6000:1887:b0:386:3356:f3ac with SMTP id ffacd0b85a97d-38dc90edfecmr5468949f8f.26.1739032758923; Sat, 08 Feb 2025 08:39:18 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , qemu-arm@nongnu.org, Mark Cave-Ayland , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Peter Maydell , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PATCH v6 1/7] hw/char/pl011: Warn when using disabled receiver Date: Sat, 8 Feb 2025 17:39:05 +0100 Message-ID: <20250208163911.54522-2-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250208163911.54522-1-philmd@linaro.org> References: <20250208163911.54522-1-philmd@linaro.org> 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=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1739032859444019100 We shouldn't receive characters when the full UART or its receiver is disabled. However we don't want to break the possibly incomplete "my first bare metal assembly program"s, so we choose to simply display a warning when this occurs. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/char/pl011.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hw/char/pl011.c b/hw/char/pl011.c index 06ce851044d..60cea1d9a16 100644 --- a/hw/char/pl011.c +++ b/hw/char/pl011.c @@ -85,6 +85,7 @@ DeviceState *pl011_create(hwaddr addr, qemu_irq irq, Char= dev *chr) #define CR_OUT1 (1 << 12) #define CR_RTS (1 << 11) #define CR_DTR (1 << 10) +#define CR_RXE (1 << 9) #define CR_TXE (1 << 8) #define CR_LBE (1 << 7) #define CR_UARTEN (1 << 0) @@ -487,6 +488,12 @@ static int pl011_can_receive(void *opaque) PL011State *s =3D (PL011State *)opaque; int r; =20 + if (!(s->cr & CR_UARTEN)) { + qemu_log_mask(LOG_GUEST_ERROR, "PL011 reading data on disabled UAR= T\n"); + } + if (!(s->cr & CR_RXE)) { + qemu_log_mask(LOG_GUEST_ERROR, "PL011 reading data on disabled TX = UART\n"); + } r =3D s->read_count < pl011_get_fifo_depth(s); trace_pl011_can_receive(s->lcr, s->read_count, r); return r; --=20 2.47.1