From patchwork Fri May 15 14:27:05 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: 6414671 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B89A19F318 for ; Fri, 15 May 2015 14:31:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D0CD220396 for ; Fri, 15 May 2015 14:31:29 +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 228132052D for ; Fri, 15 May 2015 14:31:28 +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 1YtGbq-0004EO-3k; Fri, 15 May 2015 14:29:06 +0000 Received: from merlin.infradead.org ([2001:4978:20e::2]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YtGa6-0003Ku-Ne for linux-arm-kernel@bombadil.infradead.org; Fri, 15 May 2015 14:27:18 +0000 Received: from static.88-198-71-155.clients.your-server.de ([88.198.71.155] helo=socrates.bennee.com) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YtGa4-0004eR-2I for linux-arm-kernel@lists.infradead.org; Fri, 15 May 2015 14:27:17 +0000 Received: from localhost ([127.0.0.1] helo=zen.linaroharston) by socrates.bennee.com with esmtp (Exim 4.80) (envelope-from ) id 1YtHqI-0000D4-B8; Fri, 15 May 2015 17:48:06 +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 v4 02/12] KVM: define common KVM_GUESTDBG_USE_SW/HW_BP bits Date: Fri, 15 May 2015 15:27:05 +0100 Message-Id: <1431700035-23479-3-git-send-email-alex.bennee@linaro.org> X-Mailer: git-send-email 2.3.5 In-Reply-To: <1431700035-23479-1-git-send-email-alex.bennee@linaro.org> References: <1431700035-23479-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-20150515_102716_226310_05D2BB14 X-CRM114-Status: GOOD ( 11.97 ) X-Spam-Score: -1.2 (-) Cc: Tony Krowiak , Alexey Kardashevskiy , Benjamin Herrenschmidt , Heiko Carstens , Bharat Bhushan , Paul Mackerras , "H. Peter Anvin" , "open list:S390" , Michael Mueller , Nadav Amit , Michael Ellerman , "maintainer:X86 ARCHITECTURE..." , Christian Borntraeger , Ingo Molnar , "Jason J. Herne" , jan.kiszka@siemens.com, Mihai Caraman , bp@suse.de, Gleb Natapov , r65777@freescale.com, Cornelia Huck , Thomas Gleixner , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Eric Farman , "open list:ABI/API" , open list , Dominik Dingel , dahi@linux.vnet.ibm.com, Martin Schwidefsky , "supporter:S390" , "open list:LINUX FOR POWERPC..." 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. Signed-off-by: Alex Bennée Reviewed-by: Andrew Jones - v4 - claim more bits for the common functionality v5 - don't use __ mechanism to move values common diff --git a/arch/powerpc/include/uapi/asm/kvm.h b/arch/powerpc/include/uapi/asm/kvm.h index ab4d473..6ea24a5 100644 --- a/arch/powerpc/include/uapi/asm/kvm.h +++ b/arch/powerpc/include/uapi/asm/kvm.h @@ -307,11 +307,9 @@ struct kvm_guest_debug_arch { /* Debug related defines */ /* * kvm_guest_debug->control is a 32 bit field. The lower 16 bits are generic - * and upper 16 bits are architecture specific. Architecture specific defines + * and upper 14 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 /* definition of registers in kvm_run */ struct kvm_sync_regs { diff --git a/arch/s390/include/uapi/asm/kvm.h b/arch/s390/include/uapi/asm/kvm.h index ef1a5fc..aca4f86 100644 --- a/arch/s390/include/uapi/asm/kvm.h +++ b/arch/s390/include/uapi/asm/kvm.h @@ -114,8 +114,6 @@ struct kvm_fpu { __u64 fprs[16]; }; -#define KVM_GUESTDBG_USE_HW_BP 0x00010000 - #define KVM_HW_BP 1 #define KVM_HW_WP_WRITE 2 #define KVM_SINGLESTEP 4 diff --git a/arch/x86/include/uapi/asm/kvm.h b/arch/x86/include/uapi/asm/kvm.h index d7dcef5..ca51d4c 100644 --- a/arch/x86/include/uapi/asm/kvm.h +++ b/arch/x86/include/uapi/asm/kvm.h @@ -250,8 +250,6 @@ struct kvm_debug_exit_arch { __u64 dr7; }; -#define KVM_GUESTDBG_USE_SW_BP 0x00010000 -#define KVM_GUESTDBG_USE_HW_BP 0x00020000 #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 70ac641..7c5dd11 100644 --- a/include/uapi/linux/kvm.h +++ b/include/uapi/linux/kvm.h @@ -570,8 +570,10 @@ struct kvm_s390_irq_state { /* 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) +#define KVM_GUESTDBG_USE_SW_BP (1 << 16) +#define KVM_GUESTDBG_USE_HW_BP (1 << 17) struct kvm_guest_debug { __u32 control;