From patchwork Tue Apr 1 11:53:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: PranavkumarSawargaonkar X-Patchwork-Id: 27534 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f71.google.com (mail-qa0-f71.google.com [209.85.216.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BA2E320341 for ; Tue, 1 Apr 2014 11:56:22 +0000 (UTC) Received: by mail-qa0-f71.google.com with SMTP id j7sf20220855qaq.2 for ; Tue, 01 Apr 2014 04:56:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=BlCFXREtFmMKLeMaEXXlgRAIOYLPKwVvxRmrC94furg=; b=aib+FhWc/RGCKhIeHJk92sDH6YGsbpJBEiB1d5FxKoEDZu2VwIn7YXRlHsBKnB4W3h py3m7BbLLHRiKyBG72OHW/Aod2wlSVfSNwVGjfNgEDy3bQdkNu/kNfagaH88LlfZzJGW ocobE9wzIhcKEibV2yiQP2OlXRKn1abunp4W1gTQTGCM4yOurbgLCccdKMDZwjQBFK1s EO2f+J6LCAl+gc9LRfqMUzSDjZ63xY9emSwXa+BFY29qd/ZyQuGeA99kYfCM1w+/4USX 8YPBVuqJM85px92VSupMcWn3h1CDa6POao9SpSjQfifL4BRjs0/Uxp1BmpDiElejd3O2 TxUg== X-Gm-Message-State: ALoCoQlVP5nLfVB+YLnUCvNxUPi61Y2ZMi5tsVeofGYhQLiT58G/Jc5l7a/HXVcTEjd3vOsW4Gxm X-Received: by 10.52.29.171 with SMTP id l11mr11168389vdh.0.1396353382390; Tue, 01 Apr 2014 04:56:22 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.106.71 with SMTP id d65ls4026qgf.17.gmail; Tue, 01 Apr 2014 04:56:22 -0700 (PDT) X-Received: by 10.220.133.80 with SMTP id e16mr28384625vct.13.1396353382298; Tue, 01 Apr 2014 04:56:22 -0700 (PDT) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id tq2si3295336vdc.93.2014.04.01.04.56.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 01 Apr 2014 04:56:22 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.181; Received: by mail-vc0-f181.google.com with SMTP id id10so9354738vcb.26 for ; Tue, 01 Apr 2014 04:56:22 -0700 (PDT) X-Received: by 10.52.37.196 with SMTP id a4mr791069vdk.33.1396353382192; Tue, 01 Apr 2014 04:56:22 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.12.8 with SMTP id v8csp229895vcv; Tue, 1 Apr 2014 04:56:21 -0700 (PDT) X-Received: by 10.224.165.1 with SMTP id g1mr27601672qay.16.1396353381829; Tue, 01 Apr 2014 04:56:21 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id p59si7499043qga.175.2014.04.01.04.56.21 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 01 Apr 2014 04:56:21 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:59748 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WUxIj-000157-FR for patch@linaro.org; Tue, 01 Apr 2014 07:56:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36973) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WUxGm-0006it-6A for qemu-devel@nongnu.org; Tue, 01 Apr 2014 07:54:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WUxGg-0007V2-6E for qemu-devel@nongnu.org; Tue, 01 Apr 2014 07:54:20 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:57433) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WUxGf-0007Uu-U3 for qemu-devel@nongnu.org; Tue, 01 Apr 2014 07:54:14 -0400 Received: by mail-pa0-f45.google.com with SMTP id kl14so9731938pab.4 for ; Tue, 01 Apr 2014 04:54:13 -0700 (PDT) X-Received: by 10.68.131.202 with SMTP id oo10mr30883874pbb.35.1396353253172; Tue, 01 Apr 2014 04:54:13 -0700 (PDT) Received: from pnqlab006.amcc.com ([182.73.239.130]) by mx.google.com with ESMTPSA id ix2sm49532958pbc.45.2014.04.01.04.54.09 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 01 Apr 2014 04:54:12 -0700 (PDT) From: Pranavkumar Sawargaonkar To: qemu-devel@nongnu.org Date: Tue, 1 Apr 2014 17:23:47 +0530 Message-Id: <1396353232-3835-2-git-send-email-pranavkumar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1396353232-3835-1-git-send-email-pranavkumar@linaro.org> References: <1396353232-3835-1-git-send-email-pranavkumar@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.220.45 Cc: peter.maydell@linaro.org, Anup Patel , patches@apm.com, kvmarm@list.cs.columbia.edu, christoffer.dall@linaro.org, Pranavkumar Sawargaonkar Subject: [Qemu-devel] [RFC PATCH V2 1/6] linux-headers: Update KVM headers from v3.14 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: pranavkumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Syncup KVM related linux headers from v3.14. Signed-off-by: Pranavkumar Sawargaonkar Signed-off-by: Anup Patel --- linux-headers/asm-arm/kvm.h | 19 +++++++------- linux-headers/asm-arm64/kvm.h | 21 ++++++++-------- linux-headers/linux/kvm.h | 10 ++++++++ linux-headers/linux/psci.h | 55 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 86 insertions(+), 19 deletions(-) create mode 100644 linux-headers/linux/psci.h diff --git a/linux-headers/asm-arm/kvm.h b/linux-headers/asm-arm/kvm.h index ef0c878..6574ddf 100644 --- a/linux-headers/asm-arm/kvm.h +++ b/linux-headers/asm-arm/kvm.h @@ -20,6 +20,7 @@ #define __ARM_KVM_H__ #include +#include #include #define __KVM_HAVE_GUEST_DEBUG @@ -83,6 +84,7 @@ struct kvm_regs { #define KVM_VGIC_V2_CPU_SIZE 0x2000 #define KVM_ARM_VCPU_POWER_OFF 0 /* CPU is started in OFF state */ +#define KVM_ARM_VCPU_PSCI_0_2 1 /* CPU uses PSCI v0.2 */ struct kvm_vcpu_init { __u32 target; @@ -194,16 +196,15 @@ struct kvm_arch_memory_slot { /* PSCI interface */ #define KVM_PSCI_FN_BASE 0x95c1ba5e -#define KVM_PSCI_FN(n) (KVM_PSCI_FN_BASE + (n)) -#define KVM_PSCI_FN_CPU_SUSPEND KVM_PSCI_FN(0) -#define KVM_PSCI_FN_CPU_OFF KVM_PSCI_FN(1) -#define KVM_PSCI_FN_CPU_ON KVM_PSCI_FN(2) -#define KVM_PSCI_FN_MIGRATE KVM_PSCI_FN(3) +#define KVM_PSCI_FN_CPU_SUSPEND PSCI_FN(KVM_PSCI_FN_BASE, 0) +#define KVM_PSCI_FN_CPU_OFF PSCI_FN(KVM_PSCI_FN_BASE, 1) +#define KVM_PSCI_FN_CPU_ON PSCI_FN(KVM_PSCI_FN_BASE, 2) +#define KVM_PSCI_FN_MIGRATE PSCI_FN(KVM_PSCI_FN_BASE, 3) -#define KVM_PSCI_RET_SUCCESS 0 -#define KVM_PSCI_RET_NI ((unsigned long)-1) -#define KVM_PSCI_RET_INVAL ((unsigned long)-2) -#define KVM_PSCI_RET_DENIED ((unsigned long)-3) +#define KVM_PSCI_RET_SUCCESS PSCI_RET_SUCCESS +#define KVM_PSCI_RET_NI PSCI_RET_NOT_SUPPORTED +#define KVM_PSCI_RET_INVAL PSCI_RET_INVALID_PARAMS +#define KVM_PSCI_RET_DENIED PSCI_RET_DENIED #endif /* __ARM_KVM_H__ */ diff --git a/linux-headers/asm-arm64/kvm.h b/linux-headers/asm-arm64/kvm.h index eaf54a3..9b67161 100644 --- a/linux-headers/asm-arm64/kvm.h +++ b/linux-headers/asm-arm64/kvm.h @@ -31,6 +31,7 @@ #define KVM_NR_SPSR 5 #ifndef __ASSEMBLY__ +#include #include #include @@ -77,6 +78,7 @@ struct kvm_regs { #define KVM_ARM_VCPU_POWER_OFF 0 /* CPU is started in OFF state */ #define KVM_ARM_VCPU_EL1_32BIT 1 /* CPU running a 32bit VM */ +#define KVM_ARM_VCPU_PSCI_0_2 2 /* CPU uses PSCI v0.2 */ struct kvm_vcpu_init { __u32 target; @@ -177,19 +179,18 @@ struct kvm_arch_memory_slot { /* Highest supported SPI, from VGIC_NR_IRQS */ #define KVM_ARM_IRQ_GIC_MAX 127 -/* PSCI interface */ +/* PSCI v0.1 interface */ #define KVM_PSCI_FN_BASE 0x95c1ba5e -#define KVM_PSCI_FN(n) (KVM_PSCI_FN_BASE + (n)) -#define KVM_PSCI_FN_CPU_SUSPEND KVM_PSCI_FN(0) -#define KVM_PSCI_FN_CPU_OFF KVM_PSCI_FN(1) -#define KVM_PSCI_FN_CPU_ON KVM_PSCI_FN(2) -#define KVM_PSCI_FN_MIGRATE KVM_PSCI_FN(3) +#define KVM_PSCI_FN_CPU_SUSPEND PSCI_FN(KVM_PSCI_FN_BASE, 0) +#define KVM_PSCI_FN_CPU_OFF PSCI_FN(KVM_PSCI_FN_BASE, 1) +#define KVM_PSCI_FN_CPU_ON PSCI_FN(KVM_PSCI_FN_BASE, 2) +#define KVM_PSCI_FN_MIGRATE PSCI_FN(KVM_PSCI_FN_BASE, 3) -#define KVM_PSCI_RET_SUCCESS 0 -#define KVM_PSCI_RET_NI ((unsigned long)-1) -#define KVM_PSCI_RET_INVAL ((unsigned long)-2) -#define KVM_PSCI_RET_DENIED ((unsigned long)-3) +#define KVM_PSCI_RET_SUCCESS PSCI_RET_SUCCESS +#define KVM_PSCI_RET_NI PSCI_RET_NOT_SUPPORTED +#define KVM_PSCI_RET_INVAL PSCI_RET_INVALID_PARAMS +#define KVM_PSCI_RET_DENIED PSCI_RET_DENIED #endif diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h index e27a4b3..fa4a2f7 100644 --- a/linux-headers/linux/kvm.h +++ b/linux-headers/linux/kvm.h @@ -171,6 +171,7 @@ struct kvm_pit_config { #define KVM_EXIT_WATCHDOG 21 #define KVM_EXIT_S390_TSCH 22 #define KVM_EXIT_EPR 23 +#define KVM_EXIT_SYSTEM_EVENT 24 /* For KVM_EXIT_INTERNAL_ERROR */ /* Emulate instruction failed. */ @@ -301,6 +302,13 @@ struct kvm_run { struct { __u32 epr; } epr; + /* KVM_EXIT_SYSTEM_EVENT */ + struct { +#define KVM_SYSTEM_EVENT_SHUTDOWN 1 +#define KVM_SYSTEM_EVENT_RESET 2 + __u32 type; + __u64 flags; + } system_event; /* Fix the size of the union. */ char padding[256]; }; @@ -740,6 +748,8 @@ struct kvm_ppc_smmu_info { #define KVM_CAP_SPAPR_MULTITCE 94 #define KVM_CAP_EXT_EMUL_CPUID 95 #define KVM_CAP_HYPERV_TIME 96 +#define KVM_CAP_IOAPIC_POLARITY_IGNORED 97 +#define KVM_CAP_ARM_PSCI_0_2 98 #ifdef KVM_CAP_IRQ_ROUTING diff --git a/linux-headers/linux/psci.h b/linux-headers/linux/psci.h new file mode 100644 index 0000000..41f727e --- /dev/null +++ b/linux-headers/linux/psci.h @@ -0,0 +1,55 @@ +/* + * ARM Power State and Coordination Interface (PSCI) header + * + * This header holds common PSCI defines and macros shared by: + * ARM kernel, ARM64 kernel, KVM ARM/ARM64 and user space. + * + * Copyright (C) 2014 Anup Patel + */ + +#ifndef _UAPI_LINUX_PSCI_H +#define _UAPI_LINUX_PSCI_H + +/* PSCI v0.1 interface */ +#define PSCI_FN(base, n) ((base) + (n)) + +#define PSCI_FN_CPU_SUSPEND(base) PSCI_FN(base, 0) +#define PSCI_FN_CPU_OFF(base) PSCI_FN(base, 1) +#define PSCI_FN_CPU_ON(base) PSCI_FN(base, 2) +#define PSCI_FN_MIGRATE(base) PSCI_FN(base, 3) + +/* PSCI v0.2 interface */ +#define PSCI_0_2_FN_BASE 0x84000000 +#define PSCI_0_2_FN(n) (PSCI_0_2_FN_BASE + (n)) +#define PSCI_0_2_FN64_BASE 0xC4000000 +#define PSCI_0_2_FN64(n) (PSCI_0_2_FN64_BASE + (n)) + +#define PSCI_0_2_FN_PSCI_VERSION PSCI_0_2_FN(0) +#define PSCI_0_2_FN_CPU_SUSPEND PSCI_0_2_FN(1) +#define PSCI_0_2_FN_CPU_OFF PSCI_0_2_FN(2) +#define PSCI_0_2_FN_CPU_ON PSCI_0_2_FN(3) +#define PSCI_0_2_FN_AFFINITY_INFO PSCI_0_2_FN(4) +#define PSCI_0_2_FN_MIGRATE PSCI_0_2_FN(5) +#define PSCI_0_2_FN_MIGRATE_INFO_TYPE PSCI_0_2_FN(6) +#define PSCI_0_2_FN_MIGRATE_INFO_UP_CPU PSCI_0_2_FN(7) +#define PSCI_0_2_FN_SYSTEM_OFF PSCI_0_2_FN(8) +#define PSCI_0_2_FN_SYSTEM_RESET PSCI_0_2_FN(9) + +#define PSCI_0_2_FN64_CPU_SUSPEND PSCI_0_2_FN64(1) +#define PSCI_0_2_FN64_CPU_ON PSCI_0_2_FN64(3) +#define PSCI_0_2_FN64_AFFINITY_INFO PSCI_0_2_FN64(4) +#define PSCI_0_2_FN64_MIGRATE PSCI_0_2_FN64(5) +#define PSCI_0_2_FN64_MIGRATE_INFO_UP_CPU PSCI_0_2_FN64(7) + +/* PSCI return values */ +#define PSCI_RET_SUCCESS 0 +#define PSCI_RET_NOT_SUPPORTED ((unsigned long)-1) +#define PSCI_RET_INVALID_PARAMS ((unsigned long)-2) +#define PSCI_RET_DENIED ((unsigned long)-3) +#define PSCI_RET_ALREADY_ON ((unsigned long)-4) +#define PSCI_RET_ON_PENDING ((unsigned long)-5) +#define PSCI_RET_INTERNAL_FAILURE ((unsigned long)-6) +#define PSCI_RET_NOT_PRESENT ((unsigned long)-7) +#define PSCI_RET_DISABLED ((unsigned long)-8) + +#endif /* _UAPI_LINUX_PSCI_H */