File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 6
6
#include <linux/jump_label.h>
7
7
#include <linux/memblock.h>
8
8
#include <linux/psci.h>
9
+
10
+ #include <asm/io.h>
9
11
#include <asm/rsi.h>
10
12
11
13
static struct realm_config config ;
@@ -93,6 +95,16 @@ bool __arm64_is_protected_mmio(phys_addr_t base, size_t size)
93
95
}
94
96
EXPORT_SYMBOL (__arm64_is_protected_mmio );
95
97
98
+ static int realm_ioremap_hook (phys_addr_t phys , size_t size , pgprot_t * prot )
99
+ {
100
+ if (__arm64_is_protected_mmio (phys , size ))
101
+ * prot = pgprot_encrypted (* prot );
102
+ else
103
+ * prot = pgprot_decrypted (* prot );
104
+
105
+ return 0 ;
106
+ }
107
+
96
108
void __init arm64_rsi_init (void )
97
109
{
98
110
if (arm_smccc_1_1_get_conduit () != SMCCC_CONDUIT_SMC )
@@ -103,6 +115,9 @@ void __init arm64_rsi_init(void)
103
115
return ;
104
116
prot_ns_shared = BIT (config .ipa_bits - 1 );
105
117
118
+ if (arm64_ioremap_prot_hook_register (realm_ioremap_hook ))
119
+ return ;
120
+
106
121
arm64_rsi_setup_memory ();
107
122
108
123
static_branch_enable (& rsi_present );
You can’t perform that action at this time.
0 commit comments