All of lore.kernel.org
 help / color / mirror / Atom feed
From: Keir Fraser <keir.xen@gmail.com>
To: Christoph Egger <Christoph.Egger@amd.com>,
	Jan Beulich <JBeulich@suse.com>
Cc: Boris Ostrovsky <boris.ostrovsky@amd.com>, xen-devel@lists.xensource.com
Subject: Re: [PATCH] x86/AMD: Add support for AMD's OSVW feature in guests
Date: Tue, 31 Jan 2012 10:39:20 +0000	[thread overview]
Message-ID: <CB4D7558.2A12B%keir.xen@gmail.com> (raw)
In-Reply-To: <4F27C417.2070209@amd.com>

On 31/01/2012 10:36, "Christoph Egger" <Christoph.Egger@amd.com> wrote:

> 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.

Deserves a code comment. Even better, deserves its own synchronisation
(e.g., your own specific lock for this purpose). It would be nice to avoid
further intricate dependencies on the big domctl lock, so we can consider
removing it in future.

 -- Keir

> 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;
>>> 
>> 
>> 
>> 
> 

  reply	other threads:[~2012-01-31 10:39 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-30 17:05 [PATCH] x86/AMD: Add support for AMD's OSVW feature in guests Boris Ostrovsky
2012-01-31 10:13 ` Jan Beulich
2012-01-31 10:36   ` Christoph Egger
2012-01-31 10:39     ` Keir Fraser [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-01-16 21:11 Boris Ostrovsky
2012-01-17  8:26 ` Jan Beulich
2012-01-17 17:54   ` Boris Ostrovsky
2012-01-18  9:50     ` Jan Beulich
2012-01-18 18:26       ` Boris Ostrovsky
2012-01-19  8:10         ` Jan Beulich
2012-01-19  8:46           ` Keir Fraser
2012-01-19 15:57             ` Boris Ostrovsky
2012-01-19 15:22           ` Boris Ostrovsky
2012-01-19 16:29             ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CB4D7558.2A12B%keir.xen@gmail.com \
    --to=keir.xen@gmail.com \
    --cc=Christoph.Egger@amd.com \
    --cc=JBeulich@suse.com \
    --cc=boris.ostrovsky@amd.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.