From: Mohammed Gamal Subject: [RFC PATCH v3 0/3] Add segment limit checks to emulator Date: Mon, 12 Jul 2010 01:56:07 +0300 Message-ID: <1278888970-2936-1-git-send-email-m.gamal005@gmail.com> Cc: mtosatti@redhat.com, kvm@vger.kernel.org, Mohammed Gamal To: avi@redhat.com Return-path: Received: from mail-wy0-f174.google.com ([74.125.82.174]:48367 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753063Ab0GKW4V (ORCPT ); Sun, 11 Jul 2010 18:56:21 -0400 Received: by wyf23 with SMTP id 23so2926395wyf.19 for ; Sun, 11 Jul 2010 15:56:20 -0700 (PDT) Sender: kvm-owner@vger.kernel.org List-ID: fter some conversation with Avi concerning why unreal mode has been seen to work with KVM on Intel. It clears out the scenario is caused as follows: - guest enters big real mode - kvm squashes limit to 64k-1 - guest executes instructions with offset > 64k - cpu issues #GP due to limit violation - kvm handle_rmode_exception() -> emulator - emulator ignores limit, emulates instruction With these applied I am getting vmentry failures with SeaBIOS and gPXE. I could still get SeaBIOS to work with emulate_invalid_guest_state=1. So it's needless to say that these patches are not meant for merging! -------- Changes from v2: - Addeded generic segment limit check helpers - Removed individual segment register segment helpers as they're no longer needed -------- Mohammed Gamal (3): Add helper methods to get segment limits x86 emulator: Add segment limit checking helpers x86 emulator: Add segment limit checks to emulator arch/x86/include/asm/kvm_emulate.h | 1 + arch/x86/include/asm/kvm_host.h | 1 + arch/x86/kvm/emulate.c | 112 ++++++++++++++++++++++++++++------- arch/x86/kvm/svm.c | 8 +++ arch/x86/kvm/vmx.c | 8 +++ arch/x86/kvm/x86.c | 12 ++++ 6 files changed, 119 insertions(+), 23 deletions(-)