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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8CAF0C433FE for ; Sun, 3 Apr 2022 15:41:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359324AbiDCPnr (ORCPT ); Sun, 3 Apr 2022 11:43:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1359344AbiDCPnc (ORCPT ); Sun, 3 Apr 2022 11:43:32 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 040953A5C2 for ; Sun, 3 Apr 2022 08:41:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649000492; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vbgCknTxS34JFqqL2+ZQgpH9eYwyzp2I7rQd8Aia+24=; b=XUAQ7NcxQebBY1oInJHlyCMk8Q+Q+njwcrbmwgWeTcwKSKhVaHnDgwrihvIvK31NElikpf WhRcLHzNcC/vsbVWAFodLts+9I/ndIboSowl/2k6s0MKE2MYbJ0z4AwEbhFXixHhDVQhzI 4Xg6XqUzw6Gbzor/hk/3NaVcvYU+/0o= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-460-yVMJFgf4PsOHNZkAFzY05Q-1; Sun, 03 Apr 2022 11:41:28 -0400 X-MC-Unique: yVMJFgf4PsOHNZkAFzY05Q-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0325080005D; Sun, 3 Apr 2022 15:41:28 +0000 (UTC) Received: from gshan.redhat.com (ovpn-12-82.pek2.redhat.com [10.72.12.82]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 04280463DF2; Sun, 3 Apr 2022 15:41:21 +0000 (UTC) From: Gavin Shan To: kvmarm@lists.cs.columbia.edu Cc: linux-kernel@vger.kernel.org, eauger@redhat.com, oupton@google.com, Jonathan.Cameron@huawei.com, vkuznets@redhat.com, will@kernel.org, shannon.zhaosl@gmail.com, james.morse@arm.com, mark.rutland@arm.com, maz@kernel.org, pbonzini@redhat.com, shan.gavin@gmail.com Subject: [PATCH v6 17/18] KVM: arm64: Expose SDEI capability Date: Sun, 3 Apr 2022 23:39:10 +0800 Message-Id: <20220403153911.12332-18-gshan@redhat.com> In-Reply-To: <20220403153911.12332-1-gshan@redhat.com> References: <20220403153911.12332-1-gshan@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The SDEI functionality is ready to be exposed. This adds new capability (KVM_CAP_ARM_SDEI) and exposes it. VMM needs this to add ACPI table for SDEI so that the service can be detected from the guest kernel. Signed-off-by: Gavin Shan --- Documentation/virt/kvm/api.rst | 11 +++++++++++ arch/arm64/kvm/arm.c | 1 + include/uapi/linux/kvm.h | 1 + 3 files changed, 13 insertions(+) diff --git a/Documentation/virt/kvm/api.rst b/Documentation/virt/kvm/api.rst index d13fa6600467..59b94a24a490 100644 --- a/Documentation/virt/kvm/api.rst +++ b/Documentation/virt/kvm/api.rst @@ -7723,6 +7723,17 @@ At this time, KVM_PMU_CAP_DISABLE is the only capability. Setting this capability will disable PMU virtualization for that VM. Usermode should adjust CPUID leaf 0xA to reflect that the PMU is disabled. +8.36 KVM_CAP_ARM_SDEI +--------------------- + +:Capability: KVM_CAP_ARM_SDEI +:Architectures: arm64 +:Type: vm + +This capability indicates that the SDEI virtual service is supported +in the host. A VMM can check whether the service is available to enable +it. + 9. Known KVM API problems ========================= diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c index 7e77d62aeab1..8117a9e974f0 100644 --- a/arch/arm64/kvm/arm.c +++ b/arch/arm64/kvm/arm.c @@ -211,6 +211,7 @@ 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: + case KVM_CAP_ARM_SDEI: r = 1; break; case KVM_CAP_SET_GUEST_DEBUG2: diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index 91a6fe4e02c0..a5474265c841 100644 --- a/include/uapi/linux/kvm.h +++ b/include/uapi/linux/kvm.h @@ -1144,6 +1144,7 @@ struct kvm_ppc_resize_hpt { #define KVM_CAP_S390_MEM_OP_EXTENSION 211 #define KVM_CAP_PMU_CAPABILITY 212 #define KVM_CAP_DISABLE_QUIRKS2 213 +#define KVM_CAP_ARM_SDEI 214 #ifdef KVM_CAP_IRQ_ROUTING -- 2.23.0