diff mbox

[1/2] fpga: Add flag to indicate bitstream needs decrypting

Message ID 1487118690-21166-1-git-send-email-mdf@kernel.org (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Moritz Fischer Feb. 15, 2017, 12:31 a.m. UTC
From: Moritz Fischer <moritz.fischer@ettus.com>

Add a flag that is passed to the write_init() callback, indicating
that the bitstream is encrypted.

The low-level driver will deal with the flag, or return an error,
if encrypted bitstreams are not supported.

Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
Cc: Alan Tull <atull@kernel.org>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: Sören Brinkmann <soren.brinkmann@xilinx.com>
Cc: linux-kernel@vger.kernel.org
Cc: linux-fpga@vger.kernel.org
---
 include/linux/fpga/fpga-mgr.h | 1 +
 1 file changed, 1 insertion(+)

Comments

Michal Simek Feb. 15, 2017, 3:03 p.m. UTC | #1
On 15.2.2017 01:31, mdf@kernel.org wrote:
> From: Moritz Fischer <moritz.fischer@ettus.com>
> 
> Add a flag that is passed to the write_init() callback, indicating
> that the bitstream is encrypted.
> 
> The low-level driver will deal with the flag, or return an error,
> if encrypted bitstreams are not supported.
> 
> Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
> Cc: Alan Tull <atull@kernel.org>
> Cc: Michal Simek <michal.simek@xilinx.com>
> Cc: Sören Brinkmann <soren.brinkmann@xilinx.com>
> Cc: linux-kernel@vger.kernel.org
> Cc: linux-fpga@vger.kernel.org
> ---
>  include/linux/fpga/fpga-mgr.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/include/linux/fpga/fpga-mgr.h b/include/linux/fpga/fpga-mgr.h
> index 57beb5d..1355d8a 100644
> --- a/include/linux/fpga/fpga-mgr.h
> +++ b/include/linux/fpga/fpga-mgr.h
> @@ -70,6 +70,7 @@ enum fpga_mgr_states {
>   */
>  #define FPGA_MGR_PARTIAL_RECONFIG	BIT(0)
>  #define FPGA_MGR_EXTERNAL_CONFIG	BIT(1)
> +#define FPGA_MGR_DECRYPT_BITSTREAM	BIT(2)
>  
>  /**
>   * struct fpga_image_info - information specific to a FPGA image
> 

Isn't it better to state that bitstream is encrypted
instead of saying that bitstream requires decryption?

Your second patch is saying add support for encrypted bitstreams.

M

--
To unsubscribe from this list: send the line "unsubscribe linux-fpga" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Alan Tull Feb. 15, 2017, 4:30 p.m. UTC | #2
On Wed, Feb 15, 2017 at 9:03 AM, Michal Simek <michal.simek@xilinx.com> wrote:
> On 15.2.2017 01:31, mdf@kernel.org wrote:
>> From: Moritz Fischer <moritz.fischer@ettus.com>
>>
>> Add a flag that is passed to the write_init() callback, indicating
>> that the bitstream is encrypted.
>>
>> The low-level driver will deal with the flag, or return an error,
>> if encrypted bitstreams are not supported.
>>
>> Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
>> Cc: Alan Tull <atull@kernel.org>
>> Cc: Michal Simek <michal.simek@xilinx.com>
>> Cc: Sören Brinkmann <soren.brinkmann@xilinx.com>
>> Cc: linux-kernel@vger.kernel.org
>> Cc: linux-fpga@vger.kernel.org
>> ---
>>  include/linux/fpga/fpga-mgr.h | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/include/linux/fpga/fpga-mgr.h b/include/linux/fpga/fpga-mgr.h
>> index 57beb5d..1355d8a 100644
>> --- a/include/linux/fpga/fpga-mgr.h
>> +++ b/include/linux/fpga/fpga-mgr.h
>> @@ -70,6 +70,7 @@ enum fpga_mgr_states {
>>   */
>>  #define FPGA_MGR_PARTIAL_RECONFIG    BIT(0)
>>  #define FPGA_MGR_EXTERNAL_CONFIG     BIT(1)
>> +#define FPGA_MGR_DECRYPT_BITSTREAM   BIT(2)
>>
>>  /**
>>   * struct fpga_image_info - information specific to a FPGA image
>>
>
> Isn't it better to state that bitstream is encrypted
> instead of saying that bitstream requires decryption?

Such as FPGA_MGR_ENCRYPTED_BITSTREAM  ?

Also please consider adding a DT property such that the FPGA region
code will set this flag similar to how the DTO sets up other FPGA
image info.

Alan

>
> Your second patch is saying add support for encrypted bitstreams.
>
> M
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fpga" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-fpga" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Moritz Fischer Feb. 15, 2017, 6:02 p.m. UTC | #3
On Wed, Feb 15, 2017 at 5:30 PM, Alan Tull <atull@kernel.org> wrote:
> On Wed, Feb 15, 2017 at 9:03 AM, Michal Simek <michal.simek@xilinx.com> wrote:

>>>  #define FPGA_MGR_PARTIAL_RECONFIG    BIT(0)
>>>  #define FPGA_MGR_EXTERNAL_CONFIG     BIT(1)
>>> +#define FPGA_MGR_DECRYPT_BITSTREAM   BIT(2)
>>>
>>>  /**
>>>   * struct fpga_image_info - information specific to a FPGA image
>>>
>>
>> Isn't it better to state that bitstream is encrypted
>> instead of saying that bitstream requires decryption?
>
> Such as FPGA_MGR_ENCRYPTED_BITSTREAM  ?

Yeah, can do. This was basically a 'redo' of my earlier 'capability' based
patchset. There it made more sense to have a 'can decrypt' capability.

> Also please consider adding a DT property such that the FPGA region
> code will set this flag similar to how the DTO sets up other FPGA
> image info.

Yeah, had that on my list. Can add that to v3.

Cheers,

Moritz
--
To unsubscribe from this list: send the line "unsubscribe linux-fpga" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Michal Simek Feb. 15, 2017, 6:07 p.m. UTC | #4
On 15.2.2017 19:02, Moritz Fischer wrote:
> On Wed, Feb 15, 2017 at 5:30 PM, Alan Tull <atull@kernel.org> wrote:
>> On Wed, Feb 15, 2017 at 9:03 AM, Michal Simek <michal.simek@xilinx.com> wrote:
> 
>>>>  #define FPGA_MGR_PARTIAL_RECONFIG    BIT(0)
>>>>  #define FPGA_MGR_EXTERNAL_CONFIG     BIT(1)
>>>> +#define FPGA_MGR_DECRYPT_BITSTREAM   BIT(2)
>>>>
>>>>  /**
>>>>   * struct fpga_image_info - information specific to a FPGA image
>>>>
>>>
>>> Isn't it better to state that bitstream is encrypted
>>> instead of saying that bitstream requires decryption?
>>
>> Such as FPGA_MGR_ENCRYPTED_BITSTREAM  ?
> 
> Yeah, can do. This was basically a 'redo' of my earlier 'capability' based
> patchset. There it made more sense to have a 'can decrypt' capability.

Just keep in your mind that there are use cases where you also need to
pass keys.

Thanks,
Michal




--
To unsubscribe from this list: send the line "unsubscribe linux-fpga" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/include/linux/fpga/fpga-mgr.h b/include/linux/fpga/fpga-mgr.h
index 57beb5d..1355d8a 100644
--- a/include/linux/fpga/fpga-mgr.h
+++ b/include/linux/fpga/fpga-mgr.h
@@ -70,6 +70,7 @@  enum fpga_mgr_states {
  */
 #define FPGA_MGR_PARTIAL_RECONFIG	BIT(0)
 #define FPGA_MGR_EXTERNAL_CONFIG	BIT(1)
+#define FPGA_MGR_DECRYPT_BITSTREAM	BIT(2)
 
 /**
  * struct fpga_image_info - information specific to a FPGA image