From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: elena.ufimtseva@oracle.com, tim@xen.org, wei.liu2@citrix.com,
ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com,
andrew.cooper3@citrix.com, ian.jackson@eu.citrix.com,
xen-devel@lists.xen.org, roger.pau@citrix.com
Subject: Re: [PATCH v2 2/4] x86/pvh: Set 32b PVH guest mode in XEN_DOMCTL_set_address_size
Date: Tue, 07 Jul 2015 11:53:37 -0400 [thread overview]
Message-ID: <559BF601.3070101@oracle.com> (raw)
In-Reply-To: <559BB4CF020000780008D3B3@mail.emea.novell.com>
On 07/07/2015 05:15 AM, Jan Beulich wrote:
>>>> On 29.06.15 at 22:21, <boris.ostrovsky@oracle.com> wrote:
>> --- a/xen/arch/x86/domain.c
>> +++ b/xen/arch/x86/domain.c
>> @@ -377,25 +377,25 @@ int switch_compat(struct domain *d)
>> struct vcpu *v;
>> int rc;
>>
>> - if ( is_pvh_domain(d) )
>> - {
>> - printk(XENLOG_G_INFO
>> - "Xen currently does not support 32bit PVH guests\n");
>> - return -EINVAL;
>> - }
>> -
>> if ( !may_switch_mode(d) )
>> return -EACCES;
>> if ( has_32bit_shinfo(d) )
>> return 0;
>>
>> - d->arch.is_32bit_pv = d->arch.has_32bit_shinfo = 1;
>> + d->arch.has_32bit_shinfo = 1;
>> + if ( is_pv_domain(d) )
>> + d->arch.is_32bit_pv = 1;
>>
>> for_each_vcpu( d, v )
>> {
>> rc = setup_compat_arg_xlat(v);
>> if ( !rc )
>> - rc = setup_compat_l4(v);
>> + {
>> + if ( !is_pvh_domain(d) )
>> + rc = setup_compat_l4(v);
>> + else
>> + rc = hvm_set_mode(v, 4);
>> + }
>> if ( rc )
>> goto undo_and_fail;
>> }
>> @@ -410,7 +410,7 @@ int switch_compat(struct domain *d)
>> {
>> free_compat_arg_xlat(v);
>>
>> - if ( !pagetable_is_null(v->arch.guest_table) )
>> + if ( !is_pvh_domain(d) && !pagetable_is_null(v->arch.guest_table) )
>> release_compat_l4(v);
>> }
>>
> And no respective change to switch_native()?
>
>> @@ -6491,6 +6490,20 @@ enum hvm_intblk nhvm_interrupt_blocked(struct vcpu *v)
>> return hvm_funcs.nhvm_intr_blocked(v);
>> }
>>
>> +int hvm_set_mode(struct vcpu *v, int mode)
>> +{
>> + if ( mode == 4 )
>> + {
>> + v->arch.hvm_vcpu.guest_efer &= ~(EFER_LMA | EFER_LME);
>> + hvm_update_guest_efer(v);
>> + }
>> +
>> + if ( hvm_funcs.set_mode )
>> + return hvm_funcs.set_mode(v, mode);
>> +
>> + return 0;
>> +}
> -EOPNOTSUPP?
Why do you think this should be an error? I probably will need to update
this to handle mode==8 for calls from switch_native() as you pointed out
above but in general it seems to me it should be OK if this procedure
doesn't do anything. Below too.
-boris
>
>> --- a/xen/arch/x86/hvm/vmx/vmx.c
>> +++ b/xen/arch/x86/hvm/vmx/vmx.c
>> @@ -1763,6 +1763,22 @@ static void vmx_enable_msr_exit_interception(struct domain *d)
>> MSR_TYPE_W);
>> }
>>
>> +int vmx_set_mode(struct vcpu *v, int mode)
>> +{
>> +
>> + if ( !is_pvh_vcpu(v) )
>> + return 0;
>> +
>> + if ( mode == 4 )
>> + {
>> + vmx_vmcs_enter(v);
>> + __vmwrite(GUEST_CS_AR_BYTES, 0xc09b);
>> + vmx_vmcs_exit(v);
>> + }
>> +
>> + return 0;
>> +}
> Again -EOPNOTSUPP?
>
> Jan
>
next prev parent reply other threads:[~2015-07-07 15:53 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-29 20:21 [PATCH v2 0/4] 32-bit domU PVH support Boris Ostrovsky
2015-06-29 20:21 ` [PATCH v2 1/4] x86/compat: Test whether guest has 32b shinfo instead of being a PV 32b domain Boris Ostrovsky
2015-07-07 9:11 ` Jan Beulich
2015-07-07 15:46 ` Boris Ostrovsky
2015-07-07 16:15 ` Jan Beulich
2015-07-07 17:13 ` Boris Ostrovsky
2015-07-08 6:48 ` Jan Beulich
2015-07-08 13:59 ` Boris Ostrovsky
2015-07-08 14:08 ` Jan Beulich
2015-07-08 14:40 ` Boris Ostrovsky
2015-07-08 14:50 ` Jan Beulich
2015-07-08 20:57 ` Boris Ostrovsky
2015-07-09 7:02 ` Jan Beulich
2015-07-09 14:10 ` Boris Ostrovsky
2015-07-09 14:17 ` Jan Beulich
2015-07-09 14:30 ` Boris Ostrovsky
2015-07-09 16:05 ` Boris Ostrovsky
2015-07-09 16:15 ` Jan Beulich
2015-06-29 20:21 ` [PATCH v2 2/4] x86/pvh: Set 32b PVH guest mode in XEN_DOMCTL_set_address_size Boris Ostrovsky
2015-07-07 9:15 ` Jan Beulich
2015-07-07 15:53 ` Boris Ostrovsky [this message]
2015-07-07 16:16 ` Jan Beulich
2015-06-29 20:21 ` [PATCH v2 3/4] x86/pvh: Handle hypercalls for 32b PVH guests Boris Ostrovsky
2015-07-07 9:20 ` Jan Beulich
2015-07-07 15:54 ` Boris Ostrovsky
2015-06-29 20:21 ` [PATCH v2 4/4] libxc/x86/pvh: Allow creation of " Boris Ostrovsky
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=559BF601.3070101@oracle.com \
--to=boris.ostrovsky@oracle.com \
--cc=JBeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=elena.ufimtseva@oracle.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=roger.pau@citrix.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=tim@xen.org \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).