|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH] x86/domain: Improvements to switch_native() and switch_compat()
>>> On 19.01.15 at 11:44, <andrew.cooper3@xxxxxxxxxx> wrote:
> To aid the cleanup in switch_compat(), release_compat_l4() is updated to
> make
> it safe to call on a vcpu without an existing compat l4.
For this part of the change:
> --- a/xen/arch/x86/domain.c
> +++ b/xen/arch/x86/domain.c
> @@ -349,6 +349,8 @@ static int setup_compat_l4(struct vcpu *v)
>
> static void release_compat_l4(struct vcpu *v)
> {
> + if ( pagetable_is_null(v->arch.guest_table) )
> + return;
I'd rather see this check be done in the one caller that needs it,
since ...
> @@ -373,21 +373,16 @@ int switch_native(struct domain *d)
>
> d->arch.is_32bit_pv = d->arch.has_32bit_shinfo = 0;
>
> - for ( vcpuid = 0; vcpuid < d->max_vcpus; vcpuid++ )
> - {
> - if (d->vcpu[vcpuid])
> - release_compat_l4(d->vcpu[vcpuid]);
> - }
> + for_each_vcpu( d, v )
> + release_compat_l4(v);
... this one can't run into that situation (or the old code would have
been broken).
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |