From patchwork Fri Feb 17 13:10:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Borntraeger X-Patchwork-Id: 9579771 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3CF9B600F6 for ; Fri, 17 Feb 2017 13:10:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2C85328615 for ; Fri, 17 Feb 2017 13:10:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 212DD286AC; Fri, 17 Feb 2017 13:10:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A2D9328604 for ; Fri, 17 Feb 2017 13:10:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755665AbdBQNKR (ORCPT ); Fri, 17 Feb 2017 08:10:17 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:60994 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755620AbdBQNKQ (ORCPT ); Fri, 17 Feb 2017 08:10:16 -0500 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v1HD3w1K064384 for ; Fri, 17 Feb 2017 08:10:15 -0500 Received: from e06smtp06.uk.ibm.com (e06smtp06.uk.ibm.com [195.75.94.102]) by mx0b-001b2d01.pphosted.com with ESMTP id 28nx9arxdf-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 17 Feb 2017 08:10:15 -0500 Received: from localhost by e06smtp06.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 17 Feb 2017 13:10:13 -0000 Received: from d06dlp02.portsmouth.uk.ibm.com (9.149.20.14) by e06smtp06.uk.ibm.com (192.168.101.136) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 17 Feb 2017 13:10:10 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id A441D2190023; Fri, 17 Feb 2017 13:09:12 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v1HDAAdO66388144; Fri, 17 Feb 2017 13:10:10 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B11094C040; Fri, 17 Feb 2017 13:09:58 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A95C54C050; Fri, 17 Feb 2017 13:09:58 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Fri, 17 Feb 2017 13:09:58 +0000 (GMT) Received: by tuxmaker.boeblingen.de.ibm.com (Postfix, from userid 25651) id 9EAEE20F5E3; Fri, 17 Feb 2017 14:10:09 +0100 (CET) From: Christian Borntraeger To: Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= Cc: KVM , Christian Borntraeger , Cornelia Huck , linux-s390 , David Hildenbrand Subject: [PATCH/RFC 2/2] KVM: enable kvm_vcpu_kick/wake_up for s390 Date: Fri, 17 Feb 2017 14:10:07 +0100 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1487337007-91063-1-git-send-email-borntraeger@de.ibm.com> References: <1487337007-91063-1-git-send-email-borntraeger@de.ibm.com> X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17021713-0024-0000-0000-000002B81946 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17021713-0025-0000-0000-00002271243C Message-Id: <1487337007-91063-3-git-send-email-borntraeger@de.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-02-17_10:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1702170123 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP while we still need to provide our private version of kick and wakeup to synchronize with some special cases, we can still enable the common code variant. Signed-off-by: Christian Borntraeger --- arch/s390/kvm/kvm-s390.c | 12 ++++++++++-- virt/kvm/kvm_main.c | 2 -- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index 7cfd0dd..fa20686 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c @@ -2485,8 +2485,14 @@ static void kvm_gmap_notifier(struct gmap *gmap, unsigned long start, int kvm_arch_vcpu_should_kick(struct kvm_vcpu *vcpu) { - /* kvm common code refers to this, but never calls it */ - BUG(); + /* + * STOP indication is resetted when delivering interrupts. This + * is done before we handle requests, so we only "loose" this + * when we are still going to handle requests. In that case + * we no longer need that STOP indication. + */ + __set_cpuflag(vcpu, CPUSTAT_STOP_INT); + kvm_s390_vsie_kick(vcpu); return 0; } @@ -3064,6 +3070,7 @@ static int __vcpu_run(struct kvm_vcpu *vcpu) */ vcpu->srcu_idx = srcu_read_lock(&vcpu->kvm->srcu); + vcpu->mode = IN_GUEST_MODE; do { rc = vcpu_pre_run(vcpu); if (rc) @@ -3088,6 +3095,7 @@ static int __vcpu_run(struct kvm_vcpu *vcpu) rc = vcpu_post_run(vcpu, exit_reason); } while (!signal_pending(current) && !guestdbg_exit_pending(vcpu) && !rc); + vcpu->mode = OUTSIDE_GUEST_MODE; srcu_read_unlock(&vcpu->kvm->srcu, vcpu->srcu_idx); return rc; diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 482612b..f80e08a 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -2205,7 +2205,6 @@ void kvm_vcpu_block(struct kvm_vcpu *vcpu) } EXPORT_SYMBOL_GPL(kvm_vcpu_block); -#ifndef CONFIG_S390 void kvm_vcpu_wake_up(struct kvm_vcpu *vcpu) { struct swait_queue_head *wqp; @@ -2235,7 +2234,6 @@ void kvm_vcpu_kick(struct kvm_vcpu *vcpu) put_cpu(); } EXPORT_SYMBOL_GPL(kvm_vcpu_kick); -#endif /* !CONFIG_S390 */ int kvm_vcpu_yield_to(struct kvm_vcpu *target) {