From patchwork Tue Oct 10 06:16:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manish Jaggi X-Patchwork-Id: 9995069 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0E311603B5 for ; Tue, 10 Oct 2017 06:20:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EBC3727D0C for ; Tue, 10 Oct 2017 06:20:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E03BA27D4D; Tue, 10 Oct 2017 06:20:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_WEB, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 245A527D0C for ; Tue, 10 Oct 2017 06:20:25 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e1nr9-0006Ex-Jg; Tue, 10 Oct 2017 06:17:31 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e1nr7-0006DZ-Pn for xen-devel@lists.xenproject.org; Tue, 10 Oct 2017 06:17:29 +0000 Received: from [193.109.254.147] by server-6.bemta-6.messagelabs.com id AE/E0-08608-9F56CD95; Tue, 10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manish.Jaggi@cavium.com X-Msg-Ref: server-16.tower-27.messagelabs.com!1507616241!110560439!2 X-Originating-IP: [104.47.42.61] 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 36748 invoked from network); 10 Oct 2017 06:17:23 -0000 Received: from mail-by2nam03on0061.outbound.protection.outlook.com (HELO NAM03-BY2-obe.outbound.protection.outlook.com) (104.47.42.61) by server-16.tower-27.messagelabs.com with AES256-SHA256 encrypted SMTP; 10 Oct 2017 06:17:23 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=t8njyoFANdzuHfB+iJacYCDaNyOthtYFrygVO/cxLww=; b=k5MYa/Iuzg+WLEVkkmN9diQrIJGMnr8owiSZsdMpBUeBT64JuWZ8KrBV4IFWWPXLzb89gHWZ4HPWUbgYCKAlcjQtDzcy4J7xjMgRk1L5S6etVkvG83+zfvuFztCfSM+aeG/nVQ+NzExjhIg+aBLYVG6XVFTE5/DZw7Y1TdJ1LjU= Received: from mjaggi.caveonetworks.com (111.93.218.67) by BLUPR0701MB2068.namprd07.prod.outlook.com (10.163.122.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Tue, 10 Oct 2017 06:17:19 +0000 From: mjaggi@caviumnetworks.com To: xen-devel@lists.xenproject.org Date: Tue, 10 Oct 2017 11:46:54 +0530 Message-Id: <1507616218-2478-2-git-send-email-mjaggi@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1507616218-2478-1-git-send-email-mjaggi@caviumnetworks.com> References: <1507616218-2478-1-git-send-email-mjaggi@caviumnetworks.com> MIME-Version: 1.0 X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: PN1PR01CA0079.INDPRD01.PROD.OUTLOOK.COM (10.174.144.147) To BLUPR0701MB2068.namprd07.prod.outlook.com (10.163.122.150) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6bc91cce-8b16-4421-3b58-08d50fa690cf X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:BLUPR0701MB2068; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB2068; 3:C3SNlcA4qCUl0YDblq1YAkOir4eniUw7TsDOOsFEifUrz7Yb2LAdl1f0QPjRvjeSVlD3kVVzDqdc6A4qDB802ExqNTLXkpey6LWb55kNUOlQIFu0WurR77hp76dXTu4sRZI0pSoDZnQAz3/eZnY6keaxrGtA8d5s6QcA4e608o/KsiNobHOHsi2Nh/LinUuI1RSXYqtAyr1s4b1ozz2t9XH6NlNgSFuFr0Ke5kDk6FRdT3tHfrSG1kXevJa0NZvF; 25:W2HZHinl9jeCF6Ip5CzhloezLaZ2KUoFcefppV2Sny7opEFgLdjbtAFPQ26cdH8zEH31eQRBLk9cqwGosr3HFn2j1ZByk22QTSZRble/KYn24U/8HeGxGXWX5NYsmx/5UBUAL61XwWEPZfWhgvuYuGGjwW0O5kHTE2wWEG7YL7debr1CyUekT9/Acjk3Ki4jwBJOpE7HSCeI/S4GxEH/zM2NZbZUxEbeuUMV9HmxERhQzdzpJQJoOmcbMQv3FJkKmCgX2ookOl8eENl9epfsyna5PEaMQ3sre5wMpKpA8NJsAK7KA4k71+we8VBjRUkV1ADYG1Z9eIYzzrx4hYrHqg==; 31:OyVV80fPC4uni+TNyQ7EqWSkvKtNt0BCxUxL0VHgWSpE3x7iBdBW/ZwXCWBOdLoBUatCcYTQexAsEyM5i3sf0QJw/l0oGN1vpHBzgWSGe79Dhn4raJF918sA+hIClYvrr9dp3L13sVwAUQ08s8dP2Wuh0BvAFUy5yqu6eXeTdYUXlZ+yZwdYWReFFYbQk287j9q88yB/m8GrpQPxzy2nT/R7mE5XsEakJFoqzPugO1k= X-MS-TrafficTypeDiagnostic: BLUPR0701MB2068: X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB2068; 20:4QT0TcNNdwio3SD2kZqpcGvjjlYQjBSQTiobZpOIP66hvyc2ePd18DVchlhWaJDx8DnHPSsTH+KMnOR7+ME4iJGO0pEeCgQ5c+gjdzXCfzcnfUlx0MNGrzE2fBf7gxbVYGVjTumfrZIfuLm3W2tokn/NHHd7GaSyILF1YFCpwpmYruBHJVo+YnzLsoB7iDpOHDzBoyP/1TE2DTGLdio9iEQSGHseGor2zTNGefBcZjeFI4N47N8esHdhXw9T6knbfKyYKmMARoMcH4hNA8u76gS+Vcet2lFJdXw6MjEz9ZvXmiCey+4yfYRqf+4Omw5oZYdlTys+1jafBg3MnWnWxWRVxqlZGDwh/0Lej8VVQ45OComcR9xTSK7BrlQJtL8pylE0xFmsBOaKKE17MjVwh/ONujciQDzJQeMFEKD3QIKYvg5QRTsmmyMLPLp49Cbz4/WJ0hnPnzLmSpE6m5FE0n1/srUgkBAqBOjjNWuO6/cAlSf26IADnHGApevk8QE+fHxNtX1+etR1f5MkDvALaDgNKPYSMf7LEo5Z3DcZjG16J+MF4x60uJrOxKBmYLLM/rvlW/XwXOfe+tMbj1S7JioMHeqLwbKAnif89wq3KiE=; 4:CPPCu+PVUGRzRtd+AolXy0/SZRRUolPNPdDb5ZfLDqM2Z/yRWcwasOEg53MgpHS7wGSx4MOTJ4SIGzyAM4FBsDnmioxowSKwsKMu4CHW11OpFrcvuxTrZVLfbuiiuL6JCTLMbLUesVzvf0fKekxHBOqqnzW/iphwfDkhccaU2ug1A1zeysc5sPkiexvfP3KsvqezKnYo0PoUzKIjDICsRpdJzu/yo3jwBW1gUOMIuF0G67yi5kTlfAwqtKX5gGuqNO7XC6CBEG9/m/7QqeprYJoi/KIY3No69HeVY2LLIkM= X-Exchange-Antispam-Report-Test: UriScan:(180628864354917); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(100000703101)(100105400095)(6041248)(20161123558100)(20161123560025)(20161123564025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BLUPR0701MB2068; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BLUPR0701MB2068; X-Forefront-PRVS: 04569283F9 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(346002)(376002)(189002)(199003)(81166006)(81156014)(8676002)(2361001)(101416001)(53936002)(105586002)(107886003)(106356001)(2906002)(2351001)(6666003)(4326008)(5003940100001)(97736004)(53416004)(33646002)(8936002)(50986999)(5660300001)(305945005)(68736007)(9686003)(6512007)(76176999)(66066001)(47776003)(3846002)(6116002)(16586007)(5009440100003)(50466002)(16526018)(48376002)(316002)(2950100002)(69596002)(42882006)(6916009)(36756003)(50226002)(189998001)(6486002)(72206003)(478600001)(25786009)(7736002)(85772001); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB2068; H:mjaggi.caveonetworks.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB2068; 23:A6DyrPWecLUY611epD1kH8uqjDzSQlryNoOPgvy?= =?us-ascii?Q?zKhtQQ7vUJJ04jPrIWlc/7uAkEBBHx8npV2RPyWSW/lRS6s/ofiiybyM23uK?= =?us-ascii?Q?5LeREB6hvDUNtH5lIssduweW6fd2tnMswZjDb7+/+cIduCSNee8tpSS/Gs7Q?= =?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y+Cj7RNKJlzxzTk/J7lwFeKrz0pUE/fRfjXtkYzZ+ACKuZ/3QvRUSOtAPxhIYOBJSNyALCa9JEKGb6AHONwRY0DQKkd1agsh4I= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2017 06:17:19.3938 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB2068 Cc: Andre.Przywara@arm.com, julien.grall@arm.com, sstabellini@kernel.org, Manish Jaggi Subject: [Xen-devel] [PATCH v5 1/5] ARM: ITS: Introduce common function add_to_host_its_list 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: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Manish Jaggi add_to_host_its_list will update the host_its_list. This common function to be invoked from gicv3_its_dt_init and gic_v3_its_acpi_probe. Signed-off-by: Manish Jaggi Reviewed-by: Andre Przywara Acked-by: Julien Grall --- xen/arch/arm/gic-v3-its.c | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/xen/arch/arm/gic-v3-its.c b/xen/arch/arm/gic-v3-its.c index 2d36030..0610991 100644 --- a/xen/arch/arm/gic-v3-its.c +++ b/xen/arch/arm/gic-v3-its.c @@ -976,11 +976,29 @@ int gicv3_its_make_hwdom_dt_nodes(const struct domain *d, return res; } +/* Common function for adding to host_its_list */ +static void add_to_host_its_list(paddr_t addr, paddr_t size, + const struct dt_device_node *node) +{ + struct host_its *its_data; + + its_data = xzalloc(struct host_its); + if ( !its_data ) + panic("GICv3: Cannot allocate memory for ITS frame"); + + its_data->addr = addr; + its_data->size = size; + its_data->dt_node = node; + + printk("GICv3: Found ITS @0x%lx\n", addr); + + list_add_tail(&its_data->entry, &host_its_list); +} + /* Scan the DT for any ITS nodes and create a list of host ITSes out of it. */ void gicv3_its_dt_init(const struct dt_device_node *node) { const struct dt_device_node *its = NULL; - struct host_its *its_data; /* * Check for ITS MSI subnodes. If any, add the ITS register @@ -996,17 +1014,7 @@ void gicv3_its_dt_init(const struct dt_device_node *node) if ( dt_device_get_address(its, 0, &addr, &size) ) panic("GICv3: Cannot find a valid ITS frame address"); - its_data = xzalloc(struct host_its); - if ( !its_data ) - panic("GICv3: Cannot allocate memory for ITS frame"); - - its_data->addr = addr; - its_data->size = size; - its_data->dt_node = its; - - printk("GICv3: Found ITS @0x%lx\n", addr); - - list_add_tail(&its_data->entry, &host_its_list); + add_to_host_its_list(addr, size, its); } }