提交 eaf040cc 编写于 作者: M Marc Zyngier 提交者: Xie XiuQi

irqchip/gic-v3-its: Register LPI tables with EFI config table

mainline inclusion
from 4.20-rc1
commit: 3fb68faee8676900f896d1615442aeca36e5f940
category: kdump
bugzilla: 5272
CVE: NA

This 10 patches is used for secondary kernel using LPI.

[PATCH 01/10] irqchip/gic-v3-its: Change initialization ordering for LPIs
[PATCH 02/10] irqchip/gic-v3-its: Simplify LPI_PENDBASE_SZ usage
[PATCH 03/10] irqchip/gic-v3-its: Split property table clearing from allocation
[PATCH 04/10] irqchip/gic-v3-its: Move pending table allocation to init time
[PATCH 05/10] irqchip/gic-v3-its: Keep track of property table's PA and VA
[PATCH 06/10] irqchip/gic-v3-its: Allow use of pre-programmed LPI tables
[PATCH 07/10] irqchip/gic-v3-its: Use pre-programmed redistributor tables with kdump kernels
[PATCH 08/10] irqchip/gic-v3-its: Check that all RDs have the same property table
[PATCH 09/10] irqchip/gic-v3-its: Register LPI tables with EFI config table
[PATCH 10/10] irqchip/gic-v3-its: Allow use of LPI tables in reserved memory

--------------------------------------

Upon enabling a redistributor, let's register the allocated tables
with the EFI table that tracks the memory reservations.
Tested-by: NJeremy Linton <jeremy.linton@arm.com>
Tested-by: NBhupesh Sharma <bhsharma@redhat.com>
Tested-by: NLei Zhang <zhang.lei@jp.fujitsu.com>
Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Reviewed-by: NHanjun Guo <guohanjun@huawei.com>
上级 76dfdc4e
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <linux/crash_dump.h> #include <linux/crash_dump.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/dma-iommu.h> #include <linux/dma-iommu.h>
#include <linux/efi.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/irqdomain.h> #include <linux/irqdomain.h>
#include <linux/list.h> #include <linux/list.h>
...@@ -1628,6 +1629,14 @@ static void its_free_prop_table(struct page *prop_page) ...@@ -1628,6 +1629,14 @@ static void its_free_prop_table(struct page *prop_page)
get_order(LPI_PROPBASE_SZ)); get_order(LPI_PROPBASE_SZ));
} }
static int gic_reserve_range(phys_addr_t addr, unsigned long size)
{
if (efi_enabled(EFI_CONFIG_TABLES))
return efi_mem_reserve_persistent(addr, size);
return 0;
}
static int __init its_setup_lpi_prop_table(void) static int __init its_setup_lpi_prop_table(void)
{ {
if (gic_rdists->flags & RDIST_FLAGS_RD_TABLES_PREALLOCATED) { if (gic_rdists->flags & RDIST_FLAGS_RD_TABLES_PREALLOCATED) {
...@@ -1655,6 +1664,8 @@ static int __init its_setup_lpi_prop_table(void) ...@@ -1655,6 +1664,8 @@ static int __init its_setup_lpi_prop_table(void)
gic_rdists->prop_table_pa = page_to_phys(page); gic_rdists->prop_table_pa = page_to_phys(page);
gic_rdists->prop_table_va = page_address(page); gic_rdists->prop_table_va = page_address(page);
WARN_ON(gic_reserve_range(gic_rdists->prop_table_pa,
LPI_PROPBASE_SZ));
} }
pr_info("GICv3: using LPI property table @%pa\n", pr_info("GICv3: using LPI property table @%pa\n",
...@@ -2049,6 +2060,7 @@ static void its_cpu_init_lpis(void) ...@@ -2049,6 +2060,7 @@ static void its_cpu_init_lpis(void)
pend_page = gic_data_rdist()->pend_page; pend_page = gic_data_rdist()->pend_page;
paddr = page_to_phys(pend_page); paddr = page_to_phys(pend_page);
WARN_ON(gic_reserve_range(paddr, LPI_PENDBASE_SZ));
/* set PROPBASE */ /* set PROPBASE */
val = (gic_rdists->prop_table_pa | val = (gic_rdists->prop_table_pa |
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册