Re: [PATCH V3 1/5] perf/amd/iommu: Consolidate and move perf_event_amd_iommu header

From: Suravee Suthikulpanit
Date: Wed Feb 10 2016 - 13:43:19 EST


Hi Boris,

On 2/10/16 23:41, Borislav Petkov wrote:
On Tue, Feb 09, 2016 at 04:53:51PM -0600, Suravee Suthikulpanit wrote:
>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"
>
>Reviewed-by: Joerg Roedel<jroedel@xxxxxxx>
>Signed-off-by: Suravee Suthikulpanit<Suravee.Suthikulpanit@xxxxxxx>
>---
> 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
Is this a header which will be used on something else besides x86 or why
is it being moved to include/linux/ ?

If not, it should go into arch/x86/events/ with the rest of the perf
private headers.

...


My goal here is to find a place that I can declare a set of function prototypes and macros used in the IOMMU driver and IOMMU PERF. These are exported by the AMD IOMMU and can be used by other drivers (e.g. IOMMU perf).

The reason I picked this location to place the header file is because there is already an existing include/linux/perf/arm_pmu.h file there. So, I thought it might be alright to put the perf_event_amd_iommu.h here.

Having the information in the file arch/x86/events/amd/iommu.h seems strange for having to specify ../../arch/x86/events/amd/iommu.h in the IOMMU driver.

So, you think it would be alright if move

include/linux/perf/perf_event_amd_iommu.h
to
arch/x86/include/perf/perf_event_amd_iommu.h


Suravee

Thanks,
Suravee