From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [patch 3/4] KVM: introduce kvm_arch_can_free_memslot, disallow slot deletion if cached cr3 Date: Thu, 07 May 2009 17:16:35 +0300 Message-ID: <4A02ED43.3010808@redhat.com> References: <20090427200620.389589459@amt.cnet> <20090427200757.023172987@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: mtosatti@redhat.com Return-path: Received: from mx2.redhat.com ([66.187.237.31]:37981 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758779AbZEGOQh (ORCPT ); Thu, 7 May 2009 10:16:37 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n47EGbov030186 for ; Thu, 7 May 2009 10:16:37 -0400 In-Reply-To: <20090427200757.023172987@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: mtosatti@redhat.com wrote: > Disallow the deletion of memory slots (and aliases, for x86 case), if a > vcpu contains a cr3 that points to such slot/alias. > That allows the guest to induce failures in the host. Better to triple-fault the guest instead. > > +int kvm_arch_can_free_memslot(struct kvm *kvm, struct kvm_memory_slot *slot) > +{ > + return 1; > +} > + > In general, instead of stubs in every arch, have x86 say KVM_HAVE_ARCH_CAN_FREE_MEMSLOT and define the stub in generic code when that define is not present. -- error compiling committee.c: too many arguments to function