- u32 pmtimer = inl(ioport);
- return (u64)wraps << 24 | pmtimer;
BTW, why is this "<< 24", and if it should be that way, shouldn't the pmtimer be "inl(ioport) & 0xffffff" ?
The pmtimer is defined to be 24 bits wide, so the shift is correct.
This is not true in general. It can be either 24 or 32 bits. What it is depends on ACPI data (acpi_gbl_FADT->tmr_val_ext).
The piix4 emulated by qemu has 24 bits.
However it is valid to only used 24 bits.
And we certainly want to mask the ioport read (as suggested by kevin and done in v3 of the patch) so we only pick up the 24 bits we actually use.