-
Notifications
You must be signed in to change notification settings - Fork 996
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1597 from jongwu/PA
kernel: upgrade kernel to 5.10.x for arm64.
- Loading branch information
Showing
3 changed files
with
31 additions
and
392 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
...ing/kernel/patches/5.10.x/0001-arm64-mmu-compared-with-linear-start-physical-addres.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
From 0b0f3b3cd9c00bc5bce5686303ef008212ce9b99 Mon Sep 17 00:00:00 2001 | ||
From: Jianyong Wu <jianyong.wu@arm.com> | ||
Date: Wed, 31 Mar 2021 10:00:53 +0800 | ||
Subject: [PATCH] arm64/mmu: compared with linear start physical address as | ||
signed | ||
|
||
When CONFIG_RANDOM_BASE is enabled, the physical base address can be | ||
a negative number. It may lead to bug if it is compared as a unsigned | ||
number. So cast it before comparison. | ||
|
||
Signed-off-by: Jianyong Wu <jianyong.wu@arm.com> | ||
--- | ||
arch/arm64/mm/mmu.c | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c | ||
index ca692a815731..24b36c85edf4 100644 | ||
--- a/arch/arm64/mm/mmu.c | ||
+++ b/arch/arm64/mm/mmu.c | ||
@@ -1453,7 +1453,7 @@ static bool inside_linear_region(u64 start, u64 size) | ||
* range which can be mapped inside this linear mapping range, must | ||
* also be derived from its end points. | ||
*/ | ||
- return start >= __pa(_PAGE_OFFSET(vabits_actual)) && | ||
+ return (s64)start >= (s64)(__pa(_PAGE_OFFSET(vabits_actual))) && | ||
(start + size - 1) <= __pa(PAGE_END - 1); | ||
} | ||
|
||
-- | ||
2.17.1 | ||
|
Oops, something went wrong.