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 10
10
#include <linux/jump_label.h>
11
11
#include <asm/rsi_cmds.h>
12
12
13
+ #define RSI_PDEV_NAME "arm-cca-dev"
14
+
13
15
DECLARE_STATIC_KEY_FALSE (rsi_present );
14
16
15
17
void __init arm64_rsi_init (void );
Original file line number Diff line number Diff line change 8
8
#include <linux/psci.h>
9
9
#include <linux/swiotlb.h>
10
10
#include <linux/cc_platform.h>
11
+ #include <linux/platform_device.h>
11
12
12
13
#include <asm/io.h>
13
14
#include <asm/mem_encrypt.h>
@@ -140,3 +141,17 @@ void __init arm64_rsi_init(void)
140
141
static_branch_enable (& rsi_present );
141
142
}
142
143
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 6
6
#include <linux/arm-smccc.h>
7
7
#include <linux/cc_platform.h>
8
8
#include <linux/kernel.h>
9
+ #include <linux/mod_devicetable.h>
9
10
#include <linux/module.h>
10
11
#include <linux/smp.h>
11
12
#include <linux/tsm.h>
@@ -219,6 +220,13 @@ static void __exit arm_cca_guest_exit(void)
219
220
}
220
221
module_exit (arm_cca_guest_exit );
221
222
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 );
222
230
MODULE_AUTHOR ("Sami Mujawar <sami.mujawar@arm.com>" );
223
231
MODULE_DESCRIPTION ("Arm CCA Guest TSM Driver" );
224
232
MODULE_LICENSE ("GPL" );
You can’t perform that action at this time.
0 commit comments