Received: by 10.192.165.148 with SMTP id m20csp4000573imm; Mon, 30 Apr 2018 09:57:52 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq01RfTG/wvaOd8cPRFjkt4B0tBTGVDNFe8OCBMx5o0ukVRHBy1IKw0rfbdYJjmHcOE/MH/ X-Received: by 10.98.4.133 with SMTP id 127mr12715779pfe.26.1525107472255; Mon, 30 Apr 2018 09:57:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525107472; cv=none; d=google.com; s=arc-20160816; b=qpqKScW3WWeiemes9a4+HyTSYxIgaX0nxbuCFoYEAX1PT8bvS1EldYoGRenz5sOf65 h4JRT90BJJVMxjpXKzwqD6VsG0RMvwoTV3uHIEtwkHt4ZqQqVNEcNRKjsae/aUvLMptI Gm41IlHFUaApvO2l4O8Yti5YdnfT9H1zNiZgvFojhMbEy8C509TidaAtcvkJLwgFL4SO jtcHKkORE1ZcxrAiClcvQMM4hqyTZkWI1/g4Mf+pxf1LAb3Z6cE2vMNFQXScbgQCUIdz 8BuDZ0T8rB1/M2/M2zaxEND4mdRVT01yQCs6VpMmBAVuKLJDM0DLcDrYx9G0CnLYc7ag e/lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=LLb5WgkX3wqZQawbMouyIY4wZ1dqRwrHoOOFyi/Saxc=; b=ST88Zujmauv1qvKWDAkQjOaUA3SHbrANOGaEP4e+GvUKWquEC1KynKiUoCyPhvDBIv /KkvFhVKtbMWpeJPZNjG39eTAfNA/avFdcG/pwV5Z1Rdl0sUZpv250ieeC/TfqmVFy82 E/cGYJZ8ECJWLGInV+Pq0eYVqvZ5GB2etnnziUsju+GVPOnr1kAhdzrEQuhrLNtsIimj EvZQ/rxH42ACxUs6CVUhkmH8OFx3TYRAf9ATYRm7EwZiU7pWLbYWCHD5KH081vLWMdlm 3A4lIzYZ9J4v7xZjNtm/UnszzgzPWd7PgDFpOyhMX051qeTgPZ8APZok+1mLM5mKUqRR CrnA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c12-v6si1938902pll.360.2018.04.30.09.57.32; Mon, 30 Apr 2018 09:57:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754924AbeD3Q5N (ORCPT + 99 others); Mon, 30 Apr 2018 12:57:13 -0400 Received: from smtp.ctxuk.citrix.com ([185.25.65.24]:6625 "EHLO SMTP.EU.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753508AbeD3Q5M (ORCPT ); Mon, 30 Apr 2018 12:57:12 -0400 X-IronPort-AV: E=Sophos;i="5.49,346,1520899200"; d="scan'208";a="72387434" Date: Mon, 30 Apr 2018 17:57:04 +0100 From: Roger Pau =?utf-8?B?TW9ubsOp?= To: Boris Ostrovsky CC: , , , Subject: Re: [Xen-devel] [PATCH 1/4] xen/PVH: Replace GDT_ENTRY with explicit constant Message-ID: <20180430165704.bkce56nzx3giodbd@MacBook-Pro-de-Roger.local> References: <20180430162339.17143-1-boris.ostrovsky@oracle.com> <20180430162339.17143-2-boris.ostrovsky@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20180430162339.17143-2-boris.ostrovsky@oracle.com> User-Agent: NeoMutt/20180323 X-ClientProxiedBy: AMSPEX02CAS01.citrite.net (10.69.22.112) To AMSPEX02CL02.citrite.net (10.69.22.126) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > 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.