Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1898327imj; Sun, 17 Feb 2019 17:57:43 -0800 (PST) X-Google-Smtp-Source: AHgI3IYcJuAjiCh4YN/Wzs8bEYyPmrMwNzgxGyxBXRpgYRbOKbA1xUNeoU7Bh4YTOQT6YzBDj6oG X-Received: by 2002:a17:902:e789:: with SMTP id cp9mr11189304plb.127.1550455063169; Sun, 17 Feb 2019 17:57:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550455063; cv=none; d=google.com; s=arc-20160816; b=cIur09gECMI8Js1LX2EOsEZnnbBGhP4SOqqdmeh4w1o3EaS9jBaNJzZLJJRJ1nNeNs 677VIXWkP5d0z57vGCo+80mGTSRedKOILf4P6wYX00FOiHeniwBk0UxLOJQ5rqT+6CWN X3zXT6uuqvpil9pRqJOpMB0Kwo4hY0GgL87zl3lFyUZ9jCkwbyWG4ylXBtayESAXYyle tvbeUVVI9jwRtLHvD2nP3vxWpTqcrsGIGBJbWoQ2x6Cd9elGzS2daqKc+UgspxUibmof R5TJY1+t4EUlBR+t3pJt2pOofu4eCaMMjFJgGA6LA4Tnzb6Bkv0bNQVQ2O8Sm0ML8qsz x8JQ== 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=Gm6AsD7keEU04w9y4WOuUtNnay1xqfFg7oTObyw57NY=; b=zV5ILHLulkOJtwEOZx7W5YtxcD35CmwxPdPDoIUdcNzPPqnIBCcHLqMtRVw7BFPxA2 dIQMAE1XIADKx3iRQ/jE/k1P911zikBlOnznHOY06ac0OLSo2cARmHvt5nf/d5QiXYKW +6hKC50rcng+oLVnRPeGKhooDzx2XxborfiNSVBQQYQFwtwIFG7pR7S8eOKXotf9nmHk M0iyT8yvHefF8eRky+UFZ9f/F7JRepj+rY3zXiDhwg2rlbj//cF8WbrWlYCEiYgc9HOr erNcvm9Nfe/uZSuTPap1xVUgoF0X6itWYiZsUY0bUv153G03uQrpZOh67yp9SbConbpS rx6A== 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 a8si11556809pff.153.2019.02.17.17.57.25; Sun, 17 Feb 2019 17:57: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 S1728210AbfBRBzB (ORCPT + 99 others); Sun, 17 Feb 2019 20:55:01 -0500 Received: from mga11.intel.com ([192.55.52.93]:57638 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727948AbfBRBzA (ORCPT ); Sun, 17 Feb 2019 20:55:00 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Feb 2019 17:55:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,382,1544515200"; d="scan'208";a="127243187" Received: from unknown (HELO [10.239.13.114]) ([10.239.13.114]) by orsmga003.jf.intel.com with ESMTP; 17 Feb 2019 17:54:57 -0800 Message-ID: <5C6A119C.8080009@intel.com> Date: Mon, 18 Feb 2019 09:59:56 +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 CC: "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" , "pbonzini@redhat.com" , "peterz@infradead.org" , "Liang, Kan" , "mingo@redhat.com" , "rkrcmar@redhat.com" , "Xu, Like" , "jannh@google.com" , "arei.gonglei@huawei.com" , "jmattson@google.com" Subject: Re: [PATCH v5 12/12] KVM/VMX/vPMU: support to report GLOBAL_STATUS_LBRS_FROZEN References: <1550135174-5423-1-git-send-email-wei.w.wang@intel.com> <1550135174-5423-13-git-send-email-wei.w.wang@intel.com> <20190214163147.GL16922@tassilo.jf.intel.com> <286AC319A985734F985F78AFA26841F73DF71ED6@shsmsx102.ccr.corp.intel.com> <20190215131014.GC16922@tassilo.jf.intel.com> In-Reply-To: <20190215131014.GC16922@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 02/15/2019 09:10 PM, Andi Kleen wrote: > > OK. The freeze bits need to be cleared by IA32_PERF_GLOBAL_STATUS_RESET, which seems not supported by the perf code yet (thus guest won't clear them). Would handle_irq_v4 also need to be changed to support that? > In Arch Perfmon v4 it is cleared by the MSR_CORE_PERF_GLOBAL_OVF_CTRL write Not very sure about this one. The spec 18.2.4.2 mentions "IA32_PERF_GLOBAL_STATUS_RESET provides additional bit fields to clear the new indicators.." IIUIC, the new freeze bits can only be cleared by RESET. > But the guest KVM pmu doesn't support v4 so far, so the only way to clear it is through DEBUGCTL. > > STATUS_RESET would only be needed to set it from the guest, which is not necessary at least for now > (and would be also v4) > > At some point the guest PMU should probably be updated for v4, but it can be done > separately from this. > Agree. I think the guest perf won't work in v4 mode if the KVM vPMU exposes it is v3. Probably we could also leave the freeze bits virtualization support to another series of vPMU v4 support? We would also need to use the STATUS_SET in v4 to set the freeze bits of GLOBAL_STATUS when entering the guest (instead of clearing the guest debugctl), so that we could achieve architectural emulation. Best, Wei