From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yb1-f171.google.com (mail-yb1-f171.google.com [209.85.219.171]) by mx.groups.io with SMTP id smtpd.web12.7074.1617199126189719229 for ; Wed, 31 Mar 2021 06:58:46 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IHYuaUSz; spf=pass (domain: gmail.com, ip: 209.85.219.171, mailfrom: edk.dan@gmail.com) Received: by mail-yb1-f171.google.com with SMTP id j2so21272808ybj.8; Wed, 31 Mar 2021 06:58:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=kwQpCAIC97SR2quVt4o0e0DGByhPmbMJvQdiRslkGyQ=; b=IHYuaUSzAbld9HQ7W/Wx8XHjPEJp8wLWIvFrhTKaGYDhsCTOmMhJMM+xDaYQPAtUUu /vIkDWrSQLjRmUZuX64DmT8ZX1RrgBPRIuoU5wI+HMCyTmPzxDbVzuNr2AZ9P/62jUvJ E1i55IMpw/+KMBR6Qs3XDyXDRy/SC7DadzxAraKcefbwyALSqegFIPS78Ye1Uz8ktWZ4 r4oUyb3qgf9hLbiDZvEmtFkRZER5g2a5t+GPXK3XMjKVtastWHQsGubw9J0TM68/KKoR 15JDxXtZlWqTDiRGZ+bpKlGtek6f7Up+w3zmlNL/PR2wYcfP5NfSUtCJwNEfPTAjJK1J 6RFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=kwQpCAIC97SR2quVt4o0e0DGByhPmbMJvQdiRslkGyQ=; b=Kp8qnaPnSAcI+XqAC/a6HHDOyjgdKIBZkYYWJxRaUWpHU36iWJV7p/ApZPXdepFQjh 0Un34oswekh9anoasyjTYoLxTKDkgHhXkSxTClAYsvvJbkX3BvX9x0v+mfOrlrrmYgab YabtYpft22p/Iwp2CjQwfBHvsb5/j8krHX09CVIvmLvmDVKExKRPW8ppdOAlO5JWMIGr UTIEPid/gRr8y/WC1KZi98jyftm65pwVJbxGe9WC+MqIeJz3c6rnZIgTj5ry+gD5/olP CKjic+AtQA5PntPIZnMBc7FszChfyA6Rm7tx6NmitSso5bffrv4TZNzs3PKnMZEIaBgV i8Wg== X-Gm-Message-State: AOAM5330p8Nc157LrKSK9wF8RNDvYsA5g41KY0GevaZrkeIiD4sXS1tH C9l5MAnx9/v1qzq70Z+Bu5F+vmQ/1McwyFv9J5BLo4ERNoU= X-Google-Smtp-Source: ABdhPJyJhBLMhLgQSP+NJzCBi4IcIygIROfYlsWKWl/waCTB9Do61pRwvKkfYLVuwl53axur+2ZXljZEh+Iia7tQz9s= X-Received: by 2002:a25:da54:: with SMTP id n81mr4988561ybf.381.1617199125282; Wed, 31 Mar 2021 06:58:45 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: "EDK" Date: Wed, 31 Mar 2021 09:58:34 -0400 Message-ID: Subject: Re: Driver health : Posting message in MessageList To: discuss@edk2.groups.io, devel@edk2.groups.io, michael.d.kinney@intel.com Cc: daniel.samuelraj@broadcom.com Content-Type: multipart/alternative; boundary="00000000000064c49205bed5835f" --00000000000064c49205bed5835f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable + Mike On Tue, Mar 30, 2021 at 1:56 AM EDK wrote: > Hi , > > For our products, we have UEFI Driver and HII Driver as two separate > images (this is a requirement for our product because we want to keep UEF= I > Driver as thin as possible). > > - Main role of UEFI Driver is providing boot services, > reporting/solving health issues, posting messages in message list, EXT= SPT > etc. > > FYI: UEFI Driver will install HII Config access protocol (*CAP*) and > driver health formset on the controller handle if the controller has heal= th > issue; at this time, HII image won't be in picture (HII image come into > play ONLY when controller is healthy); if UEFI Driver detects controller = is > healthy then it will not install HII Config access protocol (if it had > installed, it would uninstall before loading HII image from controller > flash to host) > > Note: We have our own API to load the HII Image from controller flash to > host > > - Role of HII is, installing HII config access protocol and Management > formset on the controller handle and allowing the user to view > controller/PD/VD/other hardware properties, perform various > controller/PD/VD level operations etc. > > > > Requirement (need to see whether this is feasible or not): There are case= s > where our controller is healthy but we would like to post certain > informational messages in messageList. > > How do I achieve this? That is I want UEFI Driver to have the capability > to post the message in messageList and our HII Image also to be > loaded/present. > > > > Can UEFI Driver and HII driver install HII Config access protocol on the > same handle? AFAIK, the answer is =E2=80=9Cno=E2=80=9D. > > I experimented just adding the driver health formset to the package via > the HiiAddPackages() on the controller handle (that is from UEFI Driver I > was not installing HII CAP but just installed the formset on controller > handle) and it is not working. In this case HII image is also loaded (thi= s > means HII image would have installed HII CAP and its own formset on the > same controller handle). > > > > Appreciate your input. > > > > Thanks, > > Daniel > > Backup: > > *Excerpt from UEFI Spec: * > > *MessageList *A pointer to an array of warning or error messages ass= o > ciated with > > the controller specified by *ControllerHandle *and *ChildHandle*. > > This is an optional parameter that may be *NULL*. *M**essageList *is > > allocated by this function with the EFI Boot Service > > *AllocatePool()*, and it is the caller=E2=80=99s responsibility to free > > *MessageList *with the EFI Boot Service *F**reePool()*. Each > > message is specified by tuple of an *EFI_HII_HANDLE *and an > > *EFI_STRING_ID*. The array of messages is terminated by tuple > > containing a *EFI_HII_HANDLE *with a value of *NULL*. The > > *EFI_HII_STRING_PROTOCOL.GetString() *function can be used > > to retrieve the warning or error message as a Null-terminated string > > in a specific language. Messages may be returned for any of the > > *HealthStatus *values except > > *EfiDriverHealthStatusReconnectRequired *and > > *EfiDriverHealthStatusRebootRequired*. > > *FormHiiHandle *A pointer to the HII handle containing the HII form > used when configuration is required. The HII handle is associated with th= e > controller specified by *ControllerHandle *and > > *C**hildHandle*. If this is *N**ULL*, then no HII form is available. An > HII handle will only be returned with a *HealthStatus *value of > > *E**fiDriverHealthStatusConfigurationRequired*. > > > > =E2=80=A6 > > > > > > > > If *MessageList *is not *NULL*, and *HealthStatu**s *is *EfiDriverHealthS= tatusReconnectRequired > *or *EfiDriverHealthStatusRebootRequired *then no messages are returned > and **MessageList *must be set to *NULL*. > > If *MessageList *is not *NULL*, and there are no warning or error > messages associated with the controller specified by *ControllerHandle *a= nd > *ChildHandle*, then **MessageList *must be set to *NULL*. > > If *MessageList *is not *NULL*, and there are one or more warning or > error messages associated with the controller specified by *ControllerHan= dle > *and *ChildHandle*, then **MessageList *must point to a buffer allocated > with the EFI Boot Service *AllocatePool()*. The number of *EFI_DRIVER_HEA= LTH_HII_MESSAGE > *structures allocated in the buffer must be one more than the total > number of warning or error messages, and the *HiiHandle *field of the > last *EFI_DRIVER_HEALTH_HII_MESSAGE *structure must be set to *NULL *to > terminate the list of messages. It is the caller=E2=80=99s responsibility= to free > the buffer returned in **MessageList *using the EFI Boot Service > *FreePool()*. Each message is specified by an *EFI_HII_HANDLE *and an > *EFI_STRING_ID*. The caller may use the *EFI_HII_STRING_PROTOCOL.GetStrin= g() > *function to convert each message into a Null-terminated string that can > may be displayed on a console device. > > If *FormHiiHandle *is *NULL*, then no forms are returned from this > function. > > If *FormHiiHandle *is not *NULL*, and *HealthStatus *is not > *EfiDriverHealthStatusConfigurationRequired*, then no forms are returned > and **FormHiiHandle *must be set to *NULL*. > > If *FormHiiHandle *is not *NULL*, and *FormSetGuid *is not *NULL*, and *H= ealthStatus > *is *EfiDriverHealthStatusConfigurationRequired*, then *FormHiiHandle *is > assigned to the HII handle which contains the HII form required to perfor= m > the configuration operation. > > > > =E2=80=A6 > > *//******************************************************** > > *// EFI_DRIVER_HEALTH_HII_MESSAGE* > > *//******************************************************** > > *typedef struct { EFI_HII_HANDLE **H**iiHandle**; **EF**I_STRING_ID **S* > *tringId**; **UI**NT64 **MessageCode;* > > *} EFI_DRIVER_HEALTH_HII_MESSAGE;* > > *HiiHandle *The *EFI_HII_HANDLE *that was returned by *EFI_HII_DAT= ABASE_PROTOCOL.NewPackageList() > *when the string pack containing StringId was registered with the HII Dat= a > base. > > *StringId *The identifier for a single string token in the string > pack associated with *HiiHandle.* > > *MessageCode *64-bit numeric value of the warning/error specified by > this message. > > A value of *0x0000000000000000 *is used to indicate that > > *MessageCode *is not specified. > > The values *0**x0000000000000001 *to *0x0fffffffffffffff *are reserved fo= r > allocation by the UEFI Specification. > > The values *0**x1000000000000000 *to *0x1fffffffffffffff *are reserved fo= r > IHV-developed drivers. > > The values *0**x8000000000000000 *to *0x8fffffffffffffff *is reserved for > platform/OEM drivers. > > All other values are reserved and should not be used. > --00000000000064c49205bed5835f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
+ Mike

On Tue, Mar 30, 2021 at 1:56 AM EDK <edk.dan@gmail.com> wrote:

Hi ,

For our products, we have UEFI Driver and HII Driver as two separate images (th= is is a requirement for our product because we want to keep UEFI Driver as thi= n as possible).

  • Main role of UEFI Driver is providing boot services, reporting/solving health issue= s, posting messages in message list, EXT SPT etc.

FYI: UEFI Driver will install HII Config access protocol (CAP) and driver health formset o= n the controller handle if the controller has health issue; at this time, HII image won't be in picture (HII image come into play ONLY when controlle= r is healthy); if UEFI Driver detects controller is healthy then it will not ins= tall HII Config access protocol (if it had installed, it would uninstall before loading HII image from controller flash to host)

Note: We have our own API to load the HII Image from controller flash to host

  • Role of HII is, installing HII config access protocol and Management formset on the controller handle and allowing the user to view controller/PD/VD/other hardware properties, perform various controller/PD/VD level operations etc.

=C2=A0

Requirement (need to see whether this is feasible or not): There are cases where our controller is healthy but we would like to post certain informational messa= ges in messageList.

How do I achieve this? That is I want UEFI Driver to have the capability to pos= t the message in messageList and our HII Image also to be loaded/present.

=C2=A0

Can UEFI Driver and HII driver install HII Config access protocol on the same handle? AFAIK, the answer is =E2=80=9Cno=E2=80=9D.

I experimented just adding the driver health formset to the package via the HiiAddPackages() on the controller handle (that is from UEFI Driver I was n= ot installing HII CAP but just installed the formset on controller handle) and= it is not working. In this case HII image is also loaded (this means HII image would have installed HII CAP and its own formset on the same controller handle).

=C2=A0

Appreciate your input.

=C2=A0

Thanks,

Daniel

Backup:

Excerpt from UEFI Spec:

Messa<= /span>geList=C2=A0=C2=A0=C2= =A0=C2=A0 =C2=A0A pointer to an array of warning or error mess= ages associated wi= th

the controller specified by ControllerHandle and ChildHandle.

This is an optional parameter that may be NULL. MessageList = i= s

allocated<= span style=3D"letter-spacing:-0.4pt"> by this function with the EFI Boot Service

Alloc<= /span>atePool(), and it = is the caller=E2=80=99s responsibility to free

Messa<= /span>geList with the EFI Boot Service FreePool(). Each

message is specified by<= span style=3D"letter-spacing:-0.05pt"> tuple of an EFI_HII_HANDLE and an

EFI_S<= /span>TRING_ID. The array of messages is terminated by tuple

containing a <= span style=3D"font-size:11pt;font-family:Calibri,sans-serif;color:maroon">E= FI_HII_HANDLE with<= span style=3D"letter-spacing:-0.25pt"> a value of NULL. The

EFI_H<= /span>II_STRING_PROTOCOL.GetString() = function can be used

to retrieve the warning or error message as a Null-ter= minated string

in a specific language. Messages may b= e returned for any of the

Healt<= /span>hStatus values except

EfiDr<= /span>iverHealthStatusReconnectRequired and

EfiDr<= /span>iverHealthStatusRebootRequired= .

FormH= iiHandle=C2=A0=C2=A0 =C2=A0A pointer to the HII handle containing th= e HII form used when configuration is= required. The HII handle is associated with the controller specified by ControllerHandle and

ChildHandle. If this is NULL, then no HII form i<= /span>s available. An= HII handle will only be returned with a HealthStatus value of

Efi= DriverHealt<= span style=3D"letter-spacing:-0.05pt">hStatusConfigurationRequired.

=C2=A0

=E2=80=A6

=C2=A0<= /p>

=C2=A0=

=C2=A0

If MessageList = is not NULL, and HealthStatus is EfiDriverHealthStatusReconnectRequired or EfiDriverHealthStatusRebootReq= uired then no messages are returned and *MessageList must be set to NULL.

If MessageList = is not NULL, and there are no warning or error messages associated with the controller speci= fied by ControllerHandle and ChildHandle= , then *MessageList must be set to NULL.

If MessageList = is not NULL, and there are one or more warning or error messages associated with the control= ler specified by ControllerHandle and= ChildHandle, then = *MessageList must point to a buffer allocated with the EFI Boot Service <= b>Al= locatePool(). The number of <= span style=3D"font-size:11pt;font-family:Consolas;color:rgb(126,0,0)">EFI_D= RIVER_HEALTH_HII_MESSAGE structures allocated in the= buffer must be one more than the total number of warning or error messages, and the HiiHandle <= /span>field of the last EFI_DRIVER_HEAL= TH_HII_MESSAGE structure must be set to NULL to terminate the list of messages. It is the caller=E2=80=99s responsibility t= o free the buffer returned in *MessageList = u= sing the EFI Boot Service FreePool(). Each message is specified by an EFI_HII_HANDLE and an EFI_STRING_ID. Th= e caller may use the EFI_HII_STRING_PROTOCOL.GetString()= function to convert each message into a Null-termin= ated string that can may be displayed on a console device.

If FormHiiHandle is NULL, then no forms are returned from this function.

If FormHiiHandle is not NULL, and HealthStatus is not Efi= DriverHealthStatusConfigurationRequired, then no fo= rms are returned and *FormHiiHandle must be set to NULL.

If <= span style=3D"font-size:11pt;font-family:Consolas;color:rgb(126,0,0)">FormH= iiHandle is not NULL= , and FormSetGuid is = not NULL, and = HealthStatus is EfiDriverHealth= StatusConfigurationRequired, then FormHiiHandle is assigned to the HII handle which contains the HII form required to perform = the configuration operation.

=C2=A0

=E2=80=A6

//************<= span style=3D"letter-spacing:0.05pt">*******************************************

// EFI_DR= IVER_HEALTH_HII_MESSAGE

//*****************<= span style=3D"letter-spacing:0.05pt">**************************************<= /b>

<= span style=3D"font-size:10pt;line-height:105%;font-family:Consolas;color:ma= roon">typedef = struct { EFI_HII_HANDLE HiiHandle; EFI_STRING_ID=C2=A0 S<= /span>tringId; UINT= 64=C2=A0=C2=A0=C2=A0=C2=A0 MessageCode;

} EFI_DRIVER_HEALTH_HII_MESSAGE;

HiiHa= ndle=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0The EFI_HII_HANDLE that was returned by EFI_HII_D= ATABASE_PROTOCOL.NewPackageList() when the string pack containing StringI= d was registered with the HII Database.

StringId=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0The identifier for a single string token in the string pack associated with HiiHandle.

MessageCode=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A064-bit numeric value of the warning/er= ror specified b= y this message.

A value of 0x0000000000000000 is used to indicate that=

MessageCode is not specified.

<= span style=3D"font-size:11pt;font-family:Calibri,sans-serif;color:black">Th= e values 0x0000000000000001 to 0x0fffffffffffffff are reserved for allocation by the UEFI Specification.

The<= span style=3D"letter-spacing:-0.1pt"> values 0x1000000000000000 to 0x1fffffffffffffff are reserved for IH= V-developed drivers.

The<= span style=3D"letter-spacing:-0.1pt"> values 0x8000000000000000 to 0x8fffffffffffffff is reserved for platform/OEM drivers.

All other values are reserved and should not be used.

--00000000000064c49205bed5835f--