From: Ingo Molnar <mingo@kernel.org>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Andy Lutomirski <luto@amacapital.net>,
Brian Gerst <brgerst@gmail.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
Arjan van de Ven <arjan@linux.intel.com>,
Andy Lutomirski <luto@kernel.org>,
the arch/x86 maintainers <x86@kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Oleg Nesterov <oleg@redhat.com>,
Kees Cook <keescook@chromium.org>,
Peter Zijlstra <peterz@infradead.org>,
Borislav Petkov <bp@alien8.de>
Subject: Re: [PATCH] x86/kconfig/32: Mark CONFIG_VM86 as BROKEN
Date: Fri, 10 Jul 2015 16:13:52 +0200 [thread overview]
Message-ID: <20150710141351.GB16910@gmail.com> (raw)
In-Reply-To: <559FA988.9030205@redhat.com>
* Paolo Bonzini <pbonzini@redhat.com> wrote:
> > Hmm.
> >
> > If we did this, I think I'd prefer a slightly more general approach. First
> > teach KVM to support a mode in which it's purely an emulator (Paolo: how hard
> > is this? It would also make testing the emulator much easier).
>
> This isn't hard, at least for Intel: make emulation_required() return true
> always (and fix the fallout). However, it's not necessary. The emulator is
> designed to be independent from the rest of KVM. At some point I think Avi was
> testing it in userspace (or planning to do so). So you would just move it from
> arch/x86/kvm to arch/x86/emulate.
Very nice!
> The obvious downside is that the emulator isn't really designed for speed.
>
> In KVM it's currently 1000-1500 times slower than the real thing. Even if you
> modified it to remove the KVM overhead (vm86 is just running ring 3 code; no
> interrupts and no pagetables to walk), it probably would take 300-500 cycles to
> execute one instruction.
This needs to be tested, but I wouldn't expect it to be a big issue:
- if anyone cares they can improve its performance
- or worst case they can upgrade their tool to something newer which will use
user-space emulation of 16-bit code anyway ...
- Furthermore I suspect with vm86 we'd trap out of vm86 mode rather often - and a
single trap can take thousands of cycles. So I suspect the effective slowdown
depends on the workload.
- In the absolute worst case it will perform like a really old CPU.
Thanks,
Ingo
next prev parent reply other threads:[~2015-07-10 14:14 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-08 1:25 [PATCH] x86/kconfig/32: Mark CONFIG_VM86 as BROKEN Andy Lutomirski
2015-07-08 2:33 ` Arjan van de Ven
2015-07-08 14:00 ` Thomas Gleixner
2015-07-08 14:04 ` Ingo Molnar
2015-07-09 9:03 ` Pavel Machek
2015-07-09 17:57 ` Andy Lutomirski
2015-07-09 18:03 ` Kees Cook
2015-07-09 18:30 ` Linus Torvalds
2015-07-08 16:59 ` Linus Torvalds
2015-07-08 17:30 ` Andy Lutomirski
2015-07-08 17:49 ` Andy Lutomirski
2015-07-08 17:55 ` Linus Torvalds
2015-07-08 18:47 ` Andy Lutomirski
2015-07-08 18:53 ` Kees Cook
2015-07-08 18:48 ` Kees Cook
2015-07-08 19:04 ` Andy Lutomirski
2015-07-08 18:54 ` Austin S Hemmelgarn
2015-07-08 19:05 ` Brian Gerst
2015-07-08 19:14 ` Andy Lutomirski
2015-07-08 19:39 ` Brian Gerst
2015-07-08 19:59 ` Andy Lutomirski
2015-07-09 5:52 ` Ingo Molnar
2015-07-09 5:59 ` Ingo Molnar
2015-07-09 18:33 ` Andy Lutomirski
2015-07-10 11:16 ` Paolo Bonzini
2015-07-10 14:13 ` Ingo Molnar [this message]
2015-07-10 14:24 ` Paolo Bonzini
2015-07-10 14:39 ` Andy Lutomirski
2015-07-10 14:12 ` Eric W. Biederman
2015-07-10 14:37 ` Andy Lutomirski
2015-07-10 16:35 ` Linus Torvalds
2015-07-10 16:44 ` Andy Lutomirski
2015-07-10 17:04 ` Linus Torvalds
2015-07-10 17:13 ` Andy Lutomirski
2015-07-10 17:39 ` Linus Torvalds
2015-07-10 17:58 ` Andy Lutomirski
2015-07-10 18:00 ` Al Viro
2015-07-11 9:18 ` Ingo Molnar
2015-07-08 19:13 ` Ingo Molnar
2015-07-08 9:45 ` [tip:x86/asm] " tip-bot for Andy Lutomirski
2015-07-08 15:32 ` [PATCH] " Brian Gerst
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=20150710141351.GB16910@gmail.com \
--to=mingo@kernel.org \
--cc=arjan@linux.intel.com \
--cc=bp@alien8.de \
--cc=brgerst@gmail.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=luto@kernel.org \
--cc=oleg@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peterz@infradead.org \
--cc=torvalds@linux-foundation.org \
--cc=x86@kernel.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).