Commit c6aab75e authored by Xu Linqin's avatar Xu Linqin Committed by guzitao
Browse files

sw64: kvm: adjust interrupt priority for guest

Sunway inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/IB73UR



--------------------------------

According to architecture manual, adjust interrupt priority of guest in
descending order as follows: RTC, IPI, MSI, INTx and VT_SERIAL. It does
not follow manual completely due to flat interrupt management in sw64 kvm.
The previous priorities were not appropriate, which may cause system lag
when numerous IPIs are generated by applications like mariadb within a
short period of time.

This patch has no negative effect on the performance of Unixbench and fio.

Signed-off-by: default avatarXu Linqin <xulinqin@wxiat.com>
Reviewed-by: default avatarHe Sheng <hesheng@wxiat.com>
Signed-off-by: default avatarGu Zitao <guzitao@wxiat.com>
parent 24ef111e
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@
 * Author: fire3 <fire3@example.com> yangzh <yangzh@gmail.com>
 * linhn <linhn@example.com>
 */
#include <asm/irq_impl.h>
#include <asm/kvm_emulate.h>
#include <asm/kvm_asm.h>
#include <linux/errno.h>
@@ -75,6 +76,12 @@ unsigned int interrupt_pending(struct kvm_vcpu *vcpu, bool *more)

	bitmap_copy(blk, vcpu->arch.irqs_pending, SWVM_IRQS);

	if (test_bit(INT_RTC, blk))
		return INT_RTC;

	if (test_bit(INT_IPI, blk))
		return INT_IPI;

	irq = find_last_bit(blk, SWVM_IRQS);

	return irq;