From mboxrd@z Thu Jan 1 00:00:00 1970 From: Graf, Alexander Date: Tue, 7 May 2019 11:47:26 +0200 Subject: [U-Boot] [PATCH v2 1/1] efi_loader: optional data in load options are binary In-Reply-To: <20190507073046.GI11160@linaro.org> References: <20190430061115.29960-1-xypron.glpk@gmx.de> <20190507015308.GA11160@linaro.org> <6974f8d4-1b1a-1414-0a04-dcd8e4248476@gmx.de> <20190507061610.GG11160@linaro.org> <20190507073046.GI11160@linaro.org> Message-ID: <00b2f550-3f7e-ba7d-e75a-a582d087906e@amazon.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 07.05.19 09:30, Takahiro Akashi wrote: > On Tue, May 07, 2019 at 09:12:56AM +0200, Heinrich Schuchardt wrote: >> On 5/7/19 8:16 AM, Takahiro Akashi wrote: >>> On Tue, May 07, 2019 at 08:04:26AM +0200, Heinrich Schuchardt wrote: >>>> On 5/7/19 7:16 AM, Heinrich Schuchardt wrote: >>>>> On 5/7/19 3:53 AM, Takahiro Akashi wrote: >>>>>> On Tue, Apr 30, 2019 at 08:11:15AM +0200, Heinrich Schuchardt wrote: >>>>>>> The field boot OptionalData in structure _EFI_LOAD_OPTIONS is for binary >>>>>>> data. >>>>>>> >>>>>>> When we use `efidebug boot add` we should convert the 5th argument from >>>>>>> UTF-8 to UTF-16 before putting it into the BootXXXX variable. >>>>>> While optional_data holds u8 string in calling >>>>>> efi_serialize_load_option(), >>>>>> it holds u16 string in leaving from efi_deserialize_load_option(). >>>>>> We should handle it in a consistent way if you want to keep optional_data >>>>>> as "const u8." >>>> When communicating with Linux optional data may contain a u16 string. >>>> But I cannot see were our coding is inconsistent. >>> I don't get your point. >>> Do you want to allow 'u8 *' variable to hold u16 string?# >> Yes, optional data may contain anything, in the case of Linux the >> command line parameters as an u16 string. >> >> Other operating systems may use the field in other ways, e.g. store an >> ASCII string. > The problem is that with your patch optional_data is *always* converted > to utf-16 as far as we use efidebug. > My efidebug is not for linux only. So what does the UEFI Shell do for command argument passing? Does it always pass in a utf16 string? If so, why? Alex