Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp2919021pxb; Fri, 8 Oct 2021 19:17:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwEi4XvGxWJYP6r6dn9m4uoIC0N8mtTcCEs1wNODHYFKAmuG1dyxnKsZlWpy4+FKqU1JFqQ X-Received: by 2002:a05:6402:5202:: with SMTP id s2mr13457303edd.67.1633745829096; Fri, 08 Oct 2021 19:17:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633745829; cv=none; d=google.com; s=arc-20160816; b=Effo/dsVClXcRGeR8zwOlckzKp+y8XQjutpAoQelQlAXbIYIqbenoY/jC/UHcUTCeN ppvYg7HjrY7R3mA6oTwNw9aa6MhFAFXs/cFA3xjGDL17Zzx/7Mrd+amZYnYmehnDnLV5 2U/kac2JMezc5JA4Td5/1T7TdSgsYbQSSst5h6Z+2/mED8O26l93AeWLQpj6ct2hjawc hIDi+vKUlo/vIXMo9nS/gdLc/VTuMmTjGBgEiU9wL4q2nmAy1dEX9h+uw7vZyc56dRYv vX/sxRGLZvc6GsWjGFex/IVcPCOtk6ypC3vRA+YiH72FmePO7pnDQpmyiAJdueqr/YgT agCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:reply-to:dkim-signature; bh=W7si8hyBuDcp1dRXujL6OsjQExomH1E+fqXnahmPoDg=; b=Nlp+LpzKeHbkzv9EPfjaJHyy1rAHaWcoP2lBTHK7YLCfRJ+YyV1S+LkUBgh4gSrIJF q1DItQQDiZhA3fco5fl/fbyuLqd1kH4s9MXUzgqEQ9V+Q1JUAXmg6AyQnF+XhG1rQGwD Mgr7Oz2w67pjiLvf/Z5vI+h+QNArVg9DN/zJGrOfO18XAEHF3ambuaSaJ7itW2ZKOylH pPU5YJAfmUQ0S++XT45GfuphqVxPgyQ9t3WXp0WQEYWeaEK+d53lw/gipXhgZv+D3TsS KpN1W1WrEHF/iOtmmITlV8/ejrjwGvVwvXeGKRlpPxMjGQe6tWhxS+xJBENOS0Lvwdof qmVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=aOVayCn6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nb24si2329033ejc.544.2021.10.08.19.16.45; Fri, 08 Oct 2021 19:17:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=aOVayCn6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244305AbhJICPC (ORCPT + 99 others); Fri, 8 Oct 2021 22:15:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244222AbhJICO6 (ORCPT ); Fri, 8 Oct 2021 22:14:58 -0400 Received: from mail-qk1-x74a.google.com (mail-qk1-x74a.google.com [IPv6:2607:f8b0:4864:20::74a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81BFEC061765 for ; Fri, 8 Oct 2021 19:13:02 -0700 (PDT) Received: by mail-qk1-x74a.google.com with SMTP id m6-20020a05620a24c600b004338e8a5a3cso9784796qkn.10 for ; Fri, 08 Oct 2021 19:13:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=reply-to:date:in-reply-to:message-id:mime-version:references :subject:from:to:cc; bh=W7si8hyBuDcp1dRXujL6OsjQExomH1E+fqXnahmPoDg=; b=aOVayCn6ej6FxmmrHt2sU4373bV7AgGsudgxlqChxKNBKeRvLn96S5TTWXhl5ULPJk I6iByFgjio/SidNywR7tnUGCRvSDXMEtfg0wpwAATih5seZXq+QX1sQoTghgk9QHQB57 9ciB8V1aON0p6mmmnPOJ6EOL7AvSBtzp/rM+Pa2gx/RTljJgt7PpcpYhy/Qeqj3D6m5L wMWuAky/wekhi60e5vPGB9DlvsoJ6WhNX1rDvrD4Mdh5h3FUJIFjNxaS/4ltVuEBwBOD 3ZYnQpGBK4gqS0MSsSW1ri3MD09TSEw2EHYYwemAOuNZ4Mo8BpFRTOjf8EBWWgJpnE4g pPUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:reply-to:date:in-reply-to:message-id :mime-version:references:subject:from:to:cc; bh=W7si8hyBuDcp1dRXujL6OsjQExomH1E+fqXnahmPoDg=; b=J80nT2892BcuafqfuYg97G0p0+VFDJTzIqs7NVV0D2B7GGE9AC13aLZKNENtcvG54C fbCD5iJ73PRi1Aupn4YyUq4CLfy/OpuAn+zW0Y5A66gVuovCxzVeEC/GeuL9MGuWH4PB o/6NhhUXgsGIQbv9sKi8fazY2Lhgk+0KZksmGjO4X1enDZiFLlV19jcBC1MXcCQmkUaA q6ucXfGbBohAoZbyJ8hdEJ68nMYAHih2qsqkUHqg8aZJmECawcbCp5CwpXwD5XS+G5EP MK72Rygv9q2omJsLgYB7Fc1akVbbQeiJPjfwbBFH754CGiU23Mv5MQg3jzIlsZKohEFe rw6A== X-Gm-Message-State: AOAM5317Djvv4pDhv+JDFK1nBvOKSmFev4b2sSqwOWxLhwEN0VxzH60v c/vCid6TxfjyeXK9a5dqIwjpqS70geU= X-Received: from seanjc798194.pdx.corp.google.com ([2620:15c:90:200:e39b:6333:b001:cb]) (user=seanjc job=sendgmr) by 2002:ac8:5682:: with SMTP id h2mr1879396qta.361.1633745581703; Fri, 08 Oct 2021 19:13:01 -0700 (PDT) Reply-To: Sean Christopherson Date: Fri, 8 Oct 2021 19:12:01 -0700 In-Reply-To: <20211009021236.4122790-1-seanjc@google.com> Message-Id: <20211009021236.4122790-9-seanjc@google.com> Mime-Version: 1.0 References: <20211009021236.4122790-1-seanjc@google.com> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog Subject: [PATCH v2 08/43] KVM: s390: Clear valid_wakeup in kvm_s390_handle_wait(), not in arch hook From: Sean Christopherson To: Marc Zyngier , Huacai Chen , Aleksandar Markovic , Paul Mackerras , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Christian Borntraeger , Janosch Frank , Paolo Bonzini Cc: James Morse , Alexandru Elisei , Suzuki K Poulose , Atish Patra , David Hildenbrand , Cornelia Huck , Claudio Imbrenda , Sean Christopherson , 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, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, David Matlack , Oliver Upton , Jing Zhang Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Move the clearing of valid_wakeup from 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. Reviewed-by: Christian Borntraeger Signed-off-by: Sean Christopherson --- 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; + } static int __init kvm_s390_init(void) -- 2.33.0.882.g93a45727a2-goog