From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex =?utf-8?Q?Benn=C3=A9e?= Subject: Re: Exposing host debug capabilities to userspace Date: Mon, 24 Nov 2014 13:59:51 +0000 Message-ID: <87a93gn1go.fsf@linaro.org> References: <87mw7l3j7x.fsf@linaro.org> <87egssn91o.fsf@zen.linaro.local.i-did-not-set--mail-host-address--so-tickle-me> <87d28cn84s.fsf@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: kvmarm@lists.cs.columbia.edu, KVM devel mailing list To: Will Deacon , Marc Zyngier , Christoffer Dall , Peter Maydell , Paolo Bonzini , Alexander Graf Return-path: Received: from static.88-198-71-155.clients.your-server.de ([88.198.71.155]:38137 "EHLO socrates.bennee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751005AbaKXN7r (ORCPT ); Mon, 24 Nov 2014 08:59:47 -0500 In-reply-to: <87d28cn84s.fsf@linaro.org> Sender: kvm-owner@vger.kernel.org List-ID: Alex Benn=C3=A9e writes: > Alex Benn=C3=A9e writes: > >> Hi, >> >> I've almost finished the ARMv8 guest debug support but I have one >> problem left to solve. userspace needs to know how many hardware deb= ug >> registers are available for GDB to use. This information is availabl= e >> from the ID_AA64DFR0_EL1 register. >> So far the options I've examined are: >> >> * KVM ioctl GET_ONE_REG(ID_AA64DFR0_EL1) >> * ptrace(PTRACE_GETREGSET, NT_ARM_HW_WATCH) >> * KVM ioctl KVM_GET_DEBUGREGS >> * Export the information via sysfs >> * Expand /proc/cpuinfo >> * Add another KVM ioctl? Alexander Graf pointed out that KVM_CHECK_EXTENSION can return any positive number for success. How about using: max_hw_bps =3D kvm_check_extension(kvm_state, KVM_CAP_GUEST_DEBUG_HW_BP= S); max_hw_wps =3D kvm_check_extension(kvm_state, KVM_CAP_GUEST_DEBUG_HW_WP= S); Seems pretty sane, doesn't change the semantics of an API and is architecture agnostic if others need the number? --=20 Alex Benn=C3=A9e