From: Andi Kleen <ak@suse.de>
To: "Jan Beulich" <jbeulich@novell.com>
Cc: "Andrew Morton" <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org, patches@x86-64.org
Subject: Re: [PATCH] x86: make SMP locks handling interact properly with CONFIG_DEBUG_RODATA (2nd try)
Date: Tue, 17 Jul 2007 19:54:34 +0200 [thread overview]
Message-ID: <200707171954.34541.ak@suse.de> (raw)
In-Reply-To: <468B5B54.76E4.0078.0@novell.com>
On Wednesday 04 July 2007 08:33:24 Jan Beulich wrote:
Sorry for late feedback.
> +#ifdef CONFIG_DEBUG_RODATA
> +
> +#ifdef CONFIG_X86_32
> +#include <asm/highmem.h>
> +#define MODULES_VADDR VMALLOC_START
> +#endif
> +
> +static inline void make_writable(const void *instr, unsigned int len)
> +{
> + unsigned long va = (unsigned long)instr;
> +
> + if (va < MODULES_VADDR) {
> + change_page_attr(virt_to_page(instr),
> + PFN_UP(va + len) - PFN_DOWN(va),
> + PAGE_KERNEL_EXEC);
> + global_flush_tlb();
> + }
> +}
> +
> +static inline void make_readonly(const void *instr, unsigned int len)
> +{
> + unsigned long va = (unsigned long)instr;
> +
> + if (va < MODULES_VADDR) {
> + change_page_attr(virt_to_page(instr),
> + PFN_UP(va + len) - PFN_DOWN(va),
> +#ifdef CONFIG_X86_64
> + PAGE_KERNEL_RO);
> +#else
> + PAGE_KERNEL_RX);
> +#endif
> + global_flush_tlb();
> + }
> +}
Can you please move those into the respective pageattr.cs without ifdefs?
Also the va < MODULES_VADDR test seems overly magic; while it may work right now
it seems fragile. It would be better to test the exact ranges in the respective
architectures
> void alternatives_smp_module_del(struct module *mod)
> {
> struct smp_alt_module *item;
> - unsigned long flags;
>
> if (smp_alt_once || noreplace_smp)
> return;
>
> - spin_lock_irqsave(&smp_alt, flags);
> + spin_lock(&smp_alt);
Unrelated change? Why? Should probably be separate patch.
> --- linux-2.6.22-rc7/arch/x86_64/kernel/vmlinux.lds.S 2007-07-03 10:57:39.000000000 +0200
> +++ 2.6.22-rc7-x86-alt-page-attr/arch/x86_64/kernel/vmlinux.lds.S 2007-07-02 14:40:15.000000000 +0200
> @@ -131,20 +131,11 @@ SECTIONS
> /* might get freed after init */
> . = ALIGN(4096);
> __smp_alt_begin = .;
> - __smp_alt_instructions = .;
> - .smp_altinstructions : AT(ADDR(.smp_altinstructions) - LOAD_OFFSET) {
> - *(.smp_altinstructions)
> - }
> - __smp_alt_instructions_end = .;
> - . = ALIGN(8);
> __smp_locks = .;
> .smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) {
> *(.smp_locks)
> }
> __smp_locks_end = .;
> - .smp_altinstr_replacement : AT(ADDR(.smp_altinstr_replacement) - LOAD_OFFSET) {
> - *(.smp_altinstr_replacement)
> - }
While ok too it should be also separate please.
-Andi
next prev parent reply other threads:[~2007-07-17 17:54 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-04 6:33 [PATCH] x86: make SMP locks handling interact properly with CONFIG_DEBUG_RODATA (2nd try) Jan Beulich
2007-07-04 15:41 ` Jeremy Fitzhardinge
2007-07-04 16:15 ` Andi Kleen
2007-07-04 16:44 ` Jeremy Fitzhardinge
2007-07-04 16:29 ` Jan Beulich
2007-07-04 17:51 ` Dave Jones
2007-07-04 18:09 ` Jeremy Fitzhardinge
2007-07-17 17:54 ` Andi Kleen [this message]
2007-07-17 20:55 ` Mathieu Desnoyers
2007-07-18 6:00 ` Jan Beulich
2007-07-17 17:57 ` Jeremy Fitzhardinge
-- strict thread matches above, loose matches on Subject: below --
2007-07-04 16:31 Jan Beulich
2007-07-04 16:46 ` Jeremy Fitzhardinge
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=200707171954.34541.ak@suse.de \
--to=ak@suse.de \
--cc=akpm@linux-foundation.org \
--cc=jbeulich@novell.com \
--cc=linux-kernel@vger.kernel.org \
--cc=patches@x86-64.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