From: Zachary Amsden <zach@vmware.com>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Chris Wright <chrisw@sous-sol.org>,
Virtualization Mailing List <virtualization@lists.osdl.org>
Subject: Re: New CPUID/MSR driver; virtualization hooks
Date: Wed, 04 Apr 2007 22:17:48 -0700 [thread overview]
Message-ID: <4614867C.4060506@vmware.com> (raw)
In-Reply-To: <46144FA6.1000802@zytor.com>
H. Peter Anvin wrote:
> It's not *quite* that easy. The assembly code around this is pretty
> extensive, because it has to stand on its head in order to present the
> proper register image.
>
Having just stood on my head for 55 breaths, might I suggest we
implement a binary equivalent CPUID paravirt-ops wrapper; then the
assembly code can just call CPUID and we can redefine it to call to a
stub, which makes the pv-ops CPUID call, the puts the outputs back in
the proper registers.
The VMI ROM CPUID is binary identical in register format with the native
instruction, so it need not do a headstand. For the others,
ENTRY(paravirt_raw_cpuid)
pushl %edx
pushl %ecx
pushl %ebx
pushl %eax
mov %esp, %eax /* pointer for eax in/out */
leal 4(%esp), %edx /* pointer for ebx in/out */
leal 8(%esp), %ecx /* pointer for ecx in/out */
leal 12(%esp), %ebx /* pointer for edx in/out */
pushl %ebx /* arg 4 passed on stack */
call *(paravirt_ops+pv_offset_CPUID)
addl $4, %esp
popl %eax
popl %ebx
popl %ecx
popl %edx
ret
Should do the right thing. In any case, thanks for the heads up.
Zach
next prev parent reply other threads:[~2007-04-05 5:17 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-05 0:50 New CPUID/MSR driver; virtualization hooks H. Peter Anvin
2007-04-05 1:16 ` Chris Wright
2007-04-05 1:23 ` H. Peter Anvin
2007-04-05 5:17 ` Zachary Amsden [this message]
2007-04-05 18:03 ` H. Peter Anvin
2007-04-05 21:09 ` Zachary Amsden
2007-04-05 21:09 ` H. Peter Anvin
2007-04-05 21:25 ` Zachary Amsden
2007-04-05 21:17 ` H. Peter Anvin
2007-04-05 21:27 ` Zachary Amsden
2007-04-05 21:40 ` H. Peter Anvin
2007-04-05 21:43 ` Jeremy Fitzhardinge
2007-04-05 21:43 ` Zachary Amsden
2007-04-05 21:49 ` Jeremy Fitzhardinge
2007-04-05 21:59 ` H. Peter Anvin
2007-04-05 22:19 ` Jeremy Fitzhardinge
2007-04-05 22:31 ` H. Peter Anvin
2007-04-05 21:54 ` Chris Wright
2007-04-05 1:48 ` Tony Breeds
2007-04-05 5:00 ` Zachary Amsden
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=4614867C.4060506@vmware.com \
--to=zach@vmware.com \
--cc=chrisw@sous-sol.org \
--cc=hpa@zytor.com \
--cc=virtualization@lists.osdl.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).