linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org
Cc: jgross@suse.com, Boris Ostrovsky <boris.ostrovsky@oracle.com>
Subject: [PATCH 4/4] xen/PVH: Remove reserved entry in PVH GDT
Date: Mon, 30 Apr 2018 12:23:39 -0400	[thread overview]
Message-ID: <20180430162339.17143-5-boris.ostrovsky@oracle.com> (raw)
In-Reply-To: <20180430162339.17143-1-boris.ostrovsky@oracle.com>

And without it we can't use _BOOT_XX macros any longer so define new ones.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
---
 arch/x86/xen/xen-pvh.S | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/arch/x86/xen/xen-pvh.S b/arch/x86/xen/xen-pvh.S
index 4eed586..30dd067 100644
--- a/arch/x86/xen/xen-pvh.S
+++ b/arch/x86/xen/xen-pvh.S
@@ -54,7 +54,11 @@
  * charge of setting up it's own stack, GDT and IDT.
  */
 
-#define PVH_GDT_ENTRY_CANARY    4
+#define PVH_GDT_ENTRY_CS        1
+#define PVH_GDT_ENTRY_DS        2
+#define PVH_GDT_ENTRY_CANARY    3
+#define PVH_CS_SEL              (PVH_GDT_ENTRY_CS * 8)
+#define PVH_DS_SEL              (PVH_GDT_ENTRY_DS * 8)
 #define PVH_CANARY_SEL          (PVH_GDT_ENTRY_CANARY * 8)
 
 ENTRY(pvh_start_xen)
@@ -62,7 +66,7 @@ ENTRY(pvh_start_xen)
 
 	lgdt (_pa(gdt))
 
-	mov $(__BOOT_DS),%eax
+	mov $(PVH_DS_SEL),%eax
 	mov %eax,%ds
 	mov %eax,%es
 	mov %eax,%ss
@@ -99,7 +103,7 @@ ENTRY(pvh_start_xen)
 	mov %eax, %cr0
 
 	/* Jump to 64-bit mode. */
-	ljmp $__BOOT_CS, $_pa(1f)
+	ljmp $PVH_CS_SEL, $_pa(1f)
 
 	/* 64-bit entry point. */
 	.code64
@@ -122,13 +126,13 @@ ENTRY(pvh_start_xen)
 	or $(X86_CR0_PG | X86_CR0_PE), %eax
 	mov %eax, %cr0
 
-	ljmp $__BOOT_CS, $1f
+	ljmp $PVH_CS_SEL, $1f
 1:
 	call xen_prepare_pvh
 	mov $_pa(pvh_bootparams), %esi
 
 	/* startup_32 doesn't expect paging and PAE to be on. */
-	ljmp $__BOOT_CS, $_pa(2f)
+	ljmp $PVH_CS_SEL, $_pa(2f)
 2:
 	mov %cr0, %eax
 	and $~X86_CR0_PG, %eax
@@ -137,7 +141,7 @@ ENTRY(pvh_start_xen)
 	and $~X86_CR4_PAE, %eax
 	mov %eax, %cr4
 
-	ljmp $__BOOT_CS, $_pa(startup_32)
+	ljmp $PVH_CS_SEL, $_pa(startup_32)
 #endif
 END(pvh_start_xen)
 
@@ -149,13 +153,12 @@ gdt:
 	.word 0
 gdt_start:
 	.quad 0x0000000000000000            /* NULL descriptor */
-	.quad 0x0000000000000000            /* reserved */
 #ifdef CONFIG_X86_64
-	.quad 0x00af9a000000ffff            /* __BOOT_CS */
+	.quad 0x00af9a000000ffff            /* PVH_CS_SEL */
 #else
-	.quad 0x00cf9a000000ffff            /* __BOOT_CS */
+	.quad 0x00cf9a000000ffff            /* PVH_CS_SEL */
 #endif
-	.quad 0x00cf92000000ffff            /* __BOOT_DS */
+	.quad 0x00cf92000000ffff            /* PVH_DS_SEL */
 	.quad 0x0040900000000018            /* PVH_CANARY_SEL */
 gdt_end:
 
-- 
2.9.3

  parent reply	other threads:[~2018-04-30 16:21 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-30 16:23 [PATCH 0/4] PVH GDT fixes and cleanup Boris Ostrovsky
2018-04-30 16:23 ` [PATCH 1/4] xen/PVH: Replace GDT_ENTRY with explicit constant Boris Ostrovsky
2018-04-30 16:57   ` [Xen-devel] " Roger Pau Monné
2018-04-30 18:07     ` Boris Ostrovsky
2018-05-01  7:53       ` Roger Pau Monné
2018-05-01 12:16         ` Boris Ostrovsky
2018-05-01 11:31   ` David Laight
2018-05-01 12:40     ` Boris Ostrovsky
2018-05-02  8:00   ` [Xen-devel] " Jan Beulich
2018-05-02 14:53     ` Boris Ostrovsky
2018-04-30 16:23 ` [PATCH 2/4] xen/PVH: Use proper CS selector in long mode Boris Ostrovsky
2018-05-02  8:05   ` [Xen-devel] " Jan Beulich
2018-05-02 14:57     ` Boris Ostrovsky
2018-05-02 15:00       ` Jan Beulich
2018-05-02 15:08         ` Boris Ostrovsky
2018-05-02 15:09           ` Jan Beulich
2018-05-02 15:28             ` Andrew Cooper
2018-04-30 16:23 ` [PATCH 3/4] xen/PVH: Set up GS segment for stack canary Boris Ostrovsky
2018-05-02  8:16   ` [Xen-devel] " Jan Beulich
2018-05-02 15:00     ` Boris Ostrovsky
2018-05-02 15:01       ` Jan Beulich
2018-05-02 15:22         ` Boris Ostrovsky
2018-05-02 15:41           ` Jan Beulich
2018-05-02 17:29             ` Boris Ostrovsky
2018-05-03  7:35               ` Jan Beulich
2018-04-30 16:23 ` Boris Ostrovsky [this message]
2018-05-01  8:00   ` [Xen-devel] [PATCH 4/4] xen/PVH: Remove reserved entry in PVH GDT Roger Pau Monné
2018-05-01 12:34     ` Boris Ostrovsky
2018-05-02  8:26       ` Jan Beulich
2018-05-02 15:06         ` Boris Ostrovsky
2018-05-02 15:07           ` Jan Beulich
2018-05-02  8:19   ` 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=20180430162339.17143-5-boris.ostrovsky@oracle.com \
    --to=boris.ostrovsky@oracle.com \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.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 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).