From: Andrew Morton <akpm@linux-foundation.org>
To: Yinghai Lu <Yinghai.Lu@Sun.COM>
Cc: Andi Kleen <ak@suse.de>, Jeff Garzik <jeff@garzik.org>,
Greg KH <greg@kroah.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] x86_64: check and enable MMCONFIG for AMD Family 10h Opteron
Date: Wed, 12 Sep 2007 15:42:26 -0700 [thread overview]
Message-ID: <20070912154226.312e99fd.akpm@linux-foundation.org> (raw)
In-Reply-To: <200709121233.39218.yinghai.lu@sun.com>
On Wed, 12 Sep 2007 12:33:38 -0700
Yinghai Lu <Yinghai.Lu@Sun.COM> wrote:
> [PATCH] x86_64: check and enable MMCONFIG for AMD Family 10h Opteron
>
> Signed-off-by: Yinghai Lu <yinghai.lu@sun.com>
>
> Index: linux-2.6/arch/x86_64/kernel/setup.c
> ===================================================================
> --- linux-2.6.orig/arch/x86_64/kernel/setup.c 2007-09-12 11:28:08.000000000 -0700
> +++ linux-2.6/arch/x86_64/kernel/setup.c 2007-09-12 12:09:32.000000000 -0700
> @@ -507,6 +507,32 @@
> }
> #endif
>
> +/*[39:8] */
> +/* why not using 0xfe000000 ? */
> +#define FAM10H_PCI_MMIO_BASE 0xc0000000
> +static void fam10h_check_enable_mmcfg(struct cpuinfo_x86 *c)
> +{
> + u32 low, high, address;
> +
> + address = 0xc0010058;
> + if (rdmsr_safe(address, &low, &high))
> + return;
> +
> + if (low & 1)
> + return;
> +
> + printk(KERN_INFO "Enable MMCONFIG on AMD Family 10h\n");
> + /*
> + * if it is not enable, let enable it and assume only one segement
> + * with 256 buses
> + */
> + low &= ~(0xfff00000 | (0xf<<2));
> + low |= (8<<2) | (1<<0);
> + high &= ~(0x0000ffff);
> + high |= (FAM10H_PCI_MMIO_BASE>>(32-8));
> + wrmsr_safe(address, low, high);
> +}
> +
> /*
> * On a AMD dual core setup the lower bits of the APIC id distingush the cores.
> * Assumes number of cores is a power of two.
> @@ -655,6 +681,9 @@
> /* Family 10 doesn't support C states in MWAIT so don't use it */
> if (c->x86 == 0x10 && !force_mwait)
> clear_bit(X86_FEATURE_MWAIT, &c->x86_capability);
> +
> + if (c->x86 == 0x10)
> + fam10h_check_enable_mmcfg(c);
> }
>
> static void __cpuinit detect_ht(struct cpuinfo_x86 *c)
fixes:
--- a/arch/x86_64/kernel/setup.c~x86_64-check-and-enable-mmconfig-for-amd-family-10h-opteron-fix
+++ a/arch/x86_64/kernel/setup.c
@@ -494,7 +494,7 @@ static int nearby_node(int apicid)
/*[39:8] */
/* why not using 0xfe000000 ? */
#define FAM10H_PCI_MMIO_BASE 0xc0000000
-static void fam10h_check_enable_mmcfg(struct cpuinfo_x86 *c)
+static void __cpuinit fam10h_check_enable_mmcfg(struct cpuinfo_x86 *c)
{
u32 low, high, address;
@@ -507,8 +507,8 @@ static void fam10h_check_enable_mmcfg(st
printk(KERN_INFO "Enable MMCONFIG on AMD Family 10h\n");
/*
- * if it is not enable, let enable it and assume only one segement
- * with 256 buses
+ * If it is not enabled, enable it and assume only one segment
+ * with 256 busses.
*/
low &= ~(0xfff00000 | (0xf<<2));
low |= (8<<2) | (1<<0);
_
prev parent reply other threads:[~2007-09-12 22:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-12 19:33 [PATCH] x86_64: check and enable MMCONFIG for AMD Family 10h Opteron Yinghai Lu
2007-09-12 22:42 ` Andrew Morton [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070912154226.312e99fd.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=Yinghai.Lu@Sun.COM \
--cc=ak@suse.de \
--cc=greg@kroah.com \
--cc=jeff@garzik.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox