diff options
| author | Sean Christopherson <seanjc@google.com> | 2024-12-19 17:26:17 -0800 |
|---|---|---|
| committer | Sean Christopherson <seanjc@google.com> | 2025-01-08 12:57:03 -0800 |
| commit | 983820cb53c0e796777caf85bfc2810ad0c8fb22 (patch) | |
| tree | 9b0f6400e8ecaa5a1de056a6c91dc450630dd1ce /tools/testing/selftests/kvm/x86/xapic_ipi_test.c | |
| parent | 7803339fa929387bbc66479532afbaf8cbebb41b (diff) | |
KVM: selftests: Add helpers for locally (un)blocking IRQs on x86
Copy KVM-Unit-Tests' x86 helpers for emitting STI and CLI, comments and
all, and use them throughout x86 selftests. The safe_halt() and sti_nop()
logic in particular benefits from centralized comments, as the behavior
isn't obvious unless the reader is already aware of the STI shadow.
Cc: Manali Shukla <Manali.Shukla@amd.com>
Link: https://lore.kernel.org/r/20241220012617.3513898-1-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'tools/testing/selftests/kvm/x86/xapic_ipi_test.c')
| -rw-r--r-- | tools/testing/selftests/kvm/x86/xapic_ipi_test.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/testing/selftests/kvm/x86/xapic_ipi_test.c b/tools/testing/selftests/kvm/x86/xapic_ipi_test.c index a76078a08ff8..6228c0806e89 100644 --- a/tools/testing/selftests/kvm/x86/xapic_ipi_test.c +++ b/tools/testing/selftests/kvm/x86/xapic_ipi_test.c @@ -106,7 +106,8 @@ static void halter_guest_code(struct test_data_page *data) data->halter_tpr = xapic_read_reg(APIC_TASKPRI); data->halter_ppr = xapic_read_reg(APIC_PROCPRI); data->hlt_count++; - asm volatile("sti; hlt; cli"); + safe_halt(); + cli(); data->wake_count++; } } |