Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp595050imu; Fri, 4 Jan 2019 03:41:43 -0800 (PST) X-Google-Smtp-Source: ALg8bN6VL2z+Vtr8Fmu3kp97Y1bW0cEWnPAVjiwwgj8idEqFNa3fmShUfGPejVFQNeZCRhvP3CQm X-Received: by 2002:a63:6c48:: with SMTP id h69mr1291050pgc.139.1546602103097; Fri, 04 Jan 2019 03:41:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546602103; cv=none; d=google.com; s=arc-20160816; b=mKzNvi1fLTXYoUO/AOLr99x8qwoKolF55qgEQutPibXSLeOOTnyGtngKYywDHY/Y3p tXGuSH5q32CDI46b9gV00qK/TMtDuvdrZZbvrmcKDJ9wEP0I1RKaHKazk/9+Shmz7dbl MXmpdLHKmIXLGo4/MHA2Isw/vZBfaI+LHwtPaBTYdjFlelFtQh6lAgS3m2DVMBHV7on7 fVcaK/AbJNaRYaMl4Bp4M5LUaU0jXnE+JiJmoQCFeP4DBo2d9ZUI2qLclP5dT4VGn1pw +oD2fdIHValCQhF6DlE2/Kq1iFRFBbDvbQlRjzMUuBOZu0wMELM8LOW+fCG9QwfepTxd VQIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :references:subject:cc:to:mime-version:user-agent:from:date :message-id; bh=6BQ+mQTZCjETOyajgdItPwpZMDLWd4cAMzj438klgUU=; b=UD4jg4juu+1uwpD5/GlteNfwhYE+OpN0NwZTIZr+DnvJx3SAidfkyaNWFy8D1M33gN TsxbO1ldDpeEWFdr/hMoR9zROAWCylQjlKihXdl0x9JxBY0rJhJ8g+bfDWIIRK5I0jiD dpPQRWSE6bb+ohRrjbH67UJ5zOeojNeK8cM3m3TNlYEvh9zMvKnFX4zwelzHIl/9TB2e R3TtVG4HxUWoC/YYCc5Jj4XkRm/hWqMEgVkAPUYbaxfGv711wH7x2RWvRUH/l38TbCnT B/+ZOyGqG+ErRnjoSNmE76zmByzFxOmnlEauvSWxikifMIgX5psJ8M/lFTE2U46cpA8g 2D/g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i1si16778186pgi.480.2019.01.04.03.41.27; Fri, 04 Jan 2019 03:41:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727947AbfADKDx (ORCPT + 99 others); Fri, 4 Jan 2019 05:03:53 -0500 Received: from mga17.intel.com ([192.55.52.151]:53930 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726262AbfADKDx (ORCPT ); Fri, 4 Jan 2019 05:03:53 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Jan 2019 02:03:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,437,1539673200"; d="scan'208";a="124040758" Received: from unknown (HELO [10.239.13.114]) ([10.239.13.114]) by orsmga001.jf.intel.com with ESMTP; 04 Jan 2019 02:03:50 -0800 Message-ID: <5C2F30CD.6010108@intel.com> Date: Fri, 04 Jan 2019 18:09:17 +0800 From: Wei Wang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Jim Mattson CC: LKML , kvm list , Paolo Bonzini , Andi Kleen , Peter Zijlstra , Kan Liang , Ingo Molnar , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , like.xu@intel.com, Jann Horn , arei.gonglei@huawei.com Subject: Re: [PATCH v4 04/10] KVM/x86: intel_pmu_lbr_enable References: <1545816338-1171-1-git-send-email-wei.w.wang@intel.com> <1545816338-1171-5-git-send-email-wei.w.wang@intel.com> <5C2DB81F.3000906@intel.com> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/03/2019 11:34 PM, Jim Mattson wrote: > On Wed, Jan 2, 2019 at 11:16 PM Wei Wang wrote: >> On 01/03/2019 07:26 AM, Jim Mattson wrote: >>> On Wed, Dec 26, 2018 at 2:01 AM Wei Wang wrote: >>>> The lbr stack is architecturally specific, for example, SKX has 32 lbr >>>> stack entries while HSW has 16 entries, so a HSW guest running on a SKX >>>> machine may not get accurate perf results. Currently, we forbid the >>>> guest lbr enabling when the guest and host see different lbr stack >>>> entries. >>> How do you handle live migration? >> This feature is gated by the QEMU "lbr=true" option. >> So if the lbr fails to work on the destination machine, >> the destination side QEMU wouldn't be able to boot, >> and migration will not happen. > Yes, but then what happens? > > Fast forward to, say, 2021. You're decommissioning all Broadwell > servers in your data center. You have to migrate the running VMs off > of those Broadwell systems onto newer hardware. But, with the current > implementation, the migration cannot happen. So, what do you do? I > suppose you just never enable the feature in the first place. Right? I'm not sure if that's the way people would do with their data centers. What would be the point of decommissioning all the BDW machines when there are important BDW VMs running? The "lbr=true" option can also be disabled via QMP, which will disable the kvm side lbr support. So if you really want to deal with the above case, you could first disable the lbr feature on the source side, and then boot the destination side QEMU without "lbr=true". The lbr feature will not be available to use by the guest at the time you decide to migrate the guest to a non-compatible physical machine. The point of this patch is: If we couldn't offer our users accurate lbr results, we'd better to have the feature disabled rather than offering wrong results to confuse them. Best, Wei