xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: David Vrabel <david.vrabel@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Daniel Kiper <daniel.kiper@oracle.com>,
	Keir Fraser <keir@xen.org>,
	David Vrabel <david.vrabel@citrix.com>,
	xen-devel@lists.xen.org
Subject: Re: [PATCH 05/10] kexec: extend hypercall with improved load/unload ops
Date: Tue, 25 Jun 2013 15:30:21 +0100	[thread overview]
Message-ID: <51C9A97D.8050606@citrix.com> (raw)
In-Reply-To: <51C9718D02000078000E03A0@nat28.tlf.novell.com>

On 25/06/13 09:31, Jan Beulich wrote:
>>>> On 24.06.13 at 19:42, David Vrabel <david.vrabel@citrix.com> wrote:
>> 
>> +static int init_transition_pgtable(struct kexec_image *image, l4_pgentry_t *l4)
[...]
>> +    l3 = __map_domain_page(l3_page);
>> +    l3 += l3_table_offset(vaddr);
>> +    if ( !(l3e_get_flags(*l3) & _PAGE_PRESENT) )
>> +    {
>> +        l2_page = kimage_alloc_control_page(image, 0);
>> +        if ( !l2_page )
>> +            goto out;
>> +        l3e_write(l3, l3e_from_page(l2_page, __PAGE_HYPERVISOR));
>> +    }
>> +    else
>> +        l2_page = l3e_get_page(*l3);
> 
> Afaict you're done using "l3" here, so you should unmap it in order
> to reduce the pressure on the domain page mapping resources.

The unmaps are grouped at the end to make the error paths simpler and I
would prefer to keep it like this.  This is only using 4 entries.  Are
we really that short?

>> +static int build_reloc_page_table(struct kexec_image *image)
>> +{
>> +    struct page_info *l4_page;
>> +    l4_pgentry_t *l4;
>> +    int result;
>> +
>> +    l4_page = kimage_alloc_control_page(image, 0);
>> +    if ( !l4_page )
>> +        return -ENOMEM;
>> +    l4 = __map_domain_page(l4_page);
>> +
>> +    result = init_level4_page(image, l4, 0, max_page << PAGE_SHIFT);
> 
> What about holes in the physical address space - not just the
> MMIO hole below 4Gb is a problem here, but also discontiguous
> physical memory.

I don't see a problem with creating mappings for non-RAM regions.

The discontiguous physical memory is a problem though.  I think I'll
solve this by specifying that images are only executed with the first 4
GiB of physical address space linearly mapped.

If this turns out not to be enough then the mappings can be extended
without breaking existing tools or images.

>> --- /dev/null
>> +++ b/xen/arch/x86/x86_64/kexec_reloc.S
[...]
> And just 8 here.

I seem to recall reading that some processors needed 16 byte alignment
for the GDT.  I may be misremembering or this was for an older processor
that Xen no longer supports.

>> +compat_mode_gdt:
>> +        .quad 0x0000000000000000     /* null                              */
>> +        .quad 0x00cf92000000ffff     /* 0x0008 ring 0 data                */
>> +        .quad 0x00cf9a000000ffff     /* 0x0010 ring 0 code, compatibility */
[...]
>> +        /*
>> +         * 16 words of stack are more than enough.
>> +         */
>> +        .fill 16,8,0
>> +reloc_stack:
> 
> And now you don't care for the stack being mis-aligned?

I do find the way you make some review comments as a question like this
rather ambiguous.  I guess I don't care? But now I'm not sure if I should.

David

  reply	other threads:[~2013-06-25 14:30 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-24 17:42 [PATCHv6 0/10] kexec: extend kexec hypercall for use with pv-ops kernels David Vrabel
2013-06-24 17:42 ` [PATCH 01/10] x86: give FIX_EFI_MPF its own fixmap entry David Vrabel
2013-06-24 17:42 ` [PATCH 02/10] xen: make GUEST_HANDLE_64() and uint64_aligned_t available everywhere David Vrabel
2013-06-25  7:42   ` Jan Beulich
2013-06-25  9:42     ` David Vrabel
2013-06-25 11:36       ` Jan Beulich
2013-06-25 13:17         ` David Vrabel
2013-06-25 13:53           ` Jan Beulich
2013-06-25 14:48             ` David Vrabel
2013-06-25 15:02               ` Jan Beulich
2013-06-24 17:42 ` [PATCH 03/10] kexec: add public interface for improved load/unload sub-ops David Vrabel
2013-06-25  7:45   ` Jan Beulich
2013-06-27 17:29     ` David Vrabel
2013-06-28  6:53       ` Jan Beulich
2013-06-24 17:42 ` [PATCH 04/10] kexec: add infrastructure for handling kexec images David Vrabel
2013-06-25  7:54   ` Jan Beulich
2013-06-27 17:17     ` David Vrabel
2013-06-24 17:42 ` [PATCH 05/10] kexec: extend hypercall with improved load/unload ops David Vrabel
2013-06-25  8:31   ` Jan Beulich
2013-06-25 14:30     ` David Vrabel [this message]
2013-06-25 14:59       ` Jan Beulich
2013-06-25 18:52   ` Daniel Kiper
2013-06-27 17:39     ` David Vrabel
2013-06-24 17:42 ` [PATCH 06/10] xen: kexec crash image when dom0 crashes David Vrabel
2013-06-24 17:42 ` [PATCH 07/10] libxc: add hypercall buffer arrays David Vrabel
2013-06-24 17:42 ` [PATCH 08/10] libxc: add API for kexec hypercall David Vrabel
2013-06-24 17:42 ` [PATCH 09/10] x86: check kexec relocation code fits in a page David Vrabel
2013-06-25  8:33   ` Jan Beulich
2013-06-25  9:31     ` Andrew Cooper
2013-06-25 11:38       ` Jan Beulich
2013-06-25 16:38         ` Ian Campbell
2013-06-25 19:00   ` Daniel Kiper
2013-06-26  9:50     ` David Vrabel
2013-06-24 17:42 ` [PATCH 10/10] MAINTAINERS: Add KEXEC maintainer David Vrabel
2013-06-24 20:31 ` [PATCHv6 0/10] kexec: extend kexec hypercall for use with pv-ops kernels Andrew Cooper
2013-06-25 19:27 ` Daniel Kiper
2013-06-26  9:44   ` David Vrabel
2013-06-26  9:52     ` Jan Beulich

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=51C9A97D.8050606@citrix.com \
    --to=david.vrabel@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=daniel.kiper@oracle.com \
    --cc=keir@xen.org \
    --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 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).