Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2413858pxb; Thu, 3 Feb 2022 06:14:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJxn/a6SZOxBKfvdDON5uwdjY3ibJ2Rz0XMojgE2Q99pcoFzu04WQhr3FSzHdw/yfS70ZpCU X-Received: by 2002:a17:907:1b16:: with SMTP id mp22mr30478447ejc.537.1643897640779; Thu, 03 Feb 2022 06:14:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643897640; cv=none; d=google.com; s=arc-20160816; b=MvXxJ3QvcQe4YYdHFPExxthdMNtOPhxygWZkTPBbAr9IgzxcsFIpLR/Imxw9uSmo99 BEVpNZfSKAgWqp9bYKgegjrsS2qwYKRfVTFN7B398Y+ZZ8QScgGM8c7HOnekiDxAYYJK P6mJblj7VCOQdevlkEwTtIGQLuSxzE2FDDehcyiq1Unot7ZRdZmldLhKkHLR5mBehL1L oJj1/n/0jnSu7zmsL8u4+nyUcgjWDWO9K4NK/mdwYTtgsEz/AMkOg5BgQxeb/q0upqZl UV+9OUHDThYc8geyVaNOeEb9FGdkPKjDtg7itVz6OUim3f4+vC7SfgJn8fCmewJ3185Y 34cQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=gYsMOanhgag9FX9U5PUDWc3Rn4Habp49ag3te6WP1O0=; b=leM4iGUZQhX64uMN6AKF32z1p5RgPFEi2Lfbeav4t8/HrnE94yAbatvXui9+qPigLK cMGOXMjr+rebekXoBcB76oVgGs5yI6+8oRUNDQYa3R8aYczy3t4itaniTR8i65aPKluA flfv2lskrlM5U9GOEFDZrrjbDhmGwsYIm8e7+wE95Kkxgdsqt3TI0XoPc9Xx1RQ0pN/o /BCLnlyTqTH1oSVBoFgJZS8r5I5XW6ZsL5HkLNRdAmxJuY3zWg4iE184oI4K5IFL+MiB kMbtVU7kwza7F81mG3f2obW5byvs9HoOf076sQXCzeHMc/XdH/anaYDOa/UVbk1n80U2 sjyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OsQlSFnA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h20si16386056ede.184.2022.02.03.06.13.33; Thu, 03 Feb 2022 06:14:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OsQlSFnA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238076AbiBAM2Z (ORCPT + 99 others); Tue, 1 Feb 2022 07:28:25 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:22979 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237630AbiBAM2W (ORCPT ); Tue, 1 Feb 2022 07:28:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643718502; 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=gYsMOanhgag9FX9U5PUDWc3Rn4Habp49ag3te6WP1O0=; b=OsQlSFnA6Pccor2foPJpl/OlbAXZmhQIEhqg8j92DCF/+jRAA7pM8qO168jgIknQUhYEIU okTYtQxKp/Dw6ZRHK2rLYK0OEHPSSLomURZA3g6OzduFL00wmdp8WcPD2qPP/5XOf8sm41 rciEMl8vgGOPbR67PbskJRwjXu5V5Js= Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-576-gYjaq2YeOfennkLyOcPGPg-1; Tue, 01 Feb 2022 07:28:21 -0500 X-MC-Unique: gYjaq2YeOfennkLyOcPGPg-1 Received: by mail-ed1-f72.google.com with SMTP id v15-20020a50a44f000000b004094f4a8f3bso8636658edb.0 for ; Tue, 01 Feb 2022 04:28:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=gYsMOanhgag9FX9U5PUDWc3Rn4Habp49ag3te6WP1O0=; b=iYUhXnLae3q7eJC2tff0T52KZqF9FZOsNONh86tQCUensZtnVc7e2vEFaKwdRKH9Rw yRr1dzMw7KRzGBf/6nA5rkzuAz/DYh74E2jIg/e7lZZXjZ/5sXqRzi+ZJK4TMxY+wK1k bAxsRig19vZHoC+Id8/H8cPcha6Od8mMISi549VFaEvXAszhfw0do40jg2PYtz/x0RY9 G0RfjHrLLkyHEUjjvBpdwetqJha18mpp93xzNz1FG2l2JR9EaLIzrJPXcp56mtdY7Ad8 vBZyz8tm+OGn30S/nqyRm6mDzmoRCi7K9ZHWnYvgUlY2u1Bh9W01qbyjpZ9mk2qSvx8m sDTw== X-Gm-Message-State: AOAM531R1nKzotLmeaY/s0j7mxx4n/nBwJsXlzeKlKsZeYbpDBW/yEax ERnrwYS0VlzoINQ/9RmRdi0KTjGViBCO/eGJ0NkXXpJxQoBTw0sRmLrDypTf48Lk4lG5opAKIq1 KRIb3IqxbWcQC3KAezzGkoW0U X-Received: by 2002:a17:907:6091:: with SMTP id ht17mr20947054ejc.626.1643718500195; Tue, 01 Feb 2022 04:28:20 -0800 (PST) X-Received: by 2002:a17:907:6091:: with SMTP id ht17mr20947035ejc.626.1643718500029; Tue, 01 Feb 2022 04:28:20 -0800 (PST) Received: from ?IPV6:2001:b07:6468:f312:c8dd:75d4:99ab:290a? ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.googlemail.com with ESMTPSA id s1sm19400809edt.49.2022.02.01.04.28.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Feb 2022 04:28:19 -0800 (PST) Message-ID: <13de6271-61bc-7138-15b3-9241508d94fa@redhat.com> Date: Tue, 1 Feb 2022 13:28:18 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH kvm/queue v2 3/3] KVM: x86/pmu: Setup the {inte|amd}_event_mapping[] when hardware_setup Content-Language: en-US To: Like Xu , Jim Mattson Cc: Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Like Xu References: <20220117085307.93030-1-likexu@tencent.com> <20220117085307.93030-4-likexu@tencent.com> From: Paolo Bonzini In-Reply-To: <20220117085307.93030-4-likexu@tencent.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/17/22 09:53, Like Xu wrote: > + > + for (i = 0; i < PERF_COUNT_HW_MAX; i++) { > + config = perf_get_hw_event_config(i) & 0xFFFFULL; > + > + kernel_hw_events[i] = (struct kvm_event_hw_type_mapping){ > + .eventsel = config & ARCH_PERFMON_EVENTSEL_EVENT, > + .unit_mask = (config & ARCH_PERFMON_EVENTSEL_UMASK) >> 8, > + .event_type = i, > + }; Should event_type be PERF_COUNT_HW_MAX if config is zero? Thanks, Paolo