From patchwork Fri Mar 11 17:57:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver Upton X-Patchwork-Id: 12778491 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 28548C433F5 for ; Fri, 11 Mar 2022 17:58:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:References: Mime-Version:Message-Id:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=Yq3l8I085+lNCphwYgCOJfqqdUzjn67sEW4DGBrGNKI=; b=rTaQkoLsQf8MQiuK8mmy3Yc1X0 W9dR31xhHL/iXP8nvmMwyRWoMub+nfl3r1U5Mz1jN8mFarQYl/5+CDFs2BeEbOMUndmkrhJLWMv0W eVkqzQTdrPZpHouv9388tjfvgjrd9v4oTQjOU8Vsa66SvMvrDS3KevnUB4jbETkIRgCzL8kFjMwp2 jwegGSXFs5QV/3Dh7+Pt1GUvEUgj9f+fYF6Mjx1EIF5s00pT7vgyXLlOdHsRwijyzfDniTK8vf1an fW8+wHuNqkGdNiJizfL2J7rIIKTZmMqByhwWpcGqZnqWwnvCf1QV6s9wIEhqfkoMNdBOkVQeTlZVo oDgRUB7g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nSjWK-00HYHW-5g; Fri, 11 Mar 2022 17:57:44 +0000 Received: from mail-il1-x149.google.com ([2607:f8b0:4864:20::149]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nSjWG-00HYG1-7r for linux-arm-kernel@lists.infradead.org; Fri, 11 Mar 2022 17:57:41 +0000 Received: by mail-il1-x149.google.com with SMTP id f18-20020a926a12000000b002be48b02bc6so5988576ilc.17 for ; Fri, 11 Mar 2022 09:57:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=BGsr6pN9enYniNk4zGr+nWX2xORuU1JL7wS+cLweFVM=; b=G8cB3TIlGOvwQlgqnb6Mv3A6ZDlk82Jx93jjWrLxun3vDuSleV+2ZENfuUS1eSZq+K IgQ+GM9Xo82V8Mun7Lw//GhahVM4rZ371b9ilQF12s4J9ZiMeW81c7rONn3ZnADLdkRR u2WDOuwVoayXZQ+3DSiHPrNnfLhLIsa/IdvllbJZZ7pvFOzW7aSZNQ8W7lifUWwLCuf2 DzxMLwqWeIeg6ntp2KnMOFHYpbHF7VkUH7zkgVfTqKkbCvbnG93z8jQ35Nzt65Ow3VLB yQHFcdwj2Grigd5frLaWlCQhcWFuBSzZAr/5LUkcx2FguOxyMPYLNFA5zfXBNAuS2oIg Zn/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=BGsr6pN9enYniNk4zGr+nWX2xORuU1JL7wS+cLweFVM=; b=KlmtJ6MED8R5KW3h/4VK9mTkgUXuZYqqJtLLlHjhYaMRPGQQU5mwavBcl4zuEQ5afi /sBJnR4lcSj1kexerx0HKhNIudlJE0HSKJZv25sMKbjFhpbJOPG7tKmMgyTdp9wRG+lB lvBmh7Yx/k1ykjVkkqHawLCIP8mZ3z+LIwMxRvdjFJ0dAvC0lyxxzg8V/POEmUZFrarl hhkUPjTXzOv71bFrLvEneBK143BB9A2V/Y49lvkPx+dLndCwXwcPtpyqdbeHwgeta3yb amZL+Wz7T7rxHXPRWMsvYJH2+YMcI71pDLa7kdLc9x40znUDKmC0vWfAMZDcF6hrgwx3 5H7A== X-Gm-Message-State: AOAM533UHdLxBbp7tLWrMHMtGs9GTkYJfv/Y2ryfuyecXFx1nxJgy6ps Ct1SXIhPiRIQepJJaOZNpyYHLzdymZA= X-Google-Smtp-Source: ABdhPJzy7TljJ49dSoKSsh7qQwadwo8KUyffYqNTXf0RMjBpnuNAtwt/ATgmZWQS3claaoNqk/pp2mmirz8= X-Received: from oupton.c.googlers.com ([fda3:e722:ac3:cc00:2b:ff92:c0a8:404]) (user=oupton job=sendgmr) by 2002:a05:6602:15c5:b0:646:4d0f:7728 with SMTP id f5-20020a05660215c500b006464d0f7728mr8810250iow.63.1647021458831; Fri, 11 Mar 2022 09:57:38 -0800 (PST) Date: Fri, 11 Mar 2022 17:57:13 +0000 In-Reply-To: <20220311175717.616958-1-oupton@google.com> Message-Id: <20220311175717.616958-2-oupton@google.com> Mime-Version: 1.0 References: <20220311174001.605719-1-oupton@google.com> <20220311175717.616958-1-oupton@google.com> X-Mailer: git-send-email 2.35.1.723.g4982287a31-goog Subject: [RFC PATCH kvmtool 1/5] TESTONLY: Sync KVM headers with pending changes From: Oliver Upton To: kvmarm@lists.cs.columbia.edu Cc: kvm@vger.kernel.org, Marc Zyngier , James Morse , Alexandru Elisei , Suzuki K Poulose , linux-arm-kernel@lists.infradead.org, Peter Shier , Ricardo Koller , Reiji Watanabe , Will Deacon , Julien Thierry , Oliver Upton X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220311_095740_315413_7FC36FB7 X-CRM114-Status: GOOD ( 10.36 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Signed-off-by: Oliver Upton --- include/linux/kvm.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/include/linux/kvm.h b/include/linux/kvm.h index 1daa452..e5bb5f1 100644 --- a/include/linux/kvm.h +++ b/include/linux/kvm.h @@ -444,6 +444,8 @@ struct kvm_run { #define KVM_SYSTEM_EVENT_SHUTDOWN 1 #define KVM_SYSTEM_EVENT_RESET 2 #define KVM_SYSTEM_EVENT_CRASH 3 +#define KVM_SYSTEM_EVENT_WAKEUP 4 +#define KVM_SYSTEM_EVENT_SUSPEND 5 __u32 type; __u64 flags; } system_event; @@ -634,6 +636,7 @@ struct kvm_vapic_addr { #define KVM_MP_STATE_OPERATING 7 #define KVM_MP_STATE_LOAD 8 #define KVM_MP_STATE_AP_RESET_HOLD 9 +#define KVM_MP_STATE_SUSPENDED 10 struct kvm_mp_state { __u32 mp_state; @@ -1131,6 +1134,10 @@ struct kvm_ppc_resize_hpt { #define KVM_CAP_EXIT_ON_EMULATION_FAILURE 204 #define KVM_CAP_ARM_MTE 205 #define KVM_CAP_VM_MOVE_ENC_CONTEXT_FROM 206 +#define KVM_CAP_VM_GPA_BITS 207 +#define KVM_CAP_XSAVE2 208 +#define KVM_CAP_SYS_ATTRIBUTES 209 +#define KVM_CAP_ARM_SYSTEM_SUSPEND 210 #ifdef KVM_CAP_IRQ_ROUTING @@ -1162,11 +1169,20 @@ struct kvm_irq_routing_hv_sint { __u32 sint; }; +struct kvm_irq_routing_xen_evtchn { + __u32 port; + __u32 vcpu; + __u32 priority; +}; + +#define KVM_IRQ_ROUTING_XEN_EVTCHN_PRIO_2LEVEL ((__u32)(-1)) + /* gsi routing entry types */ #define KVM_IRQ_ROUTING_IRQCHIP 1 #define KVM_IRQ_ROUTING_MSI 2 #define KVM_IRQ_ROUTING_S390_ADAPTER 3 #define KVM_IRQ_ROUTING_HV_SINT 4 +#define KVM_IRQ_ROUTING_XEN_EVTCHN 5 struct kvm_irq_routing_entry { __u32 gsi; @@ -1178,6 +1194,7 @@ struct kvm_irq_routing_entry { struct kvm_irq_routing_msi msi; struct kvm_irq_routing_s390_adapter adapter; struct kvm_irq_routing_hv_sint hv_sint; + struct kvm_irq_routing_xen_evtchn xen_evtchn; __u32 pad[8]; } u; }; @@ -1208,6 +1225,7 @@ struct kvm_x86_mce { #define KVM_XEN_HVM_CONFIG_INTERCEPT_HCALL (1 << 1) #define KVM_XEN_HVM_CONFIG_SHARED_INFO (1 << 2) #define KVM_XEN_HVM_CONFIG_RUNSTATE (1 << 3) +#define KVM_XEN_HVM_CONFIG_EVTCHN_2LEVEL (1 << 4) struct kvm_xen_hvm_config { __u32 flags; @@ -2031,4 +2049,7 @@ struct kvm_stats_desc { #define KVM_GET_STATS_FD _IO(KVMIO, 0xce) +/* Available with KVM_CAP_XSAVE2 */ +#define KVM_GET_XSAVE2 _IOR(KVMIO, 0xcf, struct kvm_xsave) + #endif /* __LINUX_KVM_H */