From: Attilio Rao <attilio.rao@citrix.com>
To: <linux-kernel@vger.kernel.org>, <mingo@redhat.com>,
<hpa@zytor.com>, <tglx@linutronix.de>, <x86@kernel.org>,
<Stefano.Stabellini@eu.citrix.com>, <konrad.wilk@oracle.com>
Cc: Attilio Rao <attilio.rao@citrix.com>
Subject: [PATCH v4 2/2] XEN: Document the semantic of x86_init.mapping.pagetable_reserve
Date: Wed, 22 Aug 2012 16:08:42 +0100 [thread overview]
Message-ID: <1345648122-11935-3-git-send-email-attilio.rao@citrix.com> (raw)
In-Reply-To: <1345648122-11935-1-git-send-email-attilio.rao@citrix.com>
The informations added on the hook are:
- Native behaviour
- Xen specific behaviour
- Logic behind the Xen specific behaviour
- setup function semantic
Even if in general it would be a good idea to separate implementation
from semantic, in this case it is beneficial to give a little bit of context
on the implementation in order to favourably understand the semantic.
Signed-off-by: Attilio Rao <attilio.rao@citrix.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
arch/x86/include/asm/x86_init.h | 19 +++++++++++++++++--
1 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h
index 38155f6..b22093c 100644
--- a/arch/x86/include/asm/x86_init.h
+++ b/arch/x86/include/asm/x86_init.h
@@ -72,8 +72,23 @@ struct x86_init_oem {
* struct x86_init_mapping - platform specific initial kernel pagetable setup
* @pagetable_reserve: reserve a range of addresses for kernel pagetable usage
*
- * For more details on the purpose of this hook, look in
- * init_memory_mapping and the commit that added it.
+ * It does reserve a range of pages, to be used as pagetable pages.
+ * The start and end parameters are expected to be contained in the
+ * [pgt_buf_start, pgt_buf_top] range.
+ * The native implementation reserves the pages via the memblock_reserve()
+ * interface.
+ * The Xen implementation, besides reserving the range via memblock_reserve(),
+ * also sets RW the remaining pages contained in the ranges
+ * [pgt_buf_start, start) and [end, pgt_buf_top).
+ * This is needed because the range [pgt_buf_start, pgt_buf_top] was
+ * previously mapped read-only by xen_set_pte_init: when running
+ * on Xen all the pagetable pages need to be mapped read-only in order to
+ * avoid protection faults from the hypervisor. However, once the correct
+ * amount of pages is reserved for the pagetables, all the others contained
+ * in the range must be set to RW so that they can be correctly recycled by
+ * the VM subsystem.
+ * This operation is meant to be performed only during init_memory_mapping(),
+ * just after space for the kernel direct mapping tables is found.
*/
struct x86_init_mapping {
void (*pagetable_reserve)(u64 start, u64 end);
--
1.7.2.5
prev parent reply other threads:[~2012-08-22 15:22 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-22 15:08 [PATCH v4 0/2] XEN/X86: Document x86_init.mapping.pagetable_reserve and enforce a better semantic Attilio Rao
2012-08-22 15:08 ` [PATCH v4 1/2] XEN/X86: Improve semantic support for x86_init.mapping.pagetable_reserve Attilio Rao
2012-08-23 15:46 ` Thomas Gleixner
2012-08-23 15:44 ` Attilio Rao
2012-08-23 17:14 ` Thomas Gleixner
2012-08-23 17:13 ` Attilio Rao
2012-08-24 10:03 ` Borislav Petkov
2012-08-24 10:10 ` Attilio Rao
2012-08-24 11:36 ` Konrad Rzeszutek Wilk
2012-08-24 11:57 ` Stefano Stabellini
2012-08-24 13:00 ` Thomas Gleixner
2012-08-24 13:24 ` Attilio Rao
2012-08-24 13:45 ` Borislav Petkov
2012-08-24 15:18 ` Thomas Gleixner
2012-08-24 13:32 ` Stefano Stabellini
2012-08-24 15:20 ` Thomas Gleixner
2012-08-24 17:27 ` Stefano Stabellini
2012-08-24 20:10 ` Thomas Gleixner
2012-08-22 15:08 ` Attilio Rao [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=1345648122-11935-3-git-send-email-attilio.rao@citrix.com \
--to=attilio.rao@citrix.com \
--cc=Stefano.Stabellini@eu.citrix.com \
--cc=hpa@zytor.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@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).