On Tue, Jun 03, 2025 at 09:17:29AM -0700, ross.philip...@oracle.com wrote: > > +void asmlinkage slaunch_early_init(uint32_t load_base_addr, > > + uint32_t tgt_base_addr, > > + uint32_t tgt_end_addr, > > + struct early_init_results *result) > > +{ > > + void *txt_heap; > > + const struct txt_os_mle_data *os_mle; > > + const struct slr_table *slrt; > > + const struct slr_entry_intel_info *intel_info; > > + > > + txt_heap = txt_init(); > > + os_mle = txt_os_mle_data_start(txt_heap); > > + > > + result->slrt_pa = os_mle->slrt; > > + result->mbi_pa = 0; > > + > > + slrt = (const struct slr_table *)(uintptr_t)os_mle->slrt; > > + > > + intel_info = (const struct slr_entry_intel_info *) > > + slr_next_entry_by_tag(slrt, NULL, SLR_ENTRY_INTEL_INFO); > > + if ( intel_info == NULL || intel_info->hdr.size != sizeof(*intel_info) > > ) > > + return; > > Since these are the x86/TXT bits, it seems at this point, not finding the > TXT info structure would be fatal, no?
It is fatal, but early code doesn't have means for reporting errors nicely, so it just continues. You think it's better to reboot right away? > > +static inline void *txt_init(void) > > +{ > > + void *txt_heap; > > + > > + /* Clear the TXT error register for a clean start of the day. */ > > + txt_write(TXTCR_ERRORCODE, 0); > > + > > + txt_heap = _p(txt_read(TXTCR_HEAP_BASE)); > > + > > + if ( txt_os_mle_data_size(txt_heap) < sizeof(struct txt_os_mle_data) || > > + txt_os_sinit_data_size(txt_heap) < sizeof(struct > > txt_os_sinit_data) ) > > + txt_reset(SLAUNCH_ERROR_GENERIC); > > I know the list of error codes pulled in are from the patches for Linux > Secure Launch which seems right. The Xen work is free to add more specific > error codes e.g. somewhere like here. We could even consider using regions > in the vendor error code space for different things like generic errors vs > architecture specific ones vs etc. > > Thanks > Ross I think some codes were already added and this is the only place where SLAUNCH_ERROR_GENERIC is used, not really sure why, will add a couple more. By the way, the new errors were inserted in the middle making about half of the errors out of sync with Linux, should Xen and Linux be in sync? Not sure about usefulness of error regions, the errors codes are only for TXT and major/minor errors in TXT.ERRORCODE weren't helpful in debugging. Regards