mirror of
https://github.com/apache/nuttx.git
synced 2026-05-18 08:54:05 +08:00
arch/arm64: Optimized SGI to avoid VM exit.
In the virtualized environment, each time an SGI is sent, the value of IGROUPR0 needs to be read once. Since the GIC Redistributor is a purely emulated device, each read of IGROUPR0 will cause a VM exit, causing serious performance degradation. This patch replaces the read with the value previously set in `gicv3_cpuif_init`, and we assume that this value has not been modified after initialization. Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
This commit is contained in:
committed by
Xiang Xiao
parent
ed8bfdd26a
commit
f7abf7446f
@@ -378,9 +378,7 @@ static int arm64_gic_send_sgi(unsigned int sgi_id, uint64_t target_aff,
|
||||
uint32_t aff1;
|
||||
uint64_t sgi_val;
|
||||
uint32_t regval;
|
||||
unsigned long base;
|
||||
|
||||
base = gic_get_rdist() + GICR_SGI_BASE_OFF;
|
||||
ASSERT(GIC_IS_SGI(sgi_id));
|
||||
|
||||
/* Extract affinity fields from target */
|
||||
@@ -394,7 +392,9 @@ static int arm64_gic_send_sgi(unsigned int sgi_id, uint64_t target_aff,
|
||||
|
||||
ARM64_DSB();
|
||||
|
||||
regval = getreg32(IGROUPR(base, 0));
|
||||
/* Read the IGROUPR0 value we set in `gicv3_cpuif_init` */
|
||||
|
||||
regval = IGROUPR_SGI_VAL;
|
||||
|
||||
if (regval & BIT(sgi_id))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user