public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@web.de>
To: Mohit Dhingra <mohitdhingras@gmail.com>
Cc: kvm@vger.kernel.org
Subject: Re: Interested in working for GSoC project
Date: Sun, 14 Apr 2013 10:18:17 +0200	[thread overview]
Message-ID: <516A6649.70707@web.de> (raw)
In-Reply-To: <CAGkgU9XRZH1agoHZm4ENsCvKpENXjN+0_p6F=rxvCeRN6Qo5jA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1751 bytes --]

On 2013-04-13 20:24, Mohit Dhingra wrote:
> Hi All,
> 
> I am Mohit Dhingra, planning to work in GSoC project "Improve nested
> virtualization support for x86". I got in touch with Jan
> (jan.kiszka@web.de) few days back.
> 
> As suggested by him, I am trying to write a simple unit test which
> tests the "vmx" functions. To start with, I have written a small code
> which checks whether "vmx" functionality is available on the current
> processor or not[1].
> 
> I have used "cpuid" to check the VMX functionality. Before executing
> cpuid, eax is set to 1. cpuid then puts the feature flags in ecx and
> edx registers. Bit5 in ecx register tells whether VMX feature is
> present or not. I am attaching the patch along with this mail.

Hint regarding assembly usage: Try to minimize the number of
instructions. Check, e.g., how the kernel implements cpuid. Result
evaluation can perfectly be done in C.

> 
> But there is a problem that I am facing. CPUID behaves differently
> when I run it using qemu-kvm, and when I run it directly in user mode.
>  Please check the below output. It would be great if someone can
> please help me out.

To enable nested VMX, you need to tweak two things: first, you need
nested=1 as parameter for kvm_intel. And, second, you have to select a
CPU type via QEMU (-cpu) that supports VMX or explicitly add that
feature to the selected CPU (-cpu ...,+vmx).

By default, only core[2]duo and the synthetic KVM type "host" come with
VMX enabled, not much more modern Intel CPU like Nehalem or SandyBridge.
That's inconsistent, and if you want to fix something in QEMU, you could
check which CPU types in qemu/target-i386/cpu.c lack the flag and post a
patch to change this.

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 263 bytes --]

  reply	other threads:[~2013-04-14  8:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-13 18:24 Interested in working for GSoC project Mohit Dhingra
2013-04-14  8:18 ` Jan Kiszka [this message]
2013-04-14 10:29   ` Kashyap Chamarthy
2013-04-20 21:01     ` Mohit Dhingra

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=516A6649.70707@web.de \
    --to=jan.kiszka@web.de \
    --cc=kvm@vger.kernel.org \
    --cc=mohitdhingras@gmail.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