hv: tee: x86_tee interrupt support

Secure interrupt (interrupt belongs to TEE) comes
when TEE vcpu is running, the interrupt will be
injected to TEE directly. But when REE vcpu is running
at that time, we need to switch to TEE for handling.

Non-Secure interrupt (interrupt belongs to REE) comes
when REE vcpu is running, the interrupt will be injected
to REE directly. But when TEE vcpu is running at that time,
we need to inject a predefined vector to TEE for notification
and continue to switch back to TEE for running.

To sum up, when secure interrupt comes, switch to TEE
immediately regardless of whether REE is running or not;
when non-Secure interrupt comes and TEE is running,
just notify the TEE and keep it running, TEE will switch
to REE on its own initiative after completing its work.

Tracked-On: projectacrn#6571
Signed-off-by: Jie Deng <jie.deng@intel.com>
Reviewed-by: Wang, Yu1 <yu1.wang@intel.com>
Acked-by: Eddie Dong <eddie.dong@Intel.com>
This commit is contained in:
Jie Deng
2021-11-12 16:13:45 +08:00
committed by wenlingz
parent 314d9ca8af
commit e97b171ca2
3 changed files with 48 additions and 0 deletions

View File

@@ -14,6 +14,7 @@
#include <asm/ioapic.h>
#include <asm/pgtable.h>
#include <asm/irq.h>
#include <asm/guest/optee.h>
/*
* Check if the IRQ is single-destination and return the destination vCPU if so.
@@ -534,6 +535,8 @@ void ptirq_softirq(uint16_t pcpu_id)
vmsi->addr.full, vmsi->data.full);
}
}
handle_x86_tee_int(entry, pcpu_id);
}
}