Received: by 10.213.65.68 with SMTP id h4csp528744imn; Fri, 16 Mar 2018 10:29:28 -0700 (PDT) X-Google-Smtp-Source: AG47ELs6TO+nofsZJyLqDReWLCHbh8TV/9Ho5uT2myhNMXT3pNb81ODRadOFO6qsCHGg2zkDO6f2 X-Received: by 10.99.126.73 with SMTP id o9mr2101916pgn.406.1521221368352; Fri, 16 Mar 2018 10:29:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521221368; cv=none; d=google.com; s=arc-20160816; b=A8mcFXlU4PdZP9ra9XUX6T0ExJSY9aMnKpe+SQHVF40Gpo9l9NJgDiqCEKNUz4rH/8 Lobks5r2wOrZ9UrUOoGwylhXc0EAFbbwieHrF9oYWLoeoxfnxty+hlsUlNFEsyxHIT4J DbPVXQSjcsYIO7OL4WKgFzwjT79RuVMyM3Jhzaj2oAv0nOKqji600xkzw3a10L4+FE/G Vb2Ye9FrGafbtlslksT2DBFjwHEez9gpkzSeyqk0Vs2yuAnsb7wPQlPmgovEOuEejBdl 66+mTZTcOpG0hJJd5v16ZGYtoNaXgEy+8QrfiHbBVDePvvrdSqQKwtngG9vC8tPAuoQg eb0Q== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=vdW4afLXgX0FakN5NGtZp10lVWyGZ0U/EEu+nogRQ/w=; b=XfrHbPYP6BeRP1+ayIIRWhchnymVJ8mQeEYcz5x9+9cTihbT5ctCXb0TV6igkrBiLs UZQiMx72Mtfbzk7kbSKEMdyYuZpalo8iTyBscXCUsmqUwpmJDg3W/e8yHiS0BC3kJnrE ++GfT9mvFoa4Y8gvupKGwGczBTdZopnidb2h1ed35mMtn9S4JcHMc/sOm4uIN1iUf4ut m8pP0oyrvKtYf8D3xan96k3CS3mfuHUuBRUELyS6M4TmPIPLcSLqUB+xp9zCDaC0X/Df G4/FJj0xR8NYD+mnTPLcYeJfVumYN3oUzAvEIA0p+2Dehi7IrYbKp4RLHEb778W6jnrM gCCQ== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u24si5728336pfh.326.2018.03.16.10.29.13; Fri, 16 Mar 2018 10:29:28 -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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753532AbeCPR2J (ORCPT + 99 others); Fri, 16 Mar 2018 13:28:09 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:60428 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751064AbeCPR2H (ORCPT ); Fri, 16 Mar 2018 13:28:07 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CBED1814DF58; Fri, 16 Mar 2018 17:28:06 +0000 (UTC) Received: from [10.36.116.50] (ovpn-116-50.ams2.redhat.com [10.36.116.50]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 105AEAFD7B; Fri, 16 Mar 2018 17:28:04 +0000 (UTC) Subject: Re: [PATCH v5 03/11] perf/x86/intel/pt: Introduce a new function to get the capability of Intel PT To: Luwei Kang , kvm@vger.kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, rkrcmar@redhat.com, linux-kernel@vger.kernel.org, joro@8bytes.org References: <1520165241-15819-1-git-send-email-luwei.kang@intel.com> <1520165241-15819-4-git-send-email-luwei.kang@intel.com> From: Paolo Bonzini Message-ID: <98515f5f-9c8a-8e1a-4fef-c9a8a0e9e8f5@redhat.com> Date: Fri, 16 Mar 2018 18:28:03 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <1520165241-15819-4-git-send-email-luwei.kang@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Fri, 16 Mar 2018 17:28:06 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Fri, 16 Mar 2018 17:28:06 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'pbonzini@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/03/2018 13:07, Luwei Kang wrote: > +u32 pt_cap_get_ex(u32 *caps, enum pt_capabilities cap) > +{ > + struct pt_cap_desc *cd = &pt_caps[cap]; > + u32 c = caps[cd->leaf * PT_CPUID_REGS_NUM + cd->reg]; > + unsigned int shift = __ffs(cd->mask); > + > + return (c & cd->mask) >> shift; > +} > +EXPORT_SYMBOL_GPL(pt_cap_get_ex); > + You should change pt_cap_get to use this function. Also, "_ex" is not a very common suffix, so perhaps you can call it __pt_cap_get. I don't have any other comments on patches 1-3, so when you resend we can ask the x86 maintainers for approval. Thanks, Paolo