From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: <linux-kernel@vger.kernel.org>, <xen-devel@lists.xenproject.org>,
<jgross@suse.com>, <stable@vger.kernel.org>
Subject: Re: [Xen-devel] [PATCH 1/4] xen/PVH: Replace GDT_ENTRY with explicit constant
Date: Mon, 30 Apr 2018 17:57:04 +0100 [thread overview]
Message-ID: <20180430165704.bkce56nzx3giodbd@MacBook-Pro-de-Roger.local> (raw)
In-Reply-To: <20180430162339.17143-2-boris.ostrovsky@oracle.com>
On Mon, Apr 30, 2018 at 12:23:36PM -0400, Boris Ostrovsky wrote:
> Latest binutils release (2.29.1) will no longer allow proper computation
> of GDT entries on 32-bits, with warning:
>
> arch/x86/xen/xen-pvh.S: Assembler messages:
> arch/x86/xen/xen-pvh.S:150: Warning: shift count out of range (32 is not between 0 and 31)
> arch/x86/xen/xen-pvh.S:150: Warning: shift count out of range (40 is not between 0 and 31)
> arch/x86/xen/xen-pvh.S:150: Warning: shift count out of range (32 is not between 0 and 31)
> arch/x86/xen/xen-pvh.S:152: Warning: shift count out of range (32 is not between 0 and 31)
> arch/x86/xen/xen-pvh.S:152: Warning: shift count out of range (40 is not between 0 and 31)
> arch/x86/xen/xen-pvh.S:152: Warning: shift count out of range (32 is not between 0 and 31)
>
> Use explicit value of the entry instead of using GDT_ENTRY() macro.
>
> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> Cc: stable@vger.kernel.org
> ---
> arch/x86/xen/xen-pvh.S | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/x86/xen/xen-pvh.S b/arch/x86/xen/xen-pvh.S
> index e1a5fbe..934f7d4 100644
> --- a/arch/x86/xen/xen-pvh.S
> +++ b/arch/x86/xen/xen-pvh.S
> @@ -145,11 +145,11 @@ gdt_start:
> .quad 0x0000000000000000 /* NULL descriptor */
> .quad 0x0000000000000000 /* reserved */
> #ifdef CONFIG_X86_64
> - .quad GDT_ENTRY(0xa09a, 0, 0xfffff) /* __KERNEL_CS */
> + .quad 0x00af9a000000ffff /* __BOOT_CS */
> #else
> - .quad GDT_ENTRY(0xc09a, 0, 0xfffff) /* __KERNEL_CS */
> + .quad 0x00cf9a000000ffff /* __BOOT_CS */
Maybe it would be cleaner to use something like:
.word 0xffff /* limit */
.word 0 /* base */
.byte 0 /* base */
.byte 0x9a /* access */
#ifdef CONFIG_X86_64
.byte 0xaf /* flags plus limit */
#else
.byte 0xcf /* flags plus limit */
#endif
.byte 0 /* base */
Or try to fix the GDT_ENTRY macro, maybe if you prepend extra 0's to
make the values 64bit that would prevent the warnings?
Or declare the GDT in enlighten_pvh in C and use it here?
Also, IIRC the base/limit values are ignored in long mode.
Thanks, Roger.
next prev parent reply other threads:[~2018-04-30 16:57 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 ` Roger Pau Monné [this message]
2018-04-30 18:07 ` [Xen-devel] " 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 ` [PATCH 4/4] xen/PVH: Remove reserved entry in PVH GDT Boris Ostrovsky
2018-05-01 8:00 ` [Xen-devel] " 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=20180430165704.bkce56nzx3giodbd@MacBook-Pro-de-Roger.local \
--to=roger.pau@citrix.com \
--cc=boris.ostrovsky@oracle.com \
--cc=jgross@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@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
all inboxes | Powered by JetHome®