All of lore.kernel.org
 help / color / mirror / Atom feed
From: Don Slutz <dslutz@verizon.com>
To: David Vrabel <david.vrabel@citrix.com>, xen-devel@lists.xen.org
Cc: Daniel Kiper <daniel.kiper@oracle.com>,
	Don Slutz <dslutz@verizon.com>, Jan Beulich <jbeulich@suse.com>
Subject: Re: [PATCHv2] x86: map portion of kexec crash area that is within the direct map area
Date: Wed, 08 Jan 2014 15:54:26 -0500	[thread overview]
Message-ID: <52CDBB02.6070702@terremark.com> (raw)
In-Reply-To: <1389206119-13527-1-git-send-email-david.vrabel@citrix.com>

On 01/08/14 13:35, David Vrabel wrote:
> From: David Vrabel <david.vrabel@citrix.com>
>
> Commit 7113a45451a9f656deeff070e47672043ed83664 (kexec/x86: do not map
> crash kernel area) causes fatal page faults when loading a crash
> image.  The attempt to zero the first control page allocated from the
> crash region will fault as the VA return by map_domain_page() has no
> mapping.
>
> The fault will occur on non-debug builds of Xen when the crash area is
> below 5 TiB (which will be most systems).
>
> The assumption that the crash area mapping was not used is incorrect.
> map_domain_page() is used when loading an image and building the
> image's page tables to temporarily map the crash area, thus the
> mapping is required if the crash area is in the direct map area.
>
> Reintroduce the mapping, but only the portions of the crash area that
> are within the direct map area.
>
> Reported-by: Don Slutz <dslutz@verizon.com>
> Signed-off-by: David Vrabel <david.vrabel@citrix.com>
> Cc: Daniel Kiper <daniel.kiper@oracle.com>
> ---
> This fixes a Xen crash so is an important fix for the 4.4 release..
>
> Changes in v2:
> - merge patches into one
> - add check for e > s before mapping
> ---
>   xen/arch/x86/setup.c |   11 +++++++++++
>   1 files changed, 11 insertions(+), 0 deletions(-)
>
> diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
> index 4833ca3..b49256d 100644
> --- a/xen/arch/x86/setup.c
> +++ b/xen/arch/x86/setup.c
> @@ -1098,6 +1098,17 @@ void __init __start_xen(unsigned long mbi_p)
>                            PFN_UP(mod[i].mod_end), PAGE_HYPERVISOR);
>       }
>   
> +    if ( kexec_crash_area.size )
> +    {
> +        unsigned long s = PFN_DOWN(kexec_crash_area.start);
> +        unsigned long e = min(s + PFN_UP(kexec_crash_area.size),
> +                              PFN_UP(__pa(HYPERVISOR_VIRT_END - 1)));
> +
> +        if ( e > s )
> +            map_pages_to_xen((unsigned long)__va(kexec_crash_area.start),
> +                             s, e - s, PAGE_HYPERVISOR);
> +    }
> +
>       xen_virt_end = ((unsigned long)_end + (1UL << L2_PAGETABLE_SHIFT) - 1) &
>                      ~((1UL << L2_PAGETABLE_SHIFT) - 1);
>       destroy_xen_mappings(xen_virt_end, XEN_VIRT_START + BOOTSTRAP_MAP_BASE);


4.4.0-rc1 + this patch works for me.  So you can add:

Tested-by: Don Slutz <dslutz@verizon.com>

    -Don Slutz

  parent reply	other threads:[~2014-01-08 20:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-08 18:35 [PATCHv2] x86: map portion of kexec crash area that is within the direct map area David Vrabel
2014-01-08 18:44 ` Daniel Kiper
2014-01-08 20:54 ` Don Slutz [this message]
2014-01-09 19:50 ` Daniel Kiper
2014-01-09 23:15   ` Andrew Cooper
2014-01-10 14:00     ` 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=52CDBB02.6070702@terremark.com \
    --to=dslutz@verizon.com \
    --cc=daniel.kiper@oracle.com \
    --cc=david.vrabel@citrix.com \
    --cc=jbeulich@suse.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.