From patchwork Thu Jan 14 19:41:27 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 72927 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id o0EJfh1O025221 for ; Thu, 14 Jan 2010 19:41:43 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757545Ab0ANTll (ORCPT ); Thu, 14 Jan 2010 14:41:41 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757521Ab0ANTlk (ORCPT ); Thu, 14 Jan 2010 14:41:40 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59423 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757520Ab0ANTlj (ORCPT ); Thu, 14 Jan 2010 14:41:39 -0500 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o0EJfc4b031996 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 14 Jan 2010 14:41:39 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o0EJfcTs016869; Thu, 14 Jan 2010 14:41:38 -0500 Received: from amt.cnet (vpn-9-200.rdu.redhat.com [10.11.9.200]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o0EJfbKU031129; Thu, 14 Jan 2010 14:41:37 -0500 Received: from amt.cnet (amt.cnet [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id EF6E368A2AB; Thu, 14 Jan 2010 17:41:27 -0200 (BRST) Received: (from marcelo@localhost) by amt.cnet (8.14.3/8.14.3/Submit) id o0EJfRuc004076; Thu, 14 Jan 2010 17:41:27 -0200 Date: Thu, 14 Jan 2010 17:41:27 -0200 From: Marcelo Tosatti To: Avi Kivity Cc: kvm Subject: KVM: MMU: bail out pagewalk on kvm_read_guest error Message-ID: <20100114194127.GA3968@amt.cnet> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-08-17) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h index 58a0f1e..ede2131 100644 --- a/arch/x86/kvm/paging_tmpl.h +++ b/arch/x86/kvm/paging_tmpl.h @@ -150,7 +150,9 @@ walk: walker->table_gfn[walker->level - 1] = table_gfn; walker->pte_gpa[walker->level - 1] = pte_gpa; - kvm_read_guest(vcpu->kvm, pte_gpa, &pte, sizeof(pte)); + if (kvm_read_guest(vcpu->kvm, pte_gpa, &pte, sizeof(pte))) + goto not_present; + trace_kvm_mmu_paging_element(pte, walker->level); if (!is_present_gpte(pte))