Re: [PATCH] lscpu: dmi: return HYPER_NONE when detection fails

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 13 Jun 2017 12:24:18 +0200
Karel Zak <kzak@xxxxxxxxxx> wrote:

> On Mon, Jun 12, 2017 at 05:32:28PM +0200, Michal Suchanek wrote:
> > There is weird mix of logic in lscpu-dmi.c which sometimes returns
> > 0 and sometimes -1 on error. Since most checks are if (rc) goto
> > done; this bails out early on error skipping some detection
> > methods. Further, in lscpu.c all following detections are guarder
> > by if(hyper) so returnning -1 causes all following methods to be
> > skipped. The hyper value is used as array index so -1 is out of
> > bounds.  
> 
> Yes, that's bug.
> 
 
> Not applied.
> 
> I don't think this is correct. We need to differentiate between
> 
>  1/ DMI not in /sys   (rc == -1)
>  2/ DMI available, but nothing detected (rc == HYPER_NONE)
> 
> For the 1/ we need to try /dev/mem.
> 
> I did some changes to the code to make it more robust. Now
> read_hypervisor_dmi() does not return -1 at all.
> 
> Please, test it. Thanks!

Looks ok. This does not crash on arm64 with the broken kernel and we
will eventually get testing of the other archs as well. Not returning
-1 should fix them.

Thanks

Michal
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux