From: Matt Mackall <mpm@selenic.com>
To: Michael Opdenacker <michael-lists@free-electrons.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
"H. Anvin" <hpa@zytor.com>,
linux-kernel@vger.kernel.org, Linux-tiny@selenic.com
Subject: Re: [PATCH] x86 (Linux Tiny): configure out support for some processors
Date: Fri, 08 Feb 2008 17:20:12 -0600 [thread overview]
Message-ID: <1202512812.17934.680.camel@cinder.waste.org> (raw)
In-Reply-To: <200802082347.25364.michael-lists@free-electrons.com>
On Fri, 2008-02-08 at 23:47 +0100, Michael Opdenacker wrote:
> This patch against x86/mm tries to revive an original patch
> from Matt Mackall which didn't get merged at that time. It makes
> it possible to disable support code for some processors. This can
> be useful to support only the exact processor type used
> in a given system.
>
> I may have made wrong assumptions with the code handling
> force_mwait. As force_mwait is only declared in
> arch/x86/kernel/cpu/amd.c, which is only compiled
> when CONFIG_X86_32 is set, I thought it was safe
> to make the code depend on CONFIG_CPU_SUP_AMD,
> but I could be wrong.
>
> Your comments are more than welcome! To make the code
> cleaner, I could use empty inline functions instead
> of ifdef's, as suggested in Documentation/SubmittingPatches.
Please include the output of size with all these options on and off.
> diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
> index dabdbef..8f9a123 100644
> --- a/arch/x86/kernel/process_32.c
> +++ b/arch/x86/kernel/process_32.c
> @@ -287,8 +287,10 @@ static void mwait_idle(void)
>
> static int __cpuinit mwait_usable(const struct cpuinfo_x86 *c)
> {
> +#ifdef CONFIG_CPU_SUP_AMD
> if (force_mwait)
> return 1;
> +#endif
Probably makes sense to move force_mwait (one word) here and eliminate
these ifdefs.
> diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c
> index 347a8cd..812bfa0 100644
> --- a/arch/x86/mm/init_32.c
> +++ b/arch/x86/mm/init_32.c
> @@ -211,12 +211,14 @@ static void __init kernel_physical_mapping_init(pgd_t *pgd_base)
> }
> }
>
> +#ifdef CONFIG_CPU_SUP_INTEL
> static inline int page_kills_ppro(unsigned long pagenr)
> {
> if (pagenr >= 0x70000 && pagenr <= 0x7003F)
> return 1;
> return 0;
> }
> +#endif
> /*
> * devmem_is_allowed() checks to see if /dev/mem access to a certain address
> @@ -287,7 +289,11 @@ static void __meminit free_new_highpage(struct page *page)
>
> void __init add_one_highpage_init(struct page *page, int pfn, int bad_ppro)
> {
> - if (page_is_ram(pfn) && !(bad_ppro && page_kills_ppro(pfn))) {
> + if (page_is_ram(pfn)
> +#ifdef CONFIG_CPU_SUP_INTEL
> + && !(bad_ppro && page_kills_ppro(pfn))
> +#endif
Yuck. A better way to do this is move the bad_ppro check into
page_kills_ppro and then ifdef out -the body- of the inline.
> @@ -592,7 +598,11 @@ void __init mem_init(void)
> #ifdef CONFIG_FLATMEM
> BUG_ON(!mem_map);
> #endif
> +#ifdef CONFIG_CPU_SUP_INTEL
> bad_ppro = ppro_with_ram_bug();
> +#else
> + bad_ppro = 0;
> +#endif
Again, move the storage for this, let it get initialized to zero
automatically, and initialize it in the CPU-specific code (if ordering
allows).
--
Mathematics is the supreme nostalgia of our time.
next prev parent reply other threads:[~2008-02-08 23:21 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-08 22:47 Michael Opdenacker
2008-02-08 23:04 ` H. Peter Anvin
2008-02-08 23:11 ` Ingo Molnar
2008-02-09 9:31 ` Michael Opdenacker
2008-02-11 22:42 ` Michael Opdenacker
2008-02-11 22:56 ` Matt Mackall
2008-02-11 23:01 ` H. Peter Anvin
2008-02-11 23:28 ` Matt Mackall
2008-02-12 0:54 ` H. Peter Anvin
2008-02-12 1:15 ` Matt Mackall
2008-02-15 11:00 ` [RFC] [PATCH] x86: Use ELF section to list CPU vendor specific code (Linux Tiny) Thomas Petazzoni
2008-02-17 18:14 ` Ingo Molnar
2008-02-17 19:46 ` H. Peter Anvin
2008-02-23 2:43 ` Matt Mackall
2008-02-23 3:19 ` H. Peter Anvin
2008-02-25 8:29 ` Thomas Petazzoni
2008-02-25 17:03 ` Matt Mackall
2008-02-25 17:53 ` Thomas Petazzoni
2008-02-25 17:58 ` Matt Mackall
2008-02-11 22:59 ` [PATCH] x86 (Linux Tiny): configure out support for some processors H. Peter Anvin
2008-02-08 23:20 ` Matt Mackall [this message]
2008-02-09 8:30 ` Simon Holm Thøgersen
2008-02-09 9:29 ` Michael Opdenacker
2008-02-09 10:05 ` Simon Holm Thøgersen
2008-02-09 21:35 ` H. Peter Anvin
2008-02-09 9:26 ` Michael Opdenacker
2008-02-09 3:48 ` Taral
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=1202512812.17934.680.camel@cinder.waste.org \
--to=mpm@selenic.com \
--cc=Linux-tiny@selenic.com \
--cc=akpm@linux-foundation.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=michael-lists@free-electrons.com \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
/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
all inboxes | Powered by JetHome®