From mboxrd@z Thu Jan 1 00:00:00 1970 From: Razvan Cojocaru Subject: Re: [PATCH 4/5] xen/vm_event: Deny MSR writes if refused by vm_event reply Date: Mon, 11 May 2015 10:44:37 +0300 Message-ID: <55505DE5.9040408@bitdefender.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> <555070790200007800078B74@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <555070790200007800078B74@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: kevin.tian@intel.com, wei.liu2@citrix.com, ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com, andrew.cooper3@citrix.com, tim@xen.org, xen-devel@lists.xen.org, eddie.dong@intel.com, Aravind.Gopalakrishnan@amd.com, jun.nakajima@intel.com, suravee.suthikulpanit@amd.com, boris.ostrovsky@oracle.com, keir@xen.org, ian.jackson@eu.citrix.com List-Id: xen-devel@lists.xenproject.org On 05/11/2015 10:03 AM, Jan Beulich wrote: >>>> 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). All clear now. Thanks, Razvan