From patchwork Fri Oct 13 10:40:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupinder Thakur X-Patchwork-Id: 115748 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp572719qgn; Fri, 13 Oct 2017 03:42:25 -0700 (PDT) X-Received: by 10.36.101.68 with SMTP id u65mr1550439itb.4.1507891345021; Fri, 13 Oct 2017 03:42:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507891345; cv=none; d=google.com; s=arc-20160816; b=BtFeWz8NPkazYksBcwUPU/0vlGDJcRMj6oS0LhYvYsvF35XpnO5ez9+c8BiwnA5xRr V4rG9arzF6XTDq/28PMuKBGP7+PvbEYNMOpVDqYmmEChJ/tW2FC0Xw/wBjZ+T64iT4bj qJoF3IM60b+YGMUCHXHpTZrc2C0DW++5VmHp4+uATHgMsc5oNToDd+di2qnvYpkCdV5c N86P6XuS+p3I8fKA/k6Vl2ABPPGDaHHjyXOJMW358hw3bqPCFr3HirFzxuiUp0rUMqKx HFTUlecL4VB4HaEoO1cFl8eGS45NsYV8Bs44Okj5tqL2CmnMS6lE7BM1KVSz0Be+p/LW iYLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:cc:message-id:date:to:from:dkim-signature :arc-authentication-results; bh=PFB0ZOtfrywwh9kxog7J4icZ9QnKqMjnx07YcdNntbo=; b=h+tBn2kaSRWScCqU68f/eHADaMg2zQnWT9FymA07k+xNROYRoKSIIjFIb4G4IYaQ+T Pl+kInofPK9vcwtbz9Y3L5/ps+5X/WMhBNy0Sr+QGR85dGbnOeUgOr9CgdQx1eI2fU3O JwIqj5mOfvC88dMVp7ylqgspx78cyT+jQYI4qua19xlNw468GTcL7cxFcGZVj+pVVS3T FR9WCpjRmMVVEzG0RCtqRZks9Dsy/JHRRwp81Qz9U/xFDEr4iZZJD4Wf3sjK6n3x2qX0 YgAKntPziZbWka2f+YuYs35aq1pFNWhBgXaNRcOHJ8sZ3CtffrjyQ2GB0NP25qUvI59H fcyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Z2jYTGUz; spf=neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id r16si419090iod.301.2017.10.13.03.42.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Oct 2017 03:42:25 -0700 (PDT) Received-SPF: neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) client-ip=192.237.175.120; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Z2jYTGUz; spf=neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e2xOT-0000XK-7d; Fri, 13 Oct 2017 10:40:41 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e2xOR-0000W3-Nl for xen-devel@lists.xenproject.org; Fri, 13 Oct 2017 10:40:40 +0000 Received: from [193.109.254.147] by server-6.bemta-6.messagelabs.com id 89/57-08608-72890E95; Fri, 13 Oct 2017 10:40:39 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrGIsWRWlGSWpSXmKPExsVyMfTAel21GQ8 iDQ41ilh83zKZyYHR4/CHKywBjFGsmXlJ+RUJrBknJ+5jKjgnWDGl+w1zA+N83i5GLg4hgRmM Eg1bLjKBOCwC7cwSLeeXMoI4EgLvWCS6f+xj7WLkBHLyJOb0z2eHsNMkXi74DxWvkni5bC1YX EhAS+LoqdmsEGO3M0l8OLEQyOHgYBMwkZjVIQFSIyKgJHFv1WQmEJtZoF5i27lfjCC2sEC4xP Yba8DiLAKqEu+PvACzeQW8JL6s6WWE2CUncfNcJ/MERv4FjAyrGDWKU4vKUot0jQz0kooy0zN KchMzc3QNDcz0clOLixPTU3MSk4r1kvNzNzECQ4gBCHYw/loWcIhRkoNJSZRXLfJBpBBfUn5K ZUZicUZ8UWlOavEhRhkODiUJXtvpQDnBotT01Iq0zBxgMMOkJTh4lER4t08DSvMWFyTmFmemQ 6ROMdpzXLhz6Q8Tx4E9t4Dkiuu3gWTHzbt/mIRY8vLzUqXEeQ+BtAmAtGWU5sENhUXfJUZZKW FeRqAzhXgKUotyM0tQ5V8xinMwKgnzuoLcxpOZVwK3+xXQWUxAZ72LADurJBEhJdXAaLq30XJ FTt3aqZ9YLvht78n+LvJp+5vElLZ61d07TNLvrrc38TrIo29Xzf8gO9PQYhpv4jLeDFmOUCff W0LanldF/iQd/zzPaZfjY4Ec/tBlvxSLlKcuPiLnljPV9t+qdpuWTRcqjwipT0neIOOp/k9cw e7CvTbB399WrTKpYtjaudZs3elVSizFGYmGWsxFxYkAz9+2R7kCAAA= X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-4.tower-27.messagelabs.com!1507891237!110719004!1 X-Originating-IP: [209.85.192.175] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 49903 invoked from network); 13 Oct 2017 10:40:38 -0000 Received: from mail-pf0-f175.google.com (HELO mail-pf0-f175.google.com) (209.85.192.175) by server-4.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 13 Oct 2017 10:40:38 -0000 Received: by mail-pf0-f175.google.com with SMTP id e64so9587667pfk.9 for ; Fri, 13 Oct 2017 03:40:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=smGlmTXwMpfxvse0CQmvhBzxdLmbQY/jOD0Htgo2m+c=; b=Z2jYTGUzcgqxlwyjYlVa+frtvc11D5qc5yGeWe9GvmW8VeXLYF6tWHUKdOQp7AWuGz UkMD9DwkWjpohlToIxzdTxO+YwmpoccEtxkV9P1P20J4yV8O8BNCH28Q1VA4ulgyiNn8 4d9TJWkzt768HnHayFOnPtJ5KkGJL2taGaniE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=smGlmTXwMpfxvse0CQmvhBzxdLmbQY/jOD0Htgo2m+c=; b=pFa0tTaFMeSaTI+i2ipSdiXaAc/VVH8/hGQF2qvI0Y4yuIQOt8YVjwUNwH02SJ7FIy Rjz4j9dQYkZR1ky8aK/OrNyu8O5bc1V/R0l6pTTj37x62MW6kXuPHda5eeIskUMUgRJR HrkrHk65vczZ2jalN0lUWq3kLPN5DTSUE/6hxvVMWXoWejL7Z+A2vJo4MRl/MI+exjW1 jA4WDtqaKWUmnbxhuBUe/raZMW/pDEORycATmxViyx4BK11vNmnupLbWKHInps9l/h3e pKDjV3q0kkaqOuEdSRb0+uY2UQ6O9SIH3AtSlNbvcTY8s2Bhtb4ZBZ9wpu3rPjkg75Zm 2n4w== X-Gm-Message-State: AMCzsaVHrYAImwSDyhAYaNC9hoDCmEMdCS8Z0GmDNwkk4hWnrjP2HSeI IClySynIes2xC0aHNFkH62UdnJND9Ow= X-Google-Smtp-Source: AOwi7QDsEsIFADlsl1+JH7AcqwEQ11V8Z5bh/UJG99GwgwO3EAa30C3OgqmF8WTtYOhchrv4A0OWpA== X-Received: by 10.84.173.228 with SMTP id p91mr1042332plb.264.1507891236732; Fri, 13 Oct 2017 03:40:36 -0700 (PDT) Received: from blr-ubuntu-linaro.qualcomm.com (blr-bdr-fw-01_globalnat_allzones-outside.qualcomm.com. [103.229.18.19]) by smtp.gmail.com with ESMTPSA id a7sm1626682pgt.39.2017.10.13.03.40.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Oct 2017 03:40:36 -0700 (PDT) From: Bhupinder Thakur To: xen-devel@lists.xenproject.org Date: Fri, 13 Oct 2017 16:10:30 +0530 Message-Id: <1507891231-4386-1-git-send-email-bhupinder.thakur@linaro.org> X-Mailer: git-send-email 2.7.4 Cc: Andre Przywara , Julien Grall , Stefano Stabellini Subject: [Xen-devel] [PATCH 26/27 v12] arm/xen: vpl011: Fix the slow early console SBSA UART output X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" The early console output uses pl011_early_write() to write data. This function waits for BUSY bit to get cleared before writing the next byte. In the SBSA UART emulation logic, the BUSY bit was set as soon one byte was written in the FIFO and it remained set until the FIFO was emptied. This meant that the output was delayed as each character needed the BUSY to get cleared. Since the SBSA UART is getting emulated in Xen using ring buffers, it ensures that once the data is enqueued in the FIFO, it will be received by xenconsole so it is safe to set the BUSY bit only when FIFO becomes full. This will ensure that pl011_early_write() is not delayed unduly to write the data. Signed-off-by: Bhupinder Thakur --- CC: Julien Grall CC: Andre Przywara CC: Stefano Stabellini xen/arch/arm/vpl011.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/xen/arch/arm/vpl011.c b/xen/arch/arm/vpl011.c index f7ddccb..0b07436 100644 --- a/xen/arch/arm/vpl011.c +++ b/xen/arch/arm/vpl011.c @@ -159,9 +159,15 @@ static void vpl011_write_data(struct domain *d, uint8_t data) { vpl011->uartfr |= TXFF; vpl011->uartris &= ~TXI; - } - vpl011->uartfr |= BUSY; + /* + * This bit is set only when FIFO becomes full. This ensures that + * the SBSA UART driver can write the early console data as fast as + * possible, without waiting for the BUSY bit to get cleared before + * writing each byte. + */ + vpl011->uartfr |= BUSY; + } vpl011->uartfr &= ~TXFE; @@ -371,11 +377,16 @@ static void vpl011_data_avail(struct domain *d) { vpl011->uartfr &= ~TXFF; vpl011->uartris |= TXI; + + /* + * Clear the BUSY bit as soon as space becomes available + * so that the SBSA UART driver can start writing more data + * without any further delay. + */ + vpl011->uartfr &= ~BUSY; + if ( out_ring_qsize == 0 ) - { - vpl011->uartfr &= ~BUSY; vpl011->uartfr |= TXFE; - } } vpl011_update_interrupt_status(d);