mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-23 09:47:44 +00:00
hv: ptdev: move softirq_dev_entry_list from vm structure to per_cpu region
Using per_cpu list to record ptdev interrupts is more reasonable than recording them per-vm. It makes dispatching such interrupts more easier as we now do it in softirq which happens following interrupt context of each pcpu. Tracked-On: #3663 Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com> Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -520,11 +520,8 @@ static void ptirq_handle_intx(struct acrn_vm *vm,
|
||||
|
||||
void ptirq_softirq(uint16_t pcpu_id)
|
||||
{
|
||||
struct acrn_vcpu *vcpu = per_cpu(vcpu, pcpu_id);
|
||||
struct acrn_vm *vm = vcpu->vm;
|
||||
|
||||
while (1) {
|
||||
struct ptirq_remapping_info *entry = ptirq_dequeue_softirq(vm);
|
||||
struct ptirq_remapping_info *entry = ptirq_dequeue_softirq(pcpu_id);
|
||||
struct ptirq_msi_info *msi;
|
||||
|
||||
if (entry == NULL) {
|
||||
@@ -541,11 +538,11 @@ void ptirq_softirq(uint16_t pcpu_id)
|
||||
|
||||
/* handle real request */
|
||||
if (entry->intr_type == PTDEV_INTR_INTX) {
|
||||
ptirq_handle_intx(vm, entry);
|
||||
ptirq_handle_intx(entry->vm, entry);
|
||||
} else {
|
||||
if (msi != NULL) {
|
||||
/* TODO: msi destmode check required */
|
||||
(void)vlapic_intr_msi(vm, msi->vmsi_addr.full, msi->vmsi_data.full);
|
||||
(void)vlapic_intr_msi(entry->vm, msi->vmsi_addr.full, msi->vmsi_data.full);
|
||||
dev_dbg(ACRN_DBG_PTIRQ, "dev-assign: irq=0x%x MSI VR: 0x%x-0x%x",
|
||||
entry->allocated_pirq,
|
||||
msi->vmsi_data.bits.vector,
|
||||
|
@@ -478,8 +478,6 @@ int32_t create_vm(uint16_t vm_id, struct acrn_vm_config *vm_config, struct acrn_
|
||||
if (status == 0) {
|
||||
prepare_epc_vm_memmap(vm);
|
||||
|
||||
INIT_LIST_HEAD(&vm->softirq_dev_entry_list);
|
||||
spinlock_init(&vm->softirq_dev_lock);
|
||||
spinlock_init(&vm->vm_lock);
|
||||
|
||||
vm->arch_vm.vlapic_state = VM_VLAPIC_XAPIC;
|
||||
|
Reference in New Issue
Block a user