All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arun Sharma <arun.sharma@intel.com>
To: Anthony Liguori <aliguori@us.ibm.com>
Cc: xen-devel@lists.sourceforge.net
Subject: Re: PIC register 'bx' clobbered in 'asm' - xen-unstable build error
Date: Fri, 25 Feb 2005 15:19:08 -0800	[thread overview]
Message-ID: <421FB26C.6040304@intel.com> (raw)
In-Reply-To: <mailman.1109368025.9618@unix-os.sc.intel.com>

On 2/25/2005 1:44 PM, Anthony Liguori wrote:
> Jerone Young wrote:
> 
>> The big question is why are you clobbering bx , dx registers on get
>> cpuid:
>>  
>>
> CPUID returns information in eax, ebx, ecx, and edx.  With -fPIC you 
> have to push ebx onto the stack before calling cpuid and pop it 
> afterward as Bin points out is what the patch to xen-unstable does.

The compiler used to generate the push/pop just fine for gcc-3.3. This is an issue specific to gcc-3.4.

gcc-3.3 code:

(gdb) disassemble vmx_identify
Dump of assembler code for function vmx_identify:
0x00000000 <vmx_identify+0>:    push   %ebp
0x00000001 <vmx_identify+1>:    mov    $0x1,%eax
0x00000006 <.LC23+3>:   mov    %esp,%ebp
0x00000008 <.LC23+5>:   push   %ebx
0x00000009 <.LC23+6>:   cpuid
0x0000000b <.LC23+8>:   pop    %ebx
0x0000000c <.LC23+9>:   xor    %eax,%eax
0x0000000e <.LC23+11>:  test   $0x20,%cl
0x00000011 <.LC23+14>:  setne  %al
0x00000014 <.LC23+17>:  pop    %ebp
0x00000015 <.LC23+18>:  dec    %eax
0x00000016 <.LC23+19>:  ret
0x00000017 <.LC23+20>:  mov    %esi,%esi
0x00000019 <.LC23+22>:  lea    0x0(%edi),%edi
End of assembler dump.

I'm following up with compiler people here to understand why the compiler thinks this is a bug.

BTW <asm-i386/processor.h> has similar code.

	-Arun


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

  parent reply	other threads:[~2005-02-25 23:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-25 21:02 PIC register 'bx' clobbered in 'asm' - xen-unstable build error David F Barrera
2005-02-25 21:17 ` Jerone Young
2005-02-25 21:44   ` Anthony Liguori
     [not found]   ` <mailman.1109368025.9618@unix-os.sc.intel.com>
2005-02-25 23:19     ` Arun Sharma [this message]
2005-02-25 21:21 ` Bin Ren

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=421FB26C.6040304@intel.com \
    --to=arun.sharma@intel.com \
    --cc=aliguori@us.ibm.com \
    --cc=xen-devel@lists.sourceforge.net \
    /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.