From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755655AbdBQGPj (ORCPT ); Fri, 17 Feb 2017 01:15:39 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36276 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755594AbdBQGPi (ORCPT ); Fri, 17 Feb 2017 01:15:38 -0500 Subject: Re: [RFC PATCH 09/33] irqchip/gic-v3-its: Split out property table allocation To: Marc Zyngier , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu References: <1484648454-21216-1-git-send-email-marc.zyngier@arm.com> <1484648454-21216-10-git-send-email-marc.zyngier@arm.com> Cc: Thomas Gleixner , Jason Cooper , Christoffer Dall From: Auger Eric Message-ID: Date: Fri, 17 Feb 2017 07:15:34 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <1484648454-21216-10-git-send-email-marc.zyngier@arm.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 17 Feb 2017 06:15:38 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Marc, On 17/01/2017 11:20, Marc Zyngier wrote: > Move the LPI property table allocation into its own function, as > this is going to be required for those associated with VMs in > the future. > > Signed-off-by: Marc Zyngier > --- > drivers/irqchip/irq-gic-v3-its.c | 28 ++++++++++++++++++---------- > 1 file changed, 18 insertions(+), 10 deletions(-) > > diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c > index b28fb19..c92ff4d 100644 > --- a/drivers/irqchip/irq-gic-v3-its.c > +++ b/drivers/irqchip/irq-gic-v3-its.c > @@ -889,15 +889,31 @@ static void its_lpi_free(struct event_lpi_map *map) > kfree(map->col_map); > } > > +static struct page *its_allocate_prop_table(gfp_t gfp_flags) > +{ > + struct page *prop_page; > + > + prop_page = alloc_pages(gfp_flags, get_order(LPI_PROPBASE_SZ)); > + if (!prop_page) > + return NULL; > + > + /* Priority 0xa0, Group-1, disabled */ > + memset(page_address(prop_page), > + LPI_PROP_DEFAULT_PRIO | LPI_PROP_GROUP1, > + LPI_PROPBASE_SZ); > + > + /* Make sure the GIC will observe the written configuration */ > + gic_flush_dcache_to_poc(page_address(gic_rdists->prop_page), LPI_PROPBASE_SZ); s/gic_rdists->prop_page/prop_page. With that fix, Reviewed-by: Eric Auger Eric > > + return prop_page; > +} > > > static int __init its_alloc_lpi_tables(void) > { > phys_addr_t paddr; > > - gic_rdists->prop_page = alloc_pages(GFP_NOWAIT, > - get_order(LPI_PROPBASE_SZ)); > + gic_rdists->prop_page = its_allocate_prop_table(GFP_NOWAIT); > if (!gic_rdists->prop_page) { > pr_err("Failed to allocate PROPBASE\n"); > return -ENOMEM; > @@ -906,14 +922,6 @@ static int __init its_alloc_lpi_tables(void) > paddr = page_to_phys(gic_rdists->prop_page); > pr_info("GIC: using LPI property table @%pa\n", &paddr); > > - /* Priority 0xa0, Group-1, disabled */ > - memset(page_address(gic_rdists->prop_page), > - LPI_PROP_DEFAULT_PRIO | LPI_PROP_GROUP1, > - LPI_PROPBASE_SZ); > - > - /* Make sure the GIC will observe the written configuration */ > - gic_flush_dcache_to_poc(page_address(gic_rdists->prop_page), LPI_PROPBASE_SZ); > - > return 0; > } > >