From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yb1-f174.google.com (mail-yb1-f174.google.com [209.85.219.174]) by mx.groups.io with SMTP id smtpd.web12.612.1617083800526628549 for ; Mon, 29 Mar 2021 22:56:41 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Qohy3Zu/; spf=pass (domain: gmail.com, ip: 209.85.219.174, mailfrom: edk.dan@gmail.com) Received: by mail-yb1-f174.google.com with SMTP id k3so5857540ybh.4; Mon, 29 Mar 2021 22:56:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=fZ73kJ9qDmToGWzqgrpl+XHv+krbHLQQECLyVV8PG1Q=; b=Qohy3Zu/NeP3XqqJCEgV7VFYAlQoP5Xepcte8MhcFATzilGQ0fmrwCNqtazQ6qlt00 q00v0psxWNuwB9G8gpVn1ZqOAgZh9p8+RhEB2WOc4LHjqOK2D81dVcxx/NHtBzuYEpKy VSBFFlP39oO5fm/B+7IoIYXXSYaWDd4WHt7FOf1+/Aa7Y38owYDiv3KK8E2hPRtzThNh PWxGS3V00hChiPf+oRoozRyL5ruh+Ue50SvuXayQxt8PuMXGoVACU2FD9hNNoNEs+Hnt 7pAvCwfBdBTI2wtTpUN47CqoU+j2MwUXbm2/H0gjrbP8FOKI8gWkb1me85bpKxTwP6lc zylQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=fZ73kJ9qDmToGWzqgrpl+XHv+krbHLQQECLyVV8PG1Q=; b=czcT3/GWsn+FzBnRJsj1Ry3Hg/InU4OKJGsxz1e7jb0fCsK73kdTLkY6Pc4dvPEHws dWt7WLN7K2C4RdKNNFU3e4Uz1j5fVfo6tR1HpaCWmlXNdFhcxDxBDPdtAJw4bQllwLQX 6IwqCsY6twmh2UrgqRC0wPkemrpVukR8KspiYjjr7TN89HhN9Um2ojxmEJLpeRlYB716 P3lNuhPOfv9n2SxVZwa5YhaJ+84m5SdnjmSiwkHffeaNuYzktyuNZrCaKxPbIEIdFYmV DoM4EH25P8E62vXWjalJpK1gTGU1FFckj71j9bvAPihhQJ6OlE4iSNFecTSf6OxHEjSy 8vJQ== X-Gm-Message-State: AOAM531GQsCju9lG/Dhr37RkDboEcMEPVoY3c3w2zl+8SRH7rSYW+ySE LCBokV1gDdNOkKn/3tMwQAlBAAmEpH8KF3bxcLx9Z6WWavggKvznUKM= X-Google-Smtp-Source: ABdhPJwdx2oCpTalic7FVvTMyZ/mVWXHdVNLnml9MzpFVNldviFebFjKd6GiLi7owC9x/4mA1vp5PtoiaezHAbyNdVI= X-Received: by 2002:a25:fc22:: with SMTP id v34mr45970166ybd.330.1617083799437; Mon, 29 Mar 2021 22:56:39 -0700 (PDT) MIME-Version: 1.0 From: "EDK" Date: Tue, 30 Mar 2021 01:56:28 -0400 Message-ID: Subject: Driver health : Posting message in MessageList To: discuss@edk2.groups.io, devel@edk2.groups.io Cc: daniel.samuelraj@broadcom.com Content-Type: multipart/alternative; boundary="0000000000007005f105bebaa961" --0000000000007005f105bebaa961 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 UEFI 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 health 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 cases 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 (this 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 assoc= i ated 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 the 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 *EfiDriverHealthStatusReconnectRequired *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 *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 controller specified by *ControllerHandle *and *ChildHandle*, then **MessageList *must point to a buffer allocated with the EFI Boot Service *AllocatePool()*. The number of *EFI_DRIVER_HEALTH_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 **Messag= eList *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.GetString() *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 *HealthStatus *is *EfiDriverHealthStatusConfigurationRequired*, then *FormHiiHandle *is assigned to the HII handle which contains the HII form required to perform 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_DATABASE_PROTOCOL.NewPackageList() *when the string pack containing StringId was registered with the HII Datab= a se. *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 for allocation by the UEFI Specification. The values *0**x1000000000000000 *to *0x1fffffffffffffff *are reserved for 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. --0000000000007005f105bebaa961 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

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

=C2=A0

=C2=A0

= If MessageList is not NULL, and HealthStatus is EfiDriverHealthStatusRec= onnectRequired or EfiDriverHealthStatusRebootRequired then no messages are return= ed and *MessageList = must be set to NULL.<= /span>

= 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 <= /span>and ChildHandle, then *MessageList = must point to a buffer allocated with the EFI Boot Service AllocatePool(). The number of <= span style=3D"font-size:11pt;font-family:Consolas;color:rgb(126,0,0)">EFI_D= RIVER_HEALTH_HII_MESSAGE <= span style=3D"font-size:11pt;font-family:Calibri,sans-serif;color:black">st= ructures allocated in the buffer must be one more than the total number of warning or error messages, and the HiiHandle fie= ld of the last EFI_DRIVER_HEAL= TH_HII_MESSAGE structure mu= st 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= 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.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 = EfiDriverHealthStatusConfigurationRequired, then no forms are returned and *FormHiiHandle must be set to NULL.

<= span style=3D"font-size:11pt;font-family:Calibri,sans-serif;color:black">If= FormHiiHandle is not NULL, and FormSetGuid is not = NULL= , and HealthStatus is EfiDriverHealthStat= usConfigurationRequired, th= en FormHiiHandle is assigned to the HII handle which contains the HII form required to perform = the configuration operation.

<= span style=3D"font-size:11pt;font-family:Calibri,sans-serif;color:black">= =C2=A0

<= span style=3D"font-size:11pt;font-family:Calibri,sans-serif;color:black">= =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.

--0000000000007005f105bebaa961--