From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Egger Subject: Re: [PATCH] x86/AMD: Add support for AMD's OSVW feature in guests Date: Tue, 31 Jan 2012 11:36:07 +0100 Message-ID: <4F27C417.2070209@amd.com> References: <1361d9895cb17aa8fce1.1327943146@wotan.osrc.amd.com> <4F27CCE40200007800070120@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4F27CCE40200007800070120@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jan Beulich Cc: Boris Ostrovsky , xen-devel@lists.xensource.com, keir@xen.org List-Id: xen-devel@lists.xenproject.org On 01/31/12 11:13, Jan Beulich wrote: >> --- a/xen/arch/x86/platform_hypercall.c Thu Jan 26 17:43:31 2012 +0000 >> +++ b/xen/arch/x86/platform_hypercall.c Mon Jan 30 18:00:50 2012 +0100 >> @@ -166,7 +166,17 @@ ret_t do_platform_op(XEN_GUEST_HANDLE(xe >> break; >> >> guest_from_compat_handle(data, op->u.microcode.data); >> + >> + while ( !domctl_lock_acquire() ) > > It's not clear to me what you're trying to protect against here. I don't > think this prevents guests from making progress (and hence possibly > seeing the intermediate [and wrong] OSVW state between > svm_host_osvw_reset() and svm_host_osvw_init()). The reason is because when we allocated VCPUs (via XEN_DOMCTL_max_vcpus and possibly other controls) we call svm_vcpu_initialise() -> svm_guest_osvw_init(). If we are in the middle of microcode update then osvw_length/osvw_status may be in an inconsistent state. Christoph > Jan > >> + if ( hypercall_preempt_check() ) >> + { >> + ret = hypercall_create_continuation( >> + __HYPERVISOR_platform_op, "h", u_xenpf_op); >> + goto out; >> + } >> + >> ret = microcode_update(data, op->u.microcode.length); >> + domctl_lock_release(); >> } >> break; >> > > > -- ---to satisfy European Law for business letters: Advanced Micro Devices GmbH Einsteinring 24, 85689 Dornach b. Muenchen Geschaeftsfuehrer: Alberto Bozzo, Andrew Bowd Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen Registergericht Muenchen, HRB Nr. 43632