[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ImageBuilder] uboot-script-gen: add xen xsm policy loading support


  • To: Alejandro Vallejo <agarciav@xxxxxxx>, Grygorii Strashko <grygorii_strashko@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Alejandro Vallejo <agarciav@xxxxxxx>
  • Date: Mon, 14 Apr 2025 13:24:13 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=epam.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qPBFSCkPwEyt4xEun8kkvsk1OUxcEL0E95EMZNUr4lU=; b=ft5NI1YpnBjm8WPJTv0Tbnz8J7i6nidu/9v0Mc5OVp/75CG2t6QvoEgv5O/mN3Pz0zBF4Flok5ntPggjVAyOJNuaDB8DTc936VIMTGMEzqctGnS1RG4FGJ/vkiB5hVdi8ewMlpC66s/qPT+r9XsYQNHF7RaciIb5ngYy+Ygz2aYDEpu5Qb8Uchs0pUslOY7pY5wfd5xm9XuJ3FW7i+9c5FJ3bMkapCKIcld2N3nXLWj71NHzVI6JzL4OV6/1IZt/OPPoeaOB4X5tBHWU3Sf0/9IfDupmTCzlrLh/Bvcg/E55xHNPrUSsx6wM1N7Uyvj6GYF77R2IIwUkIhee8ygqjQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=sJ+ZNIwKx6FuSzPj2ijXpqRFWLHv04E52WmMPQ/FIzUB59dHtp4+xoBwFf/O5nxDPx/dbHsHaUz45czKhhtxtMQyoWlqm/6IpgDIegYxX0sZmMFv5P272nkUwRjhgXDfWa2Ur3ZT75r2lGOQICWilUHR2jG30uLNdIM9VnxpL5IRcZKuv5GJyBkCP7CkgGSCZBQqBOg1go8vdyBCQ11+VBKMunRnRVcsKCXVCE86XJvnzsNDVm6ZmnWutw0Vr+h7S9ioxp+hx6B38mOJXqJvD7nN41S8OwEjjwIfWZUzfdLZfxMIhoWCqiMizXNULve7H/dpDe5ETAu7iH4A2Cf7+Q==
  • Cc: Oleksandr Tyshchenko <Oleksandr_Tyshchenko@xxxxxxxx>, Xen-devel <xen-devel-bounces@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 14 Apr 2025 12:24:31 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Mon Apr 14, 2025 at 12:57 PM BST, Alejandro Vallejo wrote:
> As a general question, why using "test" so much, rather than
>
>    if [ -n "$FOO" -a "FOO" == ABC ]
>
> Using test seems far harder to read than it needs to be, and single
> brackets are perfectly valid POSIX shell.
>
> On Mon Apr 14, 2025 at 9:14 AM BST, Grygorii Strashko wrote:
>> From: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
>>
>> This patch adds Xen XSM policy loading support.
>>
>> The configuration file XEN_POLICY specifies Xen hypervisor
>> XSM policy binary to load.
>>
>> Signed-off-by: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
>> ---
>>  README.md                |  2 ++
>>  scripts/uboot-script-gen | 33 +++++++++++++++++++++++++++++++++
>>  2 files changed, 35 insertions(+)
>>
>> diff --git a/README.md b/README.md
>> index 137abef153ce..9106d2a07302 100644
>> --- a/README.md
>> +++ b/README.md
>> @@ -91,6 +91,8 @@ Where:
>>  - XEN specifies the Xen hypervisor binary to load. Note that it has to
>>    be a regular Xen binary, not a u-boot binary.
>>  
>> +- XEN_POLICY specifies the Xen hypervisor XSM policy binary to load.
>> +
>>  - XEN_COLORS specifies the colors (cache coloring) to be used for Xen
>>    and is in the format startcolor-endcolor
>>  
>> diff --git a/scripts/uboot-script-gen b/scripts/uboot-script-gen
>> index c4d26caf5e0e..343eba20e4d9 100755
>> --- a/scripts/uboot-script-gen
>> +++ b/scripts/uboot-script-gen
>> @@ -315,6 +315,15 @@ function xen_device_tree_editing()
>>      dt_set "/chosen" "#size-cells" "hex" "0x2"
>>      dt_set "/chosen" "xen,xen-bootargs" "str" "$XEN_CMD"
>>  
>> +    if test "$XEN_POLICY" && test $xen_policy_addr != "-"
>
> If XEN_POLICY is a binary, shouldn't it be "test -f" ? Same later on.

On the absent flag:

Nevermind, I see you're using "-n" implicitly instead. I'd rather it be
less opaque, but it does function. I do think most uses of test "$FOO"
would be better off with an explicit -f or -n. But that's a separate
matter.

Cheers,
Alejandro



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.