Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3042633ybl; Thu, 29 Aug 2019 17:23:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqwN0AUR/BjDtdAAO0+izulggmVjGgMIhiE/38GYYPUOHZq5ZHJHPgg99eQkjRlDW5C/ddvk X-Received: by 2002:a63:1b66:: with SMTP id b38mr10791603pgm.54.1567124601452; Thu, 29 Aug 2019 17:23:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567124601; cv=none; d=google.com; s=arc-20160816; b=NA2vjNuG0wL4ozJeblsQO+Dxej3vWyBlrjb+ZNiVWbSBFoouxQmGsuOjumILlM7PkG 4V309XJScr9ngy8LFGGZTahVTlpkhkL84FPUvQRspKu5L0J5DPljwVFNh9vcon3LSPu6 sP5DpiD6BphEBMtGyRXm1o/GxksEJiIKv8KM6Hey9jE5bCUS9ihNQWrxXBXRC+138PhL 3HIhxklhTwjd11V3VRaTNsyIWfEjfMJlLyY9x/5eWBOCNcyRtsz0VAdv0gQfIQ4FUtp1 rT7g4w5A4/D/LjbZTDNUAL6e6K6L5StHMFJ/ZXOvpezxCmv2d4r1WZeuDfaqB3v6qj82 L0Tg== 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=QCthpv1Wd1bxq9CuU3UrdzALOgYc2qbcuK4DfHQh4RY=; b=pRZZVjxuq7037vFqlGMkG2LfDnZ/xo88deaQjcLcvLz73zXHdsWJkXIjgp1T0Y/asE g0+zOeVZHbcJYPemKNM2eoE3C/fDPui55XW4hndB08OCJ63OYn3EX4TwZdYaQgCMEBA0 zduAbG5wCMZyeYcA5mNRJaihpmpDdXuQ8kroQ0ppxmCk5/I5S6zzfgobYjL+CnSifiwm B93iI68R8SehsJM1S59cAsZlsznaCpJVV5NnIOFgYgtSTwXSi9M5mVbCydh9gn+EqtrG OHOCVjU86MVp74dwYwvgAv6F2WqflPg4ExWrUD8Ev18AaW02LA5a5xyiCBOCphSVOe4w YaeQ== 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 n21si3471310pjt.33.2019.08.29.17.23.05; Thu, 29 Aug 2019 17:23:21 -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 S1727182AbfH3AWM convert rfc822-to-8bit (ORCPT + 99 others); Thu, 29 Aug 2019 20:22:12 -0400 Received: from mga07.intel.com ([134.134.136.100]:22601 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726988AbfH3AWM (ORCPT ); Thu, 29 Aug 2019 20:22:12 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Aug 2019 17:22:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,445,1559545200"; d="scan'208";a="332694186" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga004.jf.intel.com with ESMTP; 29 Aug 2019 17:22:11 -0700 Received: from fmsmsx126.amr.corp.intel.com (10.18.125.43) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 29 Aug 2019 17:22:11 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX126.amr.corp.intel.com (10.18.125.43) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 29 Aug 2019 17:22:10 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.112]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.139]) with mapi id 14.03.0439.000; Fri, 30 Aug 2019 08:22:09 +0800 From: "Kang, Luwei" To: Andi Kleen CC: "pbonzini@redhat.com" , "rkrcmar@redhat.com" , "Christopherson, Sean J" , "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 Thread-Topic: [RFC v1 3/9] KVM: x86: Implement MSR_IA32_PEBS_ENABLE read/write emulation Thread-Index: AQHVXiwscwhutE1kJU23+jUvuPvAQqcSHKUAgAC3tRA= Date: Fri, 30 Aug 2019 00:22:08 +0000 Message-ID: <82D7661F83C1A047AF7DC287873BF1E1737F78B3@SHSMSX104.ccr.corp.intel.com> References: <1567056849-14608-1-git-send-email-luwei.kang@intel.com> <1567056849-14608-4-git-send-email-luwei.kang@intel.com> <20190829212016.GV5447@tassilo.jf.intel.com> In-Reply-To: <20190829212016.GV5447@tassilo.jf.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 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 Yes, this function will return 1 if neither of above two conditions check are not true. And will inject a #GP to guest. Thanks, Luwei Kang