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

irqchip/gic-v3-its: Simplify LPI_PENDBASE_SZ usage

mainline inclusion
from 4.20-rc1
commit: adaab500dd81a59d2b3b0ce3e995db5b9e3ee8a4
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

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

LPI_PENDING_SZ is always used in conjunction with a max(), which doesn't
make much sense, since we're guaranteed that LPI_PENDING_SZ is already
aligned to 64K. Let's remove it.
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>
上级 770aaf10
......@@ -1924,12 +1924,9 @@ static int its_alloc_collections(struct its_node *its)
static struct page *its_allocate_pending_table(gfp_t gfp_flags)
{
struct page *pend_page;
/*
* The pending pages have to be at least 64kB aligned,
* hence the 'max(LPI_PENDBASE_SZ, SZ_64K)' below.
*/
pend_page = alloc_pages(gfp_flags | __GFP_ZERO,
get_order(max_t(u32, LPI_PENDBASE_SZ, SZ_64K)));
get_order(LPI_PENDBASE_SZ));
if (!pend_page)
return NULL;
......@@ -1941,8 +1938,7 @@ static struct page *its_allocate_pending_table(gfp_t gfp_flags)
static void its_free_pending_table(struct page *pt)
{
free_pages((unsigned long)page_address(pt),
get_order(max_t(u32, LPI_PENDBASE_SZ, SZ_64K)));
free_pages((unsigned long)page_address(pt), get_order(LPI_PENDBASE_SZ));
}
static void its_cpu_init_lpis(void)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册