Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933612AbbLVTcF (ORCPT ); Tue, 22 Dec 2015 14:32:05 -0500 Received: from mail-bn1on0087.outbound.protection.outlook.com ([157.56.110.87]:41604 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932180AbbLVTaU (ORCPT ); Tue, 22 Dec 2015 14:30:20 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Suravee.Suthikulpanit@amd.com; From: Suravee Suthikulpanit To: , , , , CC: , , Suravee Suthikulpanit Subject: [PATCH 1/6] perf/amd/iommu: Consolidate and move perf_event_amd_iommu header Date: Tue, 22 Dec 2015 13:19:12 -0600 Message-ID: <1450811957-1511-2-git-send-email-Suravee.Suthikulpanit@amd.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1450811957-1511-1-git-send-email-Suravee.Suthikulpanit@amd.com> References: <1450811957-1511-1-git-send-email-Suravee.Suthikulpanit@amd.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: BY2PR04CA0009.namprd04.prod.outlook.com (10.255.247.19) To CY1PR12MB0444.namprd12.prod.outlook.com (25.163.91.22) X-Microsoft-Exchange-Diagnostics: 1;CY1PR12MB0444;2:W2sPL+v2GIe9D+R5/+5q98qMx/qP9c5z8faNRYSB6vPo1QPLGq82lJ79fQFKGTejEHNyXRrhZb8t/HjArZ+T2hRW0hJfVTnspef9QNI8Gwpm3KwCDD+B+EaYQwkrGs2muoeWDQcrBjKqzJAUcI6VuQ==;3:hVItnwkb+kvp3kpTfbSN6erwPZ06WDQFa9BuIEVRQQsnyn66HBJDaH1tIElenboq8++QsJm8W+weLgOpjtHfROTzA0LXrlPsMJ+tdIbVIdmESsOYMZH3VmF+dDf2Ftof;25:+P56RTcP13NVmbi6FaohFcZA2QZv+kVGGSTqHTmCBcovhLDY279Q9+q+T3W/EnM4Rmyl1V146yW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qp7WKvoziR2jg02Rkpor70igIQ5DL6ycqu2/k/2tmlZIloFvtbAPm0ay/jnX4TIakxuBotBHJCJ+BjAYVCZNwCdx1Qsb9jFkn/SDQaxPNb7GsiW9GEKZywRFVv5ayS+PxMo27pMKan+ovnD8Jt6lzgU= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(8121501046)(520078)(5005006)(3002001)(10201501046);SRVR:CY1PR12MB0444;BCL:0;PCL:0;RULEID:;SRVR:CY1PR12MB0444; X-Forefront-PRVS: 0798146F16 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6009001)(189002)(199003)(105586002)(101416001)(53416004)(19580395003)(50466002)(40100003)(19580405001)(106356001)(5001770100001)(42186005)(97736004)(47776003)(50986999)(87976001)(2201001)(3846002)(48376002)(5003940100001)(76176999)(229853001)(66066001)(86362001)(189998001)(2950100001)(6116002)(36756003)(5004730100002)(50226001)(77096005)(586003)(5008740100001)(1096002)(92566002)(122386002)(2004002);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR12MB0444;H:ssuthiku-cz-dev.amd.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR12MB0444;23:AryQmFRXvVd0lz4o7veK+4ugE4FFojkAotij0Q1vV?= =?us-ascii?Q?CaZ48wCrJp4uq9UItD2F+4MTzJToET9iqkvKjLm2nTk0BZzV866dTnjn+ynT?= =?us-ascii?Q?8IwRQSBRcEF1kt0JIyXQzdA2ZUiZnryFtaiwpjE83xLEng4ak9MjSRiA3vno?= =?us-ascii?Q?rQVmVGlJGA1xZJTyyZm9aRqXJ4Op117JMsxUA54MMOavbV294B07c3uJZWvn?= =?us-ascii?Q?67IoSJbkkV5YDaNUMZpTbDzf/xjI1v3K1ZktI+rUA3tcZWSjhBMetyFrTjyA?=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gnHZIMlKvlmN0V87PtyBP7tnZJYniaFpTamw==;24:RxZg2d6QJY6PMmjzkynRZBJQr9YMqCLGbrgaSpvT0NS9Ev3/rpqRB6fbioMbJ6GBGbCPeqznjfvdDwc2bE9qDJGOcTSRTbtRCKVMx/H38wE=;20:tzoLlNf92fxX/H3UVVLvjPPISdKEPN6T2vz8p/FDRTJO0WRptxA8/sXWckXZ7ckICJ+UxAEZpSGHlwsEu7+hS6+mXU2aQIdQ7lkhbxohD8XTIIyux60fOHXUA1KNJsQcjqFTs3UImj9Oys0yjaR4eZyGj65qqRgT/Tdslh0syVtaLscKR+FKoHP55qBDg5xSI7o7D5WxpO9hNYx/bnNd98w1mlGFLdte43gmfpnldwzqBXCQbq6WhrOO1cAdXiYE X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Dec 2015 19:30:15.7195 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR12MB0444 X-Microsoft-Exchange-Diagnostics: 1;CY1PR12MB0853;2:e5oMWL9zrbLii52xirsbx8RSXcANgfGc+Yc9w45EK1MdeKW8rYQKw1NE/+TibvKwDdAesEa3rtw9y5GiD4/EOFSjAYcaOscHZgnGzNYJpla0joatbJPcARklo4/N+22urlHHmzWccTL6HNivnXJFqQ==;23:8xwhFZRYvtAdnGjkkw3aGYYqx2Eq/ukW88dKqLNE4jCtpRf/Um1veJJ2Yn1M2j+jlHo1FL0APO6TcOgWYfJ/xtAT3lZarHJoIV+76t/0MJVms0q2QHT6lf6e1T6CMQM0fz94XfVIqmvimd1a2NO+SeqWCOXZ0X6KEkqtyAxhRpy3NVL6jZJ8IL7Tgn330Yry X-OriginatorOrg: amd.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5739 Lines: 164 This patch consolidates "arch/x86/kernel/cpu/perf_event_amd_iommu.h" and "drivers/iommu/amd_iommu_proto.h", which contain duplicate function declarations, into "include/linux/perf/perf_event_amd_iommu.h" Signed-off-by: Suravee Suthikulpanit --- arch/x86/kernel/cpu/perf_event_amd_iommu.c | 2 +- arch/x86/kernel/cpu/perf_event_amd_iommu.h | 40 ------------------------------ drivers/iommu/amd_iommu_init.c | 2 ++ drivers/iommu/amd_iommu_proto.h | 7 ------ include/linux/perf/perf_event_amd_iommu.h | 40 ++++++++++++++++++++++++++++++ 5 files changed, 43 insertions(+), 48 deletions(-) delete mode 100644 arch/x86/kernel/cpu/perf_event_amd_iommu.h create mode 100644 include/linux/perf/perf_event_amd_iommu.h diff --git a/arch/x86/kernel/cpu/perf_event_amd_iommu.c b/arch/x86/kernel/cpu/perf_event_amd_iommu.c index 86f8259..1192f1d 100644 --- a/arch/x86/kernel/cpu/perf_event_amd_iommu.c +++ b/arch/x86/kernel/cpu/perf_event_amd_iommu.c @@ -12,12 +12,12 @@ */ #include +#include #include #include #include #include "perf_event.h" -#include "perf_event_amd_iommu.h" #define COUNTER_SHIFT 16 diff --git a/arch/x86/kernel/cpu/perf_event_amd_iommu.h b/arch/x86/kernel/cpu/perf_event_amd_iommu.h deleted file mode 100644 index 845d173..0000000 --- a/arch/x86/kernel/cpu/perf_event_amd_iommu.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2013 Advanced Micro Devices, Inc. - * - * Author: Steven Kinney - * Author: Suravee Suthikulpanit - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#ifndef _PERF_EVENT_AMD_IOMMU_H_ -#define _PERF_EVENT_AMD_IOMMU_H_ - -/* iommu pc mmio region register indexes */ -#define IOMMU_PC_COUNTER_REG 0x00 -#define IOMMU_PC_COUNTER_SRC_REG 0x08 -#define IOMMU_PC_PASID_MATCH_REG 0x10 -#define IOMMU_PC_DOMID_MATCH_REG 0x18 -#define IOMMU_PC_DEVID_MATCH_REG 0x20 -#define IOMMU_PC_COUNTER_REPORT_REG 0x28 - -/* maximun specified bank/counters */ -#define PC_MAX_SPEC_BNKS 64 -#define PC_MAX_SPEC_CNTRS 16 - -/* iommu pc reg masks*/ -#define IOMMU_BASE_DEVID 0x0000 - -/* amd_iommu_init.c external support functions */ -extern bool amd_iommu_pc_supported(void); - -extern u8 amd_iommu_pc_get_max_banks(u16 devid); - -extern u8 amd_iommu_pc_get_max_counters(u16 devid); - -extern int amd_iommu_pc_get_set_reg_val(u16 devid, u8 bank, u8 cntr, - u8 fxn, u64 *value, bool is_write); - -#endif /*_PERF_EVENT_AMD_IOMMU_H_*/ diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c index 013bdff..b6d684c 100644 --- a/drivers/iommu/amd_iommu_init.c +++ b/drivers/iommu/amd_iommu_init.c @@ -27,6 +27,8 @@ #include #include #include +#include + #include #include #include diff --git a/drivers/iommu/amd_iommu_proto.h b/drivers/iommu/amd_iommu_proto.h index 0bd9eb3..ac2da91 100644 --- a/drivers/iommu/amd_iommu_proto.h +++ b/drivers/iommu/amd_iommu_proto.h @@ -55,13 +55,6 @@ extern int amd_iommu_domain_set_gcr3(struct iommu_domain *dom, int pasid, extern int amd_iommu_domain_clear_gcr3(struct iommu_domain *dom, int pasid); extern struct iommu_domain *amd_iommu_get_v2_domain(struct pci_dev *pdev); -/* IOMMU Performance Counter functions */ -extern bool amd_iommu_pc_supported(void); -extern u8 amd_iommu_pc_get_max_banks(u16 devid); -extern u8 amd_iommu_pc_get_max_counters(u16 devid); -extern int amd_iommu_pc_get_set_reg_val(u16 devid, u8 bank, u8 cntr, u8 fxn, - u64 *value, bool is_write); - #ifdef CONFIG_IRQ_REMAP extern int amd_iommu_create_irq_domain(struct amd_iommu *iommu); #else diff --git a/include/linux/perf/perf_event_amd_iommu.h b/include/linux/perf/perf_event_amd_iommu.h new file mode 100644 index 0000000..845d173 --- /dev/null +++ b/include/linux/perf/perf_event_amd_iommu.h @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2013 Advanced Micro Devices, Inc. + * + * Author: Steven Kinney + * Author: Suravee Suthikulpanit + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef _PERF_EVENT_AMD_IOMMU_H_ +#define _PERF_EVENT_AMD_IOMMU_H_ + +/* iommu pc mmio region register indexes */ +#define IOMMU_PC_COUNTER_REG 0x00 +#define IOMMU_PC_COUNTER_SRC_REG 0x08 +#define IOMMU_PC_PASID_MATCH_REG 0x10 +#define IOMMU_PC_DOMID_MATCH_REG 0x18 +#define IOMMU_PC_DEVID_MATCH_REG 0x20 +#define IOMMU_PC_COUNTER_REPORT_REG 0x28 + +/* maximun specified bank/counters */ +#define PC_MAX_SPEC_BNKS 64 +#define PC_MAX_SPEC_CNTRS 16 + +/* iommu pc reg masks*/ +#define IOMMU_BASE_DEVID 0x0000 + +/* amd_iommu_init.c external support functions */ +extern bool amd_iommu_pc_supported(void); + +extern u8 amd_iommu_pc_get_max_banks(u16 devid); + +extern u8 amd_iommu_pc_get_max_counters(u16 devid); + +extern int amd_iommu_pc_get_set_reg_val(u16 devid, u8 bank, u8 cntr, + u8 fxn, u64 *value, bool is_write); + +#endif /*_PERF_EVENT_AMD_IOMMU_H_*/ -- 1.9.1 -- 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/