diff mbox series

[2/2] uboot-script-gen: do not enable direct mapping by default

Message ID 20220626184536.666647-2-burzalodowa@gmail.com (mailing list archive)
State New, archived
Headers show
Series [1/2] uboot-script-gen: prevent user mistakes due to DOM0_KERNEL becoming optional | expand

Commit Message

Xenia Ragiadakou June 26, 2022, 6:45 p.m. UTC
To be inline with XEN, do not enable direct mapping automatically for all
statically allocated domains.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
---
 README.md                | 4 ++--
 scripts/uboot-script-gen | 8 ++------
 2 files changed, 4 insertions(+), 8 deletions(-)

Comments

Ayan Kumar Halder June 27, 2022, 9:15 a.m. UTC | #1
On 26/06/2022 19:45, Xenia Ragiadakou wrote:
> To be inline with XEN, do not enable direct mapping automatically for all
> statically allocated domains.
>
> Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Reviewed-by: Ayan Kumar Halder <ayankuma@amd.com>
> ---
>   README.md                | 4 ++--
>   scripts/uboot-script-gen | 8 ++------
>   2 files changed, 4 insertions(+), 8 deletions(-)
>
> diff --git a/README.md b/README.md
> index cb15ca5..03e437b 100644
> --- a/README.md
> +++ b/README.md
> @@ -169,8 +169,8 @@ Where:
>     if specified, indicates the host physical address regions
>     [baseaddr, baseaddr + size) to be reserved to the VM for static allocation.
>   
> -- DOMU_DIRECT_MAP[number] can be set to 1 or 0.
> -  If set to 1, the VM is direct mapped. The default is 1.
> +- DOMU_DIRECT_MAP[number] if set to 1, enables direct mapping.
> +  By default, direct mapping is disabled.
>     This is only applicable when DOMU_STATIC_MEM is specified.
>   
>   - LINUX is optional but specifies the Linux kernel for when Xen is NOT
> diff --git a/scripts/uboot-script-gen b/scripts/uboot-script-gen
> index 085e29f..66ce6f7 100755
> --- a/scripts/uboot-script-gen
> +++ b/scripts/uboot-script-gen
> @@ -52,7 +52,7 @@ function dt_set()
>               echo "fdt set $path $var $array" >> $UBOOT_SOURCE
>           elif test $data_type = "bool"
>           then
> -            if test "$data" -eq 1
> +            if test "$data" == "1"
>               then
>                   echo "fdt set $path $var" >> $UBOOT_SOURCE
>               fi
> @@ -74,7 +74,7 @@ function dt_set()
>               fdtput $FDTEDIT -p -t s $path $var $data
>           elif test $data_type = "bool"
>           then
> -            if test "$data" -eq 1
> +            if test "$data" == "1"
>               then
>                   fdtput $FDTEDIT -p $path $var
>               fi
> @@ -491,10 +491,6 @@ function xen_config()
>           then
>               DOMU_CMD[$i]="console=ttyAMA0"
>           fi
> -        if test -z "${DOMU_DIRECT_MAP[$i]}"
> -        then
> -             DOMU_DIRECT_MAP[$i]=1
> -        fi
>           i=$(( $i + 1 ))
>       done
>   }
Stefano Stabellini June 29, 2022, 12:28 a.m. UTC | #2
On Sun, 26 Jun 2022, Xenia Ragiadakou wrote:
> To be inline with XEN, do not enable direct mapping automatically for all
> statically allocated domains.
> 
> Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>

Actually I don't know about this one. I think it is OK that ImageBuilder
defaults are different from Xen defaults. This is a case where I think
it would be good to enable DOMU_DIRECT_MAP by default when
DOMU_STATIC_MEM is specified.


> ---
>  README.md                | 4 ++--
>  scripts/uboot-script-gen | 8 ++------
>  2 files changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/README.md b/README.md
> index cb15ca5..03e437b 100644
> --- a/README.md
> +++ b/README.md
> @@ -169,8 +169,8 @@ Where:
>    if specified, indicates the host physical address regions
>    [baseaddr, baseaddr + size) to be reserved to the VM for static allocation.
>  
> -- DOMU_DIRECT_MAP[number] can be set to 1 or 0.
> -  If set to 1, the VM is direct mapped. The default is 1.
> +- DOMU_DIRECT_MAP[number] if set to 1, enables direct mapping.
> +  By default, direct mapping is disabled.
>    This is only applicable when DOMU_STATIC_MEM is specified.
>  
>  - LINUX is optional but specifies the Linux kernel for when Xen is NOT
> diff --git a/scripts/uboot-script-gen b/scripts/uboot-script-gen
> index 085e29f..66ce6f7 100755
> --- a/scripts/uboot-script-gen
> +++ b/scripts/uboot-script-gen
> @@ -52,7 +52,7 @@ function dt_set()
>              echo "fdt set $path $var $array" >> $UBOOT_SOURCE
>          elif test $data_type = "bool"
>          then
> -            if test "$data" -eq 1
> +            if test "$data" == "1"
>              then
>                  echo "fdt set $path $var" >> $UBOOT_SOURCE
>              fi
> @@ -74,7 +74,7 @@ function dt_set()
>              fdtput $FDTEDIT -p -t s $path $var $data
>          elif test $data_type = "bool"
>          then
> -            if test "$data" -eq 1
> +            if test "$data" == "1"
>              then
>                  fdtput $FDTEDIT -p $path $var
>              fi
> @@ -491,10 +491,6 @@ function xen_config()
>          then
>              DOMU_CMD[$i]="console=ttyAMA0"
>          fi
> -        if test -z "${DOMU_DIRECT_MAP[$i]}"
> -        then
> -             DOMU_DIRECT_MAP[$i]=1
> -        fi
>          i=$(( $i + 1 ))
>      done
>  }
> -- 
> 2.34.1
>
Xenia Ragiadakou June 29, 2022, 5:01 p.m. UTC | #3
Hi Stefano,

On 6/29/22 03:28, Stefano Stabellini wrote:
> On Sun, 26 Jun 2022, Xenia Ragiadakou wrote:
>> To be inline with XEN, do not enable direct mapping automatically for all
>> statically allocated domains.
>>
>> Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
> Actually I don't know about this one. I think it is OK that ImageBuilder
> defaults are different from Xen defaults. This is a case where I think
> it would be good to enable DOMU_DIRECT_MAP by default when
> DOMU_STATIC_MEM is specified.
Just realized that I forgot to add [ImageBuilder] tag to the patches. 
Sorry about that.

I cc Ayan, since the change was suggested by him.
I have no strong preference on the default value.

Xenia

>> ---
>>   README.md                | 4 ++--
>>   scripts/uboot-script-gen | 8 ++------
>>   2 files changed, 4 insertions(+), 8 deletions(-)
>>
>> diff --git a/README.md b/README.md
>> index cb15ca5..03e437b 100644
>> --- a/README.md
>> +++ b/README.md
>> @@ -169,8 +169,8 @@ Where:
>>     if specified, indicates the host physical address regions
>>     [baseaddr, baseaddr + size) to be reserved to the VM for static allocation.
>>   
>> -- DOMU_DIRECT_MAP[number] can be set to 1 or 0.
>> -  If set to 1, the VM is direct mapped. The default is 1.
>> +- DOMU_DIRECT_MAP[number] if set to 1, enables direct mapping.
>> +  By default, direct mapping is disabled.
>>     This is only applicable when DOMU_STATIC_MEM is specified.
>>   
>>   - LINUX is optional but specifies the Linux kernel for when Xen is NOT
>> diff --git a/scripts/uboot-script-gen b/scripts/uboot-script-gen
>> index 085e29f..66ce6f7 100755
>> --- a/scripts/uboot-script-gen
>> +++ b/scripts/uboot-script-gen
>> @@ -52,7 +52,7 @@ function dt_set()
>>               echo "fdt set $path $var $array" >> $UBOOT_SOURCE
>>           elif test $data_type = "bool"
>>           then
>> -            if test "$data" -eq 1
>> +            if test "$data" == "1"
>>               then
>>                   echo "fdt set $path $var" >> $UBOOT_SOURCE
>>               fi
>> @@ -74,7 +74,7 @@ function dt_set()
>>               fdtput $FDTEDIT -p -t s $path $var $data
>>           elif test $data_type = "bool"
>>           then
>> -            if test "$data" -eq 1
>> +            if test "$data" == "1"
>>               then
>>                   fdtput $FDTEDIT -p $path $var
>>               fi
>> @@ -491,10 +491,6 @@ function xen_config()
>>           then
>>               DOMU_CMD[$i]="console=ttyAMA0"
>>           fi
>> -        if test -z "${DOMU_DIRECT_MAP[$i]}"
>> -        then
>> -             DOMU_DIRECT_MAP[$i]=1
>> -        fi
>>           i=$(( $i + 1 ))
>>       done
>>   }
>> -- 
>> 2.34.1
>>
Ayan Kumar Halder June 29, 2022, 7:02 p.m. UTC | #4
Hi Stefano/Xenia,

On 29/06/2022 18:01, xenia wrote:
> Hi Stefano,
>
> On 6/29/22 03:28, Stefano Stabellini wrote:
>> On Sun, 26 Jun 2022, Xenia Ragiadakou wrote:
>>> To be inline with XEN, do not enable direct mapping automatically 
>>> for all
>>> statically allocated domains.
>>>
>>> Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
>> Actually I don't know about this one. I think it is OK that ImageBuilder
>> defaults are different from Xen defaults. This is a case where I think
>> it would be good to enable DOMU_DIRECT_MAP by default when
>> DOMU_STATIC_MEM is specified.
> Just realized that I forgot to add [ImageBuilder] tag to the patches. 
> Sorry about that.

@Stefano, why do you wish the Imagebuilder's behaviour to differ from 
Xen ? Is there any use-case that helps.

- Ayan

>
> I cc Ayan, since the change was suggested by him.
> I have no strong preference on the default value.
>
> Xenia
>
>>> ---
>>>   README.md                | 4 ++--
>>>   scripts/uboot-script-gen | 8 ++------
>>>   2 files changed, 4 insertions(+), 8 deletions(-)
>>>
>>> diff --git a/README.md b/README.md
>>> index cb15ca5..03e437b 100644
>>> --- a/README.md
>>> +++ b/README.md
>>> @@ -169,8 +169,8 @@ Where:
>>>     if specified, indicates the host physical address regions
>>>     [baseaddr, baseaddr + size) to be reserved to the VM for static 
>>> allocation.
>>>   -- DOMU_DIRECT_MAP[number] can be set to 1 or 0.
>>> -  If set to 1, the VM is direct mapped. The default is 1.
>>> +- DOMU_DIRECT_MAP[number] if set to 1, enables direct mapping.
>>> +  By default, direct mapping is disabled.
>>>     This is only applicable when DOMU_STATIC_MEM is specified.
>>>     - LINUX is optional but specifies the Linux kernel for when Xen 
>>> is NOT
>>> diff --git a/scripts/uboot-script-gen b/scripts/uboot-script-gen
>>> index 085e29f..66ce6f7 100755
>>> --- a/scripts/uboot-script-gen
>>> +++ b/scripts/uboot-script-gen
>>> @@ -52,7 +52,7 @@ function dt_set()
>>>               echo "fdt set $path $var $array" >> $UBOOT_SOURCE
>>>           elif test $data_type = "bool"
>>>           then
>>> -            if test "$data" -eq 1
>>> +            if test "$data" == "1"
>>>               then
>>>                   echo "fdt set $path $var" >> $UBOOT_SOURCE
>>>               fi
>>> @@ -74,7 +74,7 @@ function dt_set()
>>>               fdtput $FDTEDIT -p -t s $path $var $data
>>>           elif test $data_type = "bool"
>>>           then
>>> -            if test "$data" -eq 1
>>> +            if test "$data" == "1"
>>>               then
>>>                   fdtput $FDTEDIT -p $path $var
>>>               fi
>>> @@ -491,10 +491,6 @@ function xen_config()
>>>           then
>>>               DOMU_CMD[$i]="console=ttyAMA0"
>>>           fi
>>> -        if test -z "${DOMU_DIRECT_MAP[$i]}"
>>> -        then
>>> -             DOMU_DIRECT_MAP[$i]=1
>>> -        fi
>>>           i=$(( $i + 1 ))
>>>       done
>>>   }
>>> -- 
>>> 2.34.1
>>>
Stefano Stabellini June 29, 2022, 8:28 p.m. UTC | #5
On Wed, 29 Jun 2022, Ayan Kumar Halder wrote:
> Hi Stefano/Xenia,
> 
> On 29/06/2022 18:01, xenia wrote:
> > Hi Stefano,
> > 
> > On 6/29/22 03:28, Stefano Stabellini wrote:
> > > On Sun, 26 Jun 2022, Xenia Ragiadakou wrote:
> > > > To be inline with XEN, do not enable direct mapping automatically for
> > > > all
> > > > statically allocated domains.
> > > > 
> > > > Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
> > > Actually I don't know about this one. I think it is OK that ImageBuilder
> > > defaults are different from Xen defaults. This is a case where I think
> > > it would be good to enable DOMU_DIRECT_MAP by default when
> > > DOMU_STATIC_MEM is specified.
> > Just realized that I forgot to add [ImageBuilder] tag to the patches. Sorry
> > about that.
> 
> @Stefano, why do you wish the Imagebuilder's behaviour to differ from Xen ? Is
> there any use-case that helps.

As background, ImageBuilder is meant to be very simple to use especially
for the most common configurations. In fact, I think ImageBuilder
doesn't necessarely have to support all the options that Xen offers,
only the most common and important.

If someone wants an esoteric option, they can always edit the generated
boot.source and make any necessary changes. I make sure to explain that
editing boot.source is always a possibility in all the talks I gave
about ImageBuilder.

Now to answer the specific question. I am positive that the most common
configuration for people that wants static memory is to have direct_map.
That is because the two go hand-in-hand in configuration where the IOMMU
is not used. So I think that from an ImageBuilder perspective direct_map
should default to enabled when static memory is requested. It can always
be disabled, both using DOMU_DIRECT_MAP, or editing boot.source.


> > I cc Ayan, since the change was suggested by him.
> > I have no strong preference on the default value.
> > 
> > Xenia
> > 
> > > > ---
> > > >   README.md                | 4 ++--
> > > >   scripts/uboot-script-gen | 8 ++------
> > > >   2 files changed, 4 insertions(+), 8 deletions(-)
> > > > 
> > > > diff --git a/README.md b/README.md
> > > > index cb15ca5..03e437b 100644
> > > > --- a/README.md
> > > > +++ b/README.md
> > > > @@ -169,8 +169,8 @@ Where:
> > > >     if specified, indicates the host physical address regions
> > > >     [baseaddr, baseaddr + size) to be reserved to the VM for static
> > > > allocation.
> > > >   -- DOMU_DIRECT_MAP[number] can be set to 1 or 0.
> > > > -  If set to 1, the VM is direct mapped. The default is 1.
> > > > +- DOMU_DIRECT_MAP[number] if set to 1, enables direct mapping.
> > > > +  By default, direct mapping is disabled.
> > > >     This is only applicable when DOMU_STATIC_MEM is specified.
> > > >     - LINUX is optional but specifies the Linux kernel for when Xen is
> > > > NOT
> > > > diff --git a/scripts/uboot-script-gen b/scripts/uboot-script-gen
> > > > index 085e29f..66ce6f7 100755
> > > > --- a/scripts/uboot-script-gen
> > > > +++ b/scripts/uboot-script-gen
> > > > @@ -52,7 +52,7 @@ function dt_set()
> > > >               echo "fdt set $path $var $array" >> $UBOOT_SOURCE
> > > >           elif test $data_type = "bool"
> > > >           then
> > > > -            if test "$data" -eq 1
> > > > +            if test "$data" == "1"
> > > >               then
> > > >                   echo "fdt set $path $var" >> $UBOOT_SOURCE
> > > >               fi
> > > > @@ -74,7 +74,7 @@ function dt_set()
> > > >               fdtput $FDTEDIT -p -t s $path $var $data
> > > >           elif test $data_type = "bool"
> > > >           then
> > > > -            if test "$data" -eq 1
> > > > +            if test "$data" == "1"
> > > >               then
> > > >                   fdtput $FDTEDIT -p $path $var
> > > >               fi
> > > > @@ -491,10 +491,6 @@ function xen_config()
> > > >           then
> > > >               DOMU_CMD[$i]="console=ttyAMA0"
> > > >           fi
> > > > -        if test -z "${DOMU_DIRECT_MAP[$i]}"
> > > > -        then
> > > > -             DOMU_DIRECT_MAP[$i]=1
> > > > -        fi
> > > >           i=$(( $i + 1 ))
> > > >       done
> > > >   }
> > > > -- 
> > > > 2.34.1
> > > > 
>
Ayan Kumar Halder June 30, 2022, 11:28 a.m. UTC | #6
On 29/06/2022 21:28, Stefano Stabellini wrote:
> On Wed, 29 Jun 2022, Ayan Kumar Halder wrote:
>> Hi Stefano/Xenia,
>>
>> On 29/06/2022 18:01, xenia wrote:
>>> Hi Stefano,
>>>
>>> On 6/29/22 03:28, Stefano Stabellini wrote:
>>>> On Sun, 26 Jun 2022, Xenia Ragiadakou wrote:
>>>>> To be inline with XEN, do not enable direct mapping automatically for
>>>>> all
>>>>> statically allocated domains.
>>>>>
>>>>> Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
>>>> Actually I don't know about this one. I think it is OK that ImageBuilder
>>>> defaults are different from Xen defaults. This is a case where I think
>>>> it would be good to enable DOMU_DIRECT_MAP by default when
>>>> DOMU_STATIC_MEM is specified.
>>> Just realized that I forgot to add [ImageBuilder] tag to the patches. Sorry
>>> about that.
>> @Stefano, why do you wish the Imagebuilder's behaviour to differ from Xen ? Is
>> there any use-case that helps.
> As background, ImageBuilder is meant to be very simple to use especially
> for the most common configurations. In fact, I think ImageBuilder
> doesn't necessarely have to support all the options that Xen offers,
> only the most common and important.
>
> If someone wants an esoteric option, they can always edit the generated
> boot.source and make any necessary changes. I make sure to explain that
> editing boot.source is always a possibility in all the talks I gave
> about ImageBuilder.
>
> Now to answer the specific question. I am positive that the most common
> configuration for people that wants static memory is to have direct_map.
> That is because the two go hand-in-hand in configuration where the IOMMU
> is not used. So I think that from an ImageBuilder perspective direct_map
> should default to enabled when static memory is requested. It can always
> be disabled, both using DOMU_DIRECT_MAP, or editing boot.source.

Many thanks for the explanation. This makes sense.

I think this patch can be dropped then.

Xenia, apologies for suggesting you to do this in the first place.

- Ayan

>
>
>>> I cc Ayan, since the change was suggested by him.
>>> I have no strong preference on the default value.
>>>
>>> Xenia
>>>
>>>>> ---
>>>>>    README.md                | 4 ++--
>>>>>    scripts/uboot-script-gen | 8 ++------
>>>>>    2 files changed, 4 insertions(+), 8 deletions(-)
>>>>>
>>>>> diff --git a/README.md b/README.md
>>>>> index cb15ca5..03e437b 100644
>>>>> --- a/README.md
>>>>> +++ b/README.md
>>>>> @@ -169,8 +169,8 @@ Where:
>>>>>      if specified, indicates the host physical address regions
>>>>>      [baseaddr, baseaddr + size) to be reserved to the VM for static
>>>>> allocation.
>>>>>    -- DOMU_DIRECT_MAP[number] can be set to 1 or 0.
>>>>> -  If set to 1, the VM is direct mapped. The default is 1.
>>>>> +- DOMU_DIRECT_MAP[number] if set to 1, enables direct mapping.
>>>>> +  By default, direct mapping is disabled.
>>>>>      This is only applicable when DOMU_STATIC_MEM is specified.
>>>>>      - LINUX is optional but specifies the Linux kernel for when Xen is
>>>>> NOT
>>>>> diff --git a/scripts/uboot-script-gen b/scripts/uboot-script-gen
>>>>> index 085e29f..66ce6f7 100755
>>>>> --- a/scripts/uboot-script-gen
>>>>> +++ b/scripts/uboot-script-gen
>>>>> @@ -52,7 +52,7 @@ function dt_set()
>>>>>                echo "fdt set $path $var $array" >> $UBOOT_SOURCE
>>>>>            elif test $data_type = "bool"
>>>>>            then
>>>>> -            if test "$data" -eq 1
>>>>> +            if test "$data" == "1"
>>>>>                then
>>>>>                    echo "fdt set $path $var" >> $UBOOT_SOURCE
>>>>>                fi
>>>>> @@ -74,7 +74,7 @@ function dt_set()
>>>>>                fdtput $FDTEDIT -p -t s $path $var $data
>>>>>            elif test $data_type = "bool"
>>>>>            then
>>>>> -            if test "$data" -eq 1
>>>>> +            if test "$data" == "1"
>>>>>                then
>>>>>                    fdtput $FDTEDIT -p $path $var
>>>>>                fi
>>>>> @@ -491,10 +491,6 @@ function xen_config()
>>>>>            then
>>>>>                DOMU_CMD[$i]="console=ttyAMA0"
>>>>>            fi
>>>>> -        if test -z "${DOMU_DIRECT_MAP[$i]}"
>>>>> -        then
>>>>> -             DOMU_DIRECT_MAP[$i]=1
>>>>> -        fi
>>>>>            i=$(( $i + 1 ))
>>>>>        done
>>>>>    }
>>>>> -- 
>>>>> 2.34.1
>>>>>
Xenia Ragiadakou June 30, 2022, 11:46 a.m. UTC | #7
Hi Ayan,

On 6/30/22 14:28, Ayan Kumar Halder wrote:
>
> On 29/06/2022 21:28, Stefano Stabellini wrote:
>> On Wed, 29 Jun 2022, Ayan Kumar Halder wrote:
>>> Hi Stefano/Xenia,
>>>
>>> On 29/06/2022 18:01, xenia wrote:
>>>> Hi Stefano,
>>>>
>>>> On 6/29/22 03:28, Stefano Stabellini wrote:
>>>>> On Sun, 26 Jun 2022, Xenia Ragiadakou wrote:
>>>>>> To be inline with XEN, do not enable direct mapping automatically 
>>>>>> for
>>>>>> all
>>>>>> statically allocated domains.
>>>>>>
>>>>>> Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
>>>>> Actually I don't know about this one. I think it is OK that 
>>>>> ImageBuilder
>>>>> defaults are different from Xen defaults. This is a case where I 
>>>>> think
>>>>> it would be good to enable DOMU_DIRECT_MAP by default when
>>>>> DOMU_STATIC_MEM is specified.
>>>> Just realized that I forgot to add [ImageBuilder] tag to the 
>>>> patches. Sorry
>>>> about that.
>>> @Stefano, why do you wish the Imagebuilder's behaviour to differ 
>>> from Xen ? Is
>>> there any use-case that helps.
>> As background, ImageBuilder is meant to be very simple to use especially
>> for the most common configurations. In fact, I think ImageBuilder
>> doesn't necessarely have to support all the options that Xen offers,
>> only the most common and important.
>>
>> If someone wants an esoteric option, they can always edit the generated
>> boot.source and make any necessary changes. I make sure to explain that
>> editing boot.source is always a possibility in all the talks I gave
>> about ImageBuilder.
>>
>> Now to answer the specific question. I am positive that the most common
>> configuration for people that wants static memory is to have direct_map.
>> That is because the two go hand-in-hand in configuration where the IOMMU
>> is not used. So I think that from an ImageBuilder perspective direct_map
>> should default to enabled when static memory is requested. It can always
>> be disabled, both using DOMU_DIRECT_MAP, or editing boot.source.
>
> Many thanks for the explanation. This makes sense.
>
> I think this patch can be dropped then.
>
> Xenia, apologies for suggesting you to do this in the first place.

No worries, it 's all part of the process :)

> - Ayan
>
>>
>>>> I cc Ayan, since the change was suggested by him.
>>>> I have no strong preference on the default value.
>>>>
>>>> Xenia
>>>>
>>>>>> ---
>>>>>>    README.md                | 4 ++--
>>>>>>    scripts/uboot-script-gen | 8 ++------
>>>>>>    2 files changed, 4 insertions(+), 8 deletions(-)
>>>>>>
>>>>>> diff --git a/README.md b/README.md
>>>>>> index cb15ca5..03e437b 100644
>>>>>> --- a/README.md
>>>>>> +++ b/README.md
>>>>>> @@ -169,8 +169,8 @@ Where:
>>>>>>      if specified, indicates the host physical address regions
>>>>>>      [baseaddr, baseaddr + size) to be reserved to the VM for static
>>>>>> allocation.
>>>>>>    -- DOMU_DIRECT_MAP[number] can be set to 1 or 0.
>>>>>> -  If set to 1, the VM is direct mapped. The default is 1.
>>>>>> +- DOMU_DIRECT_MAP[number] if set to 1, enables direct mapping.
>>>>>> +  By default, direct mapping is disabled.
>>>>>>      This is only applicable when DOMU_STATIC_MEM is specified.
>>>>>>      - LINUX is optional but specifies the Linux kernel for when 
>>>>>> Xen is
>>>>>> NOT
>>>>>> diff --git a/scripts/uboot-script-gen b/scripts/uboot-script-gen
>>>>>> index 085e29f..66ce6f7 100755
>>>>>> --- a/scripts/uboot-script-gen
>>>>>> +++ b/scripts/uboot-script-gen
>>>>>> @@ -52,7 +52,7 @@ function dt_set()
>>>>>>                echo "fdt set $path $var $array" >> $UBOOT_SOURCE
>>>>>>            elif test $data_type = "bool"
>>>>>>            then
>>>>>> -            if test "$data" -eq 1
>>>>>> +            if test "$data" == "1"
>>>>>>                then
>>>>>>                    echo "fdt set $path $var" >> $UBOOT_SOURCE
>>>>>>                fi
>>>>>> @@ -74,7 +74,7 @@ function dt_set()
>>>>>>                fdtput $FDTEDIT -p -t s $path $var $data
>>>>>>            elif test $data_type = "bool"
>>>>>>            then
>>>>>> -            if test "$data" -eq 1
>>>>>> +            if test "$data" == "1"
>>>>>>                then
>>>>>>                    fdtput $FDTEDIT -p $path $var
>>>>>>                fi
>>>>>> @@ -491,10 +491,6 @@ function xen_config()
>>>>>>            then
>>>>>>                DOMU_CMD[$i]="console=ttyAMA0"
>>>>>>            fi
>>>>>> -        if test -z "${DOMU_DIRECT_MAP[$i]}"
>>>>>> -        then
>>>>>> -             DOMU_DIRECT_MAP[$i]=1
>>>>>> -        fi
>>>>>>            i=$(( $i + 1 ))
>>>>>>        done
>>>>>>    }
>>>>>> -- 
>>>>>> 2.34.1
>>>>>>
diff mbox series

Patch

diff --git a/README.md b/README.md
index cb15ca5..03e437b 100644
--- a/README.md
+++ b/README.md
@@ -169,8 +169,8 @@  Where:
   if specified, indicates the host physical address regions
   [baseaddr, baseaddr + size) to be reserved to the VM for static allocation.
 
-- DOMU_DIRECT_MAP[number] can be set to 1 or 0.
-  If set to 1, the VM is direct mapped. The default is 1.
+- DOMU_DIRECT_MAP[number] if set to 1, enables direct mapping.
+  By default, direct mapping is disabled.
   This is only applicable when DOMU_STATIC_MEM is specified.
 
 - LINUX is optional but specifies the Linux kernel for when Xen is NOT
diff --git a/scripts/uboot-script-gen b/scripts/uboot-script-gen
index 085e29f..66ce6f7 100755
--- a/scripts/uboot-script-gen
+++ b/scripts/uboot-script-gen
@@ -52,7 +52,7 @@  function dt_set()
             echo "fdt set $path $var $array" >> $UBOOT_SOURCE
         elif test $data_type = "bool"
         then
-            if test "$data" -eq 1
+            if test "$data" == "1"
             then
                 echo "fdt set $path $var" >> $UBOOT_SOURCE
             fi
@@ -74,7 +74,7 @@  function dt_set()
             fdtput $FDTEDIT -p -t s $path $var $data
         elif test $data_type = "bool"
         then
-            if test "$data" -eq 1
+            if test "$data" == "1"
             then
                 fdtput $FDTEDIT -p $path $var
             fi
@@ -491,10 +491,6 @@  function xen_config()
         then
             DOMU_CMD[$i]="console=ttyAMA0"
         fi
-        if test -z "${DOMU_DIRECT_MAP[$i]}"
-        then
-             DOMU_DIRECT_MAP[$i]=1
-        fi
         i=$(( $i + 1 ))
     done
 }