Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2877514ybl; Thu, 29 Aug 2019 14:21:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqxhDsbqkYWvYJ1FXEulZYoX1qAZD8FcUiK/ZPa9KlwHe9CNPAjz8zu+g/HcLX/9Jq/d7K7D X-Received: by 2002:a17:90a:256f:: with SMTP id j102mr12543768pje.14.1567113685572; Thu, 29 Aug 2019 14:21:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567113685; cv=none; d=google.com; s=arc-20160816; b=mVKenho7u8kSZ0+OB6X2h+/B21YtuSTPCF8md8Q8uOc7N3FKHy6NAXslM2xhEkzE8v x85vTpIalNMMt2aiakGWsHd7w49SG5axjiUEvILtQ0PBSClXKGm3SlLj4Yw7HRY60ci7 YZiB0IlTvjjWTEPy+GtXE+ZAZNupl8hefvWsYf2iTMGrvBIlnzIT+jn2kPqe194o1KTJ k6D4vQOy5YiXS8GrBEL0Ja5hQOjMIWRNDMntRKjxUs2O5p9XgRGeAdAKDNrLh1F/HaN/ TLegUv3nT80QxPMXlKQ6wpgIXpkB51voekVGOFMVUBBm4EU2YfkTy97K6v9owlCTcuBK BUAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=njJ3p3kSs40EwcJIMizzFze1TjU4sZw1SzbnxqXUGNo=; b=t7+befaH76YAzwIWx1ncocq306Nt55QCYH3HbkTzQm0sMK7Lpu4K36Z9PWesvjgIO0 kgVckdq6s/+hex2TLckNTcLcttujIG2fIOjUyPTOPIrVG+3XTLPV8b6gqq2MusKgFKEk OD6uJBTKqrG09tK/MQI6hRYG48733HpfcieVkhbx/I6w7g6icQbCpFfoxUuyFRDc5wb/ GKUWwLuJHkjsC9EtPTPkZ/k2H1c5yAmJaTGe6NhV0qM1DG7nBPYkGsrbExJS/WH47laq hxt08yINT2LzdQrYn/PR1nGSVTaP4ZSUsI5JkGyLK7cwAM/2iHCOrPBaFSnIkPnvLVAl pUHg== 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 z11si3159351pju.108.2019.08.29.14.21.10; Thu, 29 Aug 2019 14:21:25 -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 S1727959AbfH2VUR (ORCPT + 99 others); Thu, 29 Aug 2019 17:20:17 -0400 Received: from mga07.intel.com ([134.134.136.100]:9707 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726526AbfH2VUR (ORCPT ); Thu, 29 Aug 2019 17:20:17 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Aug 2019 14:20:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,445,1559545200"; d="scan'208";a="186097946" Received: from tassilo.jf.intel.com (HELO tassilo.localdomain) ([10.7.201.137]) by orsmga006.jf.intel.com with ESMTP; 29 Aug 2019 14:20:17 -0700 Received: by tassilo.localdomain (Postfix, from userid 1000) id EDB1730121D; Thu, 29 Aug 2019 14:20:16 -0700 (PDT) Date: Thu, 29 Aug 2019 14:20:16 -0700 From: Andi Kleen To: Luwei Kang Cc: pbonzini@redhat.com, rkrcmar@redhat.com, sean.j.christopherson@intel.com, vkuznets@redhat.com, wanpengli@tencent.com, jmattson@google.com, joro@8bytes.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC v1 3/9] KVM: x86: Implement MSR_IA32_PEBS_ENABLE read/write emulation Message-ID: <20190829212016.GV5447@tassilo.jf.intel.com> References: <1567056849-14608-1-git-send-email-luwei.kang@intel.com> <1567056849-14608-4-git-send-email-luwei.kang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1567056849-14608-4-git-send-email-luwei.kang@intel.com> User-Agent: Mutt/1.12.0 (2019-05-25) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > + case MSR_IA32_PEBS_ENABLE: > + if (pmu->pebs_enable == data) > + return 0; > + if (!(data & pmu->pebs_enable_mask) && > + (data & MSR_IA32_PEBS_OUTPUT_MASK) == > + MSR_IA32_PEBS_OUTPUT_PT) { > + pebs_enable_changed(pmu, data); > + return 0; > + } Need #GP for bad values