From: "Jan Beulich" Subject: Re: [PATCH 2/5] xen/vm_access: Support for memory-content hiding Date: Mon, 11 May 2015 08:50:25 +0100 Message-ID: <55507B610200007800078BB0@mail.emea.novell.com> References: <1430932352-4289-1-git-send-email-rcojocaru@bitdefender.com> <1430932352-4289-3-git-send-email-rcojocaru@bitdefender.com> <554CFB760200007800078703@mail.emea.novell.com> <554CE8FC.5040305@bitdefender.com> <554DAF57.3060105@bitdefender.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <554DAF57.3060105@bitdefender.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Razvan Cojocaru , Tamas K Lengyel Cc: Tim Deegan , Kevin Tian , "wei.liu2@citrix.com" , Ian Campbell , Stefano Stabellini , Jun Nakajima , Andrew Cooper , Ian Jackson , "xen-devel@lists.xen.org" , Eddie Dong , "Aravind.Gopalakrishnan@amd.com" , "suravee.suthikulpanit@amd.com" , Keir Fraser , Boris Ostrovsky List-Id: xen-devel@lists.xenproject.org >>> On 09.05.15 at 08:55, wrote: > On 05/09/2015 02:34 AM, Tamas K Lengyel wrote: >>>>> @@ -193,6 +200,11 @@ struct vm_event_xsetbv { >>>>> >>> uint64_t value; >>>>> >>> }; >>>>> >>> >>>>> >>> +struct vm_event_emul_read_data { >>>>> >>> + uint32_t size; >>>>> >>> + uint8_t data[164]; >>>> >> >>>> >> This number needs an explanation. >>> > >>> > It's less than the size of the x86_regs and enough for all the cases >>> > we've tested so far... >>> > >>> > >>> > Thanks, >>> > Razvan >> I feel like 164 bytes is really wasteful for all vm_events considering >> this would be useful only in a very specific subset of cases. Not sure >> what would be the right way to get around that.. Maybe having another >> hypercall (potentionally under memop?) place that buffer somewhere >> where Xen can access it before the vm_event response is processed? >> That would require two hypercalls to be issued by the monitoring >> domain, one to place the buffer and one for the event channel >> notification being sent to Xen to that the response is placed on the >> ring, but it might save space on the ring buffer for all other >> cases/users. > > How is it wasteful? Those bytes are in a union with the x86 registers > that are already in each vm_event request and response, and the size of > that buffer is smaller than the size of the x86 registers struct. As said elsewhere already (but just to clarify things here too) - the wastefulness isn't in the event structure, but in the addition of a field of this type to struct arch_vcpu. Jan