Re: [kvm-unit-tests GIT PULL] x86: random smattering of changes
From: Yosry Ahmed
Date: Thu May 28 2026 - 15:12:23 EST
On Thu, May 28, 2026 at 12:07 PM Sean Christopherson <seanjc@xxxxxxxxxx> wrote:
>
> On Wed, May 27, 2026, Yosry Ahmed wrote:
> > > > ----------------------------------------------------------------
> > > > Isaku Yamahata (2):
> > > > x86: Replace NOP with CPUID after WRMSR(TSCDEADLINE) to serialize deadline timer
> > > > x86: tscdeadline_latency: Remove unnecessary nop
> > > >
> > > > Jim Mattson (1):
> > > > x86: nVMX: Add retry loop to advanced RTM debugging subtest
> > > >
> > > > Kevin Cheng (2):
> > > > x86/svm: Add missing svm intercepts
> > > > x86/svm: Add unsupported instruction intercept test
> > >
> > > Any reason not to include this series:
> > > https://lore.kernel.org/kvm/20260312200308.3089379-1-chengkev@xxxxxxxxxx/?
>
> I ran out of steam (and time), and I don't want to merge like this without a high
> level of confidence that it's the least awful option.
We're already doing this for vmx:
https://gitlab.com/kvm-unit-tests/kvm-unit-tests/-/blob/master/x86/vmx_tests.c?ref_type=heads#L806.
If this is the only thing holding that series, I think cleaning it up
should be done separately for both VMX and SVM.
>
> +asm(
> + "insn_sidt: sidt idt_descr;ret\n\t"
> + "insn_sgdt: sgdt gdt_descr;ret\n\t"
> + "insn_sldt: sldt %ax;ret\n\t"
> + "insn_str: str %ax;ret\n\t"
> + "insn_ltr: ltr %ax;ret\n\t"
> + "insn_pushf: pushf;ret\n\t"
> + "insn_popf: popf;ret\n\t"
> + "insn_intn: int $0x22; vmmcall; ret\n\t"
> + "insn_int_handler: iretq\n\t"
> + "insn_stgi: stgi;ret\n\t"
> + "insn_clgi: clgi;ret\n\t"
> + "insn_rdtscp: rdtscp;ret\n\t"
> + "insn_wbinvd: wbinvd;ret\n\t"
> + "insn_lidt: lidt idt_descr;ret\n\t"
> + "insn_lgdt: lgdt gdt_descr;ret\n\t"
> + "insn_lldt: xor %eax, %eax; lldt %ax;ret\n\t"
> + "insn_rdpmc: xor %ecx, %ecx; rdpmc;ret\n\t"
> + "insn_cpuid: mov $10, %eax; cpuid;ret\n\t"
> + "insn_invd: invd;ret\n\t"
> + "insn_pause: pause;ret\n\t"
> + "insn_hlt: hlt;ret\n\t"
> + "insn_invlpg: invlpg 0x12345678;ret\n\t"
> + "insn_rdtsc: rdtsc;ret\n\t"
> + "insn_monitor: xor %eax, %eax; xor %ecx, %ecx; xor %edx, %edx; monitor;ret\n\t"
> + "insn_mwait: xor %eax, %eax; xor %ecx, %ecx; mwait;ret\n\t"
> + "insn_skinit: skinit;ret\n\t"
> + "insn_icebp: .byte 0xf1; ret\n\t"
> + "insn_xsetbv: mov $0, %ecx; xor %edx, %edx; xor %eax, %eax; xgetbv; xsetbv;ret\n\t"
> + "insn_rdpru: xor %ecx, %ecx; .byte 0x0f,0x01,0xfd;ret\n\t"
> +);
> +
> +extern void insn_sidt(struct svm_test *test);
> +extern void insn_sgdt(struct svm_test *test);
> +extern void insn_sldt(struct svm_test *test);
> +extern void insn_str(struct svm_test *test);
> +extern void insn_ltr(struct svm_test *test);
> +extern void insn_pushf(struct svm_test *test);
> +extern void insn_popf(struct svm_test *test);
> +extern void insn_intn(struct svm_test *test);
> +extern void insn_int_handler(struct svm_test *test);
> +extern void insn_stgi(struct svm_test *test);
> +extern void insn_clgi(struct svm_test *test);
> +extern void insn_rdtscp(struct svm_test *test);
> +extern void insn_wbinvd(struct svm_test *test);
> +extern void insn_lidt(struct svm_test *test);
> +extern void insn_lgdt(struct svm_test *test);
> +extern void insn_lldt(struct svm_test *test);
> +extern void insn_rdpmc(struct svm_test *test);
> +extern void insn_cpuid(struct svm_test *test);
> +extern void insn_invd(struct svm_test *test);
> +extern void insn_pause(struct svm_test *test);
> +extern void insn_hlt(struct svm_test *test);
> +extern void insn_invlpg(struct svm_test *test);
> +extern void insn_rdtsc(struct svm_test *test);
> +extern void insn_monitor(struct svm_test *test);
> +extern void insn_mwait(struct svm_test *test);
> +extern void insn_skinit(struct svm_test *test);
> +extern void insn_icebp(struct svm_test *test);
> +extern void insn_xsetbv(struct svm_test *test);
> +extern void insn_rdpru(struct svm_test *test);
>
> > Also this (but less importantly):
> > https://lore.kernel.org/kvm/20260317225327.4068448-1-yosry@xxxxxxxxxx/.
>
> Because I hate bumping the timeouts. It's a losing game of whack-a-mole. For
> now, it's easier to bury my head in the sand.
LOL