-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathLayer.v
326 lines (270 loc) · 9.35 KB
/
Layer.v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
Require Import LayerDeps.
Require Import Ident.
Require Import RData.
Require Import EventReplay.
Require Import MoverTypes.
Require Import Constants.
Require Import CommonLib.
Require Import TableDataOpsIntro.Spec.
Require Import BaremoreHandler.Spec.
Require Import AbsAccessor.Spec.
Require Import RmiSMC.Spec.
Require Import RunSMC.Spec.
Require Import TableAux.Spec.
Require Import TableDataOpsRef3.Spec.
Local Open Scope Z_scope.
Section Layer.
Context `{real_params: RealParams}.
Section InvDef.
Record high_level_invariant (adt: RData) :=
mkInvariants { }.
Global Instance TableDataOpsRef3_ops : CompatDataOps RData :=
{
empty_data := empty_adt;
high_level_invariant := high_level_invariant;
low_level_invariant := fun (b: block) (d: RData) => True;
kernel_mode adt := True
}.
End InvDef.
Section InvInit.
Global Instance TableDataOpsRef3_prf : CompatData RData.
Proof.
constructor; intros; simpl; eauto.
constructor.
Qed.
End InvInit.
Context `{Hstencil: Stencil}.
Context `{Hmem: Mem.MemoryModelX}.
Context `{Hmwd: UseMemWithData mem}.
Section InvProof.
Global Instance table_create3_inv: PreservesInvariants table_create3_spec.
Proof.
constructor; intros; simpl; eauto.
constructor.
Qed.
Global Instance table_destroy3_inv: PreservesInvariants table_destroy3_spec.
Proof.
constructor; intros; simpl; eauto.
constructor.
Qed.
Global Instance table_map3_inv: PreservesInvariants table_map3_spec.
Proof.
constructor; intros; simpl; eauto.
constructor.
Qed.
Global Instance table_unmap3_inv: PreservesInvariants table_unmap3_spec.
Proof.
constructor; intros; simpl; eauto.
constructor.
Qed.
Global Instance data_create3_inv: PreservesInvariants data_create3_spec.
Proof.
constructor; intros; simpl; eauto.
constructor.
Qed.
Global Instance data_create_unknown3_inv: PreservesInvariants data_create_unknown3_spec.
Proof.
constructor; intros; simpl; eauto.
constructor.
Qed.
Global Instance data_destroy3_inv: PreservesInvariants data_destroy3_spec.
Proof.
constructor; intros; simpl; eauto.
constructor.
Qed.
Global Instance data_destroy_inv: PreservesInvariants data_destroy_spec.
Proof.
constructor; intros; simpl; eauto.
constructor.
Qed.
Global Instance table_create_inv: PreservesInvariants table_create_spec.
Proof.
constructor; intros; simpl; eauto.
constructor.
Qed.
Global Instance el3_sync_lel_inv: PreservesInvariants el3_sync_lel_spec.
Proof.
constructor; intros; simpl; eauto.
constructor.
Qed.
Global Instance buffer_unmap_inv: PreservesInvariants buffer_unmap_spec.
Proof.
constructor; intros; simpl; eauto.
constructor.
Qed.
Global Instance granule_unlock_inv: PreservesInvariants granule_unlock_spec.
Proof.
constructor; intros; simpl; eauto.
constructor.
Qed.
Global Instance enter_rmm_inv: PreservesInvariants enter_rmm_spec.
Proof.
constructor; intros; simpl; eauto.
constructor.
Qed.
Global Instance data_create_unknown_inv: PreservesInvariants data_create_unknown_spec.
Proof.
constructor; intros; simpl; eauto.
constructor.
Qed.
Global Instance smc_granule_delegate_inv: PreservesInvariants smc_granule_delegate_spec.
Proof.
constructor; intros; simpl; eauto.
constructor.
Qed.
Global Instance table_unmap_inv: PreservesInvariants table_unmap_spec.
Proof.
constructor; intros; simpl; eauto.
constructor.
Qed.
Global Instance exit_rmm_inv: PreservesInvariants exit_rmm_spec.
Proof.
constructor; intros; simpl; eauto.
constructor.
Qed.
Global Instance table_destroy_inv: PreservesInvariants table_destroy_spec.
Proof.
constructor; intros; simpl; eauto.
constructor.
Qed.
Global Instance smc_granule_undelegate_inv: PreservesInvariants smc_granule_undelegate_spec.
Proof.
constructor; intros; simpl; eauto.
constructor.
Qed.
Global Instance granule_set_state_inv: PreservesInvariants granule_set_state_spec.
Proof.
constructor; intros; simpl; eauto.
constructor.
Qed.
Global Instance table_map_inv: PreservesInvariants table_map_spec.
Proof.
constructor; intros; simpl; eauto.
constructor.
Qed.
Global Instance smc_rec_destroy_inv: PreservesInvariants smc_rec_destroy_spec.
Proof.
constructor; intros; simpl; eauto.
constructor.
Qed.
Global Instance smc_rec_create_inv: PreservesInvariants smc_rec_create_spec.
Proof.
constructor; intros; simpl; eauto.
constructor.
Qed.
Global Instance granule_map_inv: PreservesInvariants granule_map_spec.
Proof.
constructor; intros; simpl; eauto.
constructor.
Qed.
Global Instance smc_rec_run_inv: PreservesInvariants smc_rec_run_spec.
Proof.
constructor; intros; simpl; eauto.
constructor.
Qed.
Global Instance data_create_inv: PreservesInvariants data_create_spec.
Proof.
constructor; intros; simpl; eauto.
constructor.
Qed.
Global Instance read_reg_inv: PreservesInvariants read_reg_spec.
Proof.
constructor; intros; simpl; eauto.
constructor.
Qed.
Global Instance find_lock_granule_inv: PreservesInvariants find_lock_granule_spec.
Proof.
constructor; intros; simpl; eauto.
constructor.
Qed.
Global Instance is_null_inv: PreservesInvariants is_null_spec.
Proof.
constructor; intros; simpl; eauto.
constructor.
Qed.
Global Instance assert_cond_inv: PreservesInvariants assert_cond_spec.
Proof.
constructor; intros; simpl; eauto.
constructor.
Qed.
Global Instance validate_table_commands_inv: PreservesInvariants validate_table_commands_spec.
Proof.
constructor; intros; simpl; eauto.
constructor.
Qed.
Global Instance get_rd_state_inv: PreservesInvariants get_rd_state_spec.
Proof.
constructor; intros; simpl; eauto.
constructor.
Qed.
Global Instance find_granule_inv: PreservesInvariants find_granule_spec.
Proof.
constructor; intros; simpl; eauto.
constructor.
Qed.
Global Instance smc_realm_create_inv: PreservesInvariants smc_realm_create_spec.
Proof.
constructor; intros; simpl; eauto.
constructor.
Qed.
Global Instance user_step_inv: PreservesInvariants user_step_spec.
Proof.
constructor; intros; simpl; eauto.
constructor.
Qed.
Global Instance smc_realm_activate_inv: PreservesInvariants smc_realm_activate_spec.
Proof.
constructor; intros; simpl; eauto.
constructor.
Qed.
Global Instance smc_realm_destroy_inv: PreservesInvariants smc_realm_destroy_spec.
Proof.
constructor; intros; simpl; eauto.
constructor.
Qed.
End InvProof.
Section LayerDef.
Definition TableDataOpsRef3_fresh : compatlayer (cdata RData) :=
_table_create3 ↦ gensem table_create3_spec
⊕ _table_destroy3 ↦ gensem table_destroy3_spec
⊕ _table_map3 ↦ gensem table_map3_spec
⊕ _table_unmap3 ↦ gensem table_unmap3_spec
⊕ _data_create3 ↦ gensem data_create3_spec
⊕ _data_create_unknown3 ↦ gensem data_create_unknown3_spec
⊕ _data_destroy3 ↦ gensem data_destroy3_spec
.
Definition TableDataOpsRef3_passthrough : compatlayer (cdata RData) :=
_data_destroy ↦ gensem data_destroy_spec
⊕ _table_create ↦ gensem table_create_spec
⊕ _el3_sync_lel ↦ gensem el3_sync_lel_spec
⊕ _buffer_unmap ↦ gensem buffer_unmap_spec
⊕ _granule_unlock ↦ gensem granule_unlock_spec
⊕ _enter_rmm ↦ gensem enter_rmm_spec
⊕ _data_create_unknown ↦ gensem data_create_unknown_spec
⊕ _smc_granule_delegate ↦ gensem smc_granule_delegate_spec
⊕ _table_unmap ↦ gensem table_unmap_spec
⊕ _exit_rmm ↦ gensem exit_rmm_spec
⊕ _table_destroy ↦ gensem table_destroy_spec
⊕ _smc_granule_undelegate ↦ gensem smc_granule_undelegate_spec
⊕ _granule_set_state ↦ gensem granule_set_state_spec
⊕ _table_map ↦ gensem table_map_spec
⊕ _smc_rec_destroy ↦ gensem smc_rec_destroy_spec
⊕ _smc_rec_create ↦ gensem smc_rec_create_spec
⊕ _granule_map ↦ gensem granule_map_spec
⊕ _smc_rec_run ↦ gensem smc_rec_run_spec
⊕ _data_create ↦ gensem data_create_spec
⊕ _read_reg ↦ gensem read_reg_spec
⊕ _find_lock_granule ↦ gensem find_lock_granule_spec
⊕ _is_null ↦ gensem is_null_spec
⊕ _assert_cond ↦ gensem assert_cond_spec
⊕ _validate_table_commands ↦ gensem validate_table_commands_spec
⊕ _get_rd_state ↦ gensem get_rd_state_spec
⊕ _find_granule ↦ gensem find_granule_spec
⊕ _smc_realm_create ↦ gensem smc_realm_create_spec
⊕ _user_step ↦ gensem user_step_spec
⊕ _smc_realm_activate ↦ gensem smc_realm_activate_spec
⊕ _smc_realm_destroy ↦ gensem smc_realm_destroy_spec
.
Definition TableDataOpsRef3 := TableDataOpsRef3_fresh ⊕ TableDataOpsRef3_passthrough.
End LayerDef.
End Layer.