From: Michael S. Tsirkin Date: Tue, 4 Jun 2013 11:52:35 +0000 (+0300) Subject: kvm: skip system call when msi route is unchanged X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=40509f7f;p=qemu.git kvm: skip system call when msi route is unchanged Some guests do a large number of mask/unmask calls which currently trigger expensive route update system calls. Detect that route in unchanged and skip the system call. Reported-by: "Zhanghaoyu (A)" Signed-off-by: Michael S. Tsirkin Signed-off-by: Gleb Natapov --- diff --git a/kvm-all.c b/kvm-all.c index 745b5017a1..3ee0ac7e7b 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -1034,6 +1034,10 @@ static int kvm_update_routing_entry(KVMState *s, continue; } + if(!memcmp(entry, new_entry, sizeof *entry)) { + return 0; + } + *entry = *new_entry; kvm_irqchip_commit_routes(s);