From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 1/4] s390/kvm: Handle hosts not supporting s390-virtio. Date: Thu, 09 Aug 2012 13:03:57 +0300 Message-ID: <50238B0D.2060604@redhat.com> References: <1344351168-2568-1-git-send-email-cornelia.huck@de.ibm.com> <1344351168-2568-2-git-send-email-cornelia.huck@de.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1344351168-2568-2-git-send-email-cornelia.huck@de.ibm.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org Sender: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org List-Archive: List-Post: To: Cornelia Huck Cc: linux-s390 , Anthony Liguori , Rusty Russell , KVM , Carsten Otte , Sebastian Ott , Marcelo Tosatti , Heiko Carstens , qemu-devel , Alexander Graf , Christian Borntraeger , Martin Schwidefsky List-ID: On 08/07/2012 05:52 PM, Cornelia Huck wrote: > Running under a kvm host does not necessarily imply the presence of > a page mapped above the main memory with the virtio information; > however, the code includes a hard coded access to that page. > > Instead, check for the presence of the page and exit gracefully > before we hit an addressing exception if it does not exist. > > /* > * Init function for virtio > * devices are in a single page above top of "normal" mem > @@ -443,6 +458,12 @@ static int __init kvm_devices_init(void) > } > > kvm_devices = (void *) real_memory_size; > + if (test_devices_support() < 0) { > + vmem_remove_mapping(real_memory_size, PAGE_SIZE); > + root_device_unregister(kvm_root); > + /* No error. */ > + return 0; > + } > Cleaner to defer root_device_register() until after the mapping has been verified. -- error compiling committee.c: too many arguments to function From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33044) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzPb8-00016y-6P for qemu-devel@nongnu.org; Thu, 09 Aug 2012 06:04:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SzPb6-0004cn-Rl for qemu-devel@nongnu.org; Thu, 09 Aug 2012 06:04:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37819) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzPb6-0004cW-K4 for qemu-devel@nongnu.org; Thu, 09 Aug 2012 06:04:08 -0400 Message-ID: <50238B0D.2060604@redhat.com> Date: Thu, 09 Aug 2012 13:03:57 +0300 From: Avi Kivity MIME-Version: 1.0 References: <1344351168-2568-1-git-send-email-cornelia.huck@de.ibm.com> <1344351168-2568-2-git-send-email-cornelia.huck@de.ibm.com> In-Reply-To: <1344351168-2568-2-git-send-email-cornelia.huck@de.ibm.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/4] s390/kvm: Handle hosts not supporting s390-virtio. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cornelia Huck Cc: linux-s390 , Anthony Liguori , Rusty Russell , KVM , Carsten Otte , Sebastian Ott , Marcelo Tosatti , Heiko Carstens , qemu-devel , Alexander Graf , Christian Borntraeger , Martin Schwidefsky On 08/07/2012 05:52 PM, Cornelia Huck wrote: > Running under a kvm host does not necessarily imply the presence of > a page mapped above the main memory with the virtio information; > however, the code includes a hard coded access to that page. > > Instead, check for the presence of the page and exit gracefully > before we hit an addressing exception if it does not exist. > > /* > * Init function for virtio > * devices are in a single page above top of "normal" mem > @@ -443,6 +458,12 @@ static int __init kvm_devices_init(void) > } > > kvm_devices = (void *) real_memory_size; > + if (test_devices_support() < 0) { > + vmem_remove_mapping(real_memory_size, PAGE_SIZE); > + root_device_unregister(kvm_root); > + /* No error. */ > + return 0; > + } > Cleaner to defer root_device_register() until after the mapping has been verified. -- error compiling committee.c: too many arguments to function