From mboxrd@z Thu Jan 1 00:00:00 1970 From: Brijesh Singh Subject: Re: [PATCH v5 01/23] memattrs: add debug attribute Date: Fri, 8 Dec 2017 16:57:13 -0600 Message-ID: <053109e5-3b12-b76c-7d87-5f1e4941ebed@amd.com> References: <20171206200346.116537-1-brijesh.singh@amd.com> <20171206200346.116537-2-brijesh.singh@amd.com> <7e7b6c05-68de-c4f8-6163-53588a6d545e@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: brijesh.singh@amd.com, QEMU Developers , Alistair Francis , Christian Borntraeger , Cornelia Huck , "Daniel P . Berrange" , "Dr. David Alan Gilbert" , "Edgar E . Iglesias" , Eduardo Habkost , Eric Blake , kvm-devel , Marcel Apfelbaum , Markus Armbruster , "Michael S. Tsirkin" , Paolo Bonzini , Peter Crosthwaite , Richard Henderson , Richard Henderson , Stefan Hajnoczi Return-path: Received: from mail-by2nam03on0054.outbound.protection.outlook.com ([104.47.42.54]:27456 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752662AbdLHW5Y (ORCPT ); Fri, 8 Dec 2017 17:57:24 -0500 In-Reply-To: Content-Language: en-US Sender: kvm-owner@vger.kernel.org List-ID: On 12/8/17 3:55 AM, Peter Maydell wrote: >> If you give me example on how >> to trigger this type of request with debug=1 then I can look into the code >> and see what we can do when memory encryption is enabled. The things like >> read-clears-bits semantics will be tricky. > The question was really whether we want to make this a general > indicator of "this operation was triggered by a debugger" and > expand that to mean "don't do things that mess with the state > of the simulation unexpectedly", or if this is really a very > encrypted-memory specific thing. It can be used as a generic indicator that operation was triggered by a debugger. There is not anything encryption specific. Having said that, in the current patch series I have been only focused on making it work from the gdbstub and HMP point of view. The debug=1 from gdbstub and HMP is tested on both encrypted and non-encrypted guest. If we decide to extend to support other callers (device model etc) then we may need to update memory load/store functions defined in memory_ldst_inc.c to work with debug=1. > By the way, I don't think this: > >> /* Access the guest memory for debug purposes */ >> #define MEMTXATTRS_DEBUG ((MemTxAttrs) { .debug = 1 }) > is a great idea. Callers that care about the transaction > attributes should just specify them properly. MEMTXATTRS_UNSPECIFIED > is a fallback for the large set of places that don't care at all. OK, I will drop the macro and update the patches in the series to set MemTxAttr.debug = 1 when we do debugger request.  thanks --Brijesh