From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: david.vrabel@Citrix.com, konrad@kernel.org,
xen-devel@lists.xenproject.org, boris.ostrovsky@oracle.com,
linux-kernel@vger.kernel.org, keir@xen.org
Subject: Re: [XEN PATCH 1/2] hvm: Support more than 32 VCPUS when migrating.
Date: Tue, 22 Apr 2014 14:34:43 -0400 [thread overview]
Message-ID: <20140422183443.GA6817@phenom.dumpdata.com> (raw)
In-Reply-To: <5345853502000078000074F8@nat28.tlf.novell.com>
On Wed, Apr 09, 2014 at 04:36:53PM +0100, Jan Beulich wrote:
> >>> On 09.04.14 at 17:27, <konrad.wilk@oracle.com> wrote:
> > On Wed, Apr 09, 2014 at 10:06:12AM +0100, Jan Beulich wrote:
> >> >>> On 08.04.14 at 19:25, <konrad@kernel.org> wrote:
> >> > --- a/xen/arch/x86/hvm/hvm.c
> >> > +++ b/xen/arch/x86/hvm/hvm.c
> >> > @@ -3470,6 +3470,9 @@ static long hvm_vcpu_op(
> >> > case VCPUOP_stop_singleshot_timer:
> >> > case VCPUOP_register_vcpu_info:
> >> > case VCPUOP_register_vcpu_time_memory_area:
> >> > + case VCPUOP_down:
> >> > + case VCPUOP_up:
> >> > + case VCPUOP_is_up:
> >>
> >> This, if I checked it properly, leaves only VCPUOP_initialise,
> >> VCPUOP_send_nmi, and VCPUOP_get_physid disallowed for HVM.
> >> None of which look inherently bad to be used by HVM (but
> >> VCPUOP_initialise certainly would need closer checking), so I
> >> wonder whether either the wrapper shouldn't be dropped altogether
> >> or at least be converted from a white list approach to a black list one.
> >
> > I was being conservative here because I did not want to allow the
> > other ones without at least testing it.
> >
> > Perhaps that can be done as a seperate patch and this just as
> > a bug-fix?
>
> I'm clearly not in favor of the patch as is - minimally I'd want it to
> convert the white list to a black list. And once you do this it would
> seem rather natural to not pointlessly add entries.
With this patch:
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index b5b92fe..5eee790 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3455,34 +3455,6 @@ static long hvm_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
}
}
-static long hvm_vcpu_op(
- int cmd, int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
-{
- long rc;
-
- switch ( cmd )
- {
- case VCPUOP_register_runstate_memory_area:
- case VCPUOP_get_runstate_info:
- case VCPUOP_set_periodic_timer:
- case VCPUOP_stop_periodic_timer:
- case VCPUOP_set_singleshot_timer:
- case VCPUOP_stop_singleshot_timer:
- case VCPUOP_register_vcpu_info:
- case VCPUOP_register_vcpu_time_memory_area:
- case VCPUOP_down:
- case VCPUOP_up:
- case VCPUOP_is_up:
- rc = do_vcpu_op(cmd, vcpuid, arg);
- break;
- default:
- rc = -ENOSYS;
- break;
- }
-
- return rc;
-}
-
typedef unsigned long hvm_hypercall_t(
unsigned long, unsigned long, unsigned long, unsigned long, unsigned long,
unsigned long);
@@ -3517,30 +3489,6 @@ static long hvm_memory_op_compat32(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
return compat_memory_op(cmd, arg);
}
-static long hvm_vcpu_op_compat32(
- int cmd, int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
-{
- long rc;
-
- switch ( cmd )
- {
- case VCPUOP_register_runstate_memory_area:
- case VCPUOP_get_runstate_info:
- case VCPUOP_set_periodic_timer:
- case VCPUOP_stop_periodic_timer:
- case VCPUOP_set_singleshot_timer:
- case VCPUOP_stop_singleshot_timer:
- case VCPUOP_register_vcpu_info:
- case VCPUOP_register_vcpu_time_memory_area:
- rc = compat_vcpu_op(cmd, vcpuid, arg);
- break;
- default:
- rc = -ENOSYS;
- break;
- }
-
- return rc;
-}
static long hvm_physdev_op_compat32(
int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
@@ -3563,7 +3511,7 @@ static long hvm_physdev_op_compat32(
static hvm_hypercall_t *const hvm_hypercall64_table[NR_hypercalls] = {
[ __HYPERVISOR_memory_op ] = (hvm_hypercall_t *)hvm_memory_op,
[ __HYPERVISOR_grant_table_op ] = (hvm_hypercall_t *)hvm_grant_table_op,
- [ __HYPERVISOR_vcpu_op ] = (hvm_hypercall_t *)hvm_vcpu_op,
+ HYPERCALL(vcpu_op),
[ __HYPERVISOR_physdev_op ] = (hvm_hypercall_t *)hvm_physdev_op,
HYPERCALL(xen_version),
HYPERCALL(console_io),
@@ -3583,7 +3531,7 @@ static hvm_hypercall_t *const hvm_hypercall64_table[NR_hypercalls] = {
static hvm_hypercall_t *const hvm_hypercall32_table[NR_hypercalls] = {
[ __HYPERVISOR_memory_op ] = (hvm_hypercall_t *)hvm_memory_op_compat32,
[ __HYPERVISOR_grant_table_op ] = (hvm_hypercall_t *)hvm_grant_table_op_compat32,
- [ __HYPERVISOR_vcpu_op ] = (hvm_hypercall_t *)hvm_vcpu_op_compat32,
+ COMPAT_CALL(vcpu_op),
[ __HYPERVISOR_physdev_op ] = (hvm_hypercall_t *)hvm_physdev_op_compat32,
COMPAT_CALL(xen_version),
HYPERCALL(console_io),
And with an HVM guest poking at the rest of VCPUOPs: VCPUOP_get_physid,
VCPUOP_initialise, and VCPUOP_send_nmi - either before the CPU is up or
when it is up - work.
That is: the VCPUOP_get_physid would return -EINVAL; VCPUOP_initialise
would return either -EEXIST or 0, and in either case
the content of the ctxt was full of zeros.
The VCPUOP_send_nmi did cause the HVM to get an NMI and it spitted out
'Dazed and confused'. It also noticed corruption:
[ 3.611742] Corrupted low memory at c000fffc (fffc phys) = 00029b00
[ 2.386785] Corrupted low memory at ffff88000000fff8 (fff8 phys) = 2990000000000
Which is odd because there does not seem to be anything in the path
of hypervisor that would cause this.
>
> Jan
>
next prev parent reply other threads:[~2014-04-22 18:35 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-04 20:44 33 VCPUs in HVM guests with live migration with Linux hangs Konrad Rzeszutek Wilk
2014-04-07 8:32 ` Ian Campbell
2014-04-08 17:25 ` [PATCH] Fixes for more than 32 VCPUs migration for HVM guests (v1) konrad
2014-04-08 17:25 ` [XEN PATCH 1/2] hvm: Support more than 32 VCPUS when migrating konrad
2014-04-08 17:25 ` konrad
2014-04-08 18:18 ` [Xen-devel] " Roger Pau Monné
2014-04-08 18:53 ` Konrad Rzeszutek Wilk
2014-04-08 18:53 ` [Xen-devel] " Konrad Rzeszutek Wilk
2014-04-09 7:37 ` Roger Pau Monné
2014-04-09 7:37 ` [Xen-devel] " Roger Pau Monné
2014-04-09 15:34 ` Konrad Rzeszutek Wilk
2014-04-09 15:34 ` [Xen-devel] " Konrad Rzeszutek Wilk
2014-04-09 15:38 ` David Vrabel
2014-04-09 15:55 ` Konrad Rzeszutek Wilk
2014-04-09 15:55 ` Konrad Rzeszutek Wilk
2014-04-09 15:38 ` David Vrabel
2014-04-09 8:33 ` Ian Campbell
2014-04-09 8:33 ` [Xen-devel] " Ian Campbell
2014-04-09 9:04 ` Roger Pau Monné
2014-04-09 9:04 ` [Xen-devel] " Roger Pau Monné
2014-04-08 18:18 ` Roger Pau Monné
2014-04-09 9:06 ` Jan Beulich
2014-04-09 15:27 ` Konrad Rzeszutek Wilk
2014-04-09 15:36 ` Jan Beulich
2014-04-09 15:36 ` Jan Beulich
2014-04-22 18:34 ` Konrad Rzeszutek Wilk
2014-04-22 18:34 ` Konrad Rzeszutek Wilk [this message]
2014-04-23 8:57 ` Jan Beulich
2014-04-23 8:57 ` Jan Beulich
2014-04-09 15:27 ` Konrad Rzeszutek Wilk
2014-04-09 9:06 ` Jan Beulich
2014-04-08 17:25 ` [LINUX PATCH 2/2] xen/pvhvm: Support more than 32 VCPUs " konrad
2014-04-09 8:03 ` Jan Beulich
2014-04-09 8:03 ` Jan Beulich
2014-04-08 17:25 ` konrad
2014-04-08 17:25 ` [PATCH] Fixes for more than 32 VCPUs migration for HVM guests (v1) konrad
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=20140422183443.GA6817@phenom.dumpdata.com \
--to=konrad.wilk@oracle.com \
--cc=JBeulich@suse.com \
--cc=boris.ostrovsky@oracle.com \
--cc=david.vrabel@Citrix.com \
--cc=keir@xen.org \
--cc=konrad@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=xen-devel@lists.xenproject.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 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.