Re: [PATCH 1/2] x86, amd: factor out MMCONFIG discovery

From: Bjorn Helgaas
Date: Thu Jan 12 2012 - 08:56:36 EST


On Wed, Jan 11, 2012 at 11:52 PM, Eric Dumazet <eric.dumazet@xxxxxxxxx> wrote:
> Le jeudi 05 janvier 2012 à 14:27 -0700, Bjorn Helgaas a écrit :
>> This factors out the AMD native MMCONFIG discovery so we can use it
>> outside amd_bus.c.
>>
>> amd_bus.c reads AMD MSRs so it can remove the MMCONFIG area from the
>> PCI resources.  We may also need the MMCONFIG information to work
>> around BIOS defects in the ACPI MCFG table.
>>
>> Cc: Borislav Petkov <borislav.petkov@xxxxxxx>
>> Cc: Yinghai Lu <yinghai@xxxxxxxxxx>
>> Cc: stable@xxxxxxxxxx       # 2.6.34+
>> Signed-off-by: Bjorn Helgaas <bhelgaas@xxxxxxxxxx>
>> ---
>>  arch/x86/include/asm/amd_nb.h |    2 ++
>>  arch/x86/kernel/amd_nb.c      |   31 ++++++++++++++++++++++++++++++
>>  arch/x86/pci/amd_bus.c        |   42 +++++++++++------------------------------
>>  3 files changed, 44 insertions(+), 31 deletions(-)
>
>>  /**
>> @@ -85,6 +57,9 @@ static int __init early_fill_mp_bus_info(void)
>>       u64 val;
>>       u32 address;
>>       bool found;
>> +     struct resource fam10h_mmconf_res, *fam10h_mmconf;
>> +     u64 fam10h_mmconf_start;
>> +     u64 fam10h_mmconf_end;
>>
>>       if (!early_pci_allowed())
>>               return -1;
>> @@ -211,12 +186,17 @@ static int __init early_fill_mp_bus_info(void)
>>               subtract_range(range, RANGE_NUM, 0, end);
>>
>>       /* get mmconfig */
>> -     get_pci_mmcfg_amd_fam10h_range();
>> +     fam10h_mmconf = amd_get_mmconfig_range(&fam10h_mmconf_res);
>>       /* need to take out mmconf range */
>
> This adds following link error if "# CONFIG_CPU_SUP_AMD is not set"
>
>  LD      .tmp_vmlinux1
> arch/x86/pci/built-in.o: In function `early_fill_mp_bus_info':
> /opt/src/linux/arch/x86/pci/amd_bus.c:189: undefined reference to
> `amd_get_mmconfig_range'
> make: *** [.tmp_vmlinux1] Error 1

I posted a fix for this, but looks like it hasn't been merged yet:
http://marc.info/?l=linux-pci&m=132614917932150&w=2

I'll resend it.

Bjorn
--
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/