From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8BBE0C433F5 for ; Mon, 27 Sep 2021 06:59:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 692B261041 for ; Mon, 27 Sep 2021 06:59:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233194AbhI0HAx (ORCPT ); Mon, 27 Sep 2021 03:00:53 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:43248 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233118AbhI0HAv (ORCPT ); Mon, 27 Sep 2021 03:00:51 -0400 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 18R6hxLf006952; Mon, 27 Sep 2021 02:58:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=2py7wAsJWXG4npGlcEaG4sxglSIfcxDBKt4Tx5S1/jw=; b=V8zmWhUJ9ZuPfoL4N+IoKp70cr/+MLOYS52QwMMT/IEJ5vbLkjXTso76yuKupXBC1ie4 B50i12wiBr7PjIfMVTJKEcX3SvlLQIc+cBahp5VV8CP6YIgn3qdwnKz4WZYlHmoojP4y 7Dt0LZieDIr8LU4ZnQdF0hZfauzzR4GYXtcggsDvU3KJTQ75EpdiTw3gL53tNSgXyIGD +bvRRxjOyg9Y0rcOB7TH34YwpGN/Kd3z5KPDQy3zL1Bip2UePGlptAeRHYIqVGGPAty4 XQimhoo0zH7dZUBzBsxDBji7iPpd0c0kWBlLYvbs8R7Ooa9JxpHzr8bXW1CoobIhFN8b Eg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3bagrycd3s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Sep 2021 02:58:26 -0400 Received: from m0098410.ppops.net (m0098410.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 18R6rbTm001549; Mon, 27 Sep 2021 02:58:25 -0400 Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0a-001b2d01.pphosted.com with ESMTP id 3bagrycd34-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Sep 2021 02:58:25 -0400 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 18R6vCRK030322; Mon, 27 Sep 2021 06:58:22 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma06ams.nl.ibm.com with ESMTP id 3b9u1j1j6r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Sep 2021 06:58:22 +0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 18R6rKDu59769286 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 27 Sep 2021 06:53:20 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9327952069; Mon, 27 Sep 2021 06:58:18 +0000 (GMT) Received: from li-43c5434c-23b8-11b2-a85c-c4958fb47a68.ibm.com (unknown [9.171.4.236]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 59E7552050; Mon, 27 Sep 2021 06:58:17 +0000 (GMT) Subject: Re: [PATCH 05/14] KVM: s390: Clear valid_wakeup in kvm_s390_handle_wait(), not in arch hook To: Sean Christopherson , Marc Zyngier , Huacai Chen , Aleksandar Markovic , Paul Mackerras , Janosch Frank , Paolo Bonzini Cc: James Morse , Alexandru Elisei , Suzuki K Poulose , David Hildenbrand , Cornelia Huck , Claudio Imbrenda , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-mips@vger.kernel.org, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, linux-kernel@vger.kernel.org, David Matlack , Jing Zhang References: <20210925005528.1145584-1-seanjc@google.com> <20210925005528.1145584-6-seanjc@google.com> From: Christian Borntraeger Message-ID: Date: Mon, 27 Sep 2021 08:58:17 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20210925005528.1145584-6-seanjc@google.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: sdW3Ij9mEecI7Aw6Z8BoXZNDLsey3ObW X-Proofpoint-GUID: PjUGObNwPsXJ0I6DdoYvd1PayuaV3MlM X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.391,FMLib:17.0.607.475 definitions=2021-09-27_01,2021-09-24_02,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 impostorscore=0 malwarescore=0 mlxlogscore=999 bulkscore=0 lowpriorityscore=0 suspectscore=0 clxscore=1015 priorityscore=1501 adultscore=0 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109230001 definitions=main-2109270042 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 25.09.21 um 02:55 schrieb Sean Christopherson: > Move the clearing of valid_wakeup out of kvm_arch_vcpu_block_finish() so > that a future patch can drop said arch hook. Unlike the other blocking- > related arch hooks (vcpu_blocking/unblocking()), vcpu_block_finish() needs > to be called even if the KVM doesn't actually block the vCPU. This will > allow future patches to differentiate between truly blocking the vCPU and > emulating a halt condition without introducing a contradiction. > > Alternatively, the hook could be renamed to kvm_arch_vcpu_halt_finish(), > but there's literally one call site in s390, and future cleanup can also > be done to handle valid_wakeup fully within kvm_s390_handle_wait() and > allow generic KVM to drop vcpu_valid_wakeup(). > > No functional change intended. > > Signed-off-by: Sean Christopherson Reviewed-by: Christian Borntraeger > --- > arch/s390/kvm/interrupt.c | 1 + > arch/s390/kvm/kvm-s390.c | 2 +- > 2 files changed, 2 insertions(+), 1 deletion(-) > > diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c > index 10722455fd02..520450a7956f 100644 > --- a/arch/s390/kvm/interrupt.c > +++ b/arch/s390/kvm/interrupt.c > @@ -1336,6 +1336,7 @@ int kvm_s390_handle_wait(struct kvm_vcpu *vcpu) > no_timer: > srcu_read_unlock(&vcpu->kvm->srcu, vcpu->srcu_idx); > kvm_vcpu_block(vcpu); > + vcpu->valid_wakeup = false; > __unset_cpu_idle(vcpu); > vcpu->srcu_idx = srcu_read_lock(&vcpu->kvm->srcu); > > diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c > index 7cabe6778b1b..08ed68639a21 100644 > --- a/arch/s390/kvm/kvm-s390.c > +++ b/arch/s390/kvm/kvm-s390.c > @@ -5082,7 +5082,7 @@ static inline unsigned long nonhyp_mask(int i) > > void kvm_arch_vcpu_block_finish(struct kvm_vcpu *vcpu) > { > - vcpu->valid_wakeup = false; > + maybe just remove the line instead of adding an empty one? > } > > static int __init kvm_s390_init(void) > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1CB83C433F5 for ; Mon, 27 Sep 2021 06:58:37 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id 8D04661165 for ; Mon, 27 Sep 2021 06:58:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8D04661165 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=de.ibm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 12C9D4A19F; Mon, 27 Sep 2021 02:58:36 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@ibm.com Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DKS+dbdCdcfY; Mon, 27 Sep 2021 02:58:35 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id F1AD84A1B0; Mon, 27 Sep 2021 02:58:34 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id DC05749F5D for ; Mon, 27 Sep 2021 02:58:33 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Edr5ceaK2wxQ for ; Mon, 27 Sep 2021 02:58:33 -0400 (EDT) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id CF5CE49E57 for ; Mon, 27 Sep 2021 02:58:32 -0400 (EDT) Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 18R6hxLf006952; Mon, 27 Sep 2021 02:58:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=2py7wAsJWXG4npGlcEaG4sxglSIfcxDBKt4Tx5S1/jw=; b=V8zmWhUJ9ZuPfoL4N+IoKp70cr/+MLOYS52QwMMT/IEJ5vbLkjXTso76yuKupXBC1ie4 B50i12wiBr7PjIfMVTJKEcX3SvlLQIc+cBahp5VV8CP6YIgn3qdwnKz4WZYlHmoojP4y 7Dt0LZieDIr8LU4ZnQdF0hZfauzzR4GYXtcggsDvU3KJTQ75EpdiTw3gL53tNSgXyIGD +bvRRxjOyg9Y0rcOB7TH34YwpGN/Kd3z5KPDQy3zL1Bip2UePGlptAeRHYIqVGGPAty4 XQimhoo0zH7dZUBzBsxDBji7iPpd0c0kWBlLYvbs8R7Ooa9JxpHzr8bXW1CoobIhFN8b Eg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3bagrycd3s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Sep 2021 02:58:26 -0400 Received: from m0098410.ppops.net (m0098410.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 18R6rbTm001549; Mon, 27 Sep 2021 02:58:25 -0400 Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0a-001b2d01.pphosted.com with ESMTP id 3bagrycd34-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Sep 2021 02:58:25 -0400 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 18R6vCRK030322; Mon, 27 Sep 2021 06:58:22 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma06ams.nl.ibm.com with ESMTP id 3b9u1j1j6r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Sep 2021 06:58:22 +0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 18R6rKDu59769286 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 27 Sep 2021 06:53:20 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9327952069; Mon, 27 Sep 2021 06:58:18 +0000 (GMT) Received: from li-43c5434c-23b8-11b2-a85c-c4958fb47a68.ibm.com (unknown [9.171.4.236]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 59E7552050; Mon, 27 Sep 2021 06:58:17 +0000 (GMT) Subject: Re: [PATCH 05/14] KVM: s390: Clear valid_wakeup in kvm_s390_handle_wait(), not in arch hook To: Sean Christopherson , Marc Zyngier , Huacai Chen , Aleksandar Markovic , Paul Mackerras , Janosch Frank , Paolo Bonzini References: <20210925005528.1145584-1-seanjc@google.com> <20210925005528.1145584-6-seanjc@google.com> From: Christian Borntraeger Message-ID: Date: Mon, 27 Sep 2021 08:58:17 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20210925005528.1145584-6-seanjc@google.com> Content-Language: en-US X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: sdW3Ij9mEecI7Aw6Z8BoXZNDLsey3ObW X-Proofpoint-GUID: PjUGObNwPsXJ0I6DdoYvd1PayuaV3MlM X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.391,FMLib:17.0.607.475 definitions=2021-09-27_01,2021-09-24_02,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 impostorscore=0 malwarescore=0 mlxlogscore=999 bulkscore=0 lowpriorityscore=0 suspectscore=0 clxscore=1015 priorityscore=1501 adultscore=0 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109230001 definitions=main-2109270042 Cc: Wanpeng Li , kvm@vger.kernel.org, David Hildenbrand , Joerg Roedel , Cornelia Huck , linux-mips@vger.kernel.org, kvm-ppc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, David Matlack , Vitaly Kuznetsov , Claudio Imbrenda , kvmarm@lists.cs.columbia.edu, Jim Mattson X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu Am 25.09.21 um 02:55 schrieb Sean Christopherson: > Move the clearing of valid_wakeup out of kvm_arch_vcpu_block_finish() so > that a future patch can drop said arch hook. Unlike the other blocking- > related arch hooks (vcpu_blocking/unblocking()), vcpu_block_finish() needs > to be called even if the KVM doesn't actually block the vCPU. This will > allow future patches to differentiate between truly blocking the vCPU and > emulating a halt condition without introducing a contradiction. > > Alternatively, the hook could be renamed to kvm_arch_vcpu_halt_finish(), > but there's literally one call site in s390, and future cleanup can also > be done to handle valid_wakeup fully within kvm_s390_handle_wait() and > allow generic KVM to drop vcpu_valid_wakeup(). > > No functional change intended. > > Signed-off-by: Sean Christopherson Reviewed-by: Christian Borntraeger > --- > arch/s390/kvm/interrupt.c | 1 + > arch/s390/kvm/kvm-s390.c | 2 +- > 2 files changed, 2 insertions(+), 1 deletion(-) > > diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c > index 10722455fd02..520450a7956f 100644 > --- a/arch/s390/kvm/interrupt.c > +++ b/arch/s390/kvm/interrupt.c > @@ -1336,6 +1336,7 @@ int kvm_s390_handle_wait(struct kvm_vcpu *vcpu) > no_timer: > srcu_read_unlock(&vcpu->kvm->srcu, vcpu->srcu_idx); > kvm_vcpu_block(vcpu); > + vcpu->valid_wakeup = false; > __unset_cpu_idle(vcpu); > vcpu->srcu_idx = srcu_read_lock(&vcpu->kvm->srcu); > > diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c > index 7cabe6778b1b..08ed68639a21 100644 > --- a/arch/s390/kvm/kvm-s390.c > +++ b/arch/s390/kvm/kvm-s390.c > @@ -5082,7 +5082,7 @@ static inline unsigned long nonhyp_mask(int i) > > void kvm_arch_vcpu_block_finish(struct kvm_vcpu *vcpu) > { > - vcpu->valid_wakeup = false; > + maybe just remove the line instead of adding an empty one? > } > > static int __init kvm_s390_init(void) > _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D1BEC433FE for ; Mon, 27 Sep 2021 07:01:24 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C10156117A for ; Mon, 27 Sep 2021 07:01:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C10156117A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=de.ibm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=x4hG1xJroZsp0JoyvyuABS5ggn8k/Oz7XtL9BSBMQ9g=; b=aMlbbLmJXNGlPnmG+pfviwgDBv BncKHexfobyNu6P0koHMc/zHHlW5NzWqz2XkbifsLvbBVNjcRItylawsvE8zMgLO+abM6sk0OgyTo TvlQ+5+YdQ+WdOQuEJapZeacCQfn2DLYgOsEWSXSlKQdSV4lvPO6ogQE3z7sV+LiQ8VinE5xgaQEH 5qbLlsc9atcx8isd0ILqadYNE2HRown5h/jVjmWyZBtXNy0GkseV7Q7z4ZFUwWYtzv0FxE+475Wvg 5hK/6Ed6GObe6Mz1V+T3X3cQu3DruAxoZKmCm1uyHIWcSj5x9aAyCjY0o3Mr5bqF0ZKet9qUANIKS YnHWcN5Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mUkb0-001lZL-98; Mon, 27 Sep 2021 06:58:38 +0000 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mUkav-001lYs-5A for linux-arm-kernel@lists.infradead.org; Mon, 27 Sep 2021 06:58:35 +0000 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 18R6hxLf006952; Mon, 27 Sep 2021 02:58:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=2py7wAsJWXG4npGlcEaG4sxglSIfcxDBKt4Tx5S1/jw=; b=V8zmWhUJ9ZuPfoL4N+IoKp70cr/+MLOYS52QwMMT/IEJ5vbLkjXTso76yuKupXBC1ie4 B50i12wiBr7PjIfMVTJKEcX3SvlLQIc+cBahp5VV8CP6YIgn3qdwnKz4WZYlHmoojP4y 7Dt0LZieDIr8LU4ZnQdF0hZfauzzR4GYXtcggsDvU3KJTQ75EpdiTw3gL53tNSgXyIGD +bvRRxjOyg9Y0rcOB7TH34YwpGN/Kd3z5KPDQy3zL1Bip2UePGlptAeRHYIqVGGPAty4 XQimhoo0zH7dZUBzBsxDBji7iPpd0c0kWBlLYvbs8R7Ooa9JxpHzr8bXW1CoobIhFN8b Eg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3bagrycd3s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Sep 2021 02:58:26 -0400 Received: from m0098410.ppops.net (m0098410.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 18R6rbTm001549; Mon, 27 Sep 2021 02:58:25 -0400 Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0a-001b2d01.pphosted.com with ESMTP id 3bagrycd34-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Sep 2021 02:58:25 -0400 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 18R6vCRK030322; Mon, 27 Sep 2021 06:58:22 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma06ams.nl.ibm.com with ESMTP id 3b9u1j1j6r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Sep 2021 06:58:22 +0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 18R6rKDu59769286 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 27 Sep 2021 06:53:20 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9327952069; Mon, 27 Sep 2021 06:58:18 +0000 (GMT) Received: from li-43c5434c-23b8-11b2-a85c-c4958fb47a68.ibm.com (unknown [9.171.4.236]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 59E7552050; Mon, 27 Sep 2021 06:58:17 +0000 (GMT) Subject: Re: [PATCH 05/14] KVM: s390: Clear valid_wakeup in kvm_s390_handle_wait(), not in arch hook To: Sean Christopherson , Marc Zyngier , Huacai Chen , Aleksandar Markovic , Paul Mackerras , Janosch Frank , Paolo Bonzini Cc: James Morse , Alexandru Elisei , Suzuki K Poulose , David Hildenbrand , Cornelia Huck , Claudio Imbrenda , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-mips@vger.kernel.org, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, linux-kernel@vger.kernel.org, David Matlack , Jing Zhang References: <20210925005528.1145584-1-seanjc@google.com> <20210925005528.1145584-6-seanjc@google.com> From: Christian Borntraeger Message-ID: Date: Mon, 27 Sep 2021 08:58:17 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20210925005528.1145584-6-seanjc@google.com> Content-Language: en-US X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: sdW3Ij9mEecI7Aw6Z8BoXZNDLsey3ObW X-Proofpoint-GUID: PjUGObNwPsXJ0I6DdoYvd1PayuaV3MlM X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.391,FMLib:17.0.607.475 definitions=2021-09-27_01,2021-09-24_02,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 impostorscore=0 malwarescore=0 mlxlogscore=999 bulkscore=0 lowpriorityscore=0 suspectscore=0 clxscore=1015 priorityscore=1501 adultscore=0 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109230001 definitions=main-2109270042 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210926_235833_239754_BA8726B6 X-CRM114-Status: GOOD ( 27.49 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Am 25.09.21 um 02:55 schrieb Sean Christopherson: > Move the clearing of valid_wakeup out of kvm_arch_vcpu_block_finish() so > that a future patch can drop said arch hook. Unlike the other blocking- > related arch hooks (vcpu_blocking/unblocking()), vcpu_block_finish() needs > to be called even if the KVM doesn't actually block the vCPU. This will > allow future patches to differentiate between truly blocking the vCPU and > emulating a halt condition without introducing a contradiction. > > Alternatively, the hook could be renamed to kvm_arch_vcpu_halt_finish(), > but there's literally one call site in s390, and future cleanup can also > be done to handle valid_wakeup fully within kvm_s390_handle_wait() and > allow generic KVM to drop vcpu_valid_wakeup(). > > No functional change intended. > > Signed-off-by: Sean Christopherson Reviewed-by: Christian Borntraeger > --- > arch/s390/kvm/interrupt.c | 1 + > arch/s390/kvm/kvm-s390.c | 2 +- > 2 files changed, 2 insertions(+), 1 deletion(-) > > diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c > index 10722455fd02..520450a7956f 100644 > --- a/arch/s390/kvm/interrupt.c > +++ b/arch/s390/kvm/interrupt.c > @@ -1336,6 +1336,7 @@ int kvm_s390_handle_wait(struct kvm_vcpu *vcpu) > no_timer: > srcu_read_unlock(&vcpu->kvm->srcu, vcpu->srcu_idx); > kvm_vcpu_block(vcpu); > + vcpu->valid_wakeup = false; > __unset_cpu_idle(vcpu); > vcpu->srcu_idx = srcu_read_lock(&vcpu->kvm->srcu); > > diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c > index 7cabe6778b1b..08ed68639a21 100644 > --- a/arch/s390/kvm/kvm-s390.c > +++ b/arch/s390/kvm/kvm-s390.c > @@ -5082,7 +5082,7 @@ static inline unsigned long nonhyp_mask(int i) > > void kvm_arch_vcpu_block_finish(struct kvm_vcpu *vcpu) > { > - vcpu->valid_wakeup = false; > + maybe just remove the line instead of adding an empty one? > } > > static int __init kvm_s390_init(void) > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Borntraeger Date: Mon, 27 Sep 2021 06:58:17 +0000 Subject: Re: [PATCH 05/14] KVM: s390: Clear valid_wakeup in kvm_s390_handle_wait(), not in arch hook Message-Id: List-Id: References: <20210925005528.1145584-1-seanjc@google.com> <20210925005528.1145584-6-seanjc@google.com> In-Reply-To: <20210925005528.1145584-6-seanjc@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Sean Christopherson , Marc Zyngier , Huacai Chen , Aleksandar Markovic , Paul Mackerras , Janosch Frank , Paolo Bonzini Cc: James Morse , Alexandru Elisei , Suzuki K Poulose , David Hildenbrand , Cornelia Huck , Claudio Imbrenda , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-mips@vger.kernel.org, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, linux-kernel@vger.kernel.org, David Matlack , Jing Zhang Am 25.09.21 um 02:55 schrieb Sean Christopherson: > Move the clearing of valid_wakeup out of kvm_arch_vcpu_block_finish() so > that a future patch can drop said arch hook. Unlike the other blocking- > related arch hooks (vcpu_blocking/unblocking()), vcpu_block_finish() needs > to be called even if the KVM doesn't actually block the vCPU. This will > allow future patches to differentiate between truly blocking the vCPU and > emulating a halt condition without introducing a contradiction. > > Alternatively, the hook could be renamed to kvm_arch_vcpu_halt_finish(), > but there's literally one call site in s390, and future cleanup can also > be done to handle valid_wakeup fully within kvm_s390_handle_wait() and > allow generic KVM to drop vcpu_valid_wakeup(). > > No functional change intended. > > Signed-off-by: Sean Christopherson Reviewed-by: Christian Borntraeger > --- > arch/s390/kvm/interrupt.c | 1 + > arch/s390/kvm/kvm-s390.c | 2 +- > 2 files changed, 2 insertions(+), 1 deletion(-) > > diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c > index 10722455fd02..520450a7956f 100644 > --- a/arch/s390/kvm/interrupt.c > +++ b/arch/s390/kvm/interrupt.c > @@ -1336,6 +1336,7 @@ int kvm_s390_handle_wait(struct kvm_vcpu *vcpu) > no_timer: > srcu_read_unlock(&vcpu->kvm->srcu, vcpu->srcu_idx); > kvm_vcpu_block(vcpu); > + vcpu->valid_wakeup = false; > __unset_cpu_idle(vcpu); > vcpu->srcu_idx = srcu_read_lock(&vcpu->kvm->srcu); > > diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c > index 7cabe6778b1b..08ed68639a21 100644 > --- a/arch/s390/kvm/kvm-s390.c > +++ b/arch/s390/kvm/kvm-s390.c > @@ -5082,7 +5082,7 @@ static inline unsigned long nonhyp_mask(int i) > > void kvm_arch_vcpu_block_finish(struct kvm_vcpu *vcpu) > { > - vcpu->valid_wakeup = false; > + maybe just remove the line instead of adding an empty one? > } > > static int __init kvm_s390_init(void) >