qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Peter Lieven <pl@kamp.de>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] Prohibit Windows from running in QEMU
Date: Fri, 4 Aug 2017 12:43:22 +0200	[thread overview]
Message-ID: <db37ed08-223f-91c8-b72d-3dede381ea6a@redhat.com> (raw)
In-Reply-To: <33560059-ae3d-9ee9-dab7-9f992f8d913c@kamp.de>

On 04/08/2017 12:27, Peter Lieven wrote:
> Am 04.08.2017 um 12:23 schrieb Paolo Bonzini:
>> On 04/08/2017 11:58, Peter Lieven wrote:
>>> Am 29.10.2013 um 10:59 schrieb Paolo Bonzini:
>>>> Il 29/10/2013 10:48, Peter Lieven ha scritto:
>>>>> Hi all,
>>>>>
>>>>> this question might seem a bit weird, but does anyone see a good way to
>>>>> avoid
>>>>> that Windows is able to boot inside qemu?
>>>>>
>>>>> We have defined several profiles for different operation systems and I want
>>>>> to avoid that someone chooses Linux and then installs Windows within
>>>>> a VM. Reason is licensing.
>>>> Patch QEMU to crash when Hyper-V extensions are enabled...
>>> Hi all,
>>>
>>> this is an old topic that has become important for me again recently.
>>> Now all Linux versions should be able to detect KVM even if Hyper-V is enabled.
>>>
>>> But how do I detect from Qemu userspace that Hyper-V is enabled?
>> Maybe a better one: make KVM crash the guest if CR8 is nonzero on a
>> vmexit.  Linux doesn't use it, Windows should not survive long.
> 
> You mean the kvm kernel module? Or can I access this register also
> from Qemu on any call that is handled in userspace? It would be easier
> to have a cmdline option to Qemu than an option to a kernel module.

Yes, the kernel module.  Accessing it in QEMU requires
cpu_synchronize_state so it's slow.  However, you could piggyback on
some other functionality that is never used by Linux to do the check,
for example the RTC I/O port.

That is, in the RTC I/O port code you call cpu_synchronize_state and
check CR8.

Paolo

>> Warning, I don't know if UEFI firmware uses CR8.
> 
> UEFI firmware is not important in this case.
> Do you know if FreeBSD, OpenBSD or NetBSD use it?
> 
> 
> Thank for your ideas,
> Peter
> 

  reply	other threads:[~2017-08-04 10:46 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-29  9:48 [Qemu-devel] Prohibit Windows from running in QEMU Peter Lieven
2013-10-29  9:59 ` Paolo Bonzini
2013-10-29 10:11   ` Peter Lieven
2013-10-29 10:19     ` Paolo Bonzini
2013-10-29 10:25       ` Gleb Natapov
2013-10-29 10:40       ` Peter Lieven
2013-10-29 10:48         ` Paolo Bonzini
2013-10-29 10:50           ` Peter Lieven
2013-10-29 14:12             ` Laszlo Ersek
2013-10-29 15:55               ` BALATON Zoltan
2013-10-29 16:00                 ` Paolo Bonzini
2013-10-29 16:29                   ` Peter Lieven
2017-08-04  9:58   ` Peter Lieven
2017-08-04 10:23     ` Paolo Bonzini
2017-08-04 10:27       ` Peter Lieven
2017-08-04 10:43         ` Paolo Bonzini [this message]
2017-08-04 10:44           ` Peter Lieven
2013-10-29 11:13 ` Michael S. Tsirkin
2013-10-29 11:26   ` Gleb Natapov
2013-10-29 11:31     ` Peter Lieven
2013-10-29 11:34       ` Gleb Natapov
2013-10-29 12:17     ` Michael S. Tsirkin
2013-10-29 12:20       ` Gleb Natapov
2013-10-30  0:16   ` Li Guang
2013-10-29 11:47 ` Daniel P. Berrange

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=db37ed08-223f-91c8-b72d-3dede381ea6a@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=pl@kamp.de \
    --cc=qemu-devel@nongnu.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).