KVM: selftests: Use __stringify() instead of custom XSTR() macros

Drop the custom defined XSTR() macros in KVM selftests and use
__stringify() instead. Include stringify.h in test_util.h to make it
available for all tests instead of including it in all the tests that
need it, as more tests will start using it.

No functional change intended.

Signed-off-by: Yosry Ahmed <yosry@kernel.org>
Link: https://patch.msgid.link/20260728174232.2423257-2-yosry@kernel.org
Signed-off-by: Sean Christopherson <seanjc@google.com>
This commit is contained in:
Yosry Ahmed 2026-07-28 17:42:20 +00:00 committed by Sean Christopherson
parent 653857a5af
commit 9be54a8265
4 changed files with 3 additions and 9 deletions

View File

@ -23,6 +23,7 @@
#include <linux/mman.h>
#include <linux/types.h>
#include <linux/stringify.h>
#define msecs_to_usecs(msec) ((msec) * 1000ULL)

View File

@ -22,9 +22,6 @@
#define SYNC_PORT 0xe
#define STR(x) #x
#define XSTR(s) STR(s)
/*
* SMI handler: runs in real-address mode.
* Reports SMRAM_STAGE via port IO, then does RSM.
@ -37,7 +34,7 @@ static u8 smi_handler[] = {
static inline void sync_with_host(u64 phase)
{
asm volatile("in $" XSTR(SYNC_PORT) ", %%al \n"
asm volatile("in $" __stringify(SYNC_PORT) ", %%al \n"
: "+a" (phase));
}

View File

@ -6,7 +6,6 @@
*/
#include <asm/kvm_para.h>
#include <linux/kvm_para.h>
#include <linux/stringify.h>
#include <stdint.h>
#include "kvm_test_harness.h"

View File

@ -22,9 +22,6 @@
#define SMRAM_GPA 0x1000000
#define SMRAM_STAGE 0xfe
#define STR(x) #x
#define XSTR(s) STR(s)
#define SYNC_PORT 0xe
#define DONE 0xff
@ -42,7 +39,7 @@ u8 smi_handler[] = {
static inline void sync_with_host(u64 phase)
{
asm volatile("in $" XSTR(SYNC_PORT)", %%al \n"
asm volatile("in $" __stringify(SYNC_PORT)", %%al \n"
: "+a" (phase));
}