From patchwork Tue Feb 27 15:15:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 129831 Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp398823edc; Tue, 27 Feb 2018 07:18:32 -0800 (PST) X-Google-Smtp-Source: AG47ELte/zhXqC5v2kPTMlA4msPmRxWWg6C95k5mdEQQoN0qk1CxnXfhzLQxlmOTrA3Wqgc59DHT X-Received: by 10.107.29.3 with SMTP id d3mr16588956iod.45.1519744712282; Tue, 27 Feb 2018 07:18:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519744712; cv=none; d=google.com; s=arc-20160816; b=TwZ0Lsr5GcB5wPnWgoJ7RuF+PZbDsChGSrEciOXGl3LzduShsBKKIPRQzsqLlcH5pz wja5NfIum/FodIT5Zz0j5TQiiL2OLSvwvAF5lng300UUAGMrJgFQQEuFoJ1ZFa0FZfQ/ rm+zESWC4WDfsmq96M0X1swgT+tyzUEN7Vkl3fQQAfWBAmdY1SL+r9juBakK+e6KNiq0 MiNSbFHUpCbOqlVJ9KafQnwGuV1IVxnqodI5X3v+1pC0tF+69bGYXzXXrteyc7z5YE/B x14zE4E4KZBL1q7v49Gin+JoYk2nqjl6d4d0Rg9eJ0hjo26kYZbVu3ucpDTXAuPkswov mrQg== 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:references:in-reply-to:message-id:date:to :from:arc-authentication-results; bh=g/m9fKQIl2vLRYs9qPpR1zs6vFhMrzVhdunf5TrFapI=; b=sq/Yra4SmiNcYU1zBukv4bPJamGm9wRszTJJHkqJn4i7GD4G8X2rcPCOJG5LQKvETe MdUnkRXBZYBA5/mErYKWlPX1hqOYgWxGfkX0/QcghcgjoX53lWD3ZmAhowG32KVyJH41 c04hHgnmveqBCbzVeH79ARG2Trt0D138bfKo8lN+9ux49TSp2LSpkIs/PUNSJRKmv1U/ ANkHmd6cIDN0gIfLJeV9FahP5lGlBTnFF5aT3pJxHd8RcAX+IGmpbBngHjbkL9APE/Qj XwE7Ay4exX+KbDRqrTJyhoCP3gZId8vo6D9ZdC8n5ag2JluejVmpxuAHWdNLO06GA2Mv ReYQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id e69si2076027iof.53.2018.02.27.07.18.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Feb 2018 07:18:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.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 1eqgzG-0005FS-KE; Tue, 27 Feb 2018 15:16:14 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eqgzF-0005Es-Dm for xen-devel@lists.xenproject.org; Tue, 27 Feb 2018 15:16:13 +0000 X-Inumbo-ID: 6725a35a-1bd1-11e8-b9b1-635ca7ef6cff Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas1.inumbo.com (Halon) with ESMTP id 6725a35a-1bd1-11e8-b9b1-635ca7ef6cff; Tue, 27 Feb 2018 15:18:02 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 232811610; Tue, 27 Feb 2018 07:16:07 -0800 (PST) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.206.53]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 147833F25C; Tue, 27 Feb 2018 07:16:05 -0800 (PST) From: julien.grall@arm.com To: xen-devel@lists.xenproject.org Date: Tue, 27 Feb 2018 15:15:53 +0000 Message-Id: <20180227151555.1953-2-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180227151555.1953-1-julien.grall@arm.com> References: <20180227151555.1953-1-julien.grall@arm.com> Cc: stewart.hildebrand@dornerworks.com, andre.przywara@arm.com, Julien Grall , sstabellini@kernel.org Subject: [Xen-devel] [PATCH 1/3] xen/arm: domain_build: Prepare DTB/ACPI tables after specific mappings X-BeenThere: xen-devel@lists.xenproject.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.xenproject.org Sender: "Xen-devel" From: Julien Grall A follow-up patch will require to have all interrupts routed to the hardware registered before calling prepare_dtb/prepare_acpi. At the moment, it is not necessary to call platform specific mappings (gic and platform) after, so it is fine to move them. Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini --- xen/arch/arm/domain_build.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 941688a2ce..a5e5c82355 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -2145,14 +2145,6 @@ int construct_dom0(struct domain *d) allocate_memory(d, &kinfo); find_gnttab_region(d, &kinfo); - if ( acpi_disabled ) - rc = prepare_dtb(d, &kinfo); - else - rc = prepare_acpi(d, &kinfo); - - if ( rc < 0 ) - return rc; - /* Map extra GIC MMIO, irqs and other hw stuffs to dom0. */ rc = gic_map_hwdom_extra_mappings(d); if ( rc < 0 ) @@ -2162,6 +2154,14 @@ int construct_dom0(struct domain *d) if ( rc < 0 ) return rc; + if ( acpi_disabled ) + rc = prepare_dtb(d, &kinfo); + else + rc = prepare_acpi(d, &kinfo); + + if ( rc < 0 ) + return rc; + /* * The following loads use the domain's p2m and require current to * be a vcpu of the domain, temporarily switch From patchwork Tue Feb 27 15:15:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 129832 Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp400778edc; Tue, 27 Feb 2018 07:20:20 -0800 (PST) X-Google-Smtp-Source: AG47ELtIX3aIpUkvP7rpHOYZGQSKWhfBEF66j0NYYOwAX9iaI3UoF1BznRNTWqLjfIT8ubUHqmsJ X-Received: by 10.107.4.74 with SMTP id 71mr16302466ioe.76.1519744820180; Tue, 27 Feb 2018 07:20:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519744820; cv=none; d=google.com; s=arc-20160816; b=IdA7DW54eGj2VTn4cZzkcqvKRmPzhF5rqZ9BenJz5w3MfKeTu+dxN7GanSOEK8w6mi tqW2pe9frfgvMy5KgYbogqnuMSm1mYJlj7mPh26EeGB3KoWEJYeb0y7+yXIIGhRuKHhP QOvKmrxxu/22iHmp4MnwauyXjDixxDA8GrWW9JNRR17v9g09ZrLVMuf6GFcViF9pPFNm QvgoMbD9LksxSb3rnT54y5aLZK7FFELDpU/AKjSTxR0RjGjTPIJI0NJyLEUL5Jax7ywh ah3GlAlQ6GNb9TTTMqjACO59Ii8rxpfWdNKqE9HRlWmkrx6vclyE9OBrZ83Lxa25KSJD 2S5w== 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:references:in-reply-to:message-id:date:to :from:arc-authentication-results; bh=InUX87GoL3/1s/S0kuu7q4wq2FVXTs2DhZAeSbkDykE=; b=QT+O7esYXjS9C1Qn0GgP8e56xrW4BddwIm2jRJ0mbiLLuGS0UL+IzpZgGBd7jCoTJs IYMOFHvvMhf77tV1mM3nGtT1gX5v9Z4GCg5g2E1/rzFVKO4VnQID6GBuzOlQUKr2Aw9y NnJ/YBlUJsrI86G5ZAnnuOERlbQ536ZVr4wCep48VjC5YeqfHJj035a8KhcjBTweo7oq f+KCAgMWEEZtjz8Us3lu93K4bNqIIYB4s9W+MFBzUIn00PUJx7wbhp12KkdtmVgtkknQ Ouu2xO+8Wdc4pUCgeZ/rdZQvqI/431qqBixQzQO7t8M0MXNfVqDUwjnwJ1onwbiD3z97 QVOw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id y78si7362848iof.151.2018.02.27.07.20.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Feb 2018 07:20:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.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 1eqh1O-0005Uj-6y; Tue, 27 Feb 2018 15:18:26 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eqh1M-0005UA-LG for xen-devel@lists.xenproject.org; Tue, 27 Feb 2018 15:18:24 +0000 X-Inumbo-ID: 67eeb856-1bd1-11e8-b9b1-635ca7ef6cff Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas1.inumbo.com (Halon) with ESMTP id 67eeb856-1bd1-11e8-b9b1-635ca7ef6cff; Tue, 27 Feb 2018 15:18:04 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 70CCB164F; Tue, 27 Feb 2018 07:16:08 -0800 (PST) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.206.53]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 61DFB3F25C; Tue, 27 Feb 2018 07:16:07 -0800 (PST) From: julien.grall@arm.com To: xen-devel@lists.xenproject.org Date: Tue, 27 Feb 2018 15:15:54 +0000 Message-Id: <20180227151555.1953-3-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180227151555.1953-1-julien.grall@arm.com> References: <20180227151555.1953-1-julien.grall@arm.com> Cc: stewart.hildebrand@dornerworks.com, andre.przywara@arm.com, Julien Grall , sstabellini@kernel.org Subject: [Xen-devel] [PATCH 2/3] xen/arm: domain_build: Rework the way to allocate the event channel interrupt X-BeenThere: xen-devel@lists.xenproject.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.xenproject.org Sender: "Xen-devel" From: Julien Grall At the moment, a placeholder will be created in the device-tree for the event channel information. Later in the domain construction, the interrupt for the event channel upcall will be allocated the device-tree fixed up. Looking at the code, the current split is not necessary because all the PPIs used by the hardware domain will by the time we create the node in the device-tree. >From now, mandate that all interrupts are registered before acpi_prepare() and dtb_prepare(). This allows us to rework the event channel code and remove one placeholder. Note, this will also help to fix the BUG(...) condition in set_interrupt_ppi which is completely wrong. See in a follow-up patch. Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini --- xen/arch/arm/domain_build.c | 74 +++++++++++++++++++++------------------------ 1 file changed, 35 insertions(+), 39 deletions(-) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index a5e5c82355..ed1a393bb5 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -576,7 +576,10 @@ static int make_memory_node(const struct domain *d, return res; } -static int make_hypervisor_node(const struct kernel_info *kinfo, +static void evtchn_allocate(struct domain *d); + +static int make_hypervisor_node(struct domain *d, + const struct kernel_info *kinfo, const struct dt_device_node *parent) { const char compat[] = @@ -620,10 +623,18 @@ static int make_hypervisor_node(const struct kernel_info *kinfo, return res; /* - * Placeholder for the event channel interrupt. The values will be - * replaced later. + * It is safe to allocate the event channel here because all the + * PPIs used by the hardware domain have been registered. + */ + evtchn_allocate(d); + + /* + * Interrupt event channel upcall: + * - Active-low level-sensitive + * - All CPUs + * TODO: Handle properly the cpumask; */ - set_interrupt_ppi(intr, ~0, 0xf, IRQ_TYPE_INVALID); + set_interrupt_ppi(intr, d->arch.evtchn_irq, 0xf, IRQ_TYPE_LEVEL_LOW); res = fdt_property_interrupts(fdt, &intr, 1); if ( res ) return res; @@ -1282,7 +1293,11 @@ static int handle_node(struct domain *d, struct kernel_info *kinfo, if ( node == dt_host ) { - res = make_hypervisor_node(kinfo, node); + /* + * The hypervisor node should always be created after all nodes + * from the host DT have been parsed. + */ + res = make_hypervisor_node(d, kinfo, node); if ( res ) return res; @@ -1939,6 +1954,12 @@ static int prepare_acpi(struct domain *d, struct kernel_info *kinfo) if ( rc != 0 ) return rc; + /* + * All PPIs have been registered, allocate the event channel + * interrupts. + */ + evtchn_allocate(d); + return 0; } #else @@ -2014,16 +2035,18 @@ static void initrd_load(struct kernel_info *kinfo) panic("Unable to copy the initrd in the hwdom memory"); } -static void evtchn_fixup(struct domain *d, struct kernel_info *kinfo) +/* + * Allocate the event channel PPIs and setup the HVM_PARAM_CALLBACK_IRQ. + * The allocated IRQ will be found in d->arch.evtchn_irq. + * + * Note that this should only be called once all PPIs used by the + * hardware domain have been registered. + */ +static void evtchn_allocate(struct domain *d) { - int res, node; + int res; u64 val; - gic_interrupt_t intr; - /* - * The allocation of the event channel IRQ has been deferred until - * now. At this time, all PPIs used by DOM0 have been registered. - */ res = vgic_allocate_ppi(d); if ( res < 0 ) panic("Unable to allocate a PPI for the event channel interrupt\n"); @@ -2041,31 +2064,6 @@ static void evtchn_fixup(struct domain *d, struct kernel_info *kinfo) HVM_PARAM_CALLBACK_TYPE_PPI_FLAG_MASK); val |= d->arch.evtchn_irq; d->arch.hvm_domain.params[HVM_PARAM_CALLBACK_IRQ] = val; - - /* - * When booting Dom0 using ACPI, Dom0 can only get the event channel - * interrupt via hypercall. - */ - if ( !acpi_disabled ) - return; - - /* Fix up "interrupts" in /hypervisor node */ - node = fdt_path_offset(kinfo->fdt, "/hypervisor"); - if ( node < 0 ) - panic("Cannot find the /hypervisor node"); - - /* Interrupt event channel upcall: - * - Active-low level-sensitive - * - All CPUs - * - * TODO: Handle properly the cpumask - */ - set_interrupt_ppi(intr, d->arch.evtchn_irq, 0xf, - IRQ_TYPE_LEVEL_LOW); - res = fdt_setprop_inplace(kinfo->fdt, node, "interrupts", - &intr, sizeof(intr)); - if ( res ) - panic("Cannot fix up \"interrupts\" property of the hypervisor node"); } static void __init find_gnttab_region(struct domain *d, @@ -2177,8 +2175,6 @@ int construct_dom0(struct domain *d) kernel_load(&kinfo); /* initrd_load will fix up the fdt, so call it before dtb_load */ initrd_load(&kinfo); - /* Allocate the event channel IRQ and fix up the device tree */ - evtchn_fixup(d, &kinfo); dtb_load(&kinfo); /* Now that we are done restore the original p2m and current. */ From patchwork Tue Feb 27 15:15:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 129833 Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp402482edc; Tue, 27 Feb 2018 07:21:50 -0800 (PST) X-Google-Smtp-Source: AG47ELvAit3u81+zMtYGfs6AkFyp0/+oRIjxfWL2LYgIezt2715ZT9HmuCis2NfKY9GXOfXpAM8w X-Received: by 10.36.254.65 with SMTP id w62mr17392103ith.130.1519744910487; Tue, 27 Feb 2018 07:21:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519744910; cv=none; d=google.com; s=arc-20160816; b=eaIK8UEMbNJShg+9xiaFDg9VjwnPh8sn+xbGuzhmM5gChrh5hOnJFHjdjCPcHd+Lyx sCSZ+U3ZHrlGscjj15IVJciW+B73dcWoLZUJ2lOpiXT3/a0aA49KuWcfb6lOyHFX2cnp Uhj8DdpJwDRhNLgbw9D/ZmbbqZNHpMg0rRHNx8nV3xrKAFYLispuRenSqnt7CqjZVgTs zH5XJZeM8HlFdCxjbyi7cLYcOw5O3cFHBsExcChAZnfGTI84aZOUZnn/VsXjwhqKt0Xn dmwYz29Olyp8UzddZh/DQE3oJfbQnC+wex2R5aubrGrRkJWxqHmgLYdcTd55qq7BBADg aWuA== 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:references:in-reply-to:message-id:date:to :from:arc-authentication-results; bh=RTlambAR6zBQaE7/RUI9KAkR2yhyP1miaP6j05eMc2s=; b=ZpDythUATykiQKI0S14n7dmkhR9zJdCUrcPuT/jDFQaf4G6GxiVWbHuD8xaTB4Epi7 B0Djvhg4t9K//S/O3lgCbq7zC8zOWjbKaHZsRsm+Giyv2bL9T8AO9XKJHfnWUdROAyOQ r915zIh7heLEBh1goE2IpcEC5i32867TtN6KVh+opfuZl7CDyyXsMWrin77zBh9eoeos vG4uaXiMZocUVh7nMYE0SVxkwNkliuSZYvELikm8gDhMUm5BAYV+jkc3z7lF8cjWE+CP ZFaWydSjsl61tqGtGH8InL86g5shDAMKSwF7byh9eq7AvAscdrLifwEEYv1+OBJxOxrZ G/+A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id 29si7395342ioi.208.2018.02.27.07.21.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Feb 2018 07:21:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.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 1eqh2X-0005gT-Ja; Tue, 27 Feb 2018 15:19:37 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eqh2W-0005fd-7R for xen-devel@lists.xenproject.org; Tue, 27 Feb 2018 15:19:36 +0000 X-Inumbo-ID: 68cde7ba-1bd1-11e8-b9b1-635ca7ef6cff Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas1.inumbo.com (Halon) with ESMTP id 68cde7ba-1bd1-11e8-b9b1-635ca7ef6cff; Tue, 27 Feb 2018 15:18:05 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E291B165C; Tue, 27 Feb 2018 07:16:09 -0800 (PST) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.206.53]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AFEA53F25C; Tue, 27 Feb 2018 07:16:08 -0800 (PST) From: julien.grall@arm.com To: xen-devel@lists.xenproject.org Date: Tue, 27 Feb 2018 15:15:55 +0000 Message-Id: <20180227151555.1953-4-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180227151555.1953-1-julien.grall@arm.com> References: <20180227151555.1953-1-julien.grall@arm.com> Cc: Stewart Hildebrand , andre.przywara@arm.com, Julien Grall , sstabellini@kernel.org Subject: [Xen-devel] [PATCH 3/3] xen/arm: domain_builder: irq sanity check logic fix X-BeenThere: xen-devel@lists.xenproject.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.xenproject.org Sender: "Xen-devel" From: Stewart Hildebrand Since commit "xen/arm: domain_build: Rework the way to allocate the event channel interrupt", it is not possible for an irq to be both below 16 and greater/equal than 32. Also fix the reference to linux documentation while we're at it. Signed-off-by: Stewart Hildebrand Signed-off-by: Julien Grall [Slightly rework the commit message] Acked-by: Stefano Stabellini --- xen/arch/arm/domain_build.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index ed1a393bb5..28ee876b92 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -503,9 +503,10 @@ static void set_interrupt_ppi(gic_interrupt_t interrupt, unsigned int irq, { __be32 *cells = interrupt; - BUG_ON(irq < 16 && irq >= 32); + BUG_ON(irq < 16); + BUG_ON(irq >= 32); - /* See linux Documentation/devictree/bindings/arm/gic.txt */ + /* See linux Documentation/devicetree/bindings/interrupt-controller/arm,gic.txt */ dt_set_cell(&cells, 1, 1); /* is a PPI */ dt_set_cell(&cells, 1, irq - 16); /* PPIs start at 16 */ dt_set_cell(&cells, 1, (cpumask << 8) | level);