From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH 2/2] x86/hvm: Don't intercept #UD exceptions in general Date: Wed, 27 Jan 2016 19:18:17 +0000 Message-ID: <56A917F9.4030003@citrix.com> References: <1453918273-23008-1-git-send-email-andrew.cooper3@citrix.com> <1453918273-23008-2-git-send-email-andrew.cooper3@citrix.com> <56A91122.50502@oracle.com> <56A91390.4030604@citrix.com> <56A91710.7010701@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <56A91710.7010701@oracle.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: Boris Ostrovsky , Xen-devel Cc: Suravee Suthikulpanit , Kevin Tian , Aravind Gopalakrishnan , Jun Nakajima , Jan Beulich List-Id: xen-devel@lists.xenproject.org On 27/01/16 19:14, Boris Ostrovsky wrote: > On 01/27/2016 01:59 PM, Andrew Cooper wrote: >> On 27/01/16 18:49, Boris Ostrovsky wrote: >>> On 01/27/2016 01:11 PM, Andrew Cooper wrote: >>>> diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c >>>> index 1d71216..1084e82 100644 >>>> --- a/xen/arch/x86/domctl.c >>>> +++ b/xen/arch/x86/domctl.c >>>> @@ -65,8 +65,20 @@ static void update_domain_cpuid_info(struct domain >>>> *d, >>>> .ecx = ctl->ecx >>>> } >>>> }; >>>> + int old_vendor = d->arch.x86_vendor; >>>> d->arch.x86_vendor = get_cpu_vendor(vendor_id.str, >>>> gcv_guest); >>>> + >>>> + if ( is_hvm_domain(d) && (d->arch.x86_vendor != old_vendor) ) >>>> + { >>>> + struct vcpu *v; >>>> + >>>> + domain_pause(d); >>>> + for_each_vcpu( d, v ) >>>> + hvm_update_guest_vendor(v); >>>> + domain_unpause(d); >>>> + } >>>> + >>>> break; >>>> } >>> Not specific to this patch, but shouldn't we pause/unpause domain for >>> the whole routine? >> Not specifically, although that might be better lonterm. >> >> In practice, this hypercall is only made as part of domain construction, >> and never at domain runtime. > > Is it safe to unpause a domain here if it is not running? Yes - all pausing/unpausing is reference counted, including the initial systemcontroller pause reference taken (on behalf of the toolstack domain) during the createdomain hypercall. ~Andrew