From: Juergen Gross <jgross@suse.com>
To: Daniel Kiper <daniel.kiper@oracle.com>
Cc: grub-devel@gnu.org, phcoder@gmail.com, mchang@suse.com,
xen-devel@lists.xen.org
Subject: Re: [PATCH v3 09/10] xen: modify page table construction
Date: Fri, 19 Feb 2016 06:20:58 +0100 [thread overview]
Message-ID: <56C6A63A.9060200@suse.com> (raw)
In-Reply-To: <20160218164001.GE3482@olila.local.net-space.pl>
On 18/02/16 17:40, Daniel Kiper wrote:
> On Wed, Feb 17, 2016 at 06:19:36PM +0100, Juergen Gross wrote:
>> Modify the page table construction to allow multiple virtual regions
>> to be mapped. This is done as preparation for removing the p2m list
>> from the initial kernel mapping in order to support huge pv domains.
>>
>> This allows a cleaner approach for mapping the relocator page by
>> using this capability.
>>
>> The interface to the assembler level of the relocator has to be changed
>> in order to be able to process multiple page table areas.
>>
>> Signed-off-by: Juergen Gross <jgross@suse.com>
>> ---
>> V3: use constants instead of numbers as requested by Daniel Kiper
>> add lots of comments to assembly code as requested by Daniel Kiper
...
>> 1:
>> + movq 0(%r8), %r12 /* Get start pfn of the current area */
>> + movq GRUB_TARGET_SIZEOF_LONG(%r8), %rcx /* Get # of pg tables */
>
> Use %r9 here and...
>
>> + testq %rcx, %rcx /* 0 -> last area reached */
>> + jz 3f
>> +2:
>> movq %r12, %rdi
>> - movq %rsi, %rbx
>> - movq 0(%rsi), %rsi
>> - shlq $12, %rsi
>> - orq $5, %rsi
>> - movq $2, %rdx
>> - movq %rcx, %r9
>> + shlq $PAGE_SHIFT, %rdi /* virtual address (1:1 mapping) */
>> + movq (%rbx, %r12, 8), %rsi /* mfn */
>> + shlq $PAGE_SHIFT, %rsi
>> + orq $(GRUB_PAGE_PRESENT | GRUB_PAGE_USER), %rsi /* Build pte */
>> + movq $UVMF_INVLPG, %rdx
>> + movq %rcx, %r9 /* %rcx clobbered by hypercall */
>
> ... you can avoid this...
>
>> movq $__HYPERVISOR_update_va_mapping, %rax
>> syscall
>>
>> movq %r9, %rcx
>
> and this...
>
>> - addq $8, %rbx
>> - addq $4096, %r12
>> - movq %rbx, %rsi
>> + incq %r12 /* next pfn */
>>
>> - loop 1b
>> + loop 2b
>>
This would require to open code the loop statement here with %r9 as
count register.
...
>> diff --git a/grub-core/lib/xen/relocator.c b/grub-core/lib/xen/relocator.c
>> index 8f427d3..250fbd4 100644
>> --- a/grub-core/lib/xen/relocator.c
>> +++ b/grub-core/lib/xen/relocator.c
>> @@ -36,15 +36,18 @@ extern grub_uint8_t grub_relocator_xen_remap_end;
>> extern grub_xen_reg_t grub_relocator_xen_stack;
>> extern grub_xen_reg_t grub_relocator_xen_start_info;
>> extern grub_xen_reg_t grub_relocator_xen_entry_point;
>> -extern grub_xen_reg_t grub_relocator_xen_paging_start;
>> -extern grub_xen_reg_t grub_relocator_xen_paging_size;
>> extern grub_xen_reg_t grub_relocator_xen_remapper_virt;
>> extern grub_xen_reg_t grub_relocator_xen_remapper_virt2;
>> extern grub_xen_reg_t grub_relocator_xen_remapper_map;
>> extern grub_xen_reg_t grub_relocator_xen_mfn_list;
>> +extern struct {
>> + grub_xen_reg_t start;
>> + grub_xen_reg_t size;
>> +} grub_relocator_xen_paging_areas[XEN_MAX_MAPPINGS];
>
> Should not you add GRUB_PACKED here? Could you define type
> earlier and use it here?
Why packed? Aah, I think I should align the variable in the assembly
source instead.
Regarding type: sure I could.
Juergen
next prev parent reply other threads:[~2016-02-19 5:21 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-17 17:19 [PATCH v3 00/10] grub-xen: support booting huge pv-domains Juergen Gross
2016-02-17 17:19 ` [PATCH v3 01/10] xen: make xen loader callable multiple times Juergen Gross
2016-02-18 10:12 ` Daniel Kiper
2016-02-18 10:32 ` Juergen Gross
2016-02-18 16:58 ` Daniel Kiper
2016-02-19 5:21 ` Juergen Gross
2016-02-19 5:21 ` Juergen Gross
2016-02-18 16:58 ` Daniel Kiper
2016-02-17 17:19 ` [PATCH v3 02/10] xen: reduce number of global variables in xen loader Juergen Gross
2016-02-18 10:22 ` Daniel Kiper
2016-02-18 10:22 ` Daniel Kiper
2016-02-18 10:34 ` Juergen Gross
2016-02-18 17:00 ` Lennart Sorensen
2016-02-19 4:59 ` [Xen-devel] " Juergen Gross
2016-02-19 16:20 ` Lennart Sorensen
2016-02-19 16:20 ` [Xen-devel] " Lennart Sorensen
2016-02-19 4:59 ` Juergen Gross
2016-02-18 17:00 ` Lennart Sorensen
2016-02-18 17:13 ` Daniel Kiper
2016-02-18 17:13 ` Daniel Kiper
2016-02-17 17:19 ` [PATCH v3 03/10] xen: add elfnote.h to avoid using numbers instead of constants Juergen Gross
2016-02-18 10:30 ` Daniel Kiper
2016-02-18 10:35 ` Juergen Gross
2016-02-18 17:15 ` Daniel Kiper
2016-02-18 17:15 ` Daniel Kiper
2016-02-17 17:19 ` Juergen Gross
2016-02-17 17:19 ` [PATCH v3 04/10] xen: synchronize xen header Juergen Gross
2016-02-18 10:33 ` Daniel Kiper
2016-02-17 17:19 ` [PATCH v3 05/10] xen: factor out p2m list allocation into separate function Juergen Gross
2016-02-18 10:39 ` Daniel Kiper
2016-02-18 10:39 ` Daniel Kiper
2016-02-17 17:19 ` Juergen Gross
2016-02-17 17:19 ` [PATCH v3 06/10] xen: factor out allocation of special pages " Juergen Gross
2016-02-18 10:42 ` Daniel Kiper
2016-02-18 10:42 ` Daniel Kiper
2016-02-17 17:19 ` [PATCH v3 07/10] xen: factor out allocation of page tables " Juergen Gross
2016-02-18 10:50 ` Daniel Kiper
2016-02-18 10:50 ` Daniel Kiper
2016-02-17 17:19 ` [PATCH v3 08/10] xen: add capability to load initrd outside of initial mapping Juergen Gross
2016-02-18 11:18 ` Daniel Kiper
2016-02-18 11:18 ` Daniel Kiper
2016-02-18 12:43 ` Juergen Gross
2016-02-18 12:43 ` Juergen Gross
2016-02-18 17:20 ` Daniel Kiper
2016-02-18 17:20 ` Daniel Kiper
2016-02-17 17:19 ` Juergen Gross
2016-02-17 17:19 ` [PATCH v3 09/10] xen: modify page table construction Juergen Gross
2016-02-18 16:40 ` Daniel Kiper
2016-02-19 5:20 ` Juergen Gross
2016-02-19 5:20 ` Juergen Gross [this message]
2016-02-18 16:40 ` Daniel Kiper
2016-02-17 17:19 ` [PATCH v3 10/10] xen: add capability to load p2m list outside of kernel mapping Juergen Gross
2016-02-18 16:44 ` Daniel Kiper
2016-02-18 16:44 ` Daniel Kiper
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=56C6A63A.9060200@suse.com \
--to=jgross@suse.com \
--cc=daniel.kiper@oracle.com \
--cc=grub-devel@gnu.org \
--cc=mchang@suse.com \
--cc=phcoder@gmail.com \
--cc=xen-devel@lists.xen.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.