Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5048050imm; Tue, 18 Sep 2018 03:35:15 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdbd03l9lHma5BOZh74BAmZx1//Q5jBvBR7pOdFoR8bM629yeH/TT9aa1/kCgHwUannvop/x X-Received: by 2002:a63:1e0b:: with SMTP id e11-v6mr26904161pge.44.1537266915211; Tue, 18 Sep 2018 03:35:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537266915; cv=none; d=google.com; s=arc-20160816; b=hnD01Qnp67gH5G0seDEamHvhjJ1T8u0sejc8WaIgpj+6eEEYqkjCWVNdOAg4dwy3/d PR9gpHybiICZNnb+DrCBsji51TDnIU+mQxfOav4xCP5uRNeA3yLPfkJRNallokIQsUN3 WRjEZwEaU7z9GPNr/MZF42idh0eNA7UA4vK2m633aDn1T09fozs3NVbtwP8bsM6mDU3O g6AmsikSQX/kWK953HskhWJW0eRaCax5EDeu80NxGtswkpz6NLnY8lwIG9GPnZp3BeOE MOuRMjV7PBM5m3fuAYVbJ+aLKbJEyJ0LifTgHLi7L1YI3hjB8gODxW+Yg6aO5WR9bEMw J1bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=tM6dM5jYvAZdIbt1bqzukSSPs5uCLwpM6SWZ7pOQD/k=; b=VF9Kvk4CRNt4yhIb/Bbb3sEdDlo/ZFo+Rew6/F+MAW4f7Q8v6y06EwrixZCQHS9dcD rnb2Iurkp4ApxIG8PQgIbFsyv/8Kv2aHckflVxTnTeTVzVt7gx4zMbvgUEpuBDtKQJaF LSS0slaYM1inLjKuYAZG85NdlMWkwguoDmA4fxsVOucLmsfib3xuHBBGM2E3wWbvRz6E ZgvB1Wz+6nL5qQSji+e+McsyAarTHwe+k9nn0A1hBAKTNp8t8fculJ5bXdz+hslAq6rC bp0fbCtvW9Mi+VGAHtLNUoL6LAtggpwV9ix3heVeHpFgRAvbQ4lA6SwUgbzK+dlVaiok d16A== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c8-v6si19024097pls.407.2018.09.18.03.34.58; Tue, 18 Sep 2018 03:35:15 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729379AbeIRQGw convert rfc822-to-8bit (ORCPT + 99 others); Tue, 18 Sep 2018 12:06:52 -0400 Received: from szxga08-in.huawei.com ([45.249.212.255]:40617 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726768AbeIRQGw (ORCPT ); Tue, 18 Sep 2018 12:06:52 -0400 Received: from DGGEML401-HUB.china.huawei.com (unknown [172.30.72.56]) by Forcepoint Email with ESMTP id A960F1E26C1FC; Tue, 18 Sep 2018 18:34:50 +0800 (CST) Received: from DGGEML422-HUB.china.huawei.com (10.1.199.39) by DGGEML401-HUB.china.huawei.com (10.3.17.32) with Microsoft SMTP Server (TLS) id 14.3.399.0; Tue, 18 Sep 2018 18:34:51 +0800 Received: from DGGEML511-MBX.china.huawei.com ([169.254.1.77]) by dggeml422-hub.china.huawei.com ([10.1.199.39]) with mapi id 14.03.0399.000; Tue, 18 Sep 2018 18:34:46 +0800 From: "Gonglei (Arei)" To: Wei Wang , Andi Kleen CC: "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" , "pbonzini@redhat.com" , "kan.liang@intel.com" , "peterz@infradead.org" , "mingo@redhat.com" , "rkrcmar@redhat.com" , "like.xu@intel.com" Subject: RE: [PATCH v2 7/8] KVM: PMU: support to save/restore the guest lbr stack on vCPU switching Thread-Topic: [PATCH v2 7/8] KVM: PMU: support to save/restore the guest lbr stack on vCPU switching Thread-Index: AQHURdllAmT0QJhl2U6encrmkRxO26T1SRnA//+bbQCAAHXJAIAAj15w Date: Tue, 18 Sep 2018 10:34:46 +0000 Message-ID: <33183CC9F5247A488A2544077AF19020DB0F342C@dggeml511-mbx.china.huawei.com> References: <1536233456-12173-1-git-send-email-wei.w.wang@intel.com> <1536233456-12173-8-git-send-email-wei.w.wang@intel.com> <33183CC9F5247A488A2544077AF19020DB0F1D5F@dggeml511-mbx.china.huawei.com> <20180918025616.GA10360@tassilo.jf.intel.com> <5BA0CC1E.6030202@intel.com> In-Reply-To: <5BA0CC1E.6030202@intel.com> Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.177.18.62] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: Wei Wang [mailto:wei.w.wang@intel.com] > Sent: Tuesday, September 18, 2018 5:58 PM > To: Andi Kleen ; Gonglei (Arei) > Cc: linux-kernel@vger.kernel.org; kvm@vger.kernel.org; pbonzini@redhat.com; > kan.liang@intel.com; peterz@infradead.org; mingo@redhat.com; > rkrcmar@redhat.com; like.xu@intel.com > Subject: Re: [PATCH v2 7/8] KVM: PMU: support to save/restore the guest lbr > stack on vCPU switching > > On 09/18/2018 10:56 AM, Andi Kleen wrote: > >>> From: Like Xu > >>> > >>> This patch adds support to KVM to save/restore the lbr stack on vCPU > >>> context switching. > >>> > >>> When the guest sets the ACTIVE bit of MSR_KVM_PV_LBR_CTRL, a perf > event > >>> is created on the host for the related vCPU. This perf event ensures the > >>> LBR stack to be saved/restored when the vCPU thread is scheduled out/in. > >>> The perf event is removed and freed when the guest clears the ACTIVE > >>> bit. > >>> > >> What about live migration? Does LBR stack need to be saved on the source > side and > >> restored on the dest side with the passthrough mode? > > Yes it should. Either for call stack LBR, or when it is frozen/disabled. > > > > When it's not frozen/disabled and not in call stack LBR mode it likely doesn't > > hurt either, but it's not strictly needed because it will > > be replaced so quickly. > > Yes, should be supported. We are working on v3 with the suggested lazy > save approach, and will send it out shortly. > Nice~ Thanks, -Gonglei