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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 5 Aug 2015 15:38:51 +0200
From:	Paolo Bonzini <pbonzini@...hat.com>
To:	Radim Krčmář <rkrcmar@...hat.com>
Cc:	linux-kernel@...r.kernel.org, kvm@...r.kernel.org
Subject: Re: [PATCH 3/5] KVM: add KVM_USER_EXIT vm ioctl for userspace exit



On 05/08/2015 15:34, Radim Krčmář wrote:
> 2015-08-05 15:29+0200, Paolo Bonzini:
>> On 05/08/2015 15:21, Radim Krčmář wrote:
>>> +	kvm_for_each_vcpu(idx, vcpu, kvm)
>>> +		if (vcpu->vcpu_id == vcpu_id) {
>>> +			kvm_make_request(KVM_REQ_EXIT, vcpu);
>>> +			kvm_vcpu_kick(vcpu);
>>> +
>>> +			return 0;
>>> +		}
>>> +
>>
>> Why not a vcpu ioctl?  kvm_for_each_vcpu can become pretty expensive if
>> you have a few dozen VCPUs.
> 
> Yeah, it will be slow, the only bright side is low frequency of calls.
> 
> vcpu ioctl should only be issued by the vcpu thread so it would
> significantly limit use.

That's a general limitation, but you can lift it for particular ioctls.

See in particular this:

#if defined(CONFIG_S390) || defined(CONFIG_PPC) || defined(CONFIG_MIPS)
        /*
         * Special cases: vcpu ioctls that are asynchronous to vcpu execution,
         * so vcpu_load() would break it.
         */
        if (ioctl == KVM_S390_INTERRUPT || ioctl == KVM_S390_IRQ || ioctl == KVM_INTERRUPT)
                return kvm_arch_vcpu_ioctl(filp, ioctl, arg);
#endif

You can add an "if (ioctl == KVM_USER_EXIT)" before.

Paolo
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ