public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xen/p2m: Export set_phys_to_machine.
@ 2013-09-06 14:00 Konrad Rzeszutek Wilk
  2013-09-06 14:06 ` [Xen-devel] " Jan Beulich
  2013-09-06 16:07 ` David Vrabel
  0 siblings, 2 replies; 5+ messages in thread
From: Konrad Rzeszutek Wilk @ 2013-09-06 14:00 UTC (permalink / raw)
  To: linux-kernel, xen-devel, boris.ostrovsky, david.vrabel
  Cc: Konrad Rzeszutek Wilk

We have already exported 'get_phys_to_machine' and there are
third-party drivers that depend on this other symbol. As such
lets make this balanced and also export this symbol.

Reported-by: Yuval Shaia <yuval.shaia@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 arch/x86/xen/p2m.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c
index 0d4ec35..cdb96bc 100644
--- a/arch/x86/xen/p2m.c
+++ b/arch/x86/xen/p2m.c
@@ -847,6 +847,7 @@ bool set_phys_to_machine(unsigned long pfn, unsigned long mfn)
 
 	return true;
 }
+EXPORT_SYMBOL_GPL(set_phys_to_machine);
 
 #define M2P_OVERRIDE_HASH_SHIFT	10
 #define M2P_OVERRIDE_HASH	(1 << M2P_OVERRIDE_HASH_SHIFT)
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Xen-devel] [PATCH] xen/p2m: Export set_phys_to_machine.
  2013-09-06 14:00 [PATCH] xen/p2m: Export set_phys_to_machine Konrad Rzeszutek Wilk
@ 2013-09-06 14:06 ` Jan Beulich
  2013-09-06 14:39   ` Konrad Rzeszutek Wilk
  2013-09-06 16:07 ` David Vrabel
  1 sibling, 1 reply; 5+ messages in thread
From: Jan Beulich @ 2013-09-06 14:06 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk
  Cc: david.vrabel, xen-devel, boris.ostrovsky, linux-kernel

>>> On 06.09.13 at 16:00, Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
> We have already exported 'get_phys_to_machine' and there are
> third-party drivers that depend on this other symbol. As such
> lets make this balanced and also export this symbol.

I tend to disagree: Allowing external modules read access to some
internal state is quite different from also allowing them to alter it.

Jan

> Reported-by: Yuval Shaia <yuval.shaia@oracle.com>
> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> ---
>  arch/x86/xen/p2m.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c
> index 0d4ec35..cdb96bc 100644
> --- a/arch/x86/xen/p2m.c
> +++ b/arch/x86/xen/p2m.c
> @@ -847,6 +847,7 @@ bool set_phys_to_machine(unsigned long pfn, unsigned long mfn)
>  
>  	return true;
>  }
> +EXPORT_SYMBOL_GPL(set_phys_to_machine);
>  
>  #define M2P_OVERRIDE_HASH_SHIFT	10
>  #define M2P_OVERRIDE_HASH	(1 << M2P_OVERRIDE_HASH_SHIFT)
> -- 
> 1.8.3.1
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org 
> http://lists.xen.org/xen-devel 




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Xen-devel] [PATCH] xen/p2m: Export set_phys_to_machine.
  2013-09-06 14:06 ` [Xen-devel] " Jan Beulich
@ 2013-09-06 14:39   ` Konrad Rzeszutek Wilk
  2013-09-06 14:49     ` Jan Beulich
  0 siblings, 1 reply; 5+ messages in thread
From: Konrad Rzeszutek Wilk @ 2013-09-06 14:39 UTC (permalink / raw)
  To: Jan Beulich; +Cc: david.vrabel, xen-devel, boris.ostrovsky, linux-kernel

On Fri, Sep 06, 2013 at 03:06:02PM +0100, Jan Beulich wrote:
> >>> On 06.09.13 at 16:00, Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
> > We have already exported 'get_phys_to_machine' and there are
> > third-party drivers that depend on this other symbol. As such
> > lets make this balanced and also export this symbol.
> 
> I tend to disagree: Allowing external modules read access to some
> internal state is quite different from also allowing them to alter it.

I am not following you. We have drivers in the kernel that do
this now. For example xen-netfront uses set_phys_to_machine.

Oddly it can be built as a module.  I am wondering how it actually
works without this EXPORT symbol.

> 
> Jan
> 
> > Reported-by: Yuval Shaia <yuval.shaia@oracle.com>
> > Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> > ---
> >  arch/x86/xen/p2m.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c
> > index 0d4ec35..cdb96bc 100644
> > --- a/arch/x86/xen/p2m.c
> > +++ b/arch/x86/xen/p2m.c
> > @@ -847,6 +847,7 @@ bool set_phys_to_machine(unsigned long pfn, unsigned long mfn)
> >  
> >  	return true;
> >  }
> > +EXPORT_SYMBOL_GPL(set_phys_to_machine);
> >  
> >  #define M2P_OVERRIDE_HASH_SHIFT	10
> >  #define M2P_OVERRIDE_HASH	(1 << M2P_OVERRIDE_HASH_SHIFT)
> > -- 
> > 1.8.3.1
> > 
> > 
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@lists.xen.org 
> > http://lists.xen.org/xen-devel 
> 
> 
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Xen-devel] [PATCH] xen/p2m: Export set_phys_to_machine.
  2013-09-06 14:39   ` Konrad Rzeszutek Wilk
@ 2013-09-06 14:49     ` Jan Beulich
  0 siblings, 0 replies; 5+ messages in thread
From: Jan Beulich @ 2013-09-06 14:49 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk
  Cc: david.vrabel, xen-devel, boris.ostrovsky, linux-kernel

>>> On 06.09.13 at 16:39, Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
> On Fri, Sep 06, 2013 at 03:06:02PM +0100, Jan Beulich wrote:
>> >>> On 06.09.13 at 16:00, Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
>> > We have already exported 'get_phys_to_machine' and there are
>> > third-party drivers that depend on this other symbol. As such
>> > lets make this balanced and also export this symbol.
>> 
>> I tend to disagree: Allowing external modules read access to some
>> internal state is quite different from also allowing them to alter it.
> 
> I am not following you. We have drivers in the kernel that do
> this now. For example xen-netfront uses set_phys_to_machine.

In which case exporting it would be fine (and necessary). But you
explicitly said "third-party drivers".

> Oddly it can be built as a module.  I am wondering how it actually
> works without this EXPORT symbol.

See the early return in xennet_release_rx_bufs() - the use of
the symbol is in dead code.

Jan


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] xen/p2m: Export set_phys_to_machine.
  2013-09-06 14:00 [PATCH] xen/p2m: Export set_phys_to_machine Konrad Rzeszutek Wilk
  2013-09-06 14:06 ` [Xen-devel] " Jan Beulich
@ 2013-09-06 16:07 ` David Vrabel
  1 sibling, 0 replies; 5+ messages in thread
From: David Vrabel @ 2013-09-06 16:07 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk; +Cc: linux-kernel, xen-devel, boris.ostrovsky

On 06/09/13 15:00, Konrad Rzeszutek Wilk wrote:
> We have already exported 'get_phys_to_machine' and there are
> third-party drivers that depend on this other symbol. As such
> lets make this balanced and also export this symbol.

I'm not sure this is a good idea.  It isn't clear why any out of tree
driver would need to mess with the p2m (or that we would actually trust
a third party driver to do this correctly...).

Also, the general kernel policy is not to export symbols that aren't
used by something in the kernel tree itself.

David

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-09-06 16:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-06 14:00 [PATCH] xen/p2m: Export set_phys_to_machine Konrad Rzeszutek Wilk
2013-09-06 14:06 ` [Xen-devel] " Jan Beulich
2013-09-06 14:39   ` Konrad Rzeszutek Wilk
2013-09-06 14:49     ` Jan Beulich
2013-09-06 16:07 ` David Vrabel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox