Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5009632imm; Tue, 18 Sep 2018 02:54:10 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaKfszP/rq94LxSSfV0i/2eyKAYP88Q7YFBPHhZLn0HdmaMsc3BTBDVRY7kS1Fg/0vqWE2T X-Received: by 2002:a62:760a:: with SMTP id r10-v6mr30258802pfc.207.1537264450858; Tue, 18 Sep 2018 02:54:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537264450; cv=none; d=google.com; s=arc-20160816; b=l2jxmFKU0jPFa9NZWdVVpms7sCaadnlKo7LkSlsCfW/VcPHbUMJopZBammnXp/gJMA YNgM56kJ7LzY2J8qWpzkCrzxlGGj3zgZv++cxAW7C5K4R+xl96spvbwZLM7GszZyKgNB iCKrDZRpwUUUnKPpLtv0K2abMIF3/A4yj9snWtoO8WPG7BInRAU79G4jP7jgE2rm6MQx g+G+fR751ZV7pwZZN3tOA3Ak40Nf5lxuTZNgO+MV4bMiUcH96Glg16ptYM1EeNA3FT6A XqZe45eMp4TNG+00Lf7Pe9+BmvMGbSzgo7PV/XXQwqdJWv7YgMwky7JccOFhfRsKBXKL KZnA== 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=QyCQucoCUjmbqeeB0tgTkqiPgR7+AvwM8ETbtwPXHh8=; b=fZtdLsgNJUR133iBQDzB78r5Tx/PFra3qdsa+eQpa6FZ1BXjQHJai3WEdx0CgfUZ3B 1CXqbE/ic6rj5fyUE5HGbsHDH8lZLiZx8G3pB7ShNDihPGgywB7kEcUYWyKBBEoOVUbb 2LgY+RaYSkERldXIBCqklXmbkZ+8MflhGwqEYFQ5lkuYJiFEoWE+nnzkLej5ITox8wWi WNCMSKnVDr0h3WGzQHFeFzG8eLJu0L6tWMyIbyjbQ72jEaPaNuN0GWg4ihRa0r2kY0OC Ie3C51q9FKWYICKKXzIdxPaRVcZyNLzTDNwGQ2e3szQlCkMstkInuOdngMvWDRf36z0X 6kRg== 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 a24-v6si13809958pgi.515.2018.09.18.02.53.54; Tue, 18 Sep 2018 02:54:10 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729501AbeIRPYy (ORCPT + 99 others); Tue, 18 Sep 2018 11:24:54 -0400 Received: from mga01.intel.com ([192.55.52.88]:61023 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726736AbeIRPYx (ORCPT ); Tue, 18 Sep 2018 11:24:53 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Sep 2018 02:53:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,389,1531810800"; d="scan'208";a="91520529" Received: from unknown (HELO [10.239.13.3]) ([10.239.13.3]) by orsmga001.jf.intel.com with ESMTP; 18 Sep 2018 02:53:01 -0700 Message-ID: <5BA0CC1E.6030202@intel.com> Date: Tue, 18 Sep 2018 17:57:50 +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: 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 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> In-Reply-To: <20180918025616.GA10360@tassilo.jf.intel.com> Content-Type: text/plain; charset=windows-1252; 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 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. Best, Wei