On Sat, 2020-05-23 at 21:00 +0300, Timo Juhani Lindfors wrote: > # HG changeset patch > # User Timo Juhani Lindfors <timo.lindf...@iki.fi> > # Date 1590255168 -10800 > # Sat May 23 20:32:48 2020 +0300 > # Branch fix/acminfo-without-msr > # Node ID d4591fde44c08fb5a0f1d1531b6df02c7223c67e > # Parent 2ada74557b3db6c13deeda874c20c5132e40c53b > Ensure txt-acminfo does not print false information if msr is not loaded > > Previously txt-acminfo would report "ACM does not match platform" > for all ACMs if the msr module was not loaded. > > Signed-off-by: Timo Juhani Lindfors <timo.lindf...@iki.fi> > > diff -r 2ada74557b3d -r d4591fde44c0 utils/txt-acminfo.c > --- a/utils/txt-acminfo.c Fri May 15 09:59:23 2020 +0200 > +++ b/utils/txt-acminfo.c Sat May 23 20:32:48 2020 +0300 > @@ -39,6 +39,7 @@ > #include <stdint.h> > #include <stdio.h> > #include <unistd.h> > +#include <stdlib.h> > #include <string.h> > #include <sys/types.h> > #include <sys/stat.h> > @@ -75,15 +76,19 @@ > int fd = open("/dev/cpu/0/msr", O_RDONLY); > if ( fd == -1 ) { > printf("Error: failed to open /dev/cpu/0/msr\n"); > - return 0; > + printf("Perhaps you should modprobe msr?\n"); > + exit(1); > } > > /* lseek() to MSR # */ > - if ( lseek(fd, msr, SEEK_SET) == (off_t)-1 ) > + if ( lseek(fd, msr, SEEK_SET) == (off_t)-1 ) { > printf("Error: failed to find MSR 0x%x\n", msr); > - else { > - if ( read(fd, &val, sizeof(val)) != sizeof(val) ) > + exit(1); > + } else { > + if ( read(fd, &val, sizeof(val)) != sizeof(val) ) { > printf("Error: failed to read MSR 0x%x value\n", msr); > + exit(1); > + } > } > > close(fd); >
Merged. Thanks, Lukasz _______________________________________________ tboot-devel mailing list tboot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tboot-devel