Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754324AbbG2WW2 (ORCPT ); Wed, 29 Jul 2015 18:22:28 -0400 Received: from mail-by2on0135.outbound.protection.outlook.com ([207.46.100.135]:60288 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753166AbbG2WW1 (ORCPT ); Wed, 29 Jul 2015 18:22:27 -0400 Authentication-Results: linux.vnet.ibm.com; dkim=none (message not signed) header.d=none; Message-ID: <1438208530.2993.350.camel@freescale.com> Subject: Re: [PATCH v5 1/2] perf,kvm/ppc: Add kvm_perf.h for powerpc From: Scott Wood To: Hemant Kumar CC: , , , , , , , , Date: Wed, 29 Jul 2015 17:22:10 -0500 In-Reply-To: <55B8ACD9.8090404@linux.vnet.ibm.com> References: <1437061722-15438-1-git-send-email-hemant@linux.vnet.ibm.com> <1437077417.2993.108.camel@freescale.com> <55B8ACD9.8090404@linux.vnet.ibm.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.16.0-fta1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Originating-IP: [2601:448:8100:f9f:12bf:48ff:fe84:c9a0] X-ClientProxiedBy: BLUPR11CA0072.namprd11.prod.outlook.com (10.141.30.40) To BY1PR03MB1482.namprd03.prod.outlook.com (25.162.210.140) X-Microsoft-Exchange-Diagnostics: 1;BY1PR03MB1482;2:PiUkdX/IZ4+qqRw7QZ2NPSvs/4rDuYswVKiBc+CMusSL+JjB8zE/g+UVIj3kcHKo/uHmUEhaVWuCowoxGXfrFyTyaE376Em1GSeQFtQa6KmNfaVKd1YutFUqvHkwV6K77CTDg5iqhI+67PsBHB6VEZKGcPpGHg7rGCCKhIyOA60=;3:IHGiHF99rfQ16OBob0tcKXmFJvxCuXQqZXG22PtYI60u23nAMt7srBU5RlE4SZ2jNkXn/dC8x2EFrFmtfy0UqLnqfORa8igrhBHgA56l+FHajQLIPIX2+othXSroI2PiIU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SHCAX61sOxcuBCoXMA5sKKJmlj5OHnc99CW8eZjmaEOL8BVKyYJyKjySUcoeX7eXSA8ZZ2kCFTJ7nHEx8D/0/1C/EwRq6xNpQcJh8hZvx3w57c3EifOvFvjB9JElbkD4SsLJXADSXoLotY= BY1PR03MB1482: X-MS-Exchange-Organization-RulesExecuted X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:BY1PR03MB1482;BCL:0;PCL:0;RULEID:;SRVR:BY1PR03MB1482; X-Forefront-PRVS: 0652EA5565 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6009001)(24454002)(377454003)(479174004)(377424004)(23676002)(77096005)(19580405001)(103116003)(5001960100002)(46102003)(50226001)(19580395003)(47776003)(50986999)(77156002)(76176999)(2950100001)(86362001)(110136002)(33646002)(50466002)(92566002)(5820100001)(62966003)(42186005)(5001920100001)(189998001)(36756003)(122386002)(40100003)(142933001)(3826002);DIR:OUT;SFP:1102;SCL:1;SRVR:BY1PR03MB1482;H:[IPv6:2601:448:8100:f9f:12bf:48ff:fe84:c9a0];FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BY1PR03MB1482;23:7qEppyzOBZ6QUNKzKvNcXI2GRjZuH49GxoJSvqmJKMq/FpZRnDvs1xni1aY+DqnV1Yt0Pwh/VHvbF+RWYaLsHnjIHQoNsUCJREBZW42v4c2O+AXK6vmEK2SablyKDnlAXnUHZpsqMKVV2sSzrc7SWBrHc8LMomLv1oaj72esd5C+Hd1+/fPvLWjwyChbHYZm7FoKgKl+WgQvB4tGWYeAWCo0TboeWLQG2BIewHip/dEzUu7zDtg7pYupon1n/0JH3CQN6tuLdMA4IAioMkoxbeBX8HBTZNnTtcD5pRCEaDpvSchOvrX+Ac/dJvm6jtVDnLlmBXoLwcX5gsrJ6KUaTshe4rYD7AX3WlIOU56kkqwGyILEwFeq63VsRb7JuZXfu3c/GSh0khbq5AUT+agVjukpt3Byifo8FMwiRM4EjWjQB3/cd4/ij1Ky5ySkM9zVgZeQo7EWUcYBUaY8Wd6rs/kUnoeT0A9C/XsRGebHkasOUrjS3hZplIbMnWPaMyg4eopUnmHruNADSLllR+cG7KQ45l1m1URP8Q9sb3YFoQkWFYT5V5NZsAgsGBQkiidMYQ4butRAetqTK6WGVXNGBJYI94g5s1KDJNIrcRnGJNHEZ3WfgSU8gIh0fvgTvgT0t6AwwiLwYEZVPxcHa/eJFAGecXY347Lfb5jN1zJ1JiNqWjFRu/fC88Y+cA+50+XI2FtXS93d3xvbK5hh5vz5BofcNA4StLescD4YnST6vdtIaTSsNnCyunq9XD5FJpFm0/wAoEc+1OsCo3xTmlF2w/AyjQMncqRRgvYbZsw1SefnmjJpvRSvV8VVmIdiOk5I7HVehqqu+xWBO62NqmtYGOF0651J8VkUPkt28fUzZ1g4BjEFtTiu46u1l9D2Xp4bwQ7GIEIpf/PDU1DakAgKAQ== X-Microsoft-Exchange-Diagnostics: 1;BY1PR03MB1482;5:8NyuSXtic3yN8luZY72OL51dTCE0DyURsnaSAGmnf7sR7Lq8gQw1mR2qovmAebgITNUemKYIeaGbs9OizoSj5ECv8iUTZiKg62ATj7XZPGfqZBwGvBtNFVXPpiA8C16zW1XbvKeqcHzRzVer0qobiA==;24:mMenYAEf1VG56DU/D8iDoeQu2XCKQ1WlZDaUeHuRg9kqAcSwUl73xIfmQnHe9SbfdPK8Nz6jf0ZShWWLzZRChBztwJHtJts93TXn+bPgIow=;20:OJnfqvfssZlXucpkJzUdNFKNyIZKn582aEK6T6vSTemkQQ5ggI2mJJx6mCpJrYKOesvCSmkk7lqG/WI+za/eng== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jul 2015 22:22:24.2815 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR03MB1482 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3361 Lines: 99 On Wed, 2015-07-29 at 16:07 +0530, Hemant Kumar wrote: > Hi Scott, > > On 07/17/2015 01:40 AM, Scott Wood wrote: > > On Thu, 2015-07-16 at 21:18 +0530, Hemant Kumar wrote: > > > To analyze the exit events with perf, we need kvm_perf.h to be added in > > > the arch/powerpc directory, where the kvm tracepoints needed to trace > > > the KVM exit events are defined. > > > > > > This patch adds "kvm_perf_book3s.h" to indicate that the tracepoints are > > > book3s specific. Generic "kvm_perf.h" then can just include > > > "kvm_perf_book3s.h". > > > > > > Signed-off-by: Hemant Kumar > > > --- > > > Changes: > > > - Not exporting the exit reasons compared to previous patchset > > > (suggested > > > by Paul) > > > > > > arch/powerpc/include/uapi/asm/kvm_perf.h | 6 ++++++ > > > arch/powerpc/include/uapi/asm/kvm_perf_book3s.h | 14 ++++++++++++++ > > > 2 files changed, 20 insertions(+) > > > create mode 100644 arch/powerpc/include/uapi/asm/kvm_perf.h > > > create mode 100644 arch/powerpc/include/uapi/asm/kvm_perf_book3s.h > > > > > > diff --git a/arch/powerpc/include/uapi/asm/kvm_perf.h > > > b/arch/powerpc/include/uapi/asm/kvm_perf.h > > > new file mode 100644 > > > index 0000000..5ed2ff3 > > > --- /dev/null > > > +++ b/arch/powerpc/include/uapi/asm/kvm_perf.h > > > @@ -0,0 +1,6 @@ > > > +#ifndef _ASM_POWERPC_KVM_PERF_H > > > +#define _ASM_POWERPC_KVM_PERF_H > > > + > > > +#include > > > + > > > +#endif > > > diff --git a/arch/powerpc/include/uapi/asm/kvm_perf_book3s.h > > > b/arch/powerpc/include/uapi/asm/kvm_perf_book3s.h > > > new file mode 100644 > > > index 0000000..8c8d8c2 > > > --- /dev/null > > > +++ b/arch/powerpc/include/uapi/asm/kvm_perf_book3s.h > > > @@ -0,0 +1,14 @@ > > > +#ifndef _ASM_POWERPC_KVM_PERF_BOOK3S_H > > > +#define _ASM_POWERPC_KVM_PERF_BOOK3S_H > > > + > > > +#include > > > + > > > +#define DECODE_STR_LEN 20 > > > + > > > +#define VCPU_ID "vcpu_id" > > > + > > > +#define KVM_ENTRY_TRACE "kvm_hv:kvm_guest_enter" > > > +#define KVM_EXIT_TRACE "kvm_hv:kvm_guest_exit" > > > +#define KVM_EXIT_REASON "trap" > > > + > > > +#endif /* _ASM_POWERPC_KVM_PERF_BOOK3S_H */ > > Again, why is book3s stuff being presented via uapi as generic > > with generic symbol names? > > > > -Scott > > Ok. > > We can change the KVM_ENTRY_TRACE macro to something like > KVM_BOOK3S_ENTRY_TRACE and likewise for KVM_EXIT_TRACE > and KVM_EXIT_REASON What about DECODE_STR_LEN and VCPU_ID? Where is this API documented? > and then, to resolve the issue of generic > macro names in the userspace side, we can handle it using __weak > modifier. Does userspace get built differently for book3s versus book3e? For now it'd be fine for userspace to check for book3s and not use the feature if it's book3e. If and when book3e gains this feature, then userspace can be changed. > What would you suggest? Another option would be to explain this interface so that we can figure out if book3e would even want different values for these, and if not, move it to asm/kvm.h. -Scott -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/