Loading arch/riscv/kvm/aia_aplic.c +31 −6 Original line number Diff line number Diff line Loading @@ -137,11 +137,21 @@ static void aplic_write_pending(struct aplic *aplic, u32 irq, bool pending) raw_spin_lock_irqsave(&irqd->lock, flags); sm = irqd->sourcecfg & APLIC_SOURCECFG_SM_MASK; if (!pending && ((sm == APLIC_SOURCECFG_SM_LEVEL_HIGH) || (sm == APLIC_SOURCECFG_SM_LEVEL_LOW))) if (sm == APLIC_SOURCECFG_SM_INACTIVE) goto skip_write_pending; if (sm == APLIC_SOURCECFG_SM_LEVEL_HIGH || sm == APLIC_SOURCECFG_SM_LEVEL_LOW) { if (!pending) goto skip_write_pending; if ((irqd->state & APLIC_IRQ_STATE_INPUT) && sm == APLIC_SOURCECFG_SM_LEVEL_LOW) goto skip_write_pending; if (!(irqd->state & APLIC_IRQ_STATE_INPUT) && sm == APLIC_SOURCECFG_SM_LEVEL_HIGH) goto skip_write_pending; } if (pending) irqd->state |= APLIC_IRQ_STATE_PENDING; else Loading Loading @@ -187,16 +197,31 @@ static void aplic_write_enabled(struct aplic *aplic, u32 irq, bool enabled) static bool aplic_read_input(struct aplic *aplic, u32 irq) { bool ret; unsigned long flags; u32 sourcecfg, sm, raw_input, irq_inverted; struct aplic_irq *irqd; unsigned long flags; bool ret = false; if (!irq || aplic->nr_irqs <= irq) return false; irqd = &aplic->irqs[irq]; raw_spin_lock_irqsave(&irqd->lock, flags); ret = (irqd->state & APLIC_IRQ_STATE_INPUT) ? true : false; sourcecfg = irqd->sourcecfg; if (sourcecfg & APLIC_SOURCECFG_D) goto skip; sm = sourcecfg & APLIC_SOURCECFG_SM_MASK; if (sm == APLIC_SOURCECFG_SM_INACTIVE) goto skip; raw_input = (irqd->state & APLIC_IRQ_STATE_INPUT) ? 1 : 0; irq_inverted = (sm == APLIC_SOURCECFG_SM_LEVEL_LOW || sm == APLIC_SOURCECFG_SM_EDGE_FALL) ? 1 : 0; ret = !!(raw_input ^ irq_inverted); skip: raw_spin_unlock_irqrestore(&irqd->lock, flags); return ret; Loading arch/riscv/kvm/vcpu_onereg.c +1 −1 Original line number Diff line number Diff line Loading @@ -986,7 +986,7 @@ static int copy_isa_ext_reg_indices(const struct kvm_vcpu *vcpu, static inline unsigned long num_isa_ext_regs(const struct kvm_vcpu *vcpu) { return copy_isa_ext_reg_indices(vcpu, NULL);; return copy_isa_ext_reg_indices(vcpu, NULL); } static int copy_sbi_ext_reg_indices(struct kvm_vcpu *vcpu, u64 __user *uindices) Loading tools/testing/selftests/kvm/aarch64/arch_timer.c +1 −1 Original line number Diff line number Diff line Loading @@ -136,7 +136,7 @@ static void guest_run_stage(struct test_vcpu_shared_data *shared_data, irq_iter = READ_ONCE(shared_data->nr_iter); __GUEST_ASSERT(config_iter + 1 == irq_iter, "config_iter + 1 = 0x%x, irq_iter = 0x%x.\n" " Guest timer interrupt was not trigged within the specified\n" " Guest timer interrupt was not triggered within the specified\n" " interval, try to increase the error margin by [-e] option.\n", config_iter + 1, irq_iter); } Loading tools/testing/selftests/kvm/riscv/arch_timer.c +1 −1 Original line number Diff line number Diff line Loading @@ -60,7 +60,7 @@ static void guest_run(struct test_vcpu_shared_data *shared_data) irq_iter = READ_ONCE(shared_data->nr_iter); __GUEST_ASSERT(config_iter + 1 == irq_iter, "config_iter + 1 = 0x%x, irq_iter = 0x%x.\n" " Guest timer interrupt was not trigged within the specified\n" " Guest timer interrupt was not triggered within the specified\n" " interval, try to increase the error margin by [-e] option.\n", config_iter + 1, irq_iter); } Loading Loading
arch/riscv/kvm/aia_aplic.c +31 −6 Original line number Diff line number Diff line Loading @@ -137,11 +137,21 @@ static void aplic_write_pending(struct aplic *aplic, u32 irq, bool pending) raw_spin_lock_irqsave(&irqd->lock, flags); sm = irqd->sourcecfg & APLIC_SOURCECFG_SM_MASK; if (!pending && ((sm == APLIC_SOURCECFG_SM_LEVEL_HIGH) || (sm == APLIC_SOURCECFG_SM_LEVEL_LOW))) if (sm == APLIC_SOURCECFG_SM_INACTIVE) goto skip_write_pending; if (sm == APLIC_SOURCECFG_SM_LEVEL_HIGH || sm == APLIC_SOURCECFG_SM_LEVEL_LOW) { if (!pending) goto skip_write_pending; if ((irqd->state & APLIC_IRQ_STATE_INPUT) && sm == APLIC_SOURCECFG_SM_LEVEL_LOW) goto skip_write_pending; if (!(irqd->state & APLIC_IRQ_STATE_INPUT) && sm == APLIC_SOURCECFG_SM_LEVEL_HIGH) goto skip_write_pending; } if (pending) irqd->state |= APLIC_IRQ_STATE_PENDING; else Loading Loading @@ -187,16 +197,31 @@ static void aplic_write_enabled(struct aplic *aplic, u32 irq, bool enabled) static bool aplic_read_input(struct aplic *aplic, u32 irq) { bool ret; unsigned long flags; u32 sourcecfg, sm, raw_input, irq_inverted; struct aplic_irq *irqd; unsigned long flags; bool ret = false; if (!irq || aplic->nr_irqs <= irq) return false; irqd = &aplic->irqs[irq]; raw_spin_lock_irqsave(&irqd->lock, flags); ret = (irqd->state & APLIC_IRQ_STATE_INPUT) ? true : false; sourcecfg = irqd->sourcecfg; if (sourcecfg & APLIC_SOURCECFG_D) goto skip; sm = sourcecfg & APLIC_SOURCECFG_SM_MASK; if (sm == APLIC_SOURCECFG_SM_INACTIVE) goto skip; raw_input = (irqd->state & APLIC_IRQ_STATE_INPUT) ? 1 : 0; irq_inverted = (sm == APLIC_SOURCECFG_SM_LEVEL_LOW || sm == APLIC_SOURCECFG_SM_EDGE_FALL) ? 1 : 0; ret = !!(raw_input ^ irq_inverted); skip: raw_spin_unlock_irqrestore(&irqd->lock, flags); return ret; Loading
arch/riscv/kvm/vcpu_onereg.c +1 −1 Original line number Diff line number Diff line Loading @@ -986,7 +986,7 @@ static int copy_isa_ext_reg_indices(const struct kvm_vcpu *vcpu, static inline unsigned long num_isa_ext_regs(const struct kvm_vcpu *vcpu) { return copy_isa_ext_reg_indices(vcpu, NULL);; return copy_isa_ext_reg_indices(vcpu, NULL); } static int copy_sbi_ext_reg_indices(struct kvm_vcpu *vcpu, u64 __user *uindices) Loading
tools/testing/selftests/kvm/aarch64/arch_timer.c +1 −1 Original line number Diff line number Diff line Loading @@ -136,7 +136,7 @@ static void guest_run_stage(struct test_vcpu_shared_data *shared_data, irq_iter = READ_ONCE(shared_data->nr_iter); __GUEST_ASSERT(config_iter + 1 == irq_iter, "config_iter + 1 = 0x%x, irq_iter = 0x%x.\n" " Guest timer interrupt was not trigged within the specified\n" " Guest timer interrupt was not triggered within the specified\n" " interval, try to increase the error margin by [-e] option.\n", config_iter + 1, irq_iter); } Loading
tools/testing/selftests/kvm/riscv/arch_timer.c +1 −1 Original line number Diff line number Diff line Loading @@ -60,7 +60,7 @@ static void guest_run(struct test_vcpu_shared_data *shared_data) irq_iter = READ_ONCE(shared_data->nr_iter); __GUEST_ASSERT(config_iter + 1 == irq_iter, "config_iter + 1 = 0x%x, irq_iter = 0x%x.\n" " Guest timer interrupt was not trigged within the specified\n" " Guest timer interrupt was not triggered within the specified\n" " interval, try to increase the error margin by [-e] option.\n", config_iter + 1, irq_iter); } Loading