x86/APIC: make connections between seemingly arbitrary numbers
authorJan Beulich <jbeulich@suse.com>
Tue, 5 Apr 2022 09:38:04 +0000 (11:38 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 5 Apr 2022 09:38:04 +0000 (11:38 +0200)
commit5c04f6b4878ef92356f67fc3a192c6375ef28ec8
tree1a663d5504881ffc82ef3f1cd1a7c2f3c1c689c8
parent3f3906b462d57613d45051940d9083d02f49d1d2
x86/APIC: make connections between seemingly arbitrary numbers

Making adjustments to arbitrarily chosen values shouldn't require
auditing the code for possible derived numbers - such a change should
be doable in a single place, having an effect on all code depending on
that choice.

For one make the TDCR write actually use APIC_DIVISOR. With the
necessary mask constant introduced, also use that in vLAPIC code. While
introducing the constant, drop APIC_TDR_DIV_TMBASE: The bit has been
undefined in halfway recent SDM and PM versions.

And then introduce a constant tying together the scale used when
converting nanoseconds to bus clocks.

No functional change intended.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
xen/arch/x86/apic.c
xen/arch/x86/hvm/vlapic.c
xen/arch/x86/include/asm/apicdef.h
xen/include/xen/lib.h