From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Jones Subject: Re: [PATCH 2/7] KVM: arm: guest debug, define API headers Date: Wed, 26 Nov 2014 18:47:33 +0100 Message-ID: <20141126174732.GH3245@hawk.usersys.redhat.com> References: <1416931805-23223-1-git-send-email-alex.bennee@linaro.org> <1416931805-23223-3-git-send-email-alex.bennee@linaro.org> <20141126143122.GB3245@hawk.usersys.redhat.com> <87sih6knzr.fsf@linaro.org> <547603CD.6060708@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Alex =?iso-8859-1?Q?Benn=E9e?= , 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, Catalin Marinas , jan.kiszka@siemens.com, Will Deacon , open list , dahi@linux.vnet.ibm.com, r65777@freescale.com, bp@suse.de To: Paolo Bonzini Return-path: Content-Disposition: inline In-Reply-To: <547603CD.6060708@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On Wed, Nov 26, 2014 at 05:46:05PM +0100, Paolo Bonzini wrote: >=20 >=20 > On 26/11/2014 15:58, Alex Benn=E9e wrote: > >=20 > > Andrew Jones writes: > >=20 > >> On Tue, Nov 25, 2014 at 04:10:00PM +0000, Alex Benn=E9e wrote: > >>> This commit defines the API headers for guest debugging. There ar= e two > >>> architecture specific debug structures: > > > >>> +/* Architecture related debug defines - upper 16 bits of > >>> + * kvm_guest_debug->control > >>> + */ > >>> +#define KVM_GUESTDBG_USE_SW_BP_SHIFT 16 > >>> +#define KVM_GUESTDBG_USE_SW_BP (1 << KVM_GUESTDBG_USE_SW_BP_SHI= =46T) > >>> +#define KVM_GUESTDBG_USE_HW_BP_SHIFT 17 > >>> +#define KVM_GUESTDBG_USE_HW_BP (1 << KVM_GUESTDBG_USE_HW_BP_SHI= =46T) > >>> + > >> > >> I see this are defined in arch/x86/include/uapi/asm/kvm.h, > >> so you needed to reproduce them here, but shouldn't they > >> be promoted to include/uapi/linux/kvm.h instead? > >=20 > > Well if we move them to common uapi we either restrict the $ARCH > > specific options that don't have SW/HW BKPTS (would be weird but...= ) or > > make them generic in the lower 16 bits (breaks API). > >=20 > > But in principle I have no objection if other don't. >=20 > I think it's a matter of personal taste. "Architecture-specific" mea= ns > "not all architectures may support it", but it's certainly a good ide= a > to reuse the same value if multiple architectures do support a #defin= e. >=20 > What you did is fine, another possibility is to do >=20 > #define __KVM_GUESTDBG_USE_SW_BP (1 << 16) >=20 > in include/uapi/linux/kvm.h, and >=20 > #define KVM_GUESTDBG_USE_SW_BP __KVM_GUESTDBG_USE_SW_BP >=20 > in the arch-specific file. Andrew, is this closer to what you intend= ed? > I just reread Documentation/virtual/kvm/api.txt a bit more closely and see that these fall in the "architecture specific control" region of th= e field. So forget what I said. But your suggestion of __KVM_GUESTDBG_USE= _SW_BP looks like a good idea to me. drew