From patchwork Wed Feb 14 12:04:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 10218663 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 74B25602CB for ; Wed, 14 Feb 2018 12:04:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6422828F7E for ; Wed, 14 Feb 2018 12:04:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5837928F9B; Wed, 14 Feb 2018 12:04:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E746628F7E for ; Wed, 14 Feb 2018 12:04:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967673AbeBNMEl (ORCPT ); Wed, 14 Feb 2018 07:04:41 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:44954 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S967648AbeBNMEk (ORCPT ); Wed, 14 Feb 2018 07:04:40 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D4657EAE91 for ; Wed, 14 Feb 2018 12:04:39 +0000 (UTC) Received: from [10.36.118.14] (unknown [10.36.118.14]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5B22021411B6; Wed, 14 Feb 2018 12:04:39 +0000 (UTC) Subject: Re: [kvm-unit-tests PATCH] x86/memory: pass host clwb and clflushopt support information To: Eduardo Habkost , kvm@vger.kernel.org References: <20171212083524.3765-1-haozhong.zhang@intel.com> <20171218183635.GD5209@localhost.localdomain> <20171219025416.lyu2on4gcv2rokzn@hz-desktop> <20171220212608.GE24025@localhost.localdomain> From: Paolo Bonzini Message-ID: <9e85cf0f-0a23-a90f-cc39-a4bfc611816b@redhat.com> Date: Wed, 14 Feb 2018 13:04:35 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <20171220212608.GE24025@localhost.localdomain> Content-Language: en-US X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Wed, 14 Feb 2018 12:04:39 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Wed, 14 Feb 2018 12:04:39 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'pbonzini@redhat.com' RCPT:'' Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --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