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

Re: [Xen-devel] [PATCH]: Fix rombios to correctly report size of disks >16GB


  • To: "Gianni Tedesco (3P)" <gianni.tedesco@xxxxxxxxxx>
  • From: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
  • Date: Fri, 23 Jul 2010 09:21:26 +0100
  • Cc: Xen Devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 23 Jul 2010 01:22:50 -0700
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: AcsqPlvzFBzWgnpTTPerVG95NkeugQAAa7+O
  • Thread-topic: [Xen-devel] [PATCH]: Fix rombios to correctly report size of disks >16GB

On 23/07/2010 09:07, "Gianni Tedesco (3P)" <gianni.tedesco@xxxxxxxxxx>
wrote:

>> For say a 17GB drive sizeinmb=17000 which can be represented with fewer than
>> 16 bits. I don't see how the code as it is will ever print the wrong thing,
>> except for drives bigger than 64TB!
> 
> Actually you are right then wrong, the patch is mis-titled, it's 64GB.
> (in fact 65,535 MB).
> 
>> Also I'm not sure but I think the
>> integer size here may be 16 bits, and the %u format specifier would only
>> print 16-bit values in that case anyway.
> 
> I tested it and it works as advertised (modulo 16 -> 64)....

64GB == 65536MB > 1UL<<16, hence we should print the size in GB, and shift
right 10 before casting. Hence should still print correctly. Is this another
example where the bcc compiler is broken?

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.