Utility routines in hvmloader for SMBIOS table validation. Signed-off-by: Ross Philipson <ross.philipson@citrix.com> _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xensource.com/xen-devel
> -static void validate_hvm_info(struct hvm_info_table *t) > +static int validate_hvm_info_table(uint8_t *table, uint32_t > table_length, > + const char *table_sig, const char *sig) > { > - uint8_t *ptr = (uint8_t *)t; > uint8_t sum = 0; > int i; > > - if ( strncmp(t->signature, "HVM INFO", 8) ) > + if (table_length == 0) > + printf("Empty HVM info table: %.*s\n", 8, sig); > + > + /* NOTE made this a common routine to validate all HVM tables. > Removed > + BUG() on failure in here - let the caller decide if a checksum > failure > + warrants that */I think comments about what code looked like historically, what changed and why belong in the commit message, not inline in the code.
> -----Original Message----- > From: Ian Campbell [mailto:Ian.Campbell@citrix.com] > Sent: Tuesday, February 21, 2012 3:48 AM > To: Ross Philipson > Cc: xen-devel@lists.xensource.com > Subject: Re: [Xen-devel] [PATCH 2/3] SMBIOS table passthrough support > > > > -static void validate_hvm_info(struct hvm_info_table *t) > > +static int validate_hvm_info_table(uint8_t *table, uint32_t > > table_length, > > + const char *table_sig, const char *sig) > > { > > - uint8_t *ptr = (uint8_t *)t; > > uint8_t sum = 0; > > int i; > > > > - if ( strncmp(t->signature, "HVM INFO", 8) ) > > + if (table_length == 0) > > + printf("Empty HVM info table: %.*s\n", 8, sig); > > + > > + /* NOTE made this a common routine to validate all HVM tables. > > Removed > > + BUG() on failure in here - let the caller decide if a checksum > > failure > > + warrants that */ > > I think comments about what code looked like historically, what changed > and why belong in the commit message, not inline in the code. >Wilco Ross
Maybe Matching Threads
- [PATCH 0/2] Fix SMBios table regressions in HVM guests
- [PATCH v2 02/03] HVM firmware passthrough libxl support
- [PATCH v4 01/04] HVM firmware passthrough HVM defs header
- [PATCH 0/3] SMBIOS table passthrough support
- [PATCH v1 01/02] HVM firmware passthrough libxl support