On 02/04/2025 3:54 pm, Alexander M. Merritt wrote: > The new toolchain baseline knows the SVM instructions. > > Resolves: xen-project/xen#204 > > Signed-off-by: Alexander M. Merritt <alexan...@edera.dev>
Reviewed-by: Andrew Cooper <andrew.coop...@citrix.com>, with a couple of notes. > --- > xen/arch/x86/hvm/svm/svm.h | 14 +++----------- > xen/arch/x86/include/asm/asm-defns.h | 12 ------------ > 2 files changed, 3 insertions(+), 23 deletions(-) > > diff --git a/xen/arch/x86/hvm/svm/svm.h b/xen/arch/x86/hvm/svm/svm.h > index beeaaab4f7..5c5e91a1ac 100644 > --- a/xen/arch/x86/hvm/svm/svm.h > +++ b/xen/arch/x86/hvm/svm/svm.h > @@ -23,25 +23,17 @@ void __update_guest_eip(struct cpu_user_regs *regs, > unsigned int inst_len); > > static inline void svm_vmload_pa(paddr_t vmcb) > { > - asm volatile ( > - ".byte 0x0f,0x01,0xda" /* vmload */ > - : : "a" (vmcb) : "memory" ); > + asm volatile ( "vmload" : : "a" (vmcb) : "memory" ); We tend to prefer :: for empty sections. > } > > static inline void svm_vmsave_pa(paddr_t vmcb) > { > - asm volatile ( > - ".byte 0x0f,0x01,0xdb" /* vmsave */ > - : : "a" (vmcb) : "memory" ); > + asm volatile ( "vmsave" : : "a" (vmcb) : "memory" ); > } > > static inline void svm_invlpga(unsigned long linear, uint32_t asid) > { > - asm volatile ( > - ".byte 0x0f,0x01,0xdf" > - : /* output */ > - : /* input */ > - "a" (linear), "c" (asid) ); > + asm volatile ( "invlpga" : /* output */ : /* input */ "a" (linear), "c" > (asid) ); And here, the output/input comments are useless and can be dropped. I can fix both on commit if you're happy? ~Andrew