From patchwork Fri Jan 3 17:22:37 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: 854876 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp8359417wrq; Fri, 3 Jan 2025 09:24:25 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUiepCWdkGthVm7eXZ/8CkufLXLyGjOFcGwaA1rSFoovX6vFpgpF0tCVCg5aThBN582ctXSOg==@linaro.org X-Google-Smtp-Source: AGHT+IH2lrrCv8ypz40n7co1bcf7NmFz+h1d34gl3YgTgXQWwWVBtw0j3iq/xE6ya0nBWFLCKzZE X-Received: by 2002:a05:622a:15c9:b0:466:948e:bef6 with SMTP id d75a77b69052e-46a4a976bc2mr783155151cf.43.1735925064899; Fri, 03 Jan 2025 09:24:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735925064; cv=none; d=google.com; s=arc-20240605; b=dMebrvWvkMYNiPsARdmjak7xqe8ccgIkpvnSH/8/VfgKkR/Y/kyfkkZKWpY8ldTK/u lXr+AZQd1upRi7PqEDK0XJrjaPaPOdgkhWow0B887Mx5SrI16VamUBkdKVKjAXE0ttbi k/JibJO7Z7FOTVsNo3rTNDYPpxDC47N4XXRez9WmXAlqBEpWuk3ud3VlgnhapaLq/HLk dQ73GJYTvP7dHN99gj9w5fsyEo8eEIW0m0dmK/zZek4jjJci9dAjwS32DZiXrPNpQ/Mc Is6671TSIuNa5Jp8QyzJDkjXC63LWcAGLiHXh61bHsLXZpXdbo2tsnz10IMPX6ol9h3E KjVA== 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=GlVN5y46CcSMejJupZx1BQuV3ovHng+r81SDig0PPcM=; fh=sOXhaDUqTNtWZrrLHpwVOLbAyi3Of/7BDc3BkRLfsYs=; b=QvmMN3DpHVPfOKfQr+lfPUjt6GAppbESHnr630jwG2V42BdfpIj+7tDuU56KPDNmtM AgG62/9CH3jOdjzm5kJ8ys9bn2McjUcJUNqQykNaAdFNwsp2mx/suKlMTMjY5nCY9214 izogKXd5+uqDUF1UrxBwmLdLnm6SfSYhOoZm57/S98H85gT0HHUxtyL5LZk0y26YtKnU XawwmffeHfPEl8WuUV1SA2eNdzrR9WhHilwPSU3+ereVZKaU9ZYxxI0bke0RgB4aHCQY zlrnw8hR+DPrfsS1WnPlK2pW1k//vO6tLd8BHxV0RwJiPhWu27a+a4BJCK+9L35BaJVa Y2Jw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jiuSRzv3; 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-46a3ebc02d2si396278891cf.397.2025.01.03.09.24.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Jan 2025 09:24:24 -0800 (PST) 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=jiuSRzv3; 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 1tTlNx-0005yJ-F1; Fri, 03 Jan 2025 12:22: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 1tTlNw-0005y2-Nd for qemu-devel@nongnu.org; Fri, 03 Jan 2025 12:22:56 -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 1tTlNv-0001O0-As for qemu-devel@nongnu.org; Fri, 03 Jan 2025 12:22:56 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-43675b1155bso113491565e9.2 for ; Fri, 03 Jan 2025 09:22:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735924973; x=1736529773; 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=GlVN5y46CcSMejJupZx1BQuV3ovHng+r81SDig0PPcM=; b=jiuSRzv3/Ybkng7ShWDIxVHxVDec7am9puq2WV7jiWjRlEjiEt2MOiF3EntvFX4iBF HzRGmcJfNhouWkW86bK27Nli1C8VZ1zwqfDRZMsCisfxx2F7SHGYz8zRvytJapwDqVjN /wobjwedwQ2muxpfa9Y0tvPir7EHwCb+73e98+eV4zksQtpCx8p55P7rlbFqYt/abzZg Iem83JvGMWvQWTRZ90RjrEnB3oeJksKwe7RjUhTGQ61JoGyajtj1+j19p0cKZwDK5zna T9hI2FIjr9rExhBEAfku9JqtMgAkBLwKv7rvrGKjJ313ECVX+xs++GiqSuWJPGaPw8C4 2ftA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735924973; x=1736529773; 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=GlVN5y46CcSMejJupZx1BQuV3ovHng+r81SDig0PPcM=; b=ftJEK9/JX5wLhbwSfb0T6CVQA0SHJ/r9Gxkycc7tgJZHm4GTa19HXoeN2aRvvdf5Ht Ilz4q0EinuDHgMNBZUqM+NAEJ3cTCrkA1QAwFpfsVkGt3s35Vv4y/siKqJoM2Z9EfG6S TScKqBlB4pQIrK34cIVw34qiRqpPJH588IYgrJG/IfL4WZx5eTZKJV5F0jXnzJ90HlTh QHjGZJE2/2HObHth26IN9D0KwkiwedBM/JaqKs2TqIp/EdODhOXRS0Hgm7NChVtyE9ZV HamiW+C9/Ux9Cw4a571InCNSFYAj6t0UQpjeXN52U5DlRshz4cZVpaw9pNxpflACuUIO jqiQ== X-Gm-Message-State: AOJu0YyBo45Ak/juPfyHVv4lVqgdfBz0IPXOcLrbQHjZ5vvPixR4l6M1 pVc+HOsnv8DVSKC521asfWZ+4OUdQEhgSprmetwUqZUCuDr8R+gAtPXvJhNYorbQLp0UY+dZwap 35z4= X-Gm-Gg: ASbGnct6DaQs8jYkddNfcX93sbIitExHUUiGxqWmT/prx0iuu3FvzuMdcHUc3QcR/PC dhO/QC1xJTDQxJZ5d3zkW3x6BoDYS18SGRthJaa8Z+sx9tqxgWWkT6JWTTa1Fv7YMetZahw1RUS B0E/WBkWRVUYApnJSr7fHI70nOmM+sV1I3ylbFFFTZZ4IepjEax/4M9xQ+q/hIc97kg03Ohsysp y3K35+20ULFs7VJAaZpL7fBXO91p3WbJwe9UfKtUpdAcorh0KAdViUS54794xr9oj3wCubdnY2q 6n/0JCshqf0hS9q+6YiiJe+l1bcjs5o= X-Received: by 2002:a05:600c:154a:b0:434:fd15:3adc with SMTP id 5b1f17b1804b1-43668b786bamr376435975e9.25.1735924973185; Fri, 03 Jan 2025 09:22:53 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4366127c508sm488947785e9.33.2025.01.03.09.22.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Jan 2025 09:22:51 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Peter Maydell , Fabiano Rosas , Laurent Vivier , qemu-arm@nongnu.org, Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PATCH v7 2/4] tests/qtest/boot-serial-test: Reduce for() loop in PL011 tests Date: Fri, 3 Jan 2025 18:22:37 +0100 Message-ID: <20250103172239.18562-3-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250103172239.18562-1-philmd@linaro.org> References: <20250103172239.18562-1-philmd@linaro.org> MIME-Version: 1.0 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Since registers are not modified, we don't need to refill their values. Directly jump to the previous store instruction to keep filling the TXDAT register. The equivalent C code remains: while (true) { *UART_DATA = 'T'; } Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Fabiano Rosas --- tests/qtest/boot-serial-test.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/qtest/boot-serial-test.c b/tests/qtest/boot-serial-test.c index a71d2857807..553575ca75c 100644 --- a/tests/qtest/boot-serial-test.c +++ b/tests/qtest/boot-serial-test.c @@ -70,18 +70,18 @@ static const uint8_t kernel_plml605[] = { }; static const uint8_t bios_raspi2[] = { - 0x08, 0x30, 0x9f, 0xe5, /* loop: ldr r3, [pc, #8] Get &UART0 */ + 0x08, 0x30, 0x9f, 0xe5, /* ldr r3, [pc, #8] Get &UART0 */ 0x54, 0x20, 0xa0, 0xe3, /* mov r2, #'T' */ - 0x00, 0x20, 0xc3, 0xe5, /* strb r2, [r3] *TXDAT = 'T' */ - 0xfb, 0xff, 0xff, 0xea, /* b -12 (loop) */ + 0x00, 0x20, 0xc3, 0xe5, /* loop: strb r2, [r3] *TXDAT = 'T' */ + 0xff, 0xff, 0xff, 0xea, /* b -4 (loop) */ 0x00, 0x10, 0x20, 0x3f, /* UART0: 0x3f201000 */ }; static const uint8_t kernel_aarch64[] = { - 0x81, 0x0a, 0x80, 0x52, /* loop: mov w1, #'T' */ + 0x81, 0x0a, 0x80, 0x52, /* mov w1, #'T' */ 0x02, 0x20, 0xa1, 0xd2, /* mov x2, #0x9000000 Load UART0 */ - 0x41, 0x00, 0x00, 0x39, /* strb w1, [x2] *TXDAT = 'T' */ - 0xfd, 0xff, 0xff, 0x17, /* b -12 (loop) */ + 0x41, 0x00, 0x00, 0x39, /* loop: strb w1, [x2] *TXDAT = 'T' */ + 0xff, 0xff, 0xff, 0x17, /* b -4 (loop) */ }; static const uint8_t kernel_nrf51[] = {