From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Borntraeger Subject: Re: [PATCH/RFC] KVM: track pid for VCPU only on KVM_RUN ioctl Date: Tue, 19 Aug 2014 11:47:33 +0200 Message-ID: <53F31D35.4010901@de.ibm.com> References: <1407249854-2953-1-git-send-email-borntraeger@de.ibm.com> <53E38193.8060206@redhat.com> <53F30CF3.5030606@de.ibm.com> <53F3187E.6080706@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Cc: KVM , Gleb Natapov , Rik van Riel , Raghavendra K T , Michael Mueller To: Paolo Bonzini Return-path: Received: from e06smtp17.uk.ibm.com ([195.75.94.113]:41990 "EHLO e06smtp17.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750768AbaHSJrl (ORCPT ); Tue, 19 Aug 2014 05:47:41 -0400 Received: from /spool/local by e06smtp17.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 19 Aug 2014 10:47:39 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 1198B1B08051 for ; Tue, 19 Aug 2014 10:48:30 +0100 (BST) Received: from d06av05.portsmouth.uk.ibm.com (d06av05.portsmouth.uk.ibm.com [9.149.37.229]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id s7J9lZn336372526 for ; Tue, 19 Aug 2014 09:47:35 GMT Received: from d06av05.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s7J9lY2R011453 for ; Tue, 19 Aug 2014 03:47:35 -0600 In-Reply-To: <53F3187E.6080706@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 19/08/14 11:27, Paolo Bonzini wrote: > Il 19/08/2014 10:38, Christian Borntraeger ha scritto: >>>> The patch may be okay, but I'm worried that it might be hiding a bug in >>>> QEMU. >> On s390 we call "KVM_S390_INITIAL_RESET" from several reset functions, e.g. during >> CPU creation. This is the first hickup and the pid now points to the main thread. > > Any reason to have a special ioctl instead of SET_REGS/SET_ONE_REG/... > (via kvm_cpu_synchronize_state, which does the ioctls in the VCPU thread)? Historical reasons mostly. Older kernel miss several interfaces to bring the CPU in a defined state (pending interrupts, cpu state, some registers...) Good news is that we are working on getting rid of it: cpu states are now available as far as I can see, only local interrupt flushing is missing.This needs some more work on our side. So in some month we probably will have a QEMU version that does not need to call this any more. For todays QEMU this patch help though. Christian