From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mohammed Gamal Subject: [RFC PATCH 0/3] Add segment limit checks to emulator Date: Thu, 8 Jul 2010 00:23:56 +0300 Message-ID: <1278537839-20144-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-bw0-f46.google.com ([209.85.214.46]:38201 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755267Ab0GGVYT (ORCPT ); Wed, 7 Jul 2010 17:24:19 -0400 Received: by bwz1 with SMTP id 1so87748bwz.19 for ; Wed, 07 Jul 2010 14:24:17 -0700 (PDT) Sender: kvm-owner@vger.kernel.org List-ID: After 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. So it's needless to say that these patches are not meant for merging! Mohammed Gamal (3): Add helper methods to get segment limits x86 emulator: Add cs_base() helper x86 emulator: Add segment limit checks and helper functions arch/x86/include/asm/kvm_emulate.h | 1 + arch/x86/include/asm/kvm_host.h | 1 + arch/x86/kvm/emulate.c | 123 +++++++++++++++++++++++++++++------- arch/x86/kvm/svm.c | 8 +++ arch/x86/kvm/vmx.c | 8 +++ arch/x86/kvm/x86.c | 12 ++++ 6 files changed, 130 insertions(+), 23 deletions(-)