diff mbox

[3/3] ARM: domain: move {set, get}_domain under config guard

Message ID 20160428135028.GE19428@n2100.arm.linux.org.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Russell King - ARM Linux April 28, 2016, 1:50 p.m. UTC
On Wed, Apr 27, 2016 at 01:16:29PM +0100, Vladimir Murzin wrote:
> I've confused myself that support for CPU_SW_DOMAIN_PAN implies
> CONFIG_CPU_USE_DOMAINS, but now I see they are in fact different
> features/users of those accessors.
> 
> So something like below should be sufficient to fix my case, right?

How about:

 arch/arm/include/asm/domain.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Vladimir Murzin April 28, 2016, 2:44 p.m. UTC | #1
On 28/04/16 14:50, Russell King - ARM Linux wrote:
> On Wed, Apr 27, 2016 at 01:16:29PM +0100, Vladimir Murzin wrote:
>> I've confused myself that support for CPU_SW_DOMAIN_PAN implies
>> CONFIG_CPU_USE_DOMAINS, but now I see they are in fact different
>> features/users of those accessors.
>>
>> So something like below should be sufficient to fix my case, right?
> 
> How about:
> 
>  arch/arm/include/asm/domain.h | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/arch/arm/include/asm/domain.h b/arch/arm/include/asm/domain.h
> index fc8ba1663601..4e218993c12d 100644
> --- a/arch/arm/include/asm/domain.h
> +++ b/arch/arm/include/asm/domain.h
> @@ -84,6 +84,7 @@
>  
>  #ifndef __ASSEMBLY__
>  
> +#ifdef CONFIG_CPU_CP15

I'm afraid it won't solve my case since R-class uses cp15 :(

Cheers
Vladimir

>  static inline unsigned int get_domain(void)
>  {
>  	unsigned int domain;
> @@ -103,6 +104,16 @@ static inline void set_domain(unsigned val)
>  	  : : "r" (val) : "memory");
>  	isb();
>  }
> +#else
> +static inline unsigned int get_domain(void)
> +{
> +	return 0;
> +}
> +
> +static inline void set_domain(unsigned val)
> +{
> +}
> +#endif
>  
>  #ifdef CONFIG_CPU_USE_DOMAINS
>  #define modify_domain(dom,type)					\
>
Russell King - ARM Linux April 28, 2016, 2:59 p.m. UTC | #2
On Thu, Apr 28, 2016 at 03:44:34PM +0100, Vladimir Murzin wrote:
> On 28/04/16 14:50, Russell King - ARM Linux wrote:
> > On Wed, Apr 27, 2016 at 01:16:29PM +0100, Vladimir Murzin wrote:
> >> I've confused myself that support for CPU_SW_DOMAIN_PAN implies
> >> CONFIG_CPU_USE_DOMAINS, but now I see they are in fact different
> >> features/users of those accessors.
> >>
> >> So something like below should be sufficient to fix my case, right?
> > 
> > How about:
> > 
> >  arch/arm/include/asm/domain.h | 11 +++++++++++
> >  1 file changed, 11 insertions(+)
> > 
> > diff --git a/arch/arm/include/asm/domain.h b/arch/arm/include/asm/domain.h
> > index fc8ba1663601..4e218993c12d 100644
> > --- a/arch/arm/include/asm/domain.h
> > +++ b/arch/arm/include/asm/domain.h
> > @@ -84,6 +84,7 @@
> >  
> >  #ifndef __ASSEMBLY__
> >  
> > +#ifdef CONFIG_CPU_CP15
> 
> I'm afraid it won't solve my case since R-class uses cp15 :(

So maybe CPU_CP15_MMU then there?

> 
> Cheers
> Vladimir
> 
> >  static inline unsigned int get_domain(void)
> >  {
> >  	unsigned int domain;
> > @@ -103,6 +104,16 @@ static inline void set_domain(unsigned val)
> >  	  : : "r" (val) : "memory");
> >  	isb();
> >  }
> > +#else
> > +static inline unsigned int get_domain(void)
> > +{
> > +	return 0;
> > +}
> > +
> > +static inline void set_domain(unsigned val)
> > +{
> > +}
> > +#endif
> >  
> >  #ifdef CONFIG_CPU_USE_DOMAINS
> >  #define modify_domain(dom,type)					\
> > 
>
Vladimir Murzin April 28, 2016, 3:06 p.m. UTC | #3
On 28/04/16 15:59, Russell King - ARM Linux wrote:
> On Thu, Apr 28, 2016 at 03:44:34PM +0100, Vladimir Murzin wrote:
>> On 28/04/16 14:50, Russell King - ARM Linux wrote:
>>> On Wed, Apr 27, 2016 at 01:16:29PM +0100, Vladimir Murzin wrote:
>>>> I've confused myself that support for CPU_SW_DOMAIN_PAN implies
>>>> CONFIG_CPU_USE_DOMAINS, but now I see they are in fact different
>>>> features/users of those accessors.
>>>>
>>>> So something like below should be sufficient to fix my case, right?
>>>
>>> How about:
>>>
>>>  arch/arm/include/asm/domain.h | 11 +++++++++++
>>>  1 file changed, 11 insertions(+)
>>>
>>> diff --git a/arch/arm/include/asm/domain.h b/arch/arm/include/asm/domain.h
>>> index fc8ba1663601..4e218993c12d 100644
>>> --- a/arch/arm/include/asm/domain.h
>>> +++ b/arch/arm/include/asm/domain.h
>>> @@ -84,6 +84,7 @@
>>>  
>>>  #ifndef __ASSEMBLY__
>>>  
>>> +#ifdef CONFIG_CPU_CP15
>>
>> I'm afraid it won't solve my case since R-class uses cp15 :(
> 
> So maybe CPU_CP15_MMU then there?

That should work :)

Thanks
Vladimir

> 
>>
>> Cheers
>> Vladimir
>>
>>>  static inline unsigned int get_domain(void)
>>>  {
>>>  	unsigned int domain;
>>> @@ -103,6 +104,16 @@ static inline void set_domain(unsigned val)
>>>  	  : : "r" (val) : "memory");
>>>  	isb();
>>>  }
>>> +#else
>>> +static inline unsigned int get_domain(void)
>>> +{
>>> +	return 0;
>>> +}
>>> +
>>> +static inline void set_domain(unsigned val)
>>> +{
>>> +}
>>> +#endif
>>>  
>>>  #ifdef CONFIG_CPU_USE_DOMAINS
>>>  #define modify_domain(dom,type)					\
>>>
>>
>
diff mbox

Patch

diff --git a/arch/arm/include/asm/domain.h b/arch/arm/include/asm/domain.h
index fc8ba1663601..4e218993c12d 100644
--- a/arch/arm/include/asm/domain.h
+++ b/arch/arm/include/asm/domain.h
@@ -84,6 +84,7 @@ 
 
 #ifndef __ASSEMBLY__
 
+#ifdef CONFIG_CPU_CP15
 static inline unsigned int get_domain(void)
 {
 	unsigned int domain;
@@ -103,6 +104,16 @@  static inline void set_domain(unsigned val)
 	  : : "r" (val) : "memory");
 	isb();
 }
+#else
+static inline unsigned int get_domain(void)
+{
+	return 0;
+}
+
+static inline void set_domain(unsigned val)
+{
+}
+#endif
 
 #ifdef CONFIG_CPU_USE_DOMAINS
 #define modify_domain(dom,type)					\