From: catalin.marinas@arm.com (Catalin Marinas)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64: Add CONFIG_DEBUG_SET_MODULE_RONX support
Date: Thu, 13 Mar 2014 10:13:09 +0000 [thread overview]
Message-ID: <20140313101308.GB30339@arm.com> (raw)
In-Reply-To: <1394055789-31479-1-git-send-email-lauraa@codeaurora.org>
Hi Laura,
On Wed, Mar 05, 2014 at 09:43:09PM +0000, Laura Abbott wrote:
> +#define PTE_SET_FN(_name, pteop) \
> +static int pte_set_##_name(pte_t *ptep, pgtable_t token, unsigned long addr, \
> + void *data) \
> +{ \
> + pte_t pte = pteop(*ptep); \
> +\
> + set_pte(ptep, pte); \
> + return 0; \
> +} \
> +
> +#define SET_MEMORY_FN(_name, callback) \
> +int set_memory_##_name(unsigned long addr, int numpages) \
> +{ \
> + unsigned long start = addr; \
> + unsigned long size = PAGE_SIZE*numpages; \
> + unsigned long end = start + size; \
> +\
> + if (start < MODULES_VADDR || start >= MODULES_END) \
> + return -EINVAL;\
> +\
> + if (end < MODULES_VADDR || end >= MODULES_END) \
> + return -EINVAL; \
> +\
> + apply_to_page_range(&init_mm, start, size, callback, NULL); \
> + flush_tlb_kernel_range(start, end); \
> + return 0;\
> +}
The code seems correct but I don't really like this macro expansion. We
changed the pte_mk* functions already to inline functions, so we should
do the same with these set_memory_*() functions. Similar to s390, we
could have a change_module_page_attr() or have two set/clear functions
like x86 that just change the pte attribute (I think the latter allows
us to no longer define pte_mkexec etc).
Thanks.
--
Catalin
prev parent reply other threads:[~2014-03-13 10:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-05 21:43 [PATCH] arm64: Add CONFIG_DEBUG_SET_MODULE_RONX support Laura Abbott
2014-03-13 10:13 ` Catalin Marinas [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=20140313101308.GB30339@arm.com \
--to=catalin.marinas@arm.com \
--cc=linux-arm-kernel@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.