From: "Jan Beulich" Subject: Re: [PATCH] xen/arch/x86: Fix early boot command line parsing Date: Tue, 03 Dec 2013 10:34:50 +0000 Message-ID: <529DC1DA0200007800109468@nat28.tlf.novell.com> References: <1386011720-29451-1-git-send-email-daniel.kiper@oracle.com> <529D3E7A.7010800@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VnnJf-0004iy-T8 for xen-devel@lists.xenproject.org; Tue, 03 Dec 2013 10:34:56 +0000 In-Reply-To: <529D3E7A.7010800@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper , Daniel Kiper Cc: xen-devel , keir@xen.org List-Id: xen-devel@lists.xenproject.org >>> On 03.12.13 at 03:14, Andrew Cooper wrote: > On 02/12/2013 19:15, Daniel Kiper wrote: >> There is no reliable way to encode nul character as a character so encode >> it as a number. Read: > http://sourceware.org/binutils/docs/as/Characters.html. >> Octal and hex encoding does not work on at least my system (GNU assembler >> version 2.22 (x86_64-linux-gnu) using BFD version (GNU Binutils for Debian) > 2.22). >> Without this fix e.g. no-real-mode option at the end of xen.gz command line >> is not detected. Additionally, encode other characters accordingly to >> the gas documentation. >> >> Signed-off-by: Daniel Kiper >> --- >> xen/arch/x86/boot/cmdline.S | 6 +++--- >> 1 file changed, 3 insertions(+), 3 deletions(-) >> >> diff --git a/xen/arch/x86/boot/cmdline.S b/xen/arch/x86/boot/cmdline.S >> index 05ffb94..4ea56b3 100644 >> --- a/xen/arch/x86/boot/cmdline.S >> +++ b/xen/arch/x86/boot/cmdline.S >> @@ -138,11 +138,11 @@ >> call .Lstrlen >> add $4,%esp >> xadd %eax,%ebx >> - cmpb $'\0',(%ebx) >> + cmpb $0,(%ebx) >> je 3f >> - cmpb $' ',(%ebx) >> + cmpb $' ,(%ebx) >> je 3f >> - cmpb $'=',(%ebx) >> + cmpb $'=,(%ebx) >> jne 1b >> 3: pop %ebx >> ret > > My version of binutils 2.22 for Debian Wheezy does perfectly well with > these constants as-are. Does it? The '\0' is consistently being translated as '0' rather than the intended NIL for every gas from 2.18 to 2.23.2. I'm not eager to take the other two adjustments though - the code is better readable/understandable the with a closing quote in place. Jan