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: 46592 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B74BD216E5 for ; Tue, 31 Mar 2015 15:12:58 +0000 (UTC) Received: by lbfb1 with SMTP id b1sf4439627lbf.2 for ; Tue, 31 Mar 2015 08:12:57 -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:cc:subject:date:message-id :in-reply-to:references:mime-version:content-type :content-transfer-encoding:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=LUQTdIU1XHY3wQcq6iF11BOfhlWMnUZv5rRDsSaSsDc=; b=Rq2Oc7d8zVQGaZEvzaHD/0a6+ca92fba4D0KgcVlVlJdN0VXNvqo9m/pby6Q3YUR34 G6MP87d1BHM0cyGbpHWJns//uvjZuBhHJzMDii/W+tQo6rAGBO8b/rcNjiK0t8ejgMNr RrJqL3Ope6dQT5T4yBW3Z80AJUMil7Qgz31r0NCBjDNDa61CWu2iNmvEtr6hr1t6DNmi SFWWrbfRLl3uctEwjoOG89VHvWMMEvO5rR3w/U6SCi9GLiyBxbonubkg5MIRaiNt++NH R885/Fg5/BWRKNND85yUZfnH3EatVmjbXe+We3w697WLGBQa6vbhAlrAiu4Li8SteFqX dXGg== X-Gm-Message-State: ALoCoQnEcykhKP6go2Rin9zOvyMXwFzR0j7RHf4W0sEyiOxdKKjKDPaJgHwp3V/mOKANHKQKgNNP X-Received: by 10.180.101.39 with SMTP id fd7mr814722wib.0.1427814777791; Tue, 31 Mar 2015 08:12:57 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.22.164 with SMTP id e4ls200270laf.18.gmail; Tue, 31 Mar 2015 08:12:57 -0700 (PDT) X-Received: by 10.112.163.229 with SMTP id yl5mr31111082lbb.60.1427814777523; Tue, 31 Mar 2015 08:12:57 -0700 (PDT) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com. [209.85.215.51]) by mx.google.com with ESMTPS id z10si9376384laa.33.2015.03.31.08.12.57 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 31 Mar 2015 08:12:57 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) client-ip=209.85.215.51; Received: by labe2 with SMTP id e2so15127384lab.3 for ; Tue, 31 Mar 2015 08:12:57 -0700 (PDT) X-Received: by 10.112.29.36 with SMTP id g4mr23317788lbh.56.1427814777271; Tue, 31 Mar 2015 08:12:57 -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 k9csp47232lbq; Tue, 31 Mar 2015 08:12:56 -0700 (PDT) X-Received: by 10.70.21.227 with SMTP id y3mr39281640pde.101.1427814772946; Tue, 31 Mar 2015 08:12:52 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ac10si19804452pac.147.2015.03.31.08.12.51; Tue, 31 Mar 2015 08:12:52 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754657AbbCaPJ7 (ORCPT + 27 others); Tue, 31 Mar 2015 11:09:59 -0400 Received: from static.88-198-71-155.clients.your-server.de ([88.198.71.155]:48150 "EHLO socrates.bennee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751830AbbCaPJg (ORCPT ); Tue, 31 Mar 2015 11:09:36 -0400 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 Cc: jan.kiszka@siemens.com, dahi@linux.vnet.ibm.com, r65777@freescale.com, bp@suse.de, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org (maintainer:X86 ARCHITECTURE...), Gleb Natapov , Bharat Bhushan , Alexey Kardashevskiy , Mihai Caraman , Nadav Amit , linuxppc-dev@lists.ozlabs.org (open list:LINUX FOR POWERPC...), linux-kernel@vger.kernel.org (open list), linux-api@vger.kernel.org (open list:ABI/API) 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.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.215.51 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 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 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;