hv: riscv: add SBI HSM HART_START interface

Tracked-On: #8791
Signed-off-by: Haicheng Li <haicheng.li@intel.com>
Signed-off-by: Jian Jun Chen <jian.jun.chen@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
This commit is contained in:
Haicheng Li
2025-09-09 15:07:06 +08:00
committed by acrnsi-robot
parent 95a13b334f
commit b4092965a4
2 changed files with 26 additions and 0 deletions

View File

@@ -74,6 +74,31 @@ static int64_t sbi_send_ipi(uint64_t mask, uint64_t mask_base)
return ret.error;
}
/**
* sbi_hsm_start_hart - Start a RISC-V hart using SBI HSM extension
* @hartid: The hardware thread (hart) ID to start
* @addr: The start address for the hart
* @arg: Argument to pass to the hart at startup
*
* This function invokes the SBI HSM extension to start a specified hart
* at the given address with the provided argument.
*
* Returns the SBI error code from the operation.
*/
int64_t sbi_hsm_start_hart(uint64_t hartid, uint64_t addr, uint64_t arg)
{
sbiret ret;
ret = sbi_ecall(hartid, addr, arg, 0, 0, 0, SBI_HSM_FID_HART_START,
SBI_EID_HSM);
if (ret.error != SBI_SUCCESS) {
pr_err("%s: Failed to start hart (%x) by SBI, error code: %lx",
__func__, hartid, ret.error);
}
return ret.error;
}
/**
* msg_type is currently unused.
*

View File

@@ -97,6 +97,7 @@ typedef struct {
};
} sbiret;
int64_t sbi_hsm_start_hart(uint64_t hartid, uint64_t addr, uint64_t arg);
void send_single_ipi(uint16_t pcpu_id, __unused uint32_t msg_type);
void send_dest_ipi_mask(uint64_t dest_mask, __unused uint32_t msg_type);