From: "Jan Beulich" Subject: Re: [PATCH V3 3/3] xen/vm_event: Deny register writes if refused by vm_event reply Date: Tue, 07 Jul 2015 14:42:00 +0100 Message-ID: <559BF348020000780008D7D9@mail.emea.novell.com> References: <1436197873-4559-1-git-send-email-rcojocaru@bitdefender.com> <1436197873-4559-4-git-send-email-rcojocaru@bitdefender.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1436197873-4559-4-git-send-email-rcojocaru@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: jun.nakajima@intel.com, kevin.tian@intel.com, wei.liu2@citrix.com, ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com, george.dunlap@eu.citrix.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, tlengyel@novetta.com, keir@xen.org, boris.ostrovsky@oracle.com List-Id: xen-devel@lists.xenproject.org >>> On 06.07.15 at 17:51, wrote: > @@ -443,6 +444,8 @@ void hvm_do_resume(struct vcpu *v) > struct domain *d = v->domain; > struct hvm_ioreq_server *s; > > + ASSERT(v == current); This seems rather pointless in this function - nothing would work if that wasn't the case. With that removed, Acked-by: Jan Beulich Also ... > @@ -468,6 +471,35 @@ void hvm_do_resume(struct vcpu *v) > } > } > > + if ( unlikely(d->arch.event_write_data) ) > + { > + struct monitor_write_data *w = &d->arch.event_write_data[v->vcpu_id]; > + > + if ( w->do_write.msr ) > + { > + hvm_msr_write_intercept(w->msr, w->value, 0); > + w->do_write.msr = 0; > + } > + > + if ( w->do_write.cr0 ) > + { > + hvm_set_cr0(w->cr0, 0); > + w->do_write.cr0 = 0; > + } > + > + if ( w->do_write.cr4 ) > + { > + hvm_set_cr4(w->cr4, 0); > + w->do_write.cr4 = 0; > + } > + > + if ( w->do_write.cr3 ) > + { > + hvm_set_cr3(w->cr3, 0); > + w->do_write.cr3 = 0; > + } > + } ... despite the CR ordering now being better, I continue to not be convinced of this model when it comes to multiple updates happening together. Yet that's not meant as a reason for the patch not to go in; it's just a (maybe only) theoretical issue I see, and that I would think _you_ want addressed. Jan