Re: [kvm-unit-tests v3 2/4] x86: Add test case for LAM_SUP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 12, 2023 at 03:51:32PM +0800, Binbin Wu wrote:
>From: Robert Hoo <robert.hu@xxxxxxxxxxxxxxx>
>
>This unit test covers:
>1. CR4.LAM_SUP toggles.
>2. Memory & MMIO access with supervisor mode address with LAM metadata.
>3. INVLPG memory operand doesn't contain LAM meta data, if the address
>   is non-canonical form then the INVLPG is the same as a NOP (no #GP).
>4. INVPCID memory operand (descriptor pointer) could contain LAM meta data,
>   however, the address in the descriptor should be canonical.
>
>In x86/unittests.cfg, add 2 test cases/guest conf, with and without LAM.
>
>LAM feature spec: https://cdrdv2.intel.com/v1/dl/getContent/671368, Chap 7
>LINEAR ADDRESS MASKING (LAM)
>
>Signed-off-by: Robert Hoo <robert.hu@xxxxxxxxxxxxxxx>
>Co-developed-by: Binbin Wu <binbin.wu@xxxxxxxxxxxxxxx>
>Signed-off-by: Binbin Wu <binbin.wu@xxxxxxxxxxxxxxx>

Reviewed-by: Chao Gao <chao.gao@xxxxxxxxx>

one nit below

>+static void do_invpcid(void *desc)
>+{
>+	unsigned long type = 0;

the local variable isn't needed ...

>+	struct invpcid_desc *desc_ptr = (struct invpcid_desc *)desc;
>+
>+	asm volatile("invpcid %0, %1" :
>+	                              : "m" (*desc_ptr), "r" (type)

You can simply use
	"r" (0)
.

>+	                              : "memory");
>+}



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux