From patchwork Mon May 22 15:31:32 2023 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: 684717 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1260647wrt; Mon, 22 May 2023 08:33:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4IYy+pwsMnwSNUI1VjYJtB30SPnOFIJYt7ispufzlFkRlIY6WcFaRHcawgvaqXBU8ccGmP X-Received: by 2002:a05:620a:8acc:b0:75b:23a1:3627 with SMTP id qv12-20020a05620a8acc00b0075b23a13627mr1098311qkn.56.1684769618712; Mon, 22 May 2023 08:33:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684769618; cv=none; d=google.com; s=arc-20160816; b=sTrjY9rpweCgJR+tmbQvfS5FV5UqFTb66ijbxGO70jwt6ozpmKNWCY5zCaiv1BLLkP +C59ZDKB646XX01neLNtsJQDmpE+ObNMiiL+ynoWBFJxrnUzNwYbJUGazpTFt1ZLgu6B CIVXw3j7o81WTYyMN4lZmuzZGq4/s/wfsyApPB0lFIXaO6imGmvG51y6TLgeRxJKRBVR JTXxFRPfI/WdG1I3xC6nQ2qf/4pFTP86ZWjvhXF5Y+pyzPfFJ+gTwi9tokuGMbGvqwqe x4izkJFGaiOeMfNi4oILx3Yq4b9lh9sxbIFcA1szQzcxGJYb02hMg8Oqc50p1vUTdWe9 R8iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=/wKkfjSufx3DW+zYa0E7GEJz1aH+QHJBoM2dYSQDuDM=; b=wZWy25SOg4SKNyBx6QzusWUHsd66wtTDpNFOXBFfIYXYAn8HAWS219hdX6TAkwiSw0 0OAeM+9j9qOIvWRdqIBAx9moxx4EX6sxLnnmS5Vg4kCCD+CsrezZ5cpSQ7jWMKgGlpBY FyCOWEjUBiE3ZgdLxO53T1hIcijnlvaWWOc8tunJevfKb12KeUl4wg02zBlHhf/PKKRX WEmnASUO4P/s240rL/xQt+niPfkB9cKATFmjWZ5SgilHJXvKE53OZpuHJ2+PjirXVdlH ofTtxL49Oec2JICDdfZuJt8WMCgc0ixlurHRDeR8mA0dfFiAQOFg9LbmTdtJNm7MtLVM 1Akw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ls+YTqEi; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id du29-20020a05620a47dd00b007593d311c06si3362812qkb.103.2023.05.22.08.33.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 May 2023 08:33:38 -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=Ls+YTqEi; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q17WD-0007NY-Jx; Mon, 22 May 2023 11:32:18 -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 1q17Vp-0007MH-Ay for qemu-devel@nongnu.org; Mon, 22 May 2023 11:31:55 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q17Vn-0001JK-Lv for qemu-devel@nongnu.org; Mon, 22 May 2023 11:31:53 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-3f605d8a8a9so10478895e9.0 for ; Mon, 22 May 2023 08:31:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684769507; x=1687361507; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=/wKkfjSufx3DW+zYa0E7GEJz1aH+QHJBoM2dYSQDuDM=; b=Ls+YTqEiXNT1nvjLPQxPfMv9S5eAVqJSNAlaIst4auvrLVJ+PGfJ9b8XWD+DU7/sIR wVw7kmV24VNxMAVUsIaW7JwVDAoK7DfCvNCYJrIfW0l6ceb/e0TK9ijR5b1O1DuP1B6l GDbc7ZhQhPpW1/HeKKqmmnOk7VaAAD3ToNZl1tN+lPsPCr4NKLSQICo/FmgcwLn4rSn4 9QTb9vaxZkY40Su9eEVhdXCXSPBoxlGdHbB0aYOgqNX9WnTVYmHjQK5EcDQlTOiPwKDl a3BFxYZSuTzvql9VkStkSMRnC4OAcTuKzXJm1DRhyuj9sKI0czdm+gThjC18tQNKjNLz +4yQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684769507; x=1687361507; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/wKkfjSufx3DW+zYa0E7GEJz1aH+QHJBoM2dYSQDuDM=; b=Ek+5PbWjIU9eGDQqCPRDnMPNXcxBsB0btV6Jrd0P6H/nalc043EIdnjj7pQlYhjRFH gtEMXTNSp5whWN8s6nsnR4lRW0ccRPlsrS89ByVlL7UqD/uDSbU4JJidPzbrduPM27GK cV+7qCQcW0GuCcDPg4f7O+YziO6xh837aReO5o8vfe5ZlWamOVyvPDFXBSzO6lvwOc4E XEi0anSGQ7TwTL5E/GxCMY1sdh4sSOIWq9pLItMPsRGwY4TqQV91ZJ/3Ky5ucybdCiwc YinkL15iR/iDTqSV0jWlR2zYVV8z26VvnU/w7tORdy/OfCD7FL2otT4Y0Buo0TSeGkts ei1g== X-Gm-Message-State: AC+VfDwE9W/22h5bG34nITSSa3xAio89XnCSzDywiTpNsjWPaNyKv701 SKsyOFwDYFHnVnSWIEynwn59Z2X+Rbl6ibPJHLY= X-Received: by 2002:a1c:f710:0:b0:3f5:146a:c79d with SMTP id v16-20020a1cf710000000b003f5146ac79dmr7210395wmh.15.1684769507111; Mon, 22 May 2023 08:31:47 -0700 (PDT) Received: from localhost.localdomain ([176.176.153.164]) by smtp.gmail.com with ESMTPSA id j15-20020a5d464f000000b00307d58b3da9sm8056538wrs.25.2023.05.22.08.31.45 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 22 May 2023 08:31:46 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , qemu-arm@nongnu.org, =?utf-8?q?Alex?= =?utf-8?q?_Benn=C3=A9e?= , Evgeny Iakovlev , =?utf-8?q?Marc-Andr=C3=A9_?= =?utf-8?q?Lureau?= , Peter Maydell , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Mikko Rapeli Subject: [PATCH 00/12] hw/char/pl011: Implement TX (async) FIFO to avoid blocking the main loop Date: Mon, 22 May 2023 17:31:32 +0200 Message-Id: <20230522153144.30610-1-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.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, T_SCC_BODY_TEXT_LINE=-0.01 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Hi, This series add support for (async) FIFO on the transmit path of the PL011 UART. - First we add fifo8_peek_buf() to the fifo8 API (patches 1-3), - Then we massage a bit the pl011 model to ease development (patches 4-11), - Finally we add the TX FIFO implementation using a chardev front-end 'watch' callback. The last patch is RFC mostly because I don't know what is the best way to resolve adding a new migratable field without breaking the migration stream. Tested with qtest/avocado/TRS test suites: trs-workspace$ make test Startup finished in 6min 40.596s (kernel) + 38.786s (userspace) = 7min 19.382s. RESULTS - date.DateTest.test_date: PASSED (46.90s) RESULTS - df.DfTest.test_df: PASSED (2.29s) RESULTS - parselogs.ParseLogsTest.test_parselogs: PASSED (23.45s) RESULTS - ping.PingTest.test_ping: PASSED (0.05s) RESULTS - python.PythonTest.test_python3: PASSED (2.72s) RESULTS - rtc.RTCTest.test_rtc: PASSED (51.84s) RESULTS - ssh.SSHTest.test_ssh: PASSED (4.56s) RESULTS - systemd.SystemdBasicTests.test_systemd_basic: PASSED (2.33s) RESULTS - systemd.SystemdBasicTests.test_systemd_failed: PASSED (4.41s) RESULTS - systemd.SystemdBasicTests.test_systemd_list: PASSED (30.07s) RESULTS - systemd.SystemdJournalTests.test_systemd_boot_time: PASSED (2.42s) RESULTS - systemd.SystemdJournalTests.test_systemd_journal: PASSED (2.62s) RESULTS - systemd.SystemdServiceTests.test_systemd_disable_enable: PASSED (40.34s) RESULTS - systemd.SystemdServiceTests.test_systemd_status: PASSED (2.43s) RESULTS - systemd.SystemdServiceTests.test_systemd_stop_start: PASSED (9.23s) RESULTS - opteetest.OpteeTestSuite.test_opteetest_xtest: PASSED (329.89s) RESULTS - soafeetestsuite.SoafeeTestSuite.test_soafee: PASSED (272.07s) RESULTS - tpm.TpmTestSuite.test_tpm: PASSED (53.61s) RESULTS - ptest.PtestRunnerTest.test_ptestrunner_expectfail: SKIPPED (0.00s) RESULTS - ptest.PtestRunnerTest.test_ptestrunner_expectsuccess: SKIPPED (0.00s) RESULTS - systemd.SystemdServiceTests.test_systemd_disable_enable_ro: SKIPPED (0.00s) SUMMARY: trs-image () - Ran 21 tests in 883.291s trs-image - OK - All required tests passed (successes=18, skipped=3, failures=0, errors=0) Philippe Mathieu-Daudé (12): util/fifo8: Fix typo in fifo8_push_all() description util/fifo8: Allow fifo8_pop_buf() to not populate popped length util/fifo8: Introduce fifo8_peek_buf() hw/char/pl011: Display register name in trace events hw/char/pl011: Remove duplicated PL011_INT_[RT]X definitions hw/char/pl011: Replace magic values by register field definitions hw/char/pl011: Split RX/TX path of pl011_reset_fifo() hw/char/pl011: Extract pl011_write_tx() from pl011_write() hw/char/pl011: Check if transmitter is enabled hw/char/pl011: Check if receiver is enabled hw/char/pl011: Rename RX FIFO methods hw/char/pl011: Implement TX FIFO include/hw/char/pl011.h | 2 + include/qemu/fifo8.h | 38 ++++++-- hw/char/pl011.c | 209 +++++++++++++++++++++++++++++++++------- util/fifo8.c | 28 +++++- hw/char/trace-events | 12 ++- 5 files changed, 239 insertions(+), 50 deletions(-)