From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Borntraeger Subject: Re: [PATCH] KVM: add kvm_arch_cpu_kick Date: Fri, 17 Feb 2017 17:42:31 +0100 Message-ID: <6f3d1415-b337-ecff-e56a-02017ea44658@de.ibm.com> References: <1487337007-91063-1-git-send-email-borntraeger@de.ibm.com> <1487337007-91063-2-git-send-email-borntraeger@de.ibm.com> <20170217151227.GA27770@potion> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: KVM , Cornelia Huck , linux-s390 , David Hildenbrand To: Paolo Bonzini , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= Return-path: Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:51898 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933900AbdBQQmj (ORCPT ); Fri, 17 Feb 2017 11:42:39 -0500 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v1HGdBh3087202 for ; Fri, 17 Feb 2017 11:42:38 -0500 Received: from e32.co.us.ibm.com (e32.co.us.ibm.com [32.97.110.150]) by mx0a-001b2d01.pphosted.com with ESMTP id 28p2khehm5-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 17 Feb 2017 11:42:38 -0500 Received: from localhost by e32.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 17 Feb 2017 09:42:36 -0700 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On 02/17/2017 05:23 PM, Paolo Bonzini wrote: > > > On 17/02/2017 16:46, Christian Borntraeger wrote: >> Looks good. The kick does not have to be synchronous and its ok if we >> reenter the guest as long as we execute the request in a timely manner, >> correct? >> >> e.g. >> - kick vcpu >> - vcpu enters SIE >> - vcpu exits SIE immediately >> - vcpu handles request >> - vcpu enters SIE >> >> would be perfectly fine? > > Yes, it would. There's some parallel with QEMU's qemu_cpu_kick, where > the signal would be processed immediately after entering KVM_RUN. Something like ---snip----- struct kvm_s390_sie_block *scb = READ_ONCE(vcpu->arch.vsie_block); atomic_or(CPUSTAT_STOP_INT, &vcpu->arch.sie_block->cpuflags); if (scb) atomic_or(CPUSTAT_STOP_INT, &scb->cpuflags); ---snip----- or ---snip----- atomic_or(CPUSTAT_STOP_INT, &vcpu->arch.sie_block->cpuflags); kvm_s390_vsie_kick(vcpu); ---snip----- should be enough then. The code will either delete that stop request when processing interrupts, but then the requests will be handled afterwards, or we enter the guest once, exit and process then the requests in the next loop iteration. As I am on my way into the weekend this needs double checking.