Re: [PATCH v6 04/10] qapi/ghes-cper: add an interface to do generic CPER error injection

Mauro Carvalho Chehab
2024-08-13T22:52:28Z

Em Mon, 12 Aug 2024 13:57:44 +0200
Igor Mammedov <imammedo@redhat.com> escreveu:

> n Platform Error Record - CPER - as defined at the UEFI
> > +# specification. See
> > +# https://uefi.org/specs/UEFI/2.10/Apx_N_Common_Platform_Error_Record.html#record-header
> > +# for more details.
> > +#
> > +# @notification-type: pre-assigned GUID string indicating the record
> > +# association with an error event notification type, as defined
> > +# at https://uefi.org/specs/UEFI/2.10/Apx_N_Common_Platform_Error_Record.html#record-header
> > +#
> > +# @raw-data: Contains a base64 encoded string with the payload of
> > +# the CPER.
> > +#
> > +# Since: 9.2
> > +##
> > +{ 'struct': 'CommonPlatformErrorRecord',
> > + 'data': {
> > + 'notification-type': 'str',
>
> like was mentioned at v5 review,
> you only need this for setting cper notification type if you are (re)using
>
> acpi_ghes_generic_error_status() && acpi_ghes_generic_error_data()
>
> however while doing this in (6/10), you are also limiting what
> could be encoded in headers to some hardcoded values.
>
> Given QEMU doesn't need to know anything about notification type,
> modulo putting it data block header, it would be beneficial
> to drop 'notification type' from QAPI interface, and include
> error status block and error data headers in raw-data.
>
> This way it should be possible to change headers within python script
> without affecting QEMU and QAPI interface. On top of that
> ghes_record_cper_errors() could be simplified by dropping (in 6/10)
> acpi_ghes_generic_error_status() && acpi_ghes_generic_error_data()
> and just copying raw-data as is directly into error buffer (assuming
> script put needed headers cper data).
>
> From fusing pov it's also beneficial to try generate junk error status
> block headers, for which python script looks like ideal place to put
> it in.

Got it. Will change it to just:

{ 'command': 'ghes-cper',
'data': {
'cper': 'str'
},
'features': [ 'unstable' ]
}

where cper contains an base64-encoded string with the entire raw data
including generic error status end generic error data.

I'm moving the current defaults to the python script. Let's merge
this with the defaults there. The script can later be modified to
allow changing such defaults.

Thanks,
Mauro