From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [PATCH v2 0/2] Trap and propagate divide errors when emulating DIV Date: Thu, 26 Aug 2010 15:15:05 -0300 Message-ID: <20100826181505.GC25688@amt.cnet> References: <1282813141-20473-1-git-send-email-avi@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mx1.redhat.com ([209.132.183.28]:62509 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752211Ab0HZTPb (ORCPT ); Thu, 26 Aug 2010 15:15:31 -0400 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o7QJFUe1019766 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 26 Aug 2010 15:15:30 -0400 Content-Disposition: inline In-Reply-To: <1282813141-20473-1-git-send-email-avi@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Aug 26, 2010 at 11:58:59AM +0300, Avi Kivity wrote: > KVM recently started emulating DIV and IDIV. However, those instructions > trap when given the right operands. Since figuring out when to trap or not > is difficult, we just execute the instruction and see if the processor trapped > or not. > > Avi Kivity (2): > x86: allow kernel exception fixup for divide errors (#DE) > - dropped > KVM: x86 emulator: add macros for executing instructions that may > trap > KVM: x86 emulator: trap and propagate #DE from DIV and IDIV > - propagate return code to x86_emulate_insn() > > arch/x86/kvm/emulate.c | 63 ++++++++++++++++++++++++++++++++++++++++++++--- > 1 files changed, 59 insertions(+), 4 deletions(-) Applied, thanks.