All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Wei Liu" <wl@xen.org>, "Jan Beulich" <JBeulich@suse.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: [Xen-devel] [PATCH 2/6] x86/boot: Map the trampoline as read-only
Date: Mon, 6 Jan 2020 15:54:19 +0000	[thread overview]
Message-ID: <20200106155423.9508-3-andrew.cooper3@citrix.com> (raw)
In-Reply-To: <20200106155423.9508-1-andrew.cooper3@citrix.com>

c/s ec92fcd1d08, which caused the trampoline GDT Access bits to be set,
removed the final writes which occurred between enabling paging and switching
to the high mappings.  There don't plausibly need to be any memory writes in
few instructions is takes to perform this transition.

As a consequence, we can remove the RWX mapping of the trampoline.  It is RX
via its identity mapping below 1M, and RW via the directmap.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Wei Liu <wl@xen.org>
CC: Roger Pau Monné <roger.pau@citrix.com>

This probably wants backporting, alongside ec92fcd1d08 if it hasn't yet.
---
 xen/arch/x86/x86_64/mm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
index 8ea09ecc30..b7ce833ffc 100644
--- a/xen/arch/x86/x86_64/mm.c
+++ b/xen/arch/x86/x86_64/mm.c
@@ -699,7 +699,7 @@ void __init zap_low_mappings(void)
     /* Replace with mapping of the boot trampoline only. */
     map_pages_to_xen(trampoline_phys, maddr_to_mfn(trampoline_phys),
                      PFN_UP(trampoline_end - trampoline_start),
-                     __PAGE_HYPERVISOR);
+                     __PAGE_HYPERVISOR_RX);
 }
 
 int setup_compat_arg_xlat(struct vcpu *v)
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2020-01-06 15:54 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-06 15:54 [Xen-devel] [PATCH 0/6] x86/boot: Remove mappings at 0 Andrew Cooper
2020-01-06 15:54 ` [Xen-devel] [PATCH 1/6] x86/boot: Check for E820_RAM earlier when searching the E820 Andrew Cooper
2020-01-07 15:12   ` Jan Beulich
2020-01-06 15:54 ` Andrew Cooper [this message]
2020-01-07 15:21   ` [Xen-devel] [PATCH 2/6] x86/boot: Map the trampoline as read-only Jan Beulich
2020-01-07 15:51     ` Andrew Cooper
2020-01-07 16:19       ` Jan Beulich
2020-01-07 19:04         ` Andrew Cooper
2020-01-08 11:08           ` Jan Beulich
2020-01-08 15:51             ` Andrew Cooper
2020-01-06 15:54 ` [Xen-devel] [PATCH 3/6] x86/boot: Remove the preconstructed low 16M superpage mappings Andrew Cooper
2020-01-07 15:43   ` Jan Beulich
2020-01-07 17:24     ` Andrew Cooper
2020-01-08 11:23       ` Jan Beulich
2020-01-08 19:41         ` Andrew Cooper
2020-01-09  9:35           ` Jan Beulich
2020-01-06 15:54 ` [Xen-devel] [PATCH 4/6] x86/boot: Clean up l?_bootmap[] construction Andrew Cooper
2020-01-07 16:16   ` Jan Beulich
2020-01-07 16:30     ` Jan Beulich
2020-01-07 18:01       ` Andrew Cooper
2020-01-13 12:08       ` Andrew Cooper
2020-01-07 18:00     ` Andrew Cooper
2020-01-08 11:38       ` Jan Beulich
2020-01-08 16:15         ` Andrew Cooper
2020-01-08 16:55           ` Jan Beulich
2020-01-08 17:09             ` Andrew Cooper
2020-01-09  9:30               ` Jan Beulich
2020-01-06 15:54 ` [Xen-devel] [PATCH 5/6] x86/boot: Don't map 0 during boot Andrew Cooper
2020-01-07 16:35   ` Jan Beulich
2020-01-07 18:03     ` Andrew Cooper
2020-01-06 15:54 ` [Xen-devel] [PATCH 6/6] x86/boot: Drop INVALID_VCPU Andrew Cooper
2020-01-07 16:52   ` Jan Beulich
2020-01-07 18:07     ` Andrew Cooper
2020-01-08 11:44       ` 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=20200106155423.9508-3-andrew.cooper3@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=roger.pau@citrix.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.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.