Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030486AbWJ3CfH (ORCPT ); Sun, 29 Oct 2006 21:35:07 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751921AbWJ3CfH (ORCPT ); Sun, 29 Oct 2006 21:35:07 -0500 Received: from ozlabs.org ([203.10.76.45]:16364 "EHLO ozlabs.org") by vger.kernel.org with ESMTP id S1751909AbWJ3CfF (ORCPT ); Sun, 29 Oct 2006 21:35:05 -0500 Subject: Re: [PATCH 1/4] Prep for paravirt: Be careful about touching BIOS address space From: Rusty Russell To: Andrew Morton Cc: Jeremy Fitzhardinge , Pavel Machek , virtualization , lkml - Kernel Mailing List In-Reply-To: <20061027215037.cd69b2a3.akpm@osdl.org> References: <1161920325.17807.29.camel@localhost.localdomain> <1161920535.17807.33.camel@localhost.localdomain> <20061027113001.GB8095@elf.ucw.cz> <45427ABD.6070407@goop.org> <20061027144157.f23fcf89.akpm@osdl.org> <4542DD84.3070006@goop.org> <20061027215037.cd69b2a3.akpm@osdl.org> Content-Type: text/plain Date: Mon, 30 Oct 2006 13:35:01 +1100 Message-Id: <1162175701.9802.24.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.6.1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3618 Lines: 110 On Fri, 2006-10-27 at 21:50 -0700, Andrew Morton wrote: > On Fri, 27 Oct 2006 21:33:08 -0700 > Jeremy Fitzhardinge wrote: > > > Andrew Morton wrote: > > > It'd be better to use include/linux/uaccess.h:probe_kernel_address() for > > > this operation. > > > > > Ah, yes, that was the precedent I was thinking of, > > We've done open-coded __get_user() in various places in the past. The difference with > probe_kernel_address() is that it doesn't get deadlocked on mmap_sem(). > > > but I guess it would > > be better to just use it directly. It's a relatively new interface, > > isn't it? > > Yeah. New enough that nobody's tried using it on non-x86 ;) It needs > to do set_fs(KERNEL_DS). And the function name is misleading: it really does get a value, not merely probe an address. And the arguments are reversed from __get_user, just to add fun. Andrew, please replace prep-for-paravirt-be-careful-about-touching-bios-warning-fix.patch Subject: Be careful about touching BIOS address space BIOS ROM areas may not be mapped into the guest address space, so be careful when touching those addresses to make sure they appear to be mapped. At Andrew's request, fix probe_kernel_address for non-x86. Signed-off-by: Jeremy Fitzhardinge Signed-off-by: Rusty Russell (modified) diff -r 9a6c8ceba677 arch/i386/kernel/setup.c --- a/arch/i386/kernel/setup.c Mon Oct 30 11:34:30 2006 +1100 +++ b/arch/i386/kernel/setup.c Mon Oct 30 13:15:33 2006 +1100 @@ -47,6 +47,7 @@ #include #include #include +#include #include