Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1566437
| From | Borislav Petkov <bp@alien8.de> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v8 9/9] perf/amd/iommu: Enable support for multiple IOMMUs |
| Date | 2017-01-25 11:00 +0100 |
| Message-ID | <t3swW-6x-15@gated-at.bofh.it> (permalink) |
| References | <t0E1A-mt-13@gated-at.bofh.it> <t2wsV-4Uh-7@gated-at.bofh.it> <t3sng-8uI-19@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Wed, Jan 25, 2017 at 10:46:53AM +0100, Peter Zijlstra wrote:
> Which is absolutely insane.
Right,
IMO, the simplest thing to do for your purposes is to embed a struct
amd_iommu pointer into struct perf_amd_iommu at init time so that you
don't have to do all that crazy dance in the PMU functions and iterate
over the iommus in get_amd_iommu() each time.
Which would then simplify all your other functions. For example:
int amd_iommu_pc_get_reg(unsigned int idx, u8 bank, u8 cntr, u8 fxn, u64 *value)
should be
int amd_iommu_pc_get_reg(struct amd_iommu *iommu, u8 bank, u8 cntr, u8 fxn, u64 *value)
and you can save yourself a lot of glue code and get rid of that
get_amd_iommu() thing.
--
Regards/Gruss,
Boris.
Good mailing practices for 400: avoid top-posting and trim the reply.
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: [PATCH v8 9/9] perf/amd/iommu: Enable support for multiple IOMMUs Peter Zijlstra <peterz@infradead.org> - 2017-01-25 10:50 +0100 Re: [PATCH v8 9/9] perf/amd/iommu: Enable support for multiple IOMMUs Borislav Petkov <bp@alien8.de> - 2017-01-25 11:00 +0100
csiph-web