Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755052AbXKSR2J (ORCPT ); Mon, 19 Nov 2007 12:28:09 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753743AbXKSR15 (ORCPT ); Mon, 19 Nov 2007 12:27:57 -0500 Received: from mail.suse.de ([195.135.220.2]:55493 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753691AbXKSR14 (ORCPT ); Mon, 19 Nov 2007 12:27:56 -0500 Date: Mon, 19 Nov 2007 18:05:16 +0100 Message-ID: From: Takashi Iwai To: Zachary Amsden Cc: Christoph Hellwig , Jeremy Fitzhardinge , Tobias Powalowski , linux-kernel@vger.kernel.org, Ingo Molnar , Thomas Gleixner Subject: Re: [PATCH] x86/paravirt: revert exports to restore old behaviour In-Reply-To: <1195001464.6352.109.camel@bodhitayantram.eng.vmware.com> References: <200711131139.42791.t.powa@gmx.de> <473A073C.2020201@goop.org> <20071113222212.GA1322@infradead.org> <1195001464.6352.109.camel@bodhitayantram.eng.vmware.com> User-Agent: Wanderlust/2.15.5 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.7 (=?ISO-8859-4?Q?Sanj=F2?=) APEL/10.6 MULE XEmacs/21.5 (beta28) (fuki) (+CVS-20070806) (i386-suse-linux) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2385 Lines: 56 At Tue, 13 Nov 2007 16:51:04 -0800, Zachary Amsden wrote: > > On Tue, 2007-11-13 at 22:22 +0000, Christoph Hellwig wrote: > > On Tue, Nov 13, 2007 at 12:21:16PM -0800, Jeremy Fitzhardinge wrote: > > > Subject: x86/paravirt: revert exports to restore old behaviour > > > > > > Subdividing the paravirt_ops structure caused a regression in certain > > > non-GPL modules which try to use mmu_ops and cpu_ops. This restores > > > the old behaviour, and makes it consistent with the > > > non-CONFIG_PARAVIRT case. > > > > NACK, both of these are internal and graphics drivers should not be > > using them. > > Some of them are internal, but some are not, they just happened to be > privileged CPU operations available to anyone. > > Does anyone know what hooks they are actually using? Something like > reading MSRs is not internal at all, it is CPU specific, and the > graphics drivers might have very good reasons to read them to figure out > how AGP is configured for example. > > The graphics drivers most certainly don't need to be paravirtualized > however, so they could always work around this with raw asm constructs. > > The mmu_ops hook is more debatable. But until someone figures out what > hooks they want, we can't know whether they are internal or not. In any > case, this is a regression. I took at this problem (as I have an nvidia card on one of my workstations), and found out that the following suffer from EXPORT_SYMBOL_GPL changes: * local_disable_irq(), local_irq_save*(), etc. * MSR-related macros like rdmsr(), wrmsr(), read_cr0(), etc. wbinvd(), too. * pmd_val(), pgd_val(), etc are all involved with pv_mm_ops. pmd_large() and pmd_bad() is also indirectly involved. __flush_tlb() and friends suffer, too. The easiest workaround I found was to undefine CONFIG_PARAVIRT before inclusion of linux kernel headers, but it is really ugly and hacky. Redefinig with raw_*() and native_*() is another way, but it takes much more work than defining these primitive functions in assembly. So, in short, with EXPORT_SYMBOL_GPL change, it's pretty hard to write a non-GPL driver in a same manner... Takashi - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/