diff mbox

[1/2] xen/arm64: correct comments

Message ID 1461160464-2194-1-git-send-email-van.freenix@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Peng Fan April 20, 2016, 1:54 p.m. UTC
The 'Base address for 4K mapping' is '(x19 >> THIRD_SHIFT) << THIRD_SHIFT'.
Also we are building 4K page mapping, not section mapping.

Signed-off-by: Peng Fan <van.freenix@gmail.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Julien Grall <julien.grall@arm.com>
---
 xen/arch/arm/arm64/head.S | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Julien Grall April 22, 2016, 4:24 p.m. UTC | #1
Hello Peng,

I would specific the file modified in the title.

On 20/04/16 14:54, Peng Fan wrote:
> The 'Base address for 4K mapping' is '(x19 >> THIRD_SHIFT) << THIRD_SHIFT'.

The computation is a sequence of 2 instructions. I gave a look to the 
rest of the file and the comments are usually put on the first instruction.

So I would much prefer to stay consistent with the rest of the code.

> Also we are building 4K page mapping, not section mapping.

To be fair, a page is a specialized section.

> Signed-off-by: Peng Fan <van.freenix@gmail.com>
> Cc: Stefano Stabellini <sstabellini@kernel.org>
> Cc: Julien Grall <julien.grall@arm.com>
> ---
>   xen/arch/arm/arm64/head.S | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S
> index 946e2c9..05e3db0 100644
> --- a/xen/arch/arm/arm64/head.S
> +++ b/xen/arch/arm/arm64/head.S
> @@ -471,10 +471,10 @@ skip_bss:
>           ldr   x4, =boot_third
>           add   x4, x4, x20            /* x4 := paddr (boot_third) */
>
> -        lsr   x2, x19, #THIRD_SHIFT  /* Base address for 4K mapping */
> -        lsl   x2, x2, #THIRD_SHIFT
> -        mov   x3, #PT_MEM_L3         /* x2 := Section map */
> -        orr   x2, x2, x3
> +        lsr   x2, x19, #THIRD_SHIFT
> +        lsl   x2, x2, #THIRD_SHIFT  /* Base address for 4K mapping */
> +        mov   x3, #PT_MEM_L3
> +        orr   x2, x2, x3            /* x2 := Page map */

The section map is the combination of 2 instructions. With this change 
we don't know quickly what the purpose of "mov x3, #PT_MEM_L3".

>
>           /* ... map of vaddr(start) in boot_third */
>           mov   x1, xzr
>

Regards,
diff mbox

Patch

diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S
index 946e2c9..05e3db0 100644
--- a/xen/arch/arm/arm64/head.S
+++ b/xen/arch/arm/arm64/head.S
@@ -471,10 +471,10 @@  skip_bss:
         ldr   x4, =boot_third
         add   x4, x4, x20            /* x4 := paddr (boot_third) */
 
-        lsr   x2, x19, #THIRD_SHIFT  /* Base address for 4K mapping */
-        lsl   x2, x2, #THIRD_SHIFT
-        mov   x3, #PT_MEM_L3         /* x2 := Section map */
-        orr   x2, x2, x3
+        lsr   x2, x19, #THIRD_SHIFT
+        lsl   x2, x2, #THIRD_SHIFT  /* Base address for 4K mapping */
+        mov   x3, #PT_MEM_L3
+        orr   x2, x2, x3            /* x2 := Page map */
 
         /* ... map of vaddr(start) in boot_third */
         mov   x1, xzr