lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 05 Sep 2010 10:18:51 +0300
From:	Avi Kivity <avi@...hat.com>
To:	Xiao Guangrong <xiaoguangrong@...fujitsu.com>
CC:	Marcelo Tosatti <mtosatti@...hat.com>,
	LKML <linux-kernel@...r.kernel.org>, KVM <kvm@...r.kernel.org>
Subject: Re: [PATCH] KVM: don't sent IPI if the vcpu is not online

  On 09/03/2010 07:12 AM, Xiao Guangrong wrote:
> It's no need sent IPI to the vcpu which is schedule out
>
>
> @@ -86,6 +86,7 @@ struct kvm_vcpu {
>   	unsigned long requests;
>   	unsigned long guest_debug;
>   	int srcu_idx;
> +	bool online;

Why not check for guest_mode instead?

>
>   	int fpu_active;
>   	int guest_fpu_loaded, guest_xcr0_loaded;
> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> index 9a73b98..998cbc8 100644
> --- a/virt/kvm/kvm_main.c
> +++ b/virt/kvm/kvm_main.c
> @@ -148,8 +148,9 @@ static bool make_all_cpus_request(struct kvm *kvm, unsigned int req)
>   	raw_spin_lock(&kvm->requests_lock);
>   	me = smp_processor_id();
>   	kvm_for_each_vcpu(i, vcpu, kvm) {
> -		if (kvm_make_check_request(req, vcpu))
> +		if (kvm_make_check_request(req, vcpu) || !vcpu->online)
>   			continue;
> +
>   		cpu = vcpu->cpu;
>   		if (cpus != NULL&&  cpu != -1&&  cpu != me)
>   			cpumask_set_cpu(cpu, cpus);

btw, I think a more important optimization would be to drop 
kvm->requests_lock.  But I have no idea how to do it.

-- 
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists