From: "H. Peter Anvin" <hpa@zytor.com>
To: Arjan van de Ven <arjan@linux.intel.com>
Cc: Ingo Molnar <mingo@elte.hu>, Yinghai Lu <yinghai@kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
NetDev <netdev@vger.kernel.org>,
x86@kernel.org, Andrew Morton <akpm@linux-foundation.org>,
"Theodore Ts'o" <tytso@mit.edu>,
Alan Cox <alan@lxorguk.ukuu.org.uk>,
jesse Barnes <jbarnes@virtuousgeek.org>
Subject: Re: oops/warning report for the week of November 26, 2008
Date: Thu, 27 Nov 2008 13:42:58 -0800 [thread overview]
Message-ID: <492F1462.4020803@zytor.com> (raw)
In-Reply-To: <20081127122800.45fc0b1a@linux.intel.com>
Arjan van de Ven wrote:
>
> diff --git a/arch/x86/kernel/cpu/mtrr/main.c b/arch/x86/kernel/cpu/mtrr/main.c
> index 1159e26..0044e61 100644
> --- a/arch/x86/kernel/cpu/mtrr/main.c
> +++ b/arch/x86/kernel/cpu/mtrr/main.c
> @@ -1567,6 +1567,8 @@ int __init mtrr_trim_uncached_memory(unsigned long end_pfn)
> * Make sure we only trim uncachable memory on machines that
> * support the Intel MTRR architecture:
> */
> + if (!cpu_has_mtrr)
> + return 0;
> if (!is_cpu(INTEL) || disable_mtrr_trim)
> return 0;
> rdmsr(MTRRdefType_MSR, def, dummy);
Okay... is_cpu() here is defined as:
#define is_cpu(vnd) (mtrr_if && mtrr_if->vendor == X86_VENDOR_##vnd)
... so an MTRR interface has been identified. Therefore testing
cpu_has_mtrr is redundant.
As far as use_intel() versus is_cpu(INTEL), it looks to me as though the
two are identical in the current code -- mtrr_if->vendor is never set in
the generic code, and so defaults to 0 - meaning X86_VENDOR_INTEL.
All in all, it looks like the vendor ID stuff is a bad case of "works by
accident" in the MTRR code, however, *given the current code* I conclude
that is_cpu(INTEL) == use_intel() and that neither can be true without
MTRRs enabled.
-hpa
next prev parent reply other threads:[~2008-11-27 21:43 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-26 23:11 oops/warning report for the week of November 26, 2008 Arjan van de Ven
2008-11-27 0:05 ` Jesse Barnes
2008-11-27 11:48 ` Ingo Molnar
2008-11-27 19:42 ` Alex Chiang
2008-11-27 19:49 ` Arjan van de Ven
2008-11-27 11:52 ` Ingo Molnar
2008-11-27 17:02 ` Jesse Barnes
2008-11-27 18:01 ` Arjan van de Ven
2008-11-27 20:18 ` Ingo Molnar
2008-11-27 20:28 ` Arjan van de Ven
2008-11-27 20:47 ` Ingo Molnar
2008-11-27 20:53 ` Arjan van de Ven
2008-11-28 8:34 ` Ingo Molnar
2008-11-27 21:18 ` H. Peter Anvin
2008-11-27 21:18 ` Yinghai Lu
2008-11-27 21:42 ` H. Peter Anvin [this message]
2008-11-28 17:18 ` Jay Cliburn
2008-11-28 17:32 ` Arjan van de Ven
2008-11-28 18:36 ` Jay Cliburn
2008-11-28 18:50 ` Arjan van de Ven
2008-11-28 21:12 ` atl1 transmit timeout Was: " Jay Cliburn
2008-11-28 21:22 ` Arjan van de Ven
2008-11-28 19:50 ` Francois Romieu
2008-11-28 20:12 ` Arjan van de Ven
2008-11-30 8:58 ` Roger Luethi
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=492F1462.4020803@zytor.com \
--to=hpa@zytor.com \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=arjan@linux.intel.com \
--cc=jbarnes@virtuousgeek.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=netdev@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=tytso@mit.edu \
--cc=x86@kernel.org \
--cc=yinghai@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;
as well as URLs for NNTP newsgroup(s).