[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150710141351.GB16910@gmail.com>
Date: Fri, 10 Jul 2015 16:13:52 +0200
From: Ingo Molnar <mingo@...nel.org>
To: Paolo Bonzini <pbonzini@...hat.com>
Cc: Andy Lutomirski <luto@...capital.net>,
Brian Gerst <brgerst@...il.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Arjan van de Ven <arjan@...ux.intel.com>,
Andy Lutomirski <luto@...nel.org>,
the arch/x86 maintainers <x86@...nel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Oleg Nesterov <oleg@...hat.com>,
Kees Cook <keescook@...omium.org>,
Peter Zijlstra <peterz@...radead.org>,
Borislav Petkov <bp@...en8.de>
Subject: Re: [PATCH] x86/kconfig/32: Mark CONFIG_VM86 as BROKEN
* Paolo Bonzini <pbonzini@...hat.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists