Message ID | 20201110172047.3401279-1-colin.king@canonical.com |
---|---|
State | Accepted |
Headers | show |
Series | lib: fwts_cmos: remove cli/sti assembler from cmos reading | expand |
On 2020-11-10 10:20 a.m., Colin King wrote: > From: Colin Ian King <colin.king@canonical.com> > > Recent Linux kernel config defaults will not allow messing around with > the interrupt disable/enable from userspace and will segfault the code. > Remove these as they don't really need to be used and we just need to > remember that updates to CMOS data may occur under kernel control > while it is being read by fwts. > > Signed-off-by: Colin Ian King <colin.king@canonical.com> > --- > src/lib/src/fwts_cmos.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/src/lib/src/fwts_cmos.c b/src/lib/src/fwts_cmos.c > index b40c8100..6b285eac 100644 > --- a/src/lib/src/fwts_cmos.c > +++ b/src/lib/src/fwts_cmos.c > @@ -47,7 +47,6 @@ int fwts_cmos_read(const uint8_t offset, uint8_t *value) > goto tidy0x80; > } > > - asm("cli"); > /* specify offset to read */ > if (fwts_outb(offset, 0x70) != FWTS_OK) { > ret = FWTS_ERROR; > @@ -64,7 +63,6 @@ int fwts_cmos_read(const uint8_t offset, uint8_t *value) > if (fwts_inb(0x71, value) != FWTS_OK) > ret = FWTS_ERROR; > tidy: > - asm("sti"); > (void)iopl(0); > tidy0x80: > (void)ioperm(0x80, 1, 0); > Acked-by: Alex Hung <alex.hung@canonical.com>
On 11/11/20 1:20 AM, Colin King wrote: > From: Colin Ian King <colin.king@canonical.com> > > Recent Linux kernel config defaults will not allow messing around with > the interrupt disable/enable from userspace and will segfault the code. > Remove these as they don't really need to be used and we just need to > remember that updates to CMOS data may occur under kernel control > while it is being read by fwts. > > Signed-off-by: Colin Ian King <colin.king@canonical.com> > --- > src/lib/src/fwts_cmos.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/src/lib/src/fwts_cmos.c b/src/lib/src/fwts_cmos.c > index b40c8100..6b285eac 100644 > --- a/src/lib/src/fwts_cmos.c > +++ b/src/lib/src/fwts_cmos.c > @@ -47,7 +47,6 @@ int fwts_cmos_read(const uint8_t offset, uint8_t *value) > goto tidy0x80; > } > > - asm("cli"); > /* specify offset to read */ > if (fwts_outb(offset, 0x70) != FWTS_OK) { > ret = FWTS_ERROR; > @@ -64,7 +63,6 @@ int fwts_cmos_read(const uint8_t offset, uint8_t *value) > if (fwts_inb(0x71, value) != FWTS_OK) > ret = FWTS_ERROR; > tidy: > - asm("sti"); > (void)iopl(0); > tidy0x80: > (void)ioperm(0x80, 1, 0); > Acked-by: Ivan Hu <ivan.hu@canonical.com>
diff --git a/src/lib/src/fwts_cmos.c b/src/lib/src/fwts_cmos.c index b40c8100..6b285eac 100644 --- a/src/lib/src/fwts_cmos.c +++ b/src/lib/src/fwts_cmos.c @@ -47,7 +47,6 @@ int fwts_cmos_read(const uint8_t offset, uint8_t *value) goto tidy0x80; } - asm("cli"); /* specify offset to read */ if (fwts_outb(offset, 0x70) != FWTS_OK) { ret = FWTS_ERROR; @@ -64,7 +63,6 @@ int fwts_cmos_read(const uint8_t offset, uint8_t *value) if (fwts_inb(0x71, value) != FWTS_OK) ret = FWTS_ERROR; tidy: - asm("sti"); (void)iopl(0); tidy0x80: (void)ioperm(0x80, 1, 0);