WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: xl/xm save -c fails - set_vcpucontext EOPNOTSUPP (was Re: [Xen-devel

To: Jan Beulich <JBeulich@xxxxxxxxxx>
Subject: Re: xl/xm save -c fails - set_vcpucontext EOPNOTSUPP (was Re: [Xen-devel] xl save -c issues with Windows 7 Ultimate)
From: AP Xen <apxeng@xxxxxxxxx>
Date: Wed, 25 May 2011 00:53:59 -0700
Cc: rshriram@xxxxxxxxx, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Keir Fraser <keir.xen@xxxxxxxxx>, Keir Fraser <keir@xxxxxxx>, Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Delivery-date: Wed, 25 May 2011 00:55:04 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=p37Zxa03Qa4BTiRn2Bl+JrcE1HZLJwkcSd9HDZE41aA=; b=WwY/RY4q55TIWtlZaMvD/JqZSFq8Vlrnb5VFGGF4KHfIBISd4ymmORuOvSTlogIDoB ga2pa+EMhtjqz46lOIOQrCRLWiOXgftIQ3LWUao1u4+Jms7SR1EeAtU/JeKJOdVcRDkc oclIk125K/v7EoubOs3+79NWBb7qebpZL6dUU=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=GfVd28pDA+BzomYu2F+CaScu32CIp180Bf5tmXxWrXCwsmVedqdenKqITAwKLhpbWc Hdlk9Zw11P9ir9TAOTQAE0Uu9emDa5uxk5g1bc0N7zXaZ6/O8Aj/dywQp8cZQ8j3UUKU zifbfKCaKX+FoJhUfllnljgF89HmoUTiEvcng=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4DDCC8B60200007800043650@xxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <BANLkTi=BqU4qJyp-BrzF9NEkFq9ED_8N=Q@xxxxxxxxxxxxxx> <CA01CF01.1B023%keir.xen@xxxxxxxxx> <4DDCC8B60200007800043650@xxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Wed, May 25, 2011 at 12:15 AM, Jan Beulich <JBeulich@xxxxxxxxxx> wrote:
>>>> On 24.05.11 at 22:09, Keir Fraser <keir.xen@xxxxxxxxx> wrote:
>> It depends on c/s 23142, and I think it isn't even needed in the absence of
>> that other patch.
>
> Correct - no checking on the context was done up to 23142, so as
> long as that one doesn't get backported the fix to it obviously doesn't
> need to be either.
>
> It's odd in the first place that you're asking, as it sort of implies you've
> been seeing -EOPNOTSUPP problems on 4.1, which you'd need to
> explain/investigate independently of the problem addressed here.

You are right. I lost site of my original problem which is xl save -c
not working with 4.1. I did a quick get_vcpucontext and
set_vcpucontext test with a HVM domain and that seems to work without
any issues. So I think the root cause of the -c option not working is
something else.

AP

> Jan
>
>>  -- Keir
>>
>> On 24/05/2011 20:24, "AP Xen" <apxeng@xxxxxxxxx> wrote:
>>
>>> Is is possible for this (23348:3e8e1800d472) to be included in Xen 4.1.1?
>>>
>>> Thanks,
>>> AP
>>>
>>> On Mon, May 16, 2011 at 6:48 PM, Shriram Rajagopalan <rshriram@xxxxxxxxx>
>>> wrote:
>>>> On Mon, May 16, 2011 at 8:02 AM, Jan Beulich <JBeulich@xxxxxxxxxx> wrote:
>>>>>
>>>>>>>> On 15.05.11 at 00:15, Shriram Rajagopalan <rshriram@xxxxxxxxx> wrote:
>>>>>> This one works only for 64-bit domUs. 32bit domU (on 64bit dom0) fails
>>>>>> with
>>>>>> usual EOPNOTSUPP.
>>>>>
>>>>> Next (hopefully final) try below.
>>>>>
>>>>> Jan
>>>>>
>>>>> --- a/xen/arch/x86/domain.c
>>>>> +++ b/xen/arch/x86/domain.c
>>>>> @@ -856,6 +856,15 @@ int arch_set_info_guest(
>>>>>         goto out;
>>>>>     }
>>>>>
>>>>> +    init_int80_direct_trap(v);
>>>>> +
>>>>> +    /* IOPL privileges are virtualised. */
>>>>> +    v->arch.pv_vcpu.iopl = (v->arch.user_regs.eflags >> 12) & 3;
>>>>> +    v->arch.user_regs.eflags &= ~X86_EFLAGS_IOPL;
>>>>> +
>>>>> +    /* Ensure real hardware interrupts are enabled. */
>>>>> +    v->arch.user_regs.eflags |= X86_EFLAGS_IF;
>>>>> +
>>>>>     if ( !v->is_initialised )
>>>>>     {
>>>>>         v->arch.pv_vcpu.ldt_base = c(ldt_base);
>>>>> @@ -863,11 +872,27 @@ int arch_set_info_guest(
>>>>>     }
>>>>>     else
>>>>>     {
>>>>> -        bool_t fail = v->arch.pv_vcpu.ctrlreg[3] != c(ctrlreg[3]);
>>>>> +        unsigned long pfn = pagetable_get_pfn(v->arch.guest_table);
>>>>> +        bool_t fail;
>>>>>
>>>>> +        if ( !compat )
>>>>> +        {
>>>>> +            fail = xen_pfn_to_cr3(pfn) != c.nat->ctrlreg[3];
>>>>>  #ifdef CONFIG_X86_64
>>>>> -        fail |= v->arch.pv_vcpu.ctrlreg[1] != c(ctrlreg[1]);
>>>>> +            if ( pagetable_is_null(v->arch.guest_table_user) )
>>>>> +                fail |= c.nat->ctrlreg[1] || !(flags & VGCF_in_kernel);
>>>>> +            else
>>>>> +            {
>>>>> +                pfn = pagetable_get_pfn(v->arch.guest_table_user);
>>>>> +                fail |= xen_pfn_to_cr3(pfn) != c.nat->ctrlreg[1];
>>>>> +            }
>>>>> +        } else {
>>>>> +            l4_pgentry_t *l4tab = __va(pfn_to_paddr(pfn));
>>>>> +
>>>>> +            pfn = l4e_get_pfn(*l4tab);
>>>>> +            fail = compat_pfn_to_cr3(pfn) != c.cmp->ctrlreg[3];
>>>>>  #endif
>>>>> +        }
>>>>>
>>>>>         for ( i = 0; i < ARRAY_SIZE(v->arch.pv_vcpu.gdt_frames); ++i )
>>>>>             fail |= v->arch.pv_vcpu.gdt_frames[i] != c(gdt_frames[i]);
>>>>> @@ -907,15 +932,6 @@ int arch_set_info_guest(
>>>>>     v->arch.pv_vcpu.ctrlreg[0] &= X86_CR0_TS;
>>>>>     v->arch.pv_vcpu.ctrlreg[0] |= read_cr0() & ~X86_CR0_TS;
>>>>>
>>>>> -    init_int80_direct_trap(v);
>>>>> -
>>>>> -    /* IOPL privileges are virtualised. */
>>>>> -    v->arch.pv_vcpu.iopl = (v->arch.user_regs.eflags >> 12) & 3;
>>>>> -    v->arch.user_regs.eflags &= ~X86_EFLAGS_IOPL;
>>>>> -
>>>>> -    /* Ensure real hardware interrupts are enabled. */
>>>>> -    v->arch.user_regs.eflags |= X86_EFLAGS_IF;
>>>>> -
>>>>>     cr4 = v->arch.pv_vcpu.ctrlreg[4];
>>>>>     v->arch.pv_vcpu.ctrlreg[4] = cr4 ? pv_guest_cr4_fixup(v, cr4) :
>>>>>         real_cr4_to_pv_guest_cr4(mmu_cr4_features);
>>>>>
>>>>>
>>>> ok. this one works :). I ve tested with remus too :P. Can you please please
>>>> spin out a patch to be pushed into the repo ? thanks for the help.
>>>>
>>>> shriram
>>>>
>>>> _______________________________________________
>>>> Xen-devel mailing list
>>>> Xen-devel@xxxxxxxxxxxxxxxxxxx
>>>> http://lists.xensource.com/xen-devel
>>>>
>>>>
>
>
>

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>