diff mbox

arm64: pageattr: Correctly adjust unaligned start addresses

Message ID 1410473432-13381-1-git-send-email-lauraa@codeaurora.org (mailing list archive)
State New, archived
Headers show

Commit Message

Laura Abbott Sept. 11, 2014, 10:10 p.m. UTC
The start address needs to be actually updated after it
is detected to be unaligned. Adjust it and the end address
properly.

Reported-by: Zi Shen Lim <zlim.lnx@gmail.com>
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
---
 arch/arm64/mm/pageattr.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Zi Shen Lim Sept. 12, 2014, 3:40 a.m. UTC | #1
On Thu, Sep 11, 2014 at 3:10 PM, Laura Abbott <lauraa@codeaurora.org> wrote:
> The start address needs to be actually updated after it
> is detected to be unaligned. Adjust it and the end address
> properly.
>
> Reported-by: Zi Shen Lim <zlim.lnx@gmail.com>
> Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
> ---
>  arch/arm64/mm/pageattr.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm64/mm/pageattr.c b/arch/arm64/mm/pageattr.c
> index 75e744e..bb0ea94 100644
> --- a/arch/arm64/mm/pageattr.c
> +++ b/arch/arm64/mm/pageattr.c
> @@ -46,7 +46,8 @@ static int change_memory_common(unsigned long addr, int numpages,
>         struct page_change_data data;
>
>         if (!IS_ALIGNED(addr, PAGE_SIZE)) {
> -               addr &= PAGE_MASK;
> +               start &= PAGE_MASK;
> +               end = start + size;
>                 WARN_ON_ONCE(1);
>         }
>

Looks good to me.
Reviewed-by: Zi Shen Lim <zlim.lnx@gmail.com>

> --
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> hosted by The Linux Foundation
>
Catalin Marinas Sept. 12, 2014, 3:36 p.m. UTC | #2
On Thu, Sep 11, 2014 at 11:10:32PM +0100, Laura Abbott wrote:
> The start address needs to be actually updated after it
> is detected to be unaligned. Adjust it and the end address
> properly.
> 
> Reported-by: Zi Shen Lim <zlim.lnx@gmail.com>
> Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
> ---
>  arch/arm64/mm/pageattr.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Applied. Thanks.
diff mbox

Patch

diff --git a/arch/arm64/mm/pageattr.c b/arch/arm64/mm/pageattr.c
index 75e744e..bb0ea94 100644
--- a/arch/arm64/mm/pageattr.c
+++ b/arch/arm64/mm/pageattr.c
@@ -46,7 +46,8 @@  static int change_memory_common(unsigned long addr, int numpages,
 	struct page_change_data data;
 
 	if (!IS_ALIGNED(addr, PAGE_SIZE)) {
-		addr &= PAGE_MASK;
+		start &= PAGE_MASK;
+		end = start + size;
 		WARN_ON_ONCE(1);
 	}