Re: [PATCH] x86, aperture: Check for GART before accessing GART registers

Borislav Petkov
2015-04-02T07:01:12Z

On Wed, Apr 01, 2015 at 09:32:08AM -0500, Aravind Gopalakrishnan wrote:
> GART registers are not present in newer processors (Fam15h, Model 10h
> and later). So, avoid accesses to GART registers in PCI config
> space by returning early in early_gart_iommu_check() and
> gart_iommu_hole_init() if GART is not available.
>
> Refactoring the family check used in amd_nb into an inline function
> so we can use it here as well as in amd_nb.c
>
> Tested the patch on Fam10h and Fam15h Model 00h-fh and this code
> runs fine. On Fam15h Model 60h-6fh and on Fam16h, we bail early
> as they don't have GART.
>
> Signed-off-by: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com>
> Reviewed-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
> ---
> arch/x86/include/asm/amd_nb.h | 11 +++++++++++
> arch/x86/kernel/amd_nb.c | 4 +---
> arch/x86/kernel/aperture_64.c | 4 ++--
> 3 files changed, 14 insertions(+), 5 deletions(-)

Applied, thanks.

--
Regards/Gruss,
Boris.

ECO tip #101: Trim your mails when you reply.
--