diff mbox

[kvm-unit-tests] x86/memory: pass host clwb and clflushopt support information

Message ID 9e85cf0f-0a23-a90f-cc39-a4bfc611816b@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Paolo Bonzini Feb. 14, 2018, 12:04 p.m. UTC
On 20/12/2017 22:26, Eduardo Habkost wrote:
> On Tue, Dec 19, 2017 at 10:54:16AM +0800, Haozhong Zhang wrote:
>> Can I understand that testing these two cases with host/guest CPUID
>> mismatch (specially clwb and clflushopt flags) is invalid? If yes,
>> please ignore this patch.
> 
> I wouldn't say it's invalid to test what happens when the host
> and guest CPUID don't match.  The question is: is it useful to do
> so?  Are we testing different code paths when we do that?
> 
> The inability to trigger #UD if the host CPUID includes the flag
> sounds like a bug/limitation we would like to get rid of as soon
> as hardware allow us to, and not a feature we need to test for.
> 
> What's the right way to ensure memory.flat is always tested using
> "-cpu host"?

We should just add it to x86/unittests.cfg, which lets you specify the
desired QEMU arguments.  Otherwise, it's not run at all as part of my
integration tests:

Thanks,

Paolo
diff mbox

Patch

diff --git a/x86/unittests.cfg b/x86/unittests.cfg
index c6a383b..22c62d5 100644
--- a/x86/unittests.cfg
+++ b/x86/unittests.cfg
@@ -142,6 +142,11 @@  arch = x86_64
 #[init]
 #file = init.flat

+[memory]
+file = memory.flat
+extra_params = -cpu host
+arch = x86_64
+
 [msr]
 file = msr.flat