linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* RFC: Using regmap in ARM64 for EL3 register access
@ 2018-03-29 23:00 Thor Thayer
  2018-04-04 10:47 ` Sudeep Holla
  0 siblings, 1 reply; 3+ messages in thread
From: Thor Thayer @ 2018-03-29 23:00 UTC (permalink / raw)
  To: Mark Brown, linux-arm-kernel; +Cc: linux-kernel

Hi,

I'm working on an ARM64 architecture that needs to manipulate some 
protected registers that are only accessible in EL3. Linux is running at 
EL1 which doesn't have the proper permissions for these registers.

Since U-Boot is running at the higher EL3, we communicate to the U-Boot 
functions through a SMC mechanism.

The regmap framework seems like a good match for accessing these 
registers. We need the same functionality as I2C and SPI regmaps - read, 
write, and update registers.

Any comments or suggestions about using regmap for this purpose? Is 
there a better method?

Thanks,

Thor

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

* Re: RFC: Using regmap in ARM64 for EL3 register access
  2018-03-29 23:00 RFC: Using regmap in ARM64 for EL3 register access Thor Thayer
@ 2018-04-04 10:47 ` Sudeep Holla
  2018-04-04 18:18   ` Thor Thayer
  0 siblings, 1 reply; 3+ messages in thread
From: Sudeep Holla @ 2018-04-04 10:47 UTC (permalink / raw)
  To: thor.thayer, Mark Brown, linux-arm-kernel; +Cc: Sudeep Holla, linux-kernel



On 30/03/18 00:00, Thor Thayer wrote:
> Hi,
>
> I'm working on an ARM64 architecture that needs to manipulate some
> protected registers that are only accessible in EL3. Linux is running at
> EL1 which doesn't have the proper permissions for these registers.
>
If the hardware/IP registers are designed not to provide access to EL1,
then providing one in software by some means is simply wrong approach to
solve whatever issue you are trying to address here.

> Since U-Boot is running at the higher EL3, we communicate to the U-Boot
> functions through a SMC mechanism.
>
Please follow SMCCC to add any SMC interface.

> The regmap framework seems like a good match for accessing these
> registers. We need the same functionality as I2C and SPI regmaps - read,
> write, and update registers.
>
No, providing register access to EL1 using regmap+SMC just defeats the
hardware security restrictions and may provide ways to exploit.
Why not abstract to the level of services you need ?

> Any comments or suggestions about using regmap for this purpose? Is
> there a better method?
>
If you are looking for power management features, then PSCI and SCMI are
couple of specifications to look at. I would really like to know more
details on your use case to provide any suggestions.


-- 
Regards,
Sudeep

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

* Re: RFC: Using regmap in ARM64 for EL3 register access
  2018-04-04 10:47 ` Sudeep Holla
@ 2018-04-04 18:18   ` Thor Thayer
  0 siblings, 0 replies; 3+ messages in thread
From: Thor Thayer @ 2018-04-04 18:18 UTC (permalink / raw)
  To: Sudeep Holla, Mark Brown, linux-arm-kernel; +Cc: linux-kernel

Hi Sudeep,

On 04/04/2018 05:47 AM, Sudeep Holla wrote:
> 
> 
> On 30/03/18 00:00, Thor Thayer wrote:
>> Hi,
>>
>> I'm working on an ARM64 architecture that needs to manipulate some
>> protected registers that are only accessible in EL3. Linux is running at
>> EL1 which doesn't have the proper permissions for these registers.
>>
> If the hardware/IP registers are designed not to provide access to EL1,
> then providing one in software by some means is simply wrong approach to
> solve whatever issue you are trying to address here.
> 
Thank you for the reply!

Sorry, I didn't describe this very well. This mechanism is similar to 
PSCI. We have System Management registers that could be needed by more 
than 1 virtual machine. So arbitration is needed and we use U-Boot for this.

>> Since U-Boot is running at the higher EL3, we communicate to the U-Boot
>> functions through a SMC mechanism.
>>
> Please follow SMCCC to add any SMC interface.
> 
Yes, the existing implementation is doing this and implements a SiP 
service framework.

>> The regmap framework seems like a good match for accessing these
>> registers. We need the same functionality as I2C and SPI regmaps - read,
>> write, and update registers.
>>
> No, providing register access to EL1 using regmap+SMC just defeats the
> hardware security restrictions and may provide ways to exploit.
> Why not abstract to the level of services you need ?
> 
I'm not following about abstracting the level of services. For accessing 
the registers, I thought a regmap implementation would be nice because 
of the read/write/update functionality that would wrap around the SMC 
SiP service functions.

>> Any comments or suggestions about using regmap for this purpose? Is
>> there a better method?
>>
> If you are looking for power management features, then PSCI and SCMI are
> couple of specifications to look at. I would really like to know more
> details on your use case to provide any suggestions.
> 
Thank you for those pointers. I vaguely knew about PSCI but I wasn't 
aware of SCMI. Let me study these interfaces, particularly SCMI, before 
I reply further because this may answer many of my questions.

Thank you again,

Thor

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

end of thread, other threads:[~2018-04-04 18:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-29 23:00 RFC: Using regmap in ARM64 for EL3 register access Thor Thayer
2018-04-04 10:47 ` Sudeep Holla
2018-04-04 18:18   ` Thor Thayer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).