mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] x86/vsyscall/64: Use proper accessor to update p4d entry
@ 2018-03-19 14:31 Boris Ostrovsky
  2018-03-19 15:09 ` Juergen Gross
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Boris Ostrovsky @ 2018-03-19 14:31 UTC (permalink / raw)
  To: linux-kernel; +Cc: tglx, mingo, hpa, luto, x86, jgross, Boris Ostrovsky

Writing to it directly does not work for Xen PV guests.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
---
 arch/x86/entry/vsyscall/vsyscall_64.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/entry/vsyscall/vsyscall_64.c b/arch/x86/entry/vsyscall/vsyscall_64.c
index 8560ef68a9d6..317be365bce3 100644
--- a/arch/x86/entry/vsyscall/vsyscall_64.c
+++ b/arch/x86/entry/vsyscall/vsyscall_64.c
@@ -347,7 +347,7 @@ void __init set_vsyscall_pgtable_user_bits(pgd_t *root)
 	set_pgd(pgd, __pgd(pgd_val(*pgd) | _PAGE_USER));
 	p4d = p4d_offset(pgd, VSYSCALL_ADDR);
 #if CONFIG_PGTABLE_LEVELS >= 5
-	p4d->p4d |= _PAGE_USER;
+	set_p4d(p4d, __p4d(p4d_val(*p4d) | _PAGE_USER));
 #endif
 	pud = pud_offset(p4d, VSYSCALL_ADDR);
 	set_pud(pud, __pud(pud_val(*pud) | _PAGE_USER));
-- 
2.14.3

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] x86/vsyscall/64: Use proper accessor to update p4d entry
  2018-03-19 14:31 [PATCH] x86/vsyscall/64: Use proper accessor to update p4d entry Boris Ostrovsky
@ 2018-03-19 15:09 ` Juergen Gross
  2018-03-20  3:42 ` Andy Lutomirski
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Juergen Gross @ 2018-03-19 15:09 UTC (permalink / raw)
  To: Boris Ostrovsky, linux-kernel; +Cc: tglx, mingo, hpa, luto, x86

On 19/03/18 15:31, Boris Ostrovsky wrote:
> Writing to it directly does not work for Xen PV guests.
> 
> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] x86/vsyscall/64: Use proper accessor to update p4d entry
  2018-03-19 14:31 [PATCH] x86/vsyscall/64: Use proper accessor to update p4d entry Boris Ostrovsky
  2018-03-19 15:09 ` Juergen Gross
@ 2018-03-20  3:42 ` Andy Lutomirski
  2018-03-20  8:09 ` [tip:x86/pti] " tip-bot for Boris Ostrovsky
  2018-03-20 11:05 ` [tip:x86/pti] x86/vsyscall/64: Use proper accessor to update P4D entry tip-bot for Boris Ostrovsky
  3 siblings, 0 replies; 5+ messages in thread
From: Andy Lutomirski @ 2018-03-20  3:42 UTC (permalink / raw)
  To: Boris Ostrovsky
  Cc: LKML, Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
	Andrew Lutomirski, X86 ML, Juergen Gross

On Mon, Mar 19, 2018 at 2:31 PM, Boris Ostrovsky
<boris.ostrovsky@oracle.com> wrote:
> Writing to it directly does not work for Xen PV guests.

Whoops, my bad.

Acked-by: Andy Lutomirski <luto@kernel.org>

>
> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> ---
>  arch/x86/entry/vsyscall/vsyscall_64.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/entry/vsyscall/vsyscall_64.c b/arch/x86/entry/vsyscall/vsyscall_64.c
> index 8560ef68a9d6..317be365bce3 100644
> --- a/arch/x86/entry/vsyscall/vsyscall_64.c
> +++ b/arch/x86/entry/vsyscall/vsyscall_64.c
> @@ -347,7 +347,7 @@ void __init set_vsyscall_pgtable_user_bits(pgd_t *root)
>         set_pgd(pgd, __pgd(pgd_val(*pgd) | _PAGE_USER));
>         p4d = p4d_offset(pgd, VSYSCALL_ADDR);
>  #if CONFIG_PGTABLE_LEVELS >= 5
> -       p4d->p4d |= _PAGE_USER;
> +       set_p4d(p4d, __p4d(p4d_val(*p4d) | _PAGE_USER));
>  #endif
>         pud = pud_offset(p4d, VSYSCALL_ADDR);
>         set_pud(pud, __pud(pud_val(*pud) | _PAGE_USER));
> --
> 2.14.3
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [tip:x86/pti] x86/vsyscall/64: Use proper accessor to update p4d entry
  2018-03-19 14:31 [PATCH] x86/vsyscall/64: Use proper accessor to update p4d entry Boris Ostrovsky
  2018-03-19 15:09 ` Juergen Gross
  2018-03-20  3:42 ` Andy Lutomirski
@ 2018-03-20  8:09 ` tip-bot for Boris Ostrovsky
  2018-03-20 11:05 ` [tip:x86/pti] x86/vsyscall/64: Use proper accessor to update P4D entry tip-bot for Boris Ostrovsky
  3 siblings, 0 replies; 5+ messages in thread
From: tip-bot for Boris Ostrovsky @ 2018-03-20  8:09 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, jgross, mingo, tglx, boris.ostrovsky, luto, hpa

Commit-ID:  f9ee6990bd505ecefa014f5e699b3c4d25860d80
Gitweb:     https://git.kernel.org/tip/f9ee6990bd505ecefa014f5e699b3c4d25860d80
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Mon, 19 Mar 2018 10:31:54 -0400
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Tue, 20 Mar 2018 09:04:51 +0100

x86/vsyscall/64: Use proper accessor to update p4d entry

Writing to it directly does not work for Xen PV guests.

Fixes: 49275fef986a ("x86/vsyscall/64: Explicitly set _PAGE_USER in the pagetable hierarchy")
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Juergen Gross <jgross@suse.com>
Acked-by: Andy Lutomirski <luto@kernel.org>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20180319143154.3742-1-boris.ostrovsky@oracle.com

---
 arch/x86/entry/vsyscall/vsyscall_64.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/entry/vsyscall/vsyscall_64.c b/arch/x86/entry/vsyscall/vsyscall_64.c
index 8560ef68a9d6..317be365bce3 100644
--- a/arch/x86/entry/vsyscall/vsyscall_64.c
+++ b/arch/x86/entry/vsyscall/vsyscall_64.c
@@ -347,7 +347,7 @@ void __init set_vsyscall_pgtable_user_bits(pgd_t *root)
 	set_pgd(pgd, __pgd(pgd_val(*pgd) | _PAGE_USER));
 	p4d = p4d_offset(pgd, VSYSCALL_ADDR);
 #if CONFIG_PGTABLE_LEVELS >= 5
-	p4d->p4d |= _PAGE_USER;
+	set_p4d(p4d, __p4d(p4d_val(*p4d) | _PAGE_USER));
 #endif
 	pud = pud_offset(p4d, VSYSCALL_ADDR);
 	set_pud(pud, __pud(pud_val(*pud) | _PAGE_USER));

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [tip:x86/pti] x86/vsyscall/64: Use proper accessor to update P4D entry
  2018-03-19 14:31 [PATCH] x86/vsyscall/64: Use proper accessor to update p4d entry Boris Ostrovsky
                   ` (2 preceding siblings ...)
  2018-03-20  8:09 ` [tip:x86/pti] " tip-bot for Boris Ostrovsky
@ 2018-03-20 11:05 ` tip-bot for Boris Ostrovsky
  3 siblings, 0 replies; 5+ messages in thread
From: tip-bot for Boris Ostrovsky @ 2018-03-20 11:05 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: tglx, mingo, linux-kernel, luto, hpa, jgross, boris.ostrovsky

Commit-ID:  31ad7f8e7dc94d3b85ccf9b6141ce6dfd35a1781
Gitweb:     https://git.kernel.org/tip/31ad7f8e7dc94d3b85ccf9b6141ce6dfd35a1781
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Mon, 19 Mar 2018 10:31:54 -0400
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Tue, 20 Mar 2018 12:00:53 +0100

x86/vsyscall/64: Use proper accessor to update P4D entry

Writing to it directly does not work for Xen PV guests.

Fixes: 49275fef986a ("x86/vsyscall/64: Explicitly set _PAGE_USER in the pagetable hierarchy")
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Juergen Gross <jgross@suse.com>
Acked-by: Andy Lutomirski <luto@kernel.org>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20180319143154.3742-1-boris.ostrovsky@oracle.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/entry/vsyscall/vsyscall_64.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/entry/vsyscall/vsyscall_64.c b/arch/x86/entry/vsyscall/vsyscall_64.c
index 8560ef68a9d6..317be365bce3 100644
--- a/arch/x86/entry/vsyscall/vsyscall_64.c
+++ b/arch/x86/entry/vsyscall/vsyscall_64.c
@@ -347,7 +347,7 @@ void __init set_vsyscall_pgtable_user_bits(pgd_t *root)
 	set_pgd(pgd, __pgd(pgd_val(*pgd) | _PAGE_USER));
 	p4d = p4d_offset(pgd, VSYSCALL_ADDR);
 #if CONFIG_PGTABLE_LEVELS >= 5
-	p4d->p4d |= _PAGE_USER;
+	set_p4d(p4d, __p4d(p4d_val(*p4d) | _PAGE_USER));
 #endif
 	pud = pud_offset(p4d, VSYSCALL_ADDR);
 	set_pud(pud, __pud(pud_val(*pud) | _PAGE_USER));

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-03-20 11:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-19 14:31 [PATCH] x86/vsyscall/64: Use proper accessor to update p4d entry Boris Ostrovsky
2018-03-19 15:09 ` Juergen Gross
2018-03-20  3:42 ` Andy Lutomirski
2018-03-20  8:09 ` [tip:x86/pti] " tip-bot for Boris Ostrovsky
2018-03-20 11:05 ` [tip:x86/pti] x86/vsyscall/64: Use proper accessor to update P4D entry tip-bot for Boris Ostrovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome