From patchwork Tue Mar 31 15:08:00 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: 6131201 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 364D3BF4A6 for ; Tue, 31 Mar 2015 15:35:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7C50620148 for ; Tue, 31 Mar 2015 15:35:02 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8F645200E8 for ; Tue, 31 Mar 2015 15:35:01 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ycy8S-0005hB-Vj; Tue, 31 Mar 2015 15:31:25 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ycy3Y-0001zO-UE for linux-arm-kernel@bombadil.infradead.org; Tue, 31 Mar 2015 15:26:21 +0000 Received: from static.88-198-71-155.clients.your-server.de ([88.198.71.155] helo=socrates.bennee.com) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ycxml-0002hO-1Z for linux-arm-kernel@lists.infradead.org; Tue, 31 Mar 2015 15:08:59 +0000 Received: from localhost ([127.0.0.1] helo=zen.linaroharston) by socrates.bennee.com with esmtp (Exim 4.80) (envelope-from ) id 1YcysQ-0005gI-8o; Tue, 31 Mar 2015 18:18:54 +0200 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, christoffer.dall@linaro.org, marc.zyngier@arm.com, peter.maydell@linaro.org, agraf@suse.de, drjones@redhat.com, pbonzini@redhat.com, zhichao.huang@linaro.org Subject: [PATCH v2 02/10] KVM: define common __KVM_GUESTDBG_USE_SW/HW_BP values Date: Tue, 31 Mar 2015 16:08:00 +0100 Message-Id: <1427814488-28467-3-git-send-email-alex.bennee@linaro.org> X-Mailer: git-send-email 2.3.4 In-Reply-To: <1427814488-28467-1-git-send-email-alex.bennee@linaro.org> References: <1427814488-28467-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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150331_160859_105135_F4119E26 X-CRM114-Status: GOOD ( 12.68 ) X-Spam-Score: -1.2 (-) Cc: "maintainer:X86 ARCHITECTURE..." , Benjamin Herrenschmidt , Alexey Kardashevskiy , Nadav Amit , Gleb Natapov , jan.kiszka@siemens.com, "H. Peter Anvin" , "open list:LINUX FOR POWERPC..." , "open list:ABI/API" , open list , Bharat Bhushan , dahi@linux.vnet.ibm.com, Ingo Molnar , Paul Mackerras , Michael Ellerman , r65777@freescale.com, Mihai Caraman , Thomas Gleixner , bp@suse.de, =?UTF-8?q?Alex=20Benn=C3=A9e?= X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently x86, powerpc and soon arm64 use the same two architecture specific bits for guest debug support for software and hardware breakpoints. This makes the shared values explicit while leaving the gate open for another architecture to use some other value if they really really want to. Signed-off-by: Alex Bennée Reviewed-by: Andrew Jones diff --git a/arch/powerpc/include/uapi/asm/kvm.h b/arch/powerpc/include/uapi/asm/kvm.h index ab4d473..1731569 100644 --- a/arch/powerpc/include/uapi/asm/kvm.h +++ b/arch/powerpc/include/uapi/asm/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/arch/x86/include/uapi/asm/kvm.h b/arch/x86/include/uapi/asm/kvm.h index d7dcef5..1438202 100644 --- a/arch/x86/include/uapi/asm/kvm.h +++ b/arch/x86/include/uapi/asm/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/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index 5eedf84..ce2db14 100644 --- a/include/uapi/linux/kvm.h +++ b/include/uapi/linux/kvm.h @@ -525,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;