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

From: Aravind Gopalakrishnan
Date: Tue Apr 07 2015 - 11:01:06 EST


On 4/7/2015 7:34 AM, Borislav Petkov wrote:
On Mon, Apr 06, 2015 at 06:10:22PM -0500, Aravind Gopalakrishnan wrote:
So what happens if !early_pci_allowed() but the GART is present? We'll
set amd_northbridges.flags |= AMD_NB_GART, but won't run any of the
setup code in aperture_64.c, right? Is that a valid setup?
It might be a valid setup. But it would work correctly only if BIOS did the
right thing with setting up aperture space.

If !early_pci_allowed() and BIOS did not setup aperture correctly, that
would have caused problems already.
But it has not been an issue so far right?
I think the right question to ask is:

What are we doing when there's no GART?

So what you probably want to do is:

if (!amd_gart_present())
return -ENODEV;

*before* the compound check.

Now, if we have detected a GART, i.e., amd_gart_present() is TRUE, the
code will behave as it used to behave before.

This should be the least intrusive change going forward IMHO.


Okay. I'll do that and correct the typos Ingo pointed out earlier and resend.

Thanks,
-Aravind.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/