From patchwork Tue Feb 21 11:26:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupinder Thakur X-Patchwork-Id: 94262 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp396541qgi; Tue, 21 Feb 2017 03:28:29 -0800 (PST) X-Received: by 10.36.52.197 with SMTP id z188mr15868070itz.71.1487676509631; Tue, 21 Feb 2017 03:28:29 -0800 (PST) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id m77si10940881ita.23.2017.02.21.03.28.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Feb 2017 03:28:29 -0800 (PST) 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; 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 1cg8am-00033J-5z; Tue, 21 Feb 2017 11:26:48 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cg8al-000316-0F for xen-devel@lists.xenproject.org; Tue, 21 Feb 2017 11:26:47 +0000 Received: from [193.109.254.147] by server-7.bemta-6.messagelabs.com id A5/9E-24539-6F32CA85; Tue, 21 Feb 2017 11:26:46 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprNIsWRWlGSWpSXmKPExsXiVRtspvtZeU2 EwdYzshbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8a7V8vYCi4KVazcbt7AeIC/i5GTQ0hgGqPE rRPOIDaLwDxmiUfLbLoYuTgkBPpZJXb0/2cESUgIxEgsWPmLqYuRA8iulni2RAiiV0vi6KnZr CD1QgKtTBJ3/y5jBKlhEzCRmNUhAVIjIqAkcW/VZCYQm1kgVOLfszZ2EFtYIEfi9YF/LBB7VS XeTW1iBWnlFfCR2LnNCWKrnMTNc53MIDYnUPjvvpfsEGu9JabdWcE2gVFgASPDKkaN4tSistQ iXSMjvaSizPSMktzEzBxdQwMzvdzU4uLE9NScxKRiveT83E2MwIBiAIIdjGvmBx5ilORgUhLl zZZaEyHEl5SfUpmRWJwRX1Sak1p8iFGGg0NJgtcOGKBCgkWp6akVaZk5wNCGSUtw8CiJ8JqCp HmLCxJzizPTIVKnGHU5du26/JJJiCUvPy9VSpxXEqRIAKQoozQPbgQszi4xykoJ8zICHSXEU5 BalJtZgir/ilGcg1FJmLdTCWgKT2ZeCdymV0BHMAEdcdNjJcgRJYkIKakGRh1O3TrpwvV2X9R KVht/2yDmujzVueqQdInAkuUPD918t5lrxsPqa5vcU8T6NJ9efVN67En6/MjYCQKeZ0tLSngn Jjw9Ne+jUuFGv0Pnw1RSzp04dabkUlRx24wjtZNC7kgy2EQyvoqbFJh6Sm/508Mr5nzneD9x1 3Irzkcfll45peDQdydx/3UlluKMREMt5qLiRACuTaaWrgIAAA== X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-6.tower-27.messagelabs.com!1487676402!88254834!1 X-Originating-IP: [74.125.83.54] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.2.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 40396 invoked from network); 21 Feb 2017 11:26:43 -0000 Received: from mail-pg0-f54.google.com (HELO mail-pg0-f54.google.com) (74.125.83.54) by server-6.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 21 Feb 2017 11:26:43 -0000 Received: by mail-pg0-f54.google.com with SMTP id 1so16557844pgi.1 for ; Tue, 21 Feb 2017 03:26:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/HUIuOsG3VMFW7Gyk05osXXS6aiRBMMp1KePOUv/lvg=; b=kjVRGzuyttpNVagjY+6mhnO/884ZVB1AXEHb0gjqiQlKa0LI0zAsxm1whMKTfrsPXp 6LfUeHyQnLnppaCdhJTO75KuZRGOYppbZubusjfyTEcAdT1cOuYT2V9Dy1QDgrjGRQdk DhlFvn8IPOIrvkwRB/Jec/nT7WJwe60yr+Xew= 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:in-reply-to :references; bh=/HUIuOsG3VMFW7Gyk05osXXS6aiRBMMp1KePOUv/lvg=; b=T9DEFtGMqxknncPIqJ9Ggh+OL3JI9OE1mM/wcoZnX1VqCMFh3PN7LZTR188OXlzovr 5Fl5kaal17VVAcm4tv0v4ojdS0nlxVI+E02x/me9NiEaTm0vCBEqAiqjV2BaAapg/1ur DkAFY/UClYnKIeTkkOMUgcplAu+ZeBAAZuiHXX8+pvByx0bAjXoIqq0Bsz88sDzLOinj gorRWum46l+dsowEFyC7VCPFqfTVwLyo07I9tzqgs9+OG2V1uXXy07mt1Tj9mXcCoAOp hI+TNy3kqQSJOrsxPFRqkAI01MAhdVxLaO9hWjQUNTef9UNeGrewzImKqGACCgGCPQ8g SwGw== X-Gm-Message-State: AMke39l3vXofGucit4IhGIhygAEAZ4byz8rI8k1vVx8OebKzA6xQEbleVORRSaZ/IGyaae9Q X-Received: by 10.98.141.194 with SMTP id p63mr32644010pfk.185.1487676401953; Tue, 21 Feb 2017 03:26:41 -0800 (PST) Received: from blr-ubuntu-linaro.wlan.qualcomm.com ([103.5.19.18]) by smtp.gmail.com with ESMTPSA id p66sm40508627pfb.88.2017.02.21.03.26.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 21 Feb 2017 03:26:41 -0800 (PST) From: Bhupinder Thakur To: xen-devel@lists.xenproject.org Date: Tue, 21 Feb 2017 16:56:07 +0530 Message-Id: <1487676368-22356-11-git-send-email-bhupinder.thakur@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1487676368-22356-1-git-send-email-bhupinder.thakur@linaro.org> References: <1487676368-22356-1-git-send-email-bhupinder.thakur@linaro.org> Cc: Julien Grall , Stefano Stabellini Subject: [Xen-devel] [PATCH 10/11] xen/arm: vpl011: Modify handle_ring_read and buffer_append to read/append vpl011 data 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" MOdifications in the following functions: - handle_ring_read() - to allow reading data from both PV or vpl011 OUT ring buffers based on which port received the event - buffer_append() - append data received for either PV or vp011 OUT ring buffer Signed-off-by: Bhupinder Thakur --- tools/console/daemon/io.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c index b1aa615..4e531e7 100644 --- a/tools/console/daemon/io.c +++ b/tools/console/daemon/io.c @@ -163,12 +163,11 @@ static int write_with_timestamp(int fd, const char *data, size_t sz, return 0; } -static void buffer_append(struct domain *dom) +static void buffer_append(struct domain *dom, struct xencons_interface *intf, int port) { struct buffer *buffer = &dom->buffer; XENCONS_RING_IDX cons, prod, size; - struct xencons_interface *intf = dom->interface; - + cons = intf->out_cons; prod = intf->out_prod; xen_mb(); @@ -192,7 +191,8 @@ static void buffer_append(struct domain *dom) xen_mb(); intf->out_cons = cons; - xenevtchn_notify(dom->xce_handle, dom->local_port); + + xenevtchn_notify(dom->xce_handle, port); /* Get the data to the logfile as early as possible because if * no one is listening on the console pty then it will fill up @@ -961,6 +961,7 @@ static void handle_tty_write(struct domain *dom) static void handle_ring_read(struct domain *dom) { xenevtchn_port_or_error_t port; + struct xencons_interface *intf; if (dom->is_dead) return; @@ -970,7 +971,15 @@ static void handle_ring_read(struct domain *dom) dom->event_count++; - buffer_append(dom); + /* + * select the interface based on the port which the event received + */ + if ( port == dom->vpl011_local_port ) + intf = dom->vpl011_interface; + else + intf = dom->interface; + + buffer_append(dom, intf, port); if (dom->event_count < RATE_LIMIT_ALLOWANCE) (void)xenevtchn_unmask(dom->xce_handle, port); @@ -1161,6 +1170,8 @@ void handle_io(void) d->next_period = now + RATE_LIMIT_PERIOD; if (d->event_count >= RATE_LIMIT_ALLOWANCE) { (void)xenevtchn_unmask(d->xce_handle, d->local_port); + if ( d->vpl011_initialized ) + (void)xenevtchn_unmask(d->xce_handle, d->vpl011_local_port); } d->event_count = 0; }