tools/hvmloader: Move various helpers to being static inlines

The IO port, MSR, IO-APIC and LAPIC accessors compile typically to single or
pairs of instructions, which is less overhead than even the stack manipulation
to call the helpers.

Move the implementations from util.c to being static inlines in util.h

In addition, turn ioapic_base_address into a constant as it is never modified
from 0xfec00000 (substantially shrinks the IO-APIC logic), and make use of the
"A" constraint for WRMSR/RDMSR like we already do for RDTSC.

Bloat-o-meter reports a net:
  add/remove: 0/13 grow/shrink: 0/18 up/down: 0/-790 (-790)

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
Andrew Cooper committed 2024-05-09 18:19:49 +01:00
1 parent 1c6112b8f5
commit 754a29cacf
5 files changed
+100 -92

No files matched your search

-1
View File
@@ -113,7 +113,6 @@ asm (
unsigned long scratch_start = SCRATCH_PHYSICAL_ADDRESS;
uint32_t ioapic_base_address = 0xfec00000;
uint8_t ioapic_version;
bool acpi_enabled;
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.