From: "Jan Beulich" Subject: Re: [PATCH 4/5] xen/vm_event: Deny MSR writes if refused by vm_event reply Date: Mon, 11 May 2015 08:03:53 +0100 Message-ID: <555070790200007800078B74@mail.emea.novell.com> References: <1430932352-4289-1-git-send-email-rcojocaru@bitdefender.com> <1430932352-4289-5-git-send-email-rcojocaru@bitdefender.com> <554CFF260200007800078743@mail.emea.novell.com> <554CECE6.1010307@bitdefender.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <554CECE6.1010307@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 Cc: tim@xen.org, kevin.tian@intel.com, wei.liu2@citrix.com, ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com, jun.nakajima@intel.com, andrew.cooper3@citrix.com, ian.jackson@eu.citrix.com, xen-devel@lists.xen.org, eddie.dong@intel.com, Aravind.Gopalakrishnan@amd.com, suravee.suthikulpanit@amd.com, keir@xen.org, boris.ostrovsky@oracle.com List-Id: xen-devel@lists.xenproject.org >>> On 08.05.15 at 19:05, wrote: > On 05/08/2015 07:23 PM, Jan Beulich wrote: >>>>> On 06.05.15 at 19:12, wrote: >>> --- a/xen/include/asm-x86/domain.h >>> +++ b/xen/include/asm-x86/domain.h >>> @@ -518,6 +518,11 @@ struct arch_vcpu >>> struct vm_event_emul_read_data emul_read_data; >>> } vm_event; >>> >>> + struct { >>> + bool_t do_write; >>> + uint64_t msr; >>> + uint64_t value; >>> + } msr_write; >>> }; >> >> Again a growth of struct vcpu by 24 bytes for everyone even though >> quite likely only very few VMs would actually need this. To be honest >> I'd even be hesitant to accept a pointer addition here. Perhaps this >> should be a suitably sized, dynamically allocated array hanging off of >> struct domain? > > Sorry, I don't follow the dynamically allocated _array_ part. Could you > please give a small example of what you mean? Have a pointer in struct arch_domain which gets populated only when needed, and if so by an array allocation with the array dimension being the maximum number of vCPU-s the domain may have. That way the memory overhead for non-monitored domains is a pointer per domain (as opposed to quite a bit more unused space per vCPU). Jan