[Xen-devel,v2] xen/arm: domain_build: Print the correct domain in dtb_load()

Message ID 20190815172944.14163-1-julien.grall@arm.com
State New
Headers show
Series
  • [Xen-devel,v2] xen/arm: domain_build: Print the correct domain in dtb_load()
Related show

Commit Message

Julien Grall Aug. 15, 2019, 5:29 p.m.
dtb_load() can be called by other domain than dom0. To avoid confusion
in the log, print the correct domain.

Signed-off-by: Julien Grall <julien.grall@arm.com>

---
    Changes in v2:
        - Fix the second print in the function as well.
---
 xen/arch/arm/domain_build.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Comments

Volodymyr Babchuk Aug. 16, 2019, 4:33 p.m. | #1
Julien Grall writes:

> dtb_load() can be called by other domain than dom0. To avoid confusion
> in the log, print the correct domain.
>
> Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>

>
> ---
>     Changes in v2:
>         - Fix the second print in the function as well.
> ---
>  xen/arch/arm/domain_build.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
> index 4e51e22927..126374f603 100644
> --- a/xen/arch/arm/domain_build.c
> +++ b/xen/arch/arm/domain_build.c
> @@ -1787,15 +1787,17 @@ static void __init dtb_load(struct kernel_info *kinfo)
>  {
>      unsigned long left;
>  
> -    printk("Loading dom0 DTB to 0x%"PRIpaddr"-0x%"PRIpaddr"\n",
> -           kinfo->dtb_paddr, kinfo->dtb_paddr + fdt_totalsize(kinfo->fdt));
> +    printk("Loading %pd DTB to 0x%"PRIpaddr"-0x%"PRIpaddr"\n",
> +           kinfo->d, kinfo->dtb_paddr,
> +           kinfo->dtb_paddr + fdt_totalsize(kinfo->fdt));
>  
>      left = copy_to_guest_phys_flush_dcache(kinfo->d, kinfo->dtb_paddr,
>                                             kinfo->fdt,
>                                             fdt_totalsize(kinfo->fdt));
>  
>      if ( left != 0 )
> -        panic("Unable to copy the DTB to dom0 memory (left = %lu bytes)\n", left);
> +        panic("Unable to copy the DTB to %pd memory (left = %lu bytes)\n",
> +              kinfo->d, left);
>      xfree(kinfo->fdt);
>  }
Stefano Stabellini Oct. 2, 2019, 1:20 a.m. | #2
On Thu, 15 Aug 2019, Julien Grall wrote:
> dtb_load() can be called by other domain than dom0. To avoid confusion
> in the log, print the correct domain.
> 
> Signed-off-by: Julien Grall <julien.grall@arm.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

> ---
>     Changes in v2:
>         - Fix the second print in the function as well.
> ---
>  xen/arch/arm/domain_build.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
> index 4e51e22927..126374f603 100644
> --- a/xen/arch/arm/domain_build.c
> +++ b/xen/arch/arm/domain_build.c
> @@ -1787,15 +1787,17 @@ static void __init dtb_load(struct kernel_info *kinfo)
>  {
>      unsigned long left;
>  
> -    printk("Loading dom0 DTB to 0x%"PRIpaddr"-0x%"PRIpaddr"\n",
> -           kinfo->dtb_paddr, kinfo->dtb_paddr + fdt_totalsize(kinfo->fdt));
> +    printk("Loading %pd DTB to 0x%"PRIpaddr"-0x%"PRIpaddr"\n",
> +           kinfo->d, kinfo->dtb_paddr,
> +           kinfo->dtb_paddr + fdt_totalsize(kinfo->fdt));
>  
>      left = copy_to_guest_phys_flush_dcache(kinfo->d, kinfo->dtb_paddr,
>                                             kinfo->fdt,
>                                             fdt_totalsize(kinfo->fdt));
>  
>      if ( left != 0 )
> -        panic("Unable to copy the DTB to dom0 memory (left = %lu bytes)\n", left);
> +        panic("Unable to copy the DTB to %pd memory (left = %lu bytes)\n",
> +              kinfo->d, left);
>      xfree(kinfo->fdt);
>  }
>  
> -- 
> 2.11.0
>
Julien Grall Oct. 10, 2019, 2:43 p.m. | #3
Hi,

Hmm, it looks like I forgot this patch before the freeze. Juergen, are you happy 
with this to go in Xen 4.13?

Cheers,

On 15/08/2019 18:29, Julien Grall wrote:
> dtb_load() can be called by other domain than dom0. To avoid confusion
> in the log, print the correct domain.
> 
> Signed-off-by: Julien Grall <julien.grall@arm.com>
> 
> ---
>      Changes in v2:
>          - Fix the second print in the function as well.
> ---
>   xen/arch/arm/domain_build.c | 8 +++++---
>   1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
> index 4e51e22927..126374f603 100644
> --- a/xen/arch/arm/domain_build.c
> +++ b/xen/arch/arm/domain_build.c
> @@ -1787,15 +1787,17 @@ static void __init dtb_load(struct kernel_info *kinfo)
>   {
>       unsigned long left;
>   
> -    printk("Loading dom0 DTB to 0x%"PRIpaddr"-0x%"PRIpaddr"\n",
> -           kinfo->dtb_paddr, kinfo->dtb_paddr + fdt_totalsize(kinfo->fdt));
> +    printk("Loading %pd DTB to 0x%"PRIpaddr"-0x%"PRIpaddr"\n",
> +           kinfo->d, kinfo->dtb_paddr,
> +           kinfo->dtb_paddr + fdt_totalsize(kinfo->fdt));
>   
>       left = copy_to_guest_phys_flush_dcache(kinfo->d, kinfo->dtb_paddr,
>                                              kinfo->fdt,
>                                              fdt_totalsize(kinfo->fdt));
>   
>       if ( left != 0 )
> -        panic("Unable to copy the DTB to dom0 memory (left = %lu bytes)\n", left);
> +        panic("Unable to copy the DTB to %pd memory (left = %lu bytes)\n",
> +              kinfo->d, left);
>       xfree(kinfo->fdt);
>   }
>   
>
Julien Grall Oct. 15, 2019, 4:45 p.m. | #4
Hi Juergen,

Gentle ping.

Cheers,

On 10/10/19 3:43 PM, Julien Grall wrote:
> Hi,
> 
> Hmm, it looks like I forgot this patch before the freeze. Juergen, are 
> you happy with this to go in Xen 4.13?
> 
> Cheers,
> 
> On 15/08/2019 18:29, Julien Grall wrote:
>> dtb_load() can be called by other domain than dom0. To avoid confusion
>> in the log, print the correct domain.
>>
>> Signed-off-by: Julien Grall <julien.grall@arm.com>
>>
>> ---
>>      Changes in v2:
>>          - Fix the second print in the function as well.
>> ---
>>   xen/arch/arm/domain_build.c | 8 +++++---
>>   1 file changed, 5 insertions(+), 3 deletions(-)
>>
>> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
>> index 4e51e22927..126374f603 100644
>> --- a/xen/arch/arm/domain_build.c
>> +++ b/xen/arch/arm/domain_build.c
>> @@ -1787,15 +1787,17 @@ static void __init dtb_load(struct kernel_info 
>> *kinfo)
>>   {
>>       unsigned long left;
>> -    printk("Loading dom0 DTB to 0x%"PRIpaddr"-0x%"PRIpaddr"\n",
>> -           kinfo->dtb_paddr, kinfo->dtb_paddr + 
>> fdt_totalsize(kinfo->fdt));
>> +    printk("Loading %pd DTB to 0x%"PRIpaddr"-0x%"PRIpaddr"\n",
>> +           kinfo->d, kinfo->dtb_paddr,
>> +           kinfo->dtb_paddr + fdt_totalsize(kinfo->fdt));
>>       left = copy_to_guest_phys_flush_dcache(kinfo->d, kinfo->dtb_paddr,
>>                                              kinfo->fdt,
>>                                              fdt_totalsize(kinfo->fdt));
>>       if ( left != 0 )
>> -        panic("Unable to copy the DTB to dom0 memory (left = %lu 
>> bytes)\n", left);
>> +        panic("Unable to copy the DTB to %pd memory (left = %lu 
>> bytes)\n",
>> +              kinfo->d, left);
>>       xfree(kinfo->fdt);
>>   }
>>
>
Juergen Gross Oct. 16, 2019, 4:53 a.m. | #5
On 15.10.19 18:45, Julien Grall wrote:
> Hi Juergen,
> 
> Gentle ping.
> 
> Cheers,
> 
> On 10/10/19 3:43 PM, Julien Grall wrote:
>> Hi,
>>
>> Hmm, it looks like I forgot this patch before the freeze. Juergen, are 
>> you happy with this to go in Xen 4.13?
>>
>> Cheers,
>>
>> On 15/08/2019 18:29, Julien Grall wrote:
>>> dtb_load() can be called by other domain than dom0. To avoid confusion
>>> in the log, print the correct domain.
>>>
>>> Signed-off-by: Julien Grall <julien.grall@arm.com>

Release-acked-by: Juergen Gross <jgross@suse.com>


Juergen

Patch

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 4e51e22927..126374f603 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -1787,15 +1787,17 @@  static void __init dtb_load(struct kernel_info *kinfo)
 {
     unsigned long left;
 
-    printk("Loading dom0 DTB to 0x%"PRIpaddr"-0x%"PRIpaddr"\n",
-           kinfo->dtb_paddr, kinfo->dtb_paddr + fdt_totalsize(kinfo->fdt));
+    printk("Loading %pd DTB to 0x%"PRIpaddr"-0x%"PRIpaddr"\n",
+           kinfo->d, kinfo->dtb_paddr,
+           kinfo->dtb_paddr + fdt_totalsize(kinfo->fdt));
 
     left = copy_to_guest_phys_flush_dcache(kinfo->d, kinfo->dtb_paddr,
                                            kinfo->fdt,
                                            fdt_totalsize(kinfo->fdt));
 
     if ( left != 0 )
-        panic("Unable to copy the DTB to dom0 memory (left = %lu bytes)\n", left);
+        panic("Unable to copy the DTB to %pd memory (left = %lu bytes)\n",
+              kinfo->d, left);
     xfree(kinfo->fdt);
 }