Commit Graph
2 Commits
Author SHA1 Message Date
Tu Dinh fb0e37df71 x86/vhpet: Fix sanitization of legacy IRQ route
When setting a timer's config register, timer_sanitize_int_route will
always reset the IRQ route value to what's valid corresponding to the
!HPET_CFG_LEGACY case. This is applied even if the HPET is set to
HPET_CFG_LEGACY.

When some operating systems (e.g. Windows) try to write to a timer
config, they will verify and rewrite the register if the values don't
match what they expect. This causes an unnecessary write to HPET_Tn_CFG.

Note, the HPET specification states that for the Tn_INT_ROUTE_CNF field:

"If the value is not supported by this prarticular timer, then the value
read back will not match what is written. [...] If the LegacyReplacement
Route bit is set, then Timers 0 and 1 will have a different routing, and
this bit field has no effect for those two timers."

Therefore, Xen should not reset timer_int_route if legacy mode is
enabled, regardless of what's in there.

Fixes: ec40d3fe21 ("x86/vhpet: check that the set interrupt route is valid")
Signed-off-by: Tu Dinh <ngoc-tu.dinh@vates.tech>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
2025-11-26 12:10:21 +01:00
Tu Dinh 242a5f75ee acpi: Set TPM2 LAML to actual log area size
The LAML field should follow the TCG PC Client Platform Firmware Profile
Specification Version. Version 1.06 Revision 52 says:

'The TCG ACPI specification uses the field name "Log Area Minimum
 Length", but the field value is the actual log area length reserved by
 Platform Firmware, not a lower bound.'

Remove the now-unused TPM_LOG_AREA_MINIMUM_SIZE.

No functional change.

Signed-off-by: Tu Dinh <ngoc-tu.dinh@vates.tech>
Acked-by: Jan Beulich <jbeulich@suse.com>
2025-11-12 09:36:06 +01:00