Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1394816iob; Wed, 4 May 2022 23:31:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWidv8C9pCRNNs5zxIgr5Bx9QqeU8l+JNF4eSoZBdkOGXliw9G+Q7oFS35Yt5BfUZ7m7v+ X-Received: by 2002:a63:6846:0:b0:3c1:9e29:fb50 with SMTP id d67-20020a636846000000b003c19e29fb50mr21117808pgc.410.1651732284719; Wed, 04 May 2022 23:31:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651732284; cv=none; d=google.com; s=arc-20160816; b=Oqf+uGngA6pDDJElM9CeqUKDEu2+tOApO9VlcBbC1wGRCxtP6bK0NlEi6rXlU1LRc0 knRNbEvS2aLK+nqXZ7COxOFXa9qdnf7C05vJ4pa8qGxMEO5WrkYQLHWK5ua56dyZMwvU i0K14kHgZnapGG7jXyNNX8OexEh/uR27KvFXATjELZVOaYwdrlo0mNh0+GkVLgRxrq++ OXxm3pEhKqXAMaxwkVX2ehcCrTZwnH8kOetzh7bcOIEAovD7CHLvi0nbUOLVKKgmHIwm o3K1ZHkO3n2nHazdfK+6z+zGd/ihvRB1DlmYoyGzSKB9KsvBwA96fAUj69CDHTGuUZJZ IlNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=SGj/vQ1D4ocYvudnNWkHuwgnsJHFH2wym4Ifog/6c54=; b=lowRbyVEq3GQMU3etXrWOG2aJzU8BLz9RioGKkw1f150DKkGfv7VVrfqW/i3dXlV4+ IQE7AN91Y9wZ9ktNW3wwDgMCcZgV43Mwz7B8JB7S8EgjveUa3NWNK/kUd0B90GkzDAjH bpTSBIZUj39xAbzUrBgAbevAaOQXOC6C/KKWlRK6okc+i2LXxrgdJh6C4PDp9VmlL/cI 4JyvSWnLkhd2D8cQ/HUOnvo98CgyMY7uDQlcyva0crb1jPIX1t1D7GW77slimmJzrCbv IHWKu3Hb3TbQuywYsmbGQ4HkbbRWEPmsf66NT0CmkN4se5xniWH3nlgY7Bn8Hi3efcR2 Blbg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lk6-20020a17090b33c600b001d26e95f5f5si1186630pjb.182.2022.05.04.23.31.08; Wed, 04 May 2022 23:31:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345723AbiEDHvv (ORCPT + 99 others); Wed, 4 May 2022 03:51:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343890AbiEDHvt (ORCPT ); Wed, 4 May 2022 03:51:49 -0400 Received: from ozlabs.ru (ozlabs.ru [107.174.27.60]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 982F713E89; Wed, 4 May 2022 00:48:13 -0700 (PDT) Received: from fstn1-p1.ozlabs.ibm.com. (localhost [IPv6:::1]) by ozlabs.ru (Postfix) with ESMTP id C4CC680511; Wed, 4 May 2022 03:48:09 -0400 (EDT) From: Alexey Kardashevskiy To: kvm-ppc@vger.kernel.org Cc: Alexey Kardashevskiy , x86@kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-riscv@lists.infradead.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, Alex Williamson , Paolo Bonzini , Fabiano Rosas Subject: [PATCH kernel] KVM: PPC: Make KVM_CAP_IRQFD_RESAMPLE platform dependent Date: Wed, 4 May 2022 17:48:07 +1000 Message-Id: <20220504074807.3616813-1-aik@ozlabs.ru> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When introduced, IRQFD resampling worked on POWER8 with XICS. However KVM on POWER9 has never implemented it - the compatibility mode code ("XICS-on-XIVE") misses the kvm_notify_acked_irq() call and the native XIVE mode does not handle INTx in KVM at all. This moved the capability support advertising to platforms and stops advertising it on XIVE, i.e. POWER9 and later. Signed-off-by: Alexey Kardashevskiy --- Or I could move this one together with KVM_CAP_IRQFD. Thoughts? --- arch/arm64/kvm/arm.c | 3 +++ arch/mips/kvm/mips.c | 3 +++ arch/powerpc/kvm/powerpc.c | 6 ++++++ arch/riscv/kvm/vm.c | 3 +++ arch/s390/kvm/kvm-s390.c | 3 +++ arch/x86/kvm/x86.c | 3 +++ virt/kvm/kvm_main.c | 1 - 7 files changed, 21 insertions(+), 1 deletion(-) diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c index 523bc934fe2f..092f0614bae3 100644 --- a/arch/arm64/kvm/arm.c +++ b/arch/arm64/kvm/arm.c @@ -210,6 +210,9 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) case KVM_CAP_SET_GUEST_DEBUG: case KVM_CAP_VCPU_ATTRIBUTES: case KVM_CAP_PTP_KVM: +#ifdef CONFIG_HAVE_KVM_IRQFD + case KVM_CAP_IRQFD_RESAMPLE: +#endif r = 1; break; case KVM_CAP_SET_GUEST_DEBUG2: diff --git a/arch/mips/kvm/mips.c b/arch/mips/kvm/mips.c index a25e0b73ee70..0f3de470a73e 100644 --- a/arch/mips/kvm/mips.c +++ b/arch/mips/kvm/mips.c @@ -1071,6 +1071,9 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) case KVM_CAP_READONLY_MEM: case KVM_CAP_SYNC_MMU: case KVM_CAP_IMMEDIATE_EXIT: +#ifdef CONFIG_HAVE_KVM_IRQFD + case KVM_CAP_IRQFD_RESAMPLE: +#endif r = 1; break; case KVM_CAP_NR_VCPUS: diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c index 875c30c12db0..87698ffef3be 100644 --- a/arch/powerpc/kvm/powerpc.c +++ b/arch/powerpc/kvm/powerpc.c @@ -591,6 +591,12 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) break; #endif +#ifdef CONFIG_HAVE_KVM_IRQFD + case KVM_CAP_IRQFD_RESAMPLE: + r = !xive_enabled(); + break; +#endif + case KVM_CAP_PPC_ALLOC_HTAB: r = hv_enabled; break; diff --git a/arch/riscv/kvm/vm.c b/arch/riscv/kvm/vm.c index c768f75279ef..b58579b386bb 100644 --- a/arch/riscv/kvm/vm.c +++ b/arch/riscv/kvm/vm.c @@ -63,6 +63,9 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) case KVM_CAP_READONLY_MEM: case KVM_CAP_MP_STATE: case KVM_CAP_IMMEDIATE_EXIT: +#ifdef CONFIG_HAVE_KVM_IRQFD + case KVM_CAP_IRQFD_RESAMPLE: +#endif r = 1; break; case KVM_CAP_NR_VCPUS: diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index 156d1c25a3c1..85e093fc8d13 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c @@ -564,6 +564,9 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) case KVM_CAP_SET_GUEST_DEBUG: case KVM_CAP_S390_DIAG318: case KVM_CAP_S390_MEM_OP_EXTENSION: +#ifdef CONFIG_HAVE_KVM_IRQFD + case KVM_CAP_IRQFD_RESAMPLE: +#endif r = 1; break; case KVM_CAP_SET_GUEST_DEBUG2: diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 0c0ca599a353..a0a7b769483d 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -4273,6 +4273,9 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) case KVM_CAP_SYS_ATTRIBUTES: case KVM_CAP_VAPIC: case KVM_CAP_ENABLE_CAP: +#ifdef CONFIG_HAVE_KVM_IRQFD + case KVM_CAP_IRQFD_RESAMPLE: +#endif r = 1; break; case KVM_CAP_EXIT_HYPERCALL: diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 70e05af5ebea..885e72e668a5 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -4293,7 +4293,6 @@ static long kvm_vm_ioctl_check_extension_generic(struct kvm *kvm, long arg) #endif #ifdef CONFIG_HAVE_KVM_IRQFD case KVM_CAP_IRQFD: - case KVM_CAP_IRQFD_RESAMPLE: #endif case KVM_CAP_IOEVENTFD_ANY_LENGTH: case KVM_CAP_CHECK_EXTENSION_VM: -- 2.30.2