From patchwork Tue Mar 31 15:40:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 46601 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CC2ED2159A for ; Tue, 31 Mar 2015 15:42:30 +0000 (UTC) Received: by lbdc10 with SMTP id c10sf4629878lbd.0 for ; Tue, 31 Mar 2015 08:42:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding: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=klHqgn1E0IHMWtTBqwpcJiF1LEHBqvwF33SjUs0TrcM=; b=U9YoiFa2ou4SGmoLr9ZOYiN/J8QvJ74JtpKPkQK+or2vX79nC7cPflnpU6e3Di9i8K UtSR3Pbx43zEt87q9CzZ//jEC3E4aQBcHclBFhGdmEDmVrDpzNgK0MU0o3RyzLybjyAI 7aSV5d5kXhYsqNilVZdcorLHte/AgPsHnqOh7LJuwYFDlHgYMQdFN4i/8L+qzXFWoaOf 4884FdxdW3GiU+aKwsw4TWiAolJJOTHLKM1EiLJO7OsobpcD3TZNiCxWQHZvhp6rPABf X3blbI7+KoztTKnHM5mo1H8+55IMJvT2duC+WpOl5i5wEju+75n0UXVwxenWPjxYSGsO UjIw== X-Gm-Message-State: ALoCoQk/GdKQoMNnhe8RyDXTWT4BKh7ewJvAQN+2d1iqvj1T+9oSzW6qsvuJKHL0yQA+81zDhvNU X-Received: by 10.112.201.232 with SMTP id kd8mr677340lbc.16.1427816549769; Tue, 31 Mar 2015 08:42:29 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.115.211 with SMTP id jq19ls789221lab.32.gmail; Tue, 31 Mar 2015 08:42:29 -0700 (PDT) X-Received: by 10.152.1.70 with SMTP id 6mr31254615lak.83.1427816549534; Tue, 31 Mar 2015 08:42:29 -0700 (PDT) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com. [209.85.217.177]) by mx.google.com with ESMTPS id s12si9415527lbm.84.2015.03.31.08.42.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 31 Mar 2015 08:42:29 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) client-ip=209.85.217.177; Received: by lbcmq2 with SMTP id mq2so15567683lbc.0 for ; Tue, 31 Mar 2015 08:42:29 -0700 (PDT) X-Received: by 10.152.163.35 with SMTP id yf3mr4881695lab.86.1427816549101; Tue, 31 Mar 2015 08:42:29 -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.112.57.201 with SMTP id k9csp65711lbq; Tue, 31 Mar 2015 08:42:28 -0700 (PDT) X-Received: by 10.55.55.75 with SMTP id e72mr29950265qka.30.1427816547880; Tue, 31 Mar 2015 08:42:27 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [208.118.235.17]) by mx.google.com with ESMTPS id f198si14054762qka.3.2015.03.31.08.42.27 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 31 Mar 2015 08:42:27 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; Received: from localhost ([::1]:39268 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YcyJ9-0001iu-2M for patch@linaro.org; Tue, 31 Mar 2015 11:42:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42453) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YcyHv-0006rq-6W for qemu-devel@nongnu.org; Tue, 31 Mar 2015 11:41:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YcyHj-0004A4-1N for qemu-devel@nongnu.org; Tue, 31 Mar 2015 11:41:11 -0400 Received: from static.88-198-71-155.clients.your-server.de ([88.198.71.155]:54262 helo=socrates.bennee.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YcyHi-00049n-SH for qemu-devel@nongnu.org; Tue, 31 Mar 2015 11:40:58 -0400 Received: from localhost ([127.0.0.1] helo=zen.linaroharston) by socrates.bennee.com with esmtp (Exim 4.80) (envelope-from ) id 1YczNt-0005y0-Ht; Tue, 31 Mar 2015 18:51:25 +0200 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org, peter.maydell@linaro.org, christoffer.dall@linaro.org, zhichao.huang@linaro.org Date: Tue, 31 Mar 2015 16:40:43 +0100 Message-Id: <1427816446-31586-2-git-send-email-alex.bennee@linaro.org> X-Mailer: git-send-email 2.3.4 In-Reply-To: <1427816446-31586-1-git-send-email-alex.bennee@linaro.org> References: <1427816446-31586-1-git-send-email-alex.bennee@linaro.org> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: alex.bennee@linaro.org X-SA-Exim-Scanned: No (on socrates.bennee.com); SAEximRunCond expanded to false X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 88.198.71.155 Cc: marc.zyngier@arm.com, =?UTF-8?q?Alex=20Benn=C3=A9e?= , linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu Subject: [Qemu-devel] [PATCH v2 1/4] linux-headers: partial sync from my kernel tree (DEV) 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: alex.bennee@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) 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 I assume I'll properly merge the KVM Headers direct from Linux when done. These headers came from: https://git.linaro.org/people/alex.bennee/linux.git/shortlog/refs/heads/guest-debug/4.0-rc6-v2 Signed-off-by: Alex Bennée --- v2 - update ABI to include ->far diff --git a/linux-headers/asm-arm64/kvm.h b/linux-headers/asm-arm64/kvm.h index 3ef77a4..73f21e4 100644 --- a/linux-headers/asm-arm64/kvm.h +++ b/linux-headers/asm-arm64/kvm.h @@ -100,10 +100,25 @@ struct kvm_sregs { struct kvm_fpu { }; +/* + * See ARM ARM D7.3: Debug Registers + * + * The control registers are architecturally defined as 32 bits but are + * stored as 64 bit values along side the value registers and aligned + * with the rest 64 bit registers in the normal CPU context. + */ +#define KVM_ARM_NDBG_REGS 16 struct kvm_guest_debug_arch { + __u64 dbg_bcr[KVM_ARM_NDBG_REGS]; + __u64 dbg_bvr[KVM_ARM_NDBG_REGS]; + __u64 dbg_wcr[KVM_ARM_NDBG_REGS]; + __u64 dbg_wvr[KVM_ARM_NDBG_REGS]; }; struct kvm_debug_exit_arch { + __u64 pc; + __u32 hsr; + __u64 far; /* used for watchpoints */ }; struct kvm_sync_regs { @@ -207,4 +222,11 @@ struct kvm_arch_memory_slot { #endif +/* + * Architecture related debug defines - upper 16 bits of + * kvm_guest_debug->control + */ +#define KVM_GUESTDBG_USE_SW_BP __KVM_GUESTDBG_USE_SW_BP +#define KVM_GUESTDBG_USE_HW_BP __KVM_GUESTDBG_USE_HW_BP + #endif /* __ARM_KVM_H__ */ diff --git a/linux-headers/asm-powerpc/kvm.h b/linux-headers/asm-powerpc/kvm.h index ab4d473..1731569 100644 --- a/linux-headers/asm-powerpc/kvm.h +++ b/linux-headers/asm-powerpc/kvm.h @@ -310,8 +310,8 @@ struct kvm_guest_debug_arch { * and upper 16 bits are architecture specific. Architecture specific defines * that ioctl is for setting hardware breakpoint or software breakpoint. */ -#define KVM_GUESTDBG_USE_SW_BP 0x00010000 -#define KVM_GUESTDBG_USE_HW_BP 0x00020000 +#define KVM_GUESTDBG_USE_SW_BP __KVM_GUESTDBG_USE_SW_BP +#define KVM_GUESTDBG_USE_HW_BP __KVM_GUESTDBG_USE_HW_BP /* definition of registers in kvm_run */ struct kvm_sync_regs { diff --git a/linux-headers/asm-x86/kvm.h b/linux-headers/asm-x86/kvm.h index d7dcef5..1438202 100644 --- a/linux-headers/asm-x86/kvm.h +++ b/linux-headers/asm-x86/kvm.h @@ -250,8 +250,8 @@ struct kvm_debug_exit_arch { __u64 dr7; }; -#define KVM_GUESTDBG_USE_SW_BP 0x00010000 -#define KVM_GUESTDBG_USE_HW_BP 0x00020000 +#define KVM_GUESTDBG_USE_SW_BP __KVM_GUESTDBG_USE_SW_BP +#define KVM_GUESTDBG_USE_HW_BP __KVM_GUESTDBG_USE_HW_BP #define KVM_GUESTDBG_INJECT_DB 0x00040000 #define KVM_GUESTDBG_INJECT_BP 0x00080000 diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h index 60a54c8..fa6c2ac 100644 --- a/linux-headers/linux/kvm.h +++ b/linux-headers/linux/kvm.h @@ -226,6 +226,7 @@ struct kvm_run { __u32 count; __u64 data_offset; /* relative to kvm_run start */ } io; + /* KVM_EXIT_DEBUG */ struct { struct kvm_debug_exit_arch arch; } debug; @@ -274,6 +275,7 @@ struct kvm_run { __u32 data; __u8 is_write; } dcr; + /* KVM_EXIT_INTERNAL_ERROR */ struct { __u32 suberror; /* Available with KVM_CAP_INTERNAL_ERROR_DATA: */ @@ -284,6 +286,7 @@ struct kvm_run { struct { __u64 gprs[32]; } osi; + /* KVM_EXIT_PAPR_HCALL */ struct { __u64 nr; __u64 ret; @@ -522,8 +525,16 @@ struct kvm_s390_irq { /* for KVM_SET_GUEST_DEBUG */ -#define KVM_GUESTDBG_ENABLE 0x00000001 -#define KVM_GUESTDBG_SINGLESTEP 0x00000002 +#define KVM_GUESTDBG_ENABLE (1 << 0) +#define KVM_GUESTDBG_SINGLESTEP (1 << 1) + +/* + * Architecture specific stuff uses the top 16 bits of the field, + * however there is some shared commonality for the common cases + */ +#define __KVM_GUESTDBG_USE_SW_BP (1 << 16) +#define __KVM_GUESTDBG_USE_HW_BP (1 << 17) + struct kvm_guest_debug { __u32 control; @@ -760,6 +771,8 @@ struct kvm_ppc_smmu_info { #define KVM_CAP_PPC_ENABLE_HCALL 104 #define KVM_CAP_CHECK_EXTENSION_VM 105 #define KVM_CAP_S390_USER_SIGP 106 +#define KVM_CAP_GUEST_DEBUG_HW_BPS 107 +#define KVM_CAP_GUEST_DEBUG_HW_WPS 108 #ifdef KVM_CAP_IRQ_ROUTING