Skip to contentSkip to conversation

Integrating SEP Driver with RAR Driver

PATCH In review Mark Allyn 3 participants 4 messages Oct 6, 2009 Staging

lore
Share & tools
lore

Mark Allyn

author
#0 lore raw

PATCH 1/1 Integrating SEP Driver with RAR Driver

SEP stands for Security Processor; a dedicated processor that does encryption, decryption, key management, and secure storage.

RAR stands for Restricted Access Region; this is memory aboard the MID platform that is restricted (via hardware) from access by software running on the x86 processor. Dedicated 'smart' peripherals such as sound, video, and encryption can access these regions of memory. They are here to help protect copyrighted midia from being illegally copied.

This is upstream revision 4 of the SEP driver.

This is a patch referenced from the linux-next repository as pulled on October 6, 2009; from the following URL:

git://git.kernel.org/pub/scm/linux/kernel/git/sfr/linux-next.git

This is a modified SEP driver to include integration with the RAR driver

The SEP uses a region of restricted memory to hold its own firmware; protecting that firmware and it's operation by snooping via the x86 software.

Please be aware that this patch does not contain any encryption algorithm. It only transports data to and from user space applications to the security processor.

Please be aware that the SEP does require propriatary firmware; however, the firmware is not within the kernel. It is to be located in /lib/firmware and loaded by the normal kernel firmware infrastructure using the request_firmware() kernel api function call.

Please be aware that this driver does require the presence of the RAR driver in order to compile and run.

Date: October 06, 2009

---
 drivers/staging/sep/Kconfig                   |    9 +-
 drivers/staging/sep/Makefile                  |    3 +-
 drivers/staging/sep/sep_driver_api.h          |  622 +++--
 drivers/staging/sep/sep_driver_config.h       |  212 ++-
 drivers/staging/sep/sep_driver_ext_api.h      |  113 +
 drivers/staging/sep/sep_driver_hw_defs.h      |   68 +-
 drivers/staging/sep/sep_ext_with_pci_driver.c |  681 +++++
 drivers/staging/sep/sep_main_mod.c            | 3704 +++++++++++++++++++++++++
 create mode 100644 drivers/staging/sep/sep_driver_ext_api.h
 create mode 100644 drivers/staging/sep/sep_ext_with_pci_driver.c
 create mode 100644 drivers/staging/sep/sep_main_mod.c
drivers/staging/sep/Kconfig +4 -5
index 0a9c39c..ef3c785 100644
@@ -1,10 +1,9 @@
 config DX_SEP
-	tristate "Discretix SEP driver"
-#	depends on MRST
-	depends on RAR_REGISTER && PCI
-	default y
+	tristate "SEP driver"
+	depends on X86_MRST && RAR_REGISTER
+	default n
 	help
-	  Discretix SEP driver
+	  SEP driver
 
 	  If unsure say M. The compiled module will be
 	  called sep_driver.ko
drivers/staging/sep/Makefile +2 -1
index 628d5f9..e2528e8 100644
@@ -1,2 +1,3 @@
+EXTRA_CFLAGS += -DLITTLE__ENDIAN -DDX_CC5_SEP_PLAT -DCRYS_NO_EXT_IF_MODE_SUPPORT
 obj-$(CONFIG_DX_SEP) := sep_driver.o
-
+sep_driver-objs := sep_main_mod.o sep_ext_with_pci_driver.o
drivers/staging/sep/sep_driver_api.h +388 -234

761 lines not on this page · raw message

drivers/staging/sep/sep_driver_config.h +158 -54

268 lines not on this page · raw message

drivers/staging/sep/sep_driver_ext_api.h new file +113 -0

113 lines not on this page · raw message

drivers/staging/sep/sep_driver_hw_defs.h +35 -33

80 lines not on this page · raw message

drivers/staging/sep/sep_ext_with_pci_driver.c new file +681 -0

681 lines not on this page · raw message

drivers/staging/sep/sep_main_mod.c new file +3704 -0

1,079 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Part of the diff is not shown here. View the raw message.

#1 lore raw
Quoted 29 lines · Mark Allyn

SEP stands for Security Processor; a dedicated processor that does encryption, decryption, key management, and secure storage.

RAR stands for Restricted Access Region; this is memory aboard the MID platform that is restricted (via hardware) from access by software running on the x86 processor. Dedicated 'smart' peripherals such as sound, video, and encryption can access these regions of memory. They are here to help protect copyrighted midia from being illegally copied.

This is upstream revision 4 of the SEP driver.

This is a patch referenced from the linux-next repository as pulled on October 6, 2009; from the following URL:

git://git.kernel.org/pub/scm/linux/kernel/git/sfr/linux-next.git

This is a modified SEP driver to include integration with the RAR driver

The SEP uses a region of restricted memory to hold its own firmware; protecting that firmware and it's operation by snooping via the x86 software.

Please be aware that this patch does not contain any encryption algorithm. It only transports data to and from user space applications to the security processor.

Quoted 5 lines

Please be aware that the SEP does require propriatary firmware; however, the firmware is not within the kernel. It is to be located in /lib/firmware and loaded by the normal kernel firmware infrastructure using the request_firmware() kernel api function call.

Is this firmware in the linux-firmware package already? If not, why not?

Why are you adding new functionality to this driver when it is not yet cleaned up and moved out of the staging tree? Please work to get it cleaned up and merged first.

thanks,

greg k-h

#2 lore raw
In reply to Mark Allyn
Quoted 21 lines · Mark Allyn

SEP stands for Security Processor; a dedicated processor that does encryption, decryption, key management, and secure storage.

RAR stands for Restricted Access Region; this is memory aboard the MID platform that is restricted (via hardware) from access by software running on the x86 processor. Dedicated 'smart' peripherals such as sound, video, and encryption can access these regions of memory. They are here to help protect copyrighted midia from being illegally copied.

This is upstream revision 4 of the SEP driver.

This is a patch referenced from the linux-next repository as pulled on October 6, 2009; from the following URL:

git://git.kernel.org/pub/scm/linux/kernel/git/sfr/linux-next.git

This is a modified SEP driver to include integration with the RAR driver

Quoted 7 lines

The SEP uses a region of restricted memory to hold its own firmware; protecting that firmware and it's operation by snooping via the x86 software.

Please be aware that this patch does not contain any encryption algorithm. It only transports data to and from user space applications to the security processor.

Also, the patch contains _numerous_ checkpatch.pl warnings and errors. Why are you submitting new changes to an existing staging driver with more errors that others will need to later clean up? That seems quite self-defeating...

confused,

greg k-h

#3 lore raw
In reply to Mark Allyn
Quoted 1 line

+#define SEP_IOCTLSETCALLERID _IO(SEP_IOC_MAGIC_NUMBER , 33)

_IOR _IOW etc... I pointed this out before and it's not fixed

drivers/staging/sep/sep_driver_api.h struct sep_driver_init_t { · line 136

Quoted 12 lines

struct sep_driver_realloc_cache_resident_t {

drivers/staging/sep/sep_driver_api.h +2 -9
-	/* new cache address */
-	u64 new_cache_addr;
-	/* new resident address */
-	u64 new_resident_addr;
-	/* new resident address */
-	u64  new_shared_area_addr;
-	/* new base address */
-	u64 new_base_addr;
-};
+  /* base address */
+  unsigned long   base_addr;

and the ioctls still need to be fixed for 32/64bit

drivers/staging/sep/sep_driver_config.h line 262

Quoted 6 lines
drivers/staging/sep/sep_driver_config.h +6 -0
+/* debug macro with 3 paramaters */
+#define DEBUG_PRINT_3(DEBUG_LEVEL, info, param1, param2, param3) \
+do { \
+	if (DEBUG_LEVEL & sepDebug) \
+		printk(KERN_WARNING info , param1, param2 , param3); \
+} while (0)

And the debug helpers are a step back

Sorry but this is basically undoing a lot of cleanup that was needed.

To put it mildly this needs a lot of further discussion before anything goes into the code.