Skip to content

Commit fb68468

Browse files
yonghuahlijinxia
authored andcommitted
HV: flush L1 cache when switching to normal world
-to avoid information leaking from secure world to normal world on platform affected by L1TF. Tracked-On: #1672 Signed-off-by: Yonghua Huang <yonghua.huang@intel.com> Reviewed-by: Kevin Tian <kevin.tian@intel.com>
1 parent 34a6336 commit fb68468

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

hypervisor/arch/x86/trusty.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,11 +306,15 @@ void switch_world(struct vcpu *vcpu, int next_world)
306306
copy_smc_param(&arch_vcpu->contexts[!next_world].run_ctx,
307307
&arch_vcpu->contexts[next_world].run_ctx);
308308

309-
/* load EPTP for next world */
310309
if (next_world == NORMAL_WORLD) {
310+
/* load EPTP for next world */
311311
exec_vmwrite64(VMX_EPT_POINTER_FULL,
312312
hva2hpa(vcpu->vm->arch_vm.nworld_eptp) |
313313
(3UL << 3U) | 0x6UL);
314+
315+
#ifndef CONFIG_L1D_FLUSH_VMENTRY_ENABLED
316+
cpu_l1d_flush();
317+
#endif
314318
} else {
315319
exec_vmwrite64(VMX_EPT_POINTER_FULL,
316320
hva2hpa(vcpu->vm->arch_vm.sworld_eptp) |

0 commit comments

Comments
 (0)