From nobody Fri May 3 02:25:11 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1564131822; cv=none; d=zoho.com; s=zohoarc; b=S2T6MJHD2AOSWFD951i+kOxHhf70rBnLxFDNCwP1Yd14gt5w9vmATZz9yPxefWadF7p/CWqLwyz2tveiJBBIyJK41r/A8BHYoQLcJQsfOum9lQ5vcfVcQRtzdnWde8fEBRGzbjV1MLDsZyzl5GVjrTM5zaS35tV+vO2eb4lYn5E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564131822; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=zs0gsEhDEr247tcMMCH9X9MCgNl+YgkD2kRFGXM4SX4=; b=UmCCsk+QgiAVeVNI0+GiuP+3Ej50t7E4RpVuuP/6mVy7OZR1w+ldAUB8W2+93cL1eVPIDvAkzu6aKiYAzgQWpngSidzsvtTV1VMGfx/zVZ4TOGEu3F6I5wpR85RcMjkHthLpzEcG3X5WJiOFMBJsAF/fiCDEch7osLV/OUXN3i8= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 156413182220230.55985049468552; Fri, 26 Jul 2019 02:03:42 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hqw70-0007PK-Mh; Fri, 26 Jul 2019 09:02:02 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hqw6y-0007PF-J7 for xen-devel@lists.xenproject.org; Fri, 26 Jul 2019 09:02:00 +0000 Received: from mail-lj1-x241.google.com (unknown [2a00:1450:4864:20::241]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 05d01ce4-af84-11e9-8980-bc764e045a96; Fri, 26 Jul 2019 09:01:58 +0000 (UTC) Received: by mail-lj1-x241.google.com with SMTP id t28so50736132lje.9 for ; Fri, 26 Jul 2019 02:01:58 -0700 (PDT) Received: from 3489.kyiv.epam.com (ll-22.209.223.85.sovam.net.ua. [85.223.209.22]) by smtp.gmail.com with ESMTPSA id v4sm9860626lji.103.2019.07.26.02.01.55 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 26 Jul 2019 02:01:56 -0700 (PDT) X-Inumbo-ID: 05d01ce4-af84-11e9-8980-bc764e045a96 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=hM8CMM0qhovHLQUGpQOWL439U8qSRDprqV2X5oX5KZE=; b=lFjYev9/TrtNecyK91tM+wbSA9RMWZuDl2g/Ildn+oxmFs/UtEZSWViUoNo2UiKGyZ H7ZJx+867nDi8zY8v6G/TcUB0aoDEw4nrmyVYCYtc5WRUoIW1qvQnzt6nDA5QXqrl1nv l/ECfwQQJM9/W9V7jrubEJ4rIOrUUnCbBiMkEggfEywjqxk2t/si4tGXW2O3VUr3Q6GZ 1YPORw7uX60Qt8HtIXfMFBL9kKGlnPRLgooiWWsBEx6G5L1FnHj/d5Jsvy70d4XMH7qG QPww/GWHMcImBncF79FfzJtptX7SRh0K1V4HAzmlwJzZzmuezvowp+6b++eOCWwqn+3Q a/8w== 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=hM8CMM0qhovHLQUGpQOWL439U8qSRDprqV2X5oX5KZE=; b=EMXnbpna+wFxwEIP6A1lo4fWWAS8tEt4RmbcfAi2srTxW+4UlQbI+Q1Yf+bOQGG83v TrlxURF/OYyAZqjUPipBuZZjWJhI0PM/HiSEeujHBawi5GMEaTCPGtiOfend3rJJM+36 CsMZxoHfjz1mF5opG/2eoaqT6VnjkSwmVv7UoEZqyKo6GN4udrBAE7VCZqd2xG5rIcx1 4L2tt4wG9hqKA1dGbm9NMj2aDGQRlfmdJvWuABfdJWNFvMIZSZU5FmpuFP1OFigmkr+p 6giImdioLMdVGFBPWcKSj3DFuH5c4qrb5HeFyrjXGOIHUS0oYvjT8VCxpeeaL5kEZMCN 1dWA== X-Gm-Message-State: APjAAAXo4Fc0v3qp56zd0ZbNSbui8ekTHgspqD2Wy6RA3krlN+lR04e8 z1Ox9kT7xd4FXkqBJUpw9yQPs1Lc X-Google-Smtp-Source: APXvYqykWEnH0jHnUYq6/c9lxc1z2by2jkTs9H6A/Nb1hmhJuAgJ/Pa47FqAbmd1lRZ99AZaXtuy2w== X-Received: by 2002:a2e:2b9d:: with SMTP id r29mr48785251ljr.181.1564131717126; Fri, 26 Jul 2019 02:01:57 -0700 (PDT) From: Viktor Mitin To: xen-devel@lists.xenproject.org Date: Fri, 26 Jul 2019 12:01:24 +0300 Message-Id: <20190726090124.26444-1-viktor.mitin.19@gmail.com> X-Mailer: git-send-email 2.17.1 Subject: [Xen-devel] [PATCH] xen/arm: extend fdt_property_interrupts X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Volodymyr Babchuk , Julien Grall , Stefano Stabellini , Viktor Mitin , Viktor Mitin MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) xen/arm: extend fdt_property_interrupts to deal with other domain than the hwdom Tested with aarch64 qemu dom0 and dom0less boot. Suggested-by: Julien Grall Signed-off-by: Viktor Mitin --- See discussion in mail: [PATCH] xen/arm: merge make_timer_node and make_timer_domU_node xen/arch/arm/domain_build.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 4c8404155a..5f68603392 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -621,17 +621,19 @@ static void __init set_interrupt(gic_interrupt_t inte= rrupt, * "interrupts": contains the list of interrupts * "interrupt-parent": link to the GIC */ -static int __init fdt_property_interrupts(void *fdt, gic_interrupt_t *intr, - unsigned num_irq) +static int __init fdt_property_interrupts(const struct kernel_info *kinfo, + gic_interrupt_t *intr, unsigned num_irq) { int res; + uint32_t phandle =3D is_hardware_domain(kinfo->d) ?=20 + dt_interrupt_controller->phandle : GUEST_PHANDLE_GI= C; =20 - res =3D fdt_property(fdt, "interrupts", intr, sizeof (intr[0]) * num_i= rq); + res =3D fdt_property(kinfo->fdt, "interrupts",=20 + intr, sizeof (intr[0]) * num_irq); if ( res ) return res; =20 - res =3D fdt_property_cell(fdt, "interrupt-parent", - dt_interrupt_controller->phandle); + res =3D fdt_property_cell(kinfo->fdt, "interrupt-parent", phandle); =20 return res; } @@ -733,7 +735,7 @@ static int __init make_hypervisor_node(struct domain *d, * TODO: Handle properly the cpumask; */ set_interrupt(intr, d->arch.evtchn_irq, 0xf, DT_IRQ_TYPE_LEVEL_LOW); - res =3D fdt_property_interrupts(fdt, &intr, 1); + res =3D fdt_property_interrupts(kinfo, &intr, 1); if ( res ) return res; =20 @@ -960,8 +962,10 @@ static int __init make_gic_node(const struct domain *d= , void *fdt, return res; } =20 -static int __init make_timer_node(const struct domain *d, void *fdt) +static int __init make_timer_node(const struct kernel_info *kinfo) { + void *fdt =3D kinfo->fdt; + static const struct dt_device_match timer_ids[] __initconst =3D { DT_MATCH_COMPATIBLE("arm,armv7-timer"), @@ -1016,7 +1020,7 @@ static int __init make_timer_node(const struct domain= *d, void *fdt) dt_dprintk(" Virt interrupt %u\n", irq); set_interrupt(intrs[2], irq, 0xf, DT_IRQ_TYPE_LEVEL_LOW); =20 - res =3D fdt_property_interrupts(fdt, intrs, 3); + res =3D fdt_property_interrupts(kinfo, intrs, 3); if ( res ) return res; =20 @@ -1377,7 +1381,7 @@ static int __init handle_node(struct domain *d, struc= t kernel_info *kinfo, if ( device_get_class(node) =3D=3D DEVICE_GIC ) return make_gic_node(d, kinfo->fdt, node); if ( dt_match_node(timer_matches, node) ) - return make_timer_node(d, kinfo->fdt); + return make_timer_node(kinfo); =20 /* Skip nodes used by Xen */ if ( dt_device_used_by(node) =3D=3D DOMID_XEN ) --=20 2.17.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel