File tree Expand file tree Collapse file tree 3 files changed +25
-0
lines changed
drivers/virt/coco/arm-cca-guest Expand file tree Collapse file tree 3 files changed +25
-0
lines changed Original file line number Diff line number Diff line change 1010#include <linux/jump_label.h>
1111#include <asm/rsi_cmds.h>
1212
13+ #define RSI_PDEV_NAME "arm-cca-dev"
14+
1315DECLARE_STATIC_KEY_FALSE (rsi_present );
1416
1517void __init arm64_rsi_init (void );
Original file line number Diff line number Diff line change 88#include <linux/psci.h>
99#include <linux/swiotlb.h>
1010#include <linux/cc_platform.h>
11+ #include <linux/platform_device.h>
1112
1213#include <asm/io.h>
1314#include <asm/mem_encrypt.h>
@@ -140,3 +141,17 @@ void __init arm64_rsi_init(void)
140141 static_branch_enable (& rsi_present );
141142}
142143
144+ static struct platform_device rsi_dev = {
145+ .name = RSI_PDEV_NAME ,
146+ .id = PLATFORM_DEVID_NONE
147+ };
148+
149+ static int __init arm64_create_dummy_rsi_dev (void )
150+ {
151+ if (is_realm_world () &&
152+ platform_device_register (& rsi_dev ))
153+ pr_err ("failed to register rsi platform device\n" );
154+ return 0 ;
155+ }
156+
157+ arch_initcall (arm64_create_dummy_rsi_dev )
Original file line number Diff line number Diff line change 66#include <linux/arm-smccc.h>
77#include <linux/cc_platform.h>
88#include <linux/kernel.h>
9+ #include <linux/mod_devicetable.h>
910#include <linux/module.h>
1011#include <linux/smp.h>
1112#include <linux/tsm.h>
@@ -219,6 +220,13 @@ static void __exit arm_cca_guest_exit(void)
219220}
220221module_exit (arm_cca_guest_exit );
221222
223+ /* modalias, so userspace can autoload this module when RSI is available */
224+ static const struct platform_device_id arm_cca_match [] __maybe_unused = {
225+ { RSI_PDEV_NAME , 0 },
226+ { }
227+ };
228+
229+ MODULE_DEVICE_TABLE (platform , arm_cca_match );
222230MODULE_AUTHOR (
"Sami Mujawar <[email protected] >" );
223231MODULE_DESCRIPTION ("Arm CCA Guest TSM Driver" );
224232MODULE_LICENSE ("GPL" );
You can’t perform that action at this time.
0 commit comments