From nobody Tue Dec 24 03:00:38 2024 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1734597482; cv=none; d=zohomail.com; s=zohoarc; b=c6C0CMNnArhWiVks43mTb0N/JDDVkL4dZiBxs1WXFS6npn1b2IpQnL+EQYsnoKOSpUhmJy1qhecA4k9IY7Auqx55giOaR+TCM1zS8Yy9+fRnQsSTGHUy6iDHqu57whPHAflmE1zA10QnAIu7ZuLHnx1Zl/Hulq4iQ9yuar4Jnxk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734597482; 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=8AAp/S2v8W3fPum66lzAfsVl337fXfIWb2U5k64KdL0=; b=LrfteAED0MBm822RmSbf7kyuT0RrJ2JQbiryQfjV0AzRiiRATPeKwmqMf2CnytXzhFCifYeh6Ct/smetEz3rrmmzUqRVMOA5aEv5LfdrPpS+89cHUxMuvVjg4tQq36hpHcKG0ARkJUmNgv7iHZ7ktyajKFD2MlR57CREzgzINiM= 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 1734597482923657.5873397370943; Thu, 19 Dec 2024 00:38:02 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tOByn-0006tW-Cy; Thu, 19 Dec 2024 03:33:57 -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 1tOByk-0006iB-AD for qemu-devel@nongnu.org; Thu, 19 Dec 2024 03:33:54 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tOByi-0005GS-Pa for qemu-devel@nongnu.org; Thu, 19 Dec 2024 03:33:54 -0500 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-591-9oDyKbxXNey8Cjv-i94plA-1; Thu, 19 Dec 2024 03:33:48 -0500 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-436219070b4so2729865e9.1 for ; Thu, 19 Dec 2024 00:33:48 -0800 (PST) Received: from [192.168.10.47] ([151.81.118.45]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436611ea423sm11356045e9.2.2024.12.19.00.33.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 00:33:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1734597230; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8AAp/S2v8W3fPum66lzAfsVl337fXfIWb2U5k64KdL0=; b=HehjXZxonx2cjglWoU7nlnNc6dMFRq23s8qa24EQoZD/UN2qkScziYzHogz2N/t3AlR2pW XGw2BzEQdK0chcUjSall3Ufv7xkkbLzKJHEXub72uQ7UgSZYFP6qM6hBq9vbPMoWnBsa3q +xrXKyuVMa5UrToP4ZUmHkM2KB4jTpA= X-MC-Unique: 9oDyKbxXNey8Cjv-i94plA-1 X-Mimecast-MFC-AGG-ID: 9oDyKbxXNey8Cjv-i94plA X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734597226; x=1735202026; 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=8AAp/S2v8W3fPum66lzAfsVl337fXfIWb2U5k64KdL0=; b=k4pcsAorNqnguAZd7q+eoJkHrYdzlRMTod2aIfXaEq47C/n3nFDUUEhAuQ7vFJcAe0 BQ/jIXhfeX0leblvbINPmHHfZk9OeYLXLPjTkOT1ydNdm3zgK1DUErt0qCRlsSC86DHA gX+T/FEL+vZrDkXXy3t8YauoxpfC+7hzXlcGxV9JrjquDQjYC62SqLyPZ4J0PaVzD2dV 8KKhUoR1sS1m2nJktr1bHiNXsvY/IIBvybPQTcke6RzSL+lgFZmTIyrFrFK1ruc6KMrX MxXj/c+VlnIpj3aCvn1bXVEngEa8ziudPlb8ciVV7vij8qo35KuHkNLfN2ebZc2rXEwE kUfA== X-Gm-Message-State: AOJu0YxX30VmSlrzzQrc3xpv/KwRLPkTEUnrO49trCQUNhFyrLMKseQ1 iU3TiNH+pXFgDg+UQy3i1j3CmVonQiRS+dTsaITCa7qVvIiwSHW6I0leQckrQUC0n26zsU032Zz ZE8yIaHNz7pn69Wf6xRVOaZAcPyPbJEAK96n04A4uhBTT4jso2RFqr7CJsmnFheY5Y4wBm3mQxp CjKIqvViPQWsJglYiE2rrMj0cvC2bnD6KnSO9G X-Gm-Gg: ASbGncsWFOHAqHVN3R98qus5XzCVNi1VETGADKXAKmSSeo6xmABMuvlx2Kwl371iMxZ PBaB8aP/ZYThjFhSIy8ppLLRwnniLBjPxg8U36XSBDomz+w/ipYd/MDE44QcgQ+iNBVR7vB6U3w CFTP6nG5XmaHh1wD5rWJKSsly2OWQudhQC/Zb7nIIq3NcbV6S5yaW3m8jMAF97fLZIcBSKTvf9J 2eOrh8Tipv+q6/Wq1LXdMCtAawB0Rrw8alXwBGPvOEVXCfhDa6YAGLOBFXO X-Received: by 2002:a05:600c:4f84:b0:434:f0df:a14 with SMTP id 5b1f17b1804b1-436553487famr54228145e9.2.1734597226542; Thu, 19 Dec 2024 00:33:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IE4H4vRHZk2XSkCrzocY6aLyz8yOIxWULqVjb1iPoLK6Z+chHqCfIJSfdI5UiTgDNqac6ftwQ== X-Received: by 2002:a05:600c:4f84:b0:434:f0df:a14 with SMTP id 5b1f17b1804b1-436553487famr54227885e9.2.1734597226195; Thu, 19 Dec 2024 00:33:46 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Zhao Liu Subject: [PULL 36/41] rust: pl011: match break logic of C version Date: Thu, 19 Dec 2024 09:32:23 +0100 Message-ID: <20241219083228.363430-37-pbonzini@redhat.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241219083228.363430-1-pbonzini@redhat.com> References: <20241219083228.363430-1-pbonzini@redhat.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=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 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_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-1.116, 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 @redhat.com) X-ZM-MESSAGEID: 1734597483908116600 Check loopback_enabled(), not fifo_enabled(), like the C code. Also, set_break_error() must not happen until the break is read from the FIFO. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Zhao Liu Signed-off-by: Paolo Bonzini --- rust/hw/char/pl011/src/device.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rust/hw/char/pl011/src/device.rs b/rust/hw/char/pl011/src/devi= ce.rs index e85d13c5a2b..960ee38ed69 100644 --- a/rust/hw/char/pl011/src/device.rs +++ b/rust/hw/char/pl011/src/device.rs @@ -460,9 +460,8 @@ pub fn can_receive(&self) -> bool { } =20 pub fn event(&mut self, event: QEMUChrEvent) { - if event =3D=3D bindings::QEMUChrEvent::CHR_EVENT_BREAK && !self.f= ifo_enabled() { + if event =3D=3D bindings::QEMUChrEvent::CHR_EVENT_BREAK && !self.l= oopback_enabled() { self.put_fifo(DATA_BREAK); - self.receive_status_error_clear.set_break_error(true); } } =20 --=20 2.47.1