irqchip/gic-v3-its: Split out property table allocation

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.

Reviewed-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>

+21 -10
+21 -10
drivers/irqchip/irq-gic-v3-its.c
··· 905 905 kfree(map->col_map); 906 906 } 907 907 908 + static struct page *its_allocate_prop_table(gfp_t gfp_flags) 909 + { 910 + struct page *prop_page; 911 + 912 + prop_page = alloc_pages(gfp_flags, get_order(LPI_PROPBASE_SZ)); 913 + if (!prop_page) 914 + return NULL; 915 + 916 + /* Priority 0xa0, Group-1, disabled */ 917 + memset(page_address(prop_page), 918 + LPI_PROP_DEFAULT_PRIO | LPI_PROP_GROUP1, 919 + LPI_PROPBASE_SZ); 920 + 921 + /* Make sure the GIC will observe the written configuration */ 922 + gic_flush_dcache_to_poc(page_address(prop_page), LPI_PROPBASE_SZ); 923 + 924 + return prop_page; 925 + } 926 + 927 + 908 928 static int __init its_alloc_lpi_tables(void) 909 929 { 910 930 phys_addr_t paddr; 911 931 912 932 lpi_id_bits = min_t(u32, gic_rdists->id_bits, ITS_MAX_LPI_NRBITS); 913 - gic_rdists->prop_page = alloc_pages(GFP_NOWAIT, 914 - get_order(LPI_PROPBASE_SZ)); 933 + gic_rdists->prop_page = its_allocate_prop_table(GFP_NOWAIT); 915 934 if (!gic_rdists->prop_page) { 916 935 pr_err("Failed to allocate PROPBASE\n"); 917 936 return -ENOMEM; ··· 938 919 939 920 paddr = page_to_phys(gic_rdists->prop_page); 940 921 pr_info("GIC: using LPI property table @%pa\n", &paddr); 941 - 942 - /* Priority 0xa0, Group-1, disabled */ 943 - memset(page_address(gic_rdists->prop_page), 944 - LPI_PROP_DEFAULT_PRIO | LPI_PROP_GROUP1, 945 - LPI_PROPBASE_SZ); 946 - 947 - /* Make sure the GIC will observe the written configuration */ 948 - gic_flush_dcache_to_poc(page_address(gic_rdists->prop_page), LPI_PROPBASE_SZ); 949 922 950 923 return its_lpi_init(lpi_id_bits); 951 924 }