Project

General

Profile

Actions

Bug #13043

closed

HPET config register does not change size

Added by Joshua M. Clulow 12 months ago. Updated 11 months ago.

Status:
Closed
Priority:
Normal
Category:
kernel
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

According to the IA-PC HPET Specification 1.0a the Timer N Configuration and Capability Register is always 64-bits in size. The upper 32-bits represents a single read-only field, Tn_INT_ROUTE_CAP, which contains the map of valid I/O APIC interrupts to which this timer may be routed.

The configuration also contains a bit that informs us whether the timer value is a 32-bit or 64-bit value, Tn_SIZE_CAP. Unfortunately we have conflated the timer value size with the width of the configuration register:

static void
hpet_write_timer_N_config(hpet_info_t *hip, uint_t n, uint64_t l)
{
        if (hip->timer_n_config[n].size_cap == 1)
                *(uint64_t *)HPET_TIMER_N_CONF_ADDRESS(
                    hip->logical_address, n) = l;
        else
                *(uint32_t *)HPET_TIMER_N_CONF_ADDRESS(
                    hip->logical_address, n) = (uint32_t)(0xFFFFFFFF & l);
}

This is not quite right, though fortunately in a way that has been effectively benign; the upper half of the register is read-only anyway and never needs to be written. We should nonetheless correct this oversight.

Actions #1

Updated by Electric Monk 12 months ago

  • Gerrit CR set to 850
Actions #2

Updated by Joshua M. Clulow 11 months ago

Testing Notes

I rebooted a physical machine onto these bits and confirmed that the HPET programming information in hpet_info is the same before and after. Results are the same as reported in #13039 for the physical machine there.

Actions #3

Updated by Electric Monk 11 months ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit 9c562f14f5af5a3d068e998a2ab674ce019cc395

commit  9c562f14f5af5a3d068e998a2ab674ce019cc395
Author: Joshua M. Clulow <josh@sysmgr.org>
Date:   2020-09-12T23:53:15.000Z

    13043 HPET config register does not change size
    Reviewed by: Dan McDonald <danmcd@joyent.com>
    Reviewed by: Garrett D'Amore <garrett@damore.org>
    Approved by: Robert Mustacchi <rm@fingolfin.org>

Actions

Also available in: Atom PDF