From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38431) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2My2-00088W-Ra for qemu-devel@nongnu.org; Wed, 11 Oct 2017 15:46:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e2Mxz-0002rZ-PH for qemu-devel@nongnu.org; Wed, 11 Oct 2017 15:46:58 -0400 Received: from mail-wm0-f44.google.com ([74.125.82.44]:54799) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e2Mxz-0002qv-Hx for qemu-devel@nongnu.org; Wed, 11 Oct 2017 15:46:55 -0400 Received: by mail-wm0-f44.google.com with SMTP id i124so7799838wmf.3 for ; Wed, 11 Oct 2017 12:46:54 -0700 (PDT) References: <62e835a4-ba5d-e620-47d2-180932a33426@redhat.com> <20171006135425.GF26575@redhat.com> <20171006140137.GH26575@redhat.com> <87h8v7lcan.fsf@dusky.pond.sub.org> <20171010080201.GB4177@dhcp-200-186.str.redhat.com> From: Paolo Bonzini Message-ID: <35705b3e-ccdd-c1af-2dd5-688a1c7e837a@redhat.com> Date: Wed, 11 Oct 2017 21:46:49 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Qemu-block] Patch to add helpful tracing output for driver authors in NVMe emulation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell , Kevin Wolf Cc: Qemu-block , qemu-devel , Doug Gale , Markus Armbruster , Max Reitz , Keith Busch On 11/10/2017 15:08, Peter Maydell wrote: >> Tracing is the right tool to detect bad guest code, and I think it makes >> sense to mark conditions that shouldn't happen with a correctly >> operating guest driver. I'm not sure if an exclamation mark is the best >> syntax for this, because I wouldn't have intuitively understood what >> it's supposed to tell me. > We have qemu_log_mask(LOG_GUEST_ERROR, ...) for logging guest errors, > so I think we should use that. LOG_GUEST_ERROR is something different too. It means something that is undefined according to the data sheet more or less, such as accessing a non-existent reference. Here the driver does some validation of the values that were written in the registers, and tells the guest if the validation fails (by putting something in another registers). Using a tracepoint sounds like the right thing to do. Paolo