From: Amit Shah <amit.shah@redhat.com>
To: nitin a kamble <nitin.a.kamble@intel.com>
Cc: Alexander Graf <agraf@suse.de>,
"kvm@vger.kernel.org list" <kvm@vger.kernel.org>,
Avi Kivity <avi@redhat.com>, Elsie Wahlig <elsie.wahlig@amd.com>,
Anthony Liguori <anthony@codemonkey.ws>,
Jun Nakajima <jun.nakajima@intel.com>,
Benjamin Serebrin <benjamin.serebrin@amd.com>
Subject: Re: Cross vendor migration ideas
Date: Mon, 17 Nov 2008 05:07:05 -0500 (EST) [thread overview]
Message-ID: <181068321.591226916425142.JavaMail.root@zmail02.collab.prod.int.phx2.redhat.com> (raw)
In-Reply-To: <1226706209.18741.20.camel@lnitindesktop.sc.intel.com>
----- "Nitin A Kamble" <nitin.a.kamble@intel.com> wrote:
> Amit, Alex,
> Please see my comments bellow.
>
> Avi,
> Please have a look at the patches, and let me know the parts you
> think
> can be done better.
>
> On Fri, 2008-11-14 at 06:07 -0700, Amit Shah wrote:
> > * On Thursday 13 Nov 2008 19:08:14 Alexander Graf wrote:
> > > On 13.11.2008, at 05:35, Amit Shah wrote:
> > > > * On Wednesday 12 Nov 2008 22:49:16 Alexander Graf wrote:
> > > >> On 12.11.2008, at 17:52, Amit Shah wrote:
> > > >>> Hi Alex,
> > > >>>
> > > >>> * On Wednesday 12 Nov 2008 21:09:43 Alexander Graf wrote:
> > > >>>> Hi,
> > > >>>>
> > > >>>> I was thinking a bit about cross vendor migration recently
> and
> > > >>>> since
> > > >>>> we're doing open source development, I figured it might be a
> good
> > > >>>> idea
> > > >>>> to talk to everyone about this.
> > > >>>>
> > > >>>> So why are we having a problem?
> > > >>>>
> > > >>>> In normal operation we don't. If we're running a 32-bit
> kernel, we
> > > >>>> can
> > > >>>> use SYSENTER to jump from kernel<->userspace. If we're on a
> 64-bit
> > > >>>> kernel with 64-bit userspace, every CPU supports SYSCALL. At
> least
> > > >>>> Linux is being smart on this and does use exactly these two
> > > >>>> capabilities in these two cases.
> > > >>>> But if we're running in compat mode (64-bit kernel with
> 32-bit
> > > >>>> userspace), things differ. Intel supports only SYSENTER here,
> while
> > > >>>> AMD only supports SYSCALL. Both can still use int80.
> > > >>>>
> > > >>>> Operating systems detect usage of SYSCALL or SYSENTER pretty
> > > >>>> early on
> > > >>>> (Linux does this on vdso). So when we boot up on an Intel
> machine,
> > > >>>> Linux assumes that using SYSENTER in compat mode is fine.
> Migrating
> > > >>>> that machine to an AMD machine breaks this assumption though,
> since
> > > >>>> SYSENTER can't be used in compat mode.
> > > >>>> On LInux, this detection is based on the CPU vendor string.
> If
> > > >>>> Linux
> > > >>>> finds a "GenuineIntel", SYSENTER is used in compat mode, if
> it's
> > > >>>> "AuthenticAMD", SYSCALL is used and if none of these two is
> found,
> > > >>>> int80 is used.
> > > >>>>
> > > >>>> I tried modifying the vendor string, removed the "overwrite
> the
> > > >>>> vendor
> > > >>>> string with the native string" hack and things look like they
> work
> > > >>>> just fine with Linux.
> > > >>>>
> > > >>>> Unfortunately right now I don't have a 64-bit Windows
> installation
> > > >>>> around to check if that approach works there too, but if it
> does
> > > >>>> and
> > > >>>> no known OS breaks due to the invalid vendor string, we can
> just
> > > >>>> create our own virtual CPU string, no?
> > > >>>
> > > >>> qemu has an option for that, -cpu qemu64 IIRC. As long as we
> expose
> > > >>> practically correct cpuids and MSRs, this should be fine. I've
> not
> > > >>> tested
> > > >>> qemu64 with winxp x64 though. Also, last I knew, winxp x64
> > > >>> installation
> > > >>> didn't succeed with --no-kvm. qemu by default exposes an AMD
> CPU
> > > >>> type.
> > > >>
> > > >> I wasn't talking about CPUID features, but the vendor string.
> Qemu64
> > > >> provides the AuthenticAMD string, so we don't run into any
> issues I'm
> > > >> presuming.
> > > >
> > > > Right -- the thing is, with the default AuthenticAMD string,
> winp x64
> > > > installation fails. That has to be because of some missing
> cpuids.
> > > > That's one
> > > > of the drawbacks of exposing a well-known CPU type. I was
> suggesting
> > > > we
> > > > should try out the -cpu qemu64 CPU type since it exposes a non-
> > > > standard CPU
> > > > to see if guests and most userspace programs work fine without
> any
> > > > further
> > > > tweaking -- see the 'cons' below for why this might be a
> problem.
> > >
> > > I still don't really understand what you're trying to say - qemu64
> is
> > > the default in KVM right now. You mean winxp64 installation
> doesn't
>
>
> > No, the default for KVM is the host CPU type.
>
> Amit, Aliex is correct. the default cpu for kvm is qemu64 not the
> host.
There are two things -- the Vendor ID and the cpuid bits. I'm talking about the vendor ID here.
> I have sent the patches to add an options -cpu host. Some of the
> patches
> are gone in, But All the patches are not in yet. Also my patches does
> not make the host option as default. I have attached the remaining
> two
> patches.
Amit.
next prev parent reply other threads:[~2008-11-17 10:07 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-12 15:39 Cross vendor migration ideas Alexander Graf
2008-11-12 15:45 ` Anthony Liguori
2008-11-12 15:50 ` Alexander Graf
2008-11-12 15:59 ` Anthony Liguori
2008-11-13 0:02 ` Skywing
2008-11-13 1:48 ` Serebrin, Benjamin (Calendar)
2008-11-15 13:03 ` Andi Kleen
2008-11-15 16:39 ` Alexander Graf
2008-11-15 17:37 ` Andi Kleen
2008-11-16 15:36 ` Avi Kivity
2008-11-17 11:09 ` Andi Kleen
2008-11-17 11:59 ` Avi Kivity
2008-11-15 17:38 ` Glauber Costa
2008-11-16 14:58 ` Avi Kivity
2008-11-13 10:16 ` Avi Kivity
2008-11-12 20:06 ` Andi Kleen
2008-11-12 20:52 ` Alexander Graf
2008-11-13 10:20 ` Avi Kivity
2008-11-12 16:52 ` Amit Shah
2008-11-12 17:19 ` Alexander Graf
2008-11-13 4:35 ` Amit Shah
2008-11-13 13:38 ` Alexander Graf
2008-11-14 13:07 ` Amit Shah
2008-11-14 23:43 ` Nitin A Kamble
2008-11-17 10:07 ` Amit Shah [this message]
-- strict thread matches above, loose matches on Subject: below --
2008-11-16 0:23 Skywing
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=181068321.591226916425142.JavaMail.root@zmail02.collab.prod.int.phx2.redhat.com \
--to=amit.shah@redhat.com \
--cc=agraf@suse.de \
--cc=anthony@codemonkey.ws \
--cc=avi@redhat.com \
--cc=benjamin.serebrin@amd.com \
--cc=elsie.wahlig@amd.com \
--cc=jun.nakajima@intel.com \
--cc=kvm@vger.kernel.org \
--cc=nitin.a.kamble@intel.com \
/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