From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE4CAC433E0 for ; Fri, 29 May 2020 10:24:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AB7A4207BC for ; Fri, 29 May 2020 10:24:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="DBEx4+5F" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726638AbgE2KYK (ORCPT ); Fri, 29 May 2020 06:24:10 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:42640 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726150AbgE2KYI (ORCPT ); Fri, 29 May 2020 06:24:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590747847; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pxDBHAtntdYo3/I5jF5RO1+05QKmLkITNesr/lf56qc=; b=DBEx4+5FN/AD28aeTa6dXDKO2fUVDo1Zp3RPGaxoClkHagydljSivvmylb7ocwM+5Qwe1h xQCNm6dLkdoqqxI9zjqFNOgUWiFQCe6V3qcNmFaIEZeaSqe+CDxd8aJLRhvVQzSIIKRm0G l/UKtQF5Y18HyBfspStKx3z1+9QmeSo= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-441-qawquSnTOy-0VwhveRywAw-1; Fri, 29 May 2020 06:24:03 -0400 X-MC-Unique: qawquSnTOy-0VwhveRywAw-1 Received: by mail-wm1-f70.google.com with SMTP id b63so2434847wme.1 for ; Fri, 29 May 2020 03:24:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=pxDBHAtntdYo3/I5jF5RO1+05QKmLkITNesr/lf56qc=; b=JCFU3fIi+gnswbW6/u9Aeh+Z00H38FAEMIo/W8yJ9mYer00YvpSEDgclf6JZWBBwVk /jGClZgPGg5976BemDzhA9w237Q7C/noiRxbgv9JZ4rJK+aCY2BCKtVezjA7G1Tp5swh 0MEcegcDu1fr2MyMmsL6DN8ljfiOonMhWjGWCUCpY2+UpiNjxsf1B0sTOmGf2BpNNqzB yWxxLS7ULUMwouDxlcDXvFd2vI7vCtaRnOzLHHwIeYkjO1maIlM0hBlWDV6rxbjaxdhJ UD3P+fD8gEvFE/+2z7Hltt1YXquNxGh8MKLacAeCizgWJgDxW7ovC8b65ciTWpZ3/I/1 4zfQ== X-Gm-Message-State: AOAM530cj5ULjD5vwGS+9tASZQiirV0Hpv5C36Wp5ceaEIfP2WqUfoSM tYgUDGcC9RBHDjyBZRDJpgYSq4yoQETUFvpZ2DFLTxfh4Kt+3o9ux4W5WzOVWYaOMgYTCq+zvlf x4H7EIqFHWkaG5GpQnE1v/HMc X-Received: by 2002:a1c:df57:: with SMTP id w84mr8387054wmg.52.1590747842077; Fri, 29 May 2020 03:24:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTJlbT0P7UibD2L2+OQYbTMuMmZmH8apUHkw6a/gvcox+qHPjE6vge9qVAIxlOiHSEMqBYiQ== X-Received: by 2002:a1c:df57:: with SMTP id w84mr8387030wmg.52.1590747841776; Fri, 29 May 2020 03:24:01 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:b096:1b7:7695:e4f7? ([2001:b07:6468:f312:b096:1b7:7695:e4f7]) by smtp.gmail.com with ESMTPSA id e6sm3010301wrx.80.2020.05.29.03.24.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 29 May 2020 03:24:00 -0700 (PDT) Subject: Re: [Qemu-devel PATCH] target/i386: define a new MSR based feature word - FEAT_PERF_CAPABILITIES To: Like Xu Cc: Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Richard Henderson , Eduardo Habkost , Marcelo Tosatti , qemu-devel@nongnu.org References: <20200529074347.124619-1-like.xu@linux.intel.com> <20200529074347.124619-5-like.xu@linux.intel.com> From: Paolo Bonzini Message-ID: <1aa68600-e48d-fa83-b2e2-b070a486afd4@redhat.com> Date: Fri, 29 May 2020 12:23:59 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20200529074347.124619-5-like.xu@linux.intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 29/05/20 09:43, Like Xu wrote: > + if (!cpu->enable_pmu) { > + *ecx &= ~CPUID_EXT_PDCM; > + } > break; > case 2: > /* cache info: needed for Pentium Pro compatibility */ > @@ -6505,6 +6528,12 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp) > } > } > > + if (kvm_enabled() && cpu->enable_pmu && > + (kvm_arch_get_supported_cpuid(kvm_state, 1, 0, R_ECX) & > + CPUID_EXT_PDCM)) { > + env->features[FEAT_1_ECX] |= CPUID_EXT_PDCM; > + } > + I'm dropping this hunk two hunks because it's going to break live migration with e.g. "-cpu IvyBridge,pmu=on". We will have to add PDCM by default only to future CPU models, but "-cpu host,pmu=on" will pick it up automatically. Paolo From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 111A6C433E0 for ; Fri, 29 May 2020 10:24:47 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D04E12074B for ; Fri, 29 May 2020 10:24:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="JVjQFthF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D04E12074B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:43822 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jecBy-0008VU-0p for qemu-devel@archiver.kernel.org; Fri, 29 May 2020 06:24:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56744) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jecBN-0007li-3J for qemu-devel@nongnu.org; Fri, 29 May 2020 06:24:09 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:32758 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jecBL-0000Iy-Pq for qemu-devel@nongnu.org; Fri, 29 May 2020 06:24:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590747846; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pxDBHAtntdYo3/I5jF5RO1+05QKmLkITNesr/lf56qc=; b=JVjQFthF7L976DwuWQQo10+LD36qNmoYtUC7pWtdS/qOXBQgOoTdc8A/ZIrcLjJl1Ps2hs 3ezu/2bpTIM8hEIz5fkWfuXOA+B7zpUeJqsZy5jiQok1gwFyVuKlwsmCuMx1+tjj0vQdwN YRTnc84PZSKolxjxxX4M2v337UIGHJ4= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-120--pUeCN0APCCcXUi86aYoyQ-1; Fri, 29 May 2020 06:24:03 -0400 X-MC-Unique: -pUeCN0APCCcXUi86aYoyQ-1 Received: by mail-wm1-f70.google.com with SMTP id y202so470638wmd.0 for ; Fri, 29 May 2020 03:24:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=pxDBHAtntdYo3/I5jF5RO1+05QKmLkITNesr/lf56qc=; b=VeKho+1OWFQwQnZNY2Cy0hShbiNiOA/0vMytp+MmaBTuMoLg2fAtgerpbjKqgjkkeB Hkkbw31zMWE6KYCa07BI9VnODDT4S+EqLINzCpfh+YXzCDNBWYY9yKio+tKmqrwf7LH5 nuqcAKR18hR8dKhtGHkyRgC3000e/KVe+CKX5ZGUmyThyUkfd+54NxnglS+IkBRlhVjv KOxnHD9i48VDsgnLlwxgLm3ajVR0wTNnO0VRmMaxODkR+Ka1gddF/0ak4Lqlhn7r0U6C tRGD5tB47/NWnClMm3U+eqMM8xE2WTk4ClS+snYRf1YRSYK0yYqhvsNVV85VPAEQxnTM 1c3A== X-Gm-Message-State: AOAM5317r0NbeTJlM0SF/8uTIov2oS1bsHveLQ/yER65ZrKXdAPn4sON HRKtwaZVoOYRJnO+AmYQC5Jc4/nsPGhgWoXrh4U+Nj/Zqm1ibPhFjh2B4xES7PKIozvO+wDUaxt EQ5WeFa+vsGavIN0= X-Received: by 2002:a1c:df57:: with SMTP id w84mr8387059wmg.52.1590747842081; Fri, 29 May 2020 03:24:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTJlbT0P7UibD2L2+OQYbTMuMmZmH8apUHkw6a/gvcox+qHPjE6vge9qVAIxlOiHSEMqBYiQ== X-Received: by 2002:a1c:df57:: with SMTP id w84mr8387030wmg.52.1590747841776; Fri, 29 May 2020 03:24:01 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:b096:1b7:7695:e4f7? ([2001:b07:6468:f312:b096:1b7:7695:e4f7]) by smtp.gmail.com with ESMTPSA id e6sm3010301wrx.80.2020.05.29.03.24.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 29 May 2020 03:24:00 -0700 (PDT) Subject: Re: [Qemu-devel PATCH] target/i386: define a new MSR based feature word - FEAT_PERF_CAPABILITIES To: Like Xu References: <20200529074347.124619-1-like.xu@linux.intel.com> <20200529074347.124619-5-like.xu@linux.intel.com> From: Paolo Bonzini Message-ID: <1aa68600-e48d-fa83-b2e2-b070a486afd4@redhat.com> Date: Fri, 29 May 2020 12:23:59 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20200529074347.124619-5-like.xu@linux.intel.com> Content-Language: en-US X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=205.139.110.120; envelope-from=pbonzini@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 23:43:13 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Wanpeng Li , Eduardo Habkost , kvm@vger.kernel.org, Joerg Roedel , Marcelo Tosatti , linux-kernel@vger.kernel.org, Sean Christopherson , qemu-devel@nongnu.org, Vitaly Kuznetsov , Richard Henderson , Jim Mattson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 29/05/20 09:43, Like Xu wrote: > + if (!cpu->enable_pmu) { > + *ecx &= ~CPUID_EXT_PDCM; > + } > break; > case 2: > /* cache info: needed for Pentium Pro compatibility */ > @@ -6505,6 +6528,12 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp) > } > } > > + if (kvm_enabled() && cpu->enable_pmu && > + (kvm_arch_get_supported_cpuid(kvm_state, 1, 0, R_ECX) & > + CPUID_EXT_PDCM)) { > + env->features[FEAT_1_ECX] |= CPUID_EXT_PDCM; > + } > + I'm dropping this hunk two hunks because it's going to break live migration with e.g. "-cpu IvyBridge,pmu=on". We will have to add PDCM by default only to future CPU models, but "-cpu host,pmu=on" will pick it up automatically. Paolo