All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joerg Roedel <jroedel@suse.de>
To: Joerg Roedel <joro@8bytes.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	rjw@rjwysocki.net, pavel@ucw.cz, hpa@zytor.com,
	Michal Kubecek <mkubecek@suse.cz>, Borislav Petkov <bp@suse.de>,
	x86@kernel.org, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Dave Hansen <dave.hansen@linux.intel.com>
Subject: Re: [PATCH] x86/power/64: Fix page-table setup for temporary text mapping
Date: Thu, 19 Apr 2018 20:28:40 +0200	[thread overview]
Message-ID: <20180419182840.mfl64py7pnbudruc@suse.de> (raw)
In-Reply-To: <1524162360-26179-1-git-send-email-joro@8bytes.org>

Adding Dave Hansen to Cc, forgot that in the initial post.

On Thu, Apr 19, 2018 at 08:26:00PM +0200, Joerg Roedel wrote:
> From: Joerg Roedel <jroedel@suse.de>
> 
> When we have a 4-level page-table there is no p4d, so we map
> the pud in the pgd. The old code before commit fb43d6cb91ef
> already did that.
> 
> With the change from above commit we end up with an invalid
> page-table which causes undefined behavior. In one report it
> caused triple faults.
> 
> Fix it by changing the p4d back to pud so that we have a
> correct page-table.
> 
> Reported-by: Borislav Petkov <bp@suse.de>
> Fixes: fb43d6cb91ef ('x86/mm: Do not auto-massage page protections')
> Tested-by: Michal Kubecek <mkubecek@suse.cz>
> Tested-by: Borislav Petkov <bp@suse.de>
> Signed-off-by: Joerg Roedel <jroedel@suse.de>
> ---
>  arch/x86/power/hibernate_64.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/power/hibernate_64.c b/arch/x86/power/hibernate_64.c
> index 48b14b534897..ccf4a49bb065 100644
> --- a/arch/x86/power/hibernate_64.c
> +++ b/arch/x86/power/hibernate_64.c
> @@ -98,7 +98,7 @@ static int set_up_temporary_text_mapping(pgd_t *pgd)
>  		set_pgd(pgd + pgd_index(restore_jump_address), new_pgd);
>  	} else {
>  		/* No p4d for 4-level paging: point the pgd to the pud page table */
> -		pgd_t new_pgd = __pgd(__pa(p4d) | pgprot_val(pgtable_prot));
> +		pgd_t new_pgd = __pgd(__pa(pud) | pgprot_val(pgtable_prot));
>  		set_pgd(pgd + pgd_index(restore_jump_address), new_pgd);
>  	}
>  
> -- 
> 2.13.6

  reply	other threads:[~2018-04-19 18:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-19 18:26 [PATCH] x86/power/64: Fix page-table setup for temporary text mapping Joerg Roedel
2018-04-19 18:28 ` Joerg Roedel [this message]
2018-04-20  9:55 ` [tip:x86/urgent] " tip-bot for Joerg Roedel

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=20180419182840.mfl64py7pnbudruc@suse.de \
    --to=jroedel@suse.de \
    --cc=bp@suse.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=joro@8bytes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=mkubecek@suse.cz \
    --cc=pavel@ucw.cz \
    --cc=rjw@rjwysocki.net \
    --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 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.