xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Mukesh Rathor <mukesh.rathor@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH 11/20] PVH xen: introduce pvh.c
Date: Wed, 15 May 2013 18:42:07 -0700	[thread overview]
Message-ID: <20130515184207.0f50b06d@mantra.us.oracle.com> (raw)
In-Reply-To: <519382BA02000078000D6658@nat28.tlf.novell.com>

On Wed, 15 May 2013 11:42:34 +0100
"Jan Beulich" <JBeulich@suse.com> wrote:

> >>> On 15.05.13 at 02:52, Mukesh Rathor <mukesh.rathor@oracle.com>
> >>> wrote:
> > --- /dev/null
> > +
> > +static int pvh_grant_table_op(unsigned int cmd,
> > XEN_GUEST_HANDLE(void) uop,
> > +                              unsigned int count)
> > +{
> > +#ifndef NDEBUG
> 
> The whole function should be in such a conditional (if it's really
> needed, which I previously said I doubt). Without doing so, and

Temporary code, can we leave it for initial stages while PVH is being
tested and tried. It will help with debug a lot. Alternately, would you be
ok with something like the patch way below. I could do same for grant
and hypercalls too.

> with the way you have pvh_hypercall64_table[], build will fail
> for debug=n.

I know. I left it for you to implment it the way you wanted with memcopy
of the table, which I completely disagree with.

> > +    rc = do_vcpu_op(cmd, vcpuid, arg);
> > +
> > +    /* pvh boot vcpu setting context for bringing up smp vcpu */
> > +    if ( cmd == VCPUOP_initialise )
> > +        vmx_vmcs_enter(current);  
> 
> This is wrong in three ways - for one, you can't call a vmx function
> from here, then the operation also doesn't appear to belong here,

Ooops, sorry! This was in vmx_pvh.c file originally and got moved. Yeah, 
I struggled with this, I can't remember why I needed this. Let me go 
back and investigate this.

> and with pvh_hypercall64_table[] not even existing in non-debug
> builds this won't happen there at all (which is making very clear that
> these function overrides are plain wrong, as I had tried to tell you
> from the beginning).

I don't think they are *wrong*, they work just fine for HVM! They might be
a different approach than you might like, and I appreciate that. But I am 
thinking of being able to easily catch and debug things when the feature 
goes thru infancy.

thanks
Mukesh

--------------------------------------------------------------------------
diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 21382eb..b1a33b5 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1129,6 +1129,10 @@ arch_do_vcpu_op(
         struct domain *d = v->domain;
         struct vcpu_register_vcpu_info info;
 
+        rc = -ENOSYS;
+        if ( is_pvh_vcpu(current) )
+            break;
+
         rc = -EFAULT;
         if ( copy_from_guest(&info, arg, 1) )
             break;
@@ -1169,6 +1173,10 @@ arch_do_vcpu_op(
     {
         struct vcpu_get_physid cpu_id;
 
+        rc = -ENOSYS;
+        if ( is_pvh_vcpu(current) )
+            break;
+
         rc = -EINVAL;
         if ( !is_pinned_vcpu(v) )
             break;
diff --git a/xen/common/domain.c b/xen/common/domain.c
index a734755..68de4bb 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -968,6 +968,12 @@ long do_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
     }
 
     case VCPUOP_down:
+        if ( is_pvh_vcpu(current) )
+        {
+            rc = -ENOSYS;
+            break;
+        }
+
         if ( !test_and_set_bit(_VPF_down, &v->pause_flags) )
             vcpu_sleep_nosync(v);
         break;
@@ -1039,6 +1045,11 @@ long do_vcpu_op(int cmd, int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
 
 #ifdef VCPU_TRAP_NMI
     case VCPUOP_send_nmi:
+        if ( is_pvh_vcpu(current) )
+        {
+            rc = -ENOSYS;
+            break;
+        }
         if ( !guest_handle_is_null(arg) )
             return -EINVAL;

  reply	other threads:[~2013-05-16  1:42 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-15  0:52 [PATCH 00/20][V5]: PVH xen: version 5 patches Mukesh Rathor
2013-05-15  0:52 ` [PATCH 01/20] PVH xen: turn gdb_frames/gdt_ents into union Mukesh Rathor
2013-05-15  0:52 ` [PATCH 02/20] PVH xen: add XENMEM_add_to_physmap_range Mukesh Rathor
2013-05-15  9:58   ` Jan Beulich
2013-05-15 23:05     ` Mukesh Rathor
2013-05-16  7:21       ` Jan Beulich
2013-05-16 11:03         ` Stefano Stabellini
2013-05-16 12:01           ` Jan Beulich
2013-05-16 15:04             ` Stefano Stabellini
2013-05-16 23:56         ` Mukesh Rathor
2013-05-17  6:37           ` Jan Beulich
2013-05-17 22:24             ` Mukesh Rathor
2013-05-15  0:52 ` [PATCH 03/20] PVH xen: create domctl_memory_mapping() function Mukesh Rathor
2013-05-15 10:07   ` Jan Beulich
2013-05-15  0:52 ` [PATCH 04/20] PVH xen: add params to read_segment_register Mukesh Rathor
2013-05-15  0:52 ` [PATCH 05/20] PVH xen: vmx realted preparatory changes for PVH Mukesh Rathor
2013-05-15  0:52 ` [PATCH 06/20] PVH xen: Move e820 fields out of pv_domain struct Mukesh Rathor
2013-05-15 10:27   ` Jan Beulich
2013-05-15  0:52 ` [PATCH 07/20] PVH xen: Introduce PVH guest type Mukesh Rathor
2013-05-15  0:52 ` [PATCH 08/20] PVH xen: tools changes to create PVH domain Mukesh Rathor
2013-05-15  0:52 ` [PATCH 09/20] PVH xen: domain creation code changes Mukesh Rathor
2013-05-15  0:52 ` [PATCH 10/20] PVH xen: create PVH vmcs, and also initialization Mukesh Rathor
2013-05-15  0:52 ` [PATCH 11/20] PVH xen: introduce pvh.c Mukesh Rathor
2013-05-15 10:42   ` Jan Beulich
2013-05-16  1:42     ` Mukesh Rathor [this message]
2013-05-16  8:00       ` Jan Beulich
2013-05-17  0:27         ` Mukesh Rathor
2013-05-17  6:43           ` Jan Beulich
2013-05-21  0:08             ` Mukesh Rathor
2013-05-21  7:07               ` Jan Beulich
2013-05-15  0:52 ` [PATCH 12/20] PVH xen: create read_descriptor_sel() Mukesh Rathor
2013-05-15  0:52 ` [PATCH 13/20] PVH xen: introduce vmx_pvh.c Mukesh Rathor
2013-05-15 11:46   ` Jan Beulich
2013-05-15  0:52 ` [PATCH 14/20] PVH xen: some misc changes like mtrr, intr, msi Mukesh Rathor
2013-05-15  0:52 ` [PATCH 15/20] PVH xen: hcall page initialize, create PVH guest type, etc Mukesh Rathor
2013-05-15  0:52 ` [PATCH 16/20] PVH xen: Miscellaneous changes Mukesh Rathor
2013-05-15 11:53   ` Jan Beulich
2013-05-16  1:51     ` Mukesh Rathor
2013-05-15  0:52 ` [PATCH 17/20] PVH xen: Introduce p2m_map_foreign Mukesh Rathor
2013-05-15 11:55   ` Jan Beulich
2013-05-15  0:52 ` [PATCH 18/20] PVH xen: Add and remove foreign pages Mukesh Rathor
2013-05-15 12:05   ` Jan Beulich
2013-05-15  0:52 ` [PATCH 19/20] PVH xen: elf and iommu related changes to prep for dom0 PVH Mukesh Rathor
2013-05-15 12:12   ` Jan Beulich
2013-05-16  1:58     ` Mukesh Rathor
2013-05-16  8:03       ` Jan Beulich
2013-05-17  1:14         ` Mukesh Rathor
2013-05-17  6:45           ` Jan Beulich
2013-05-18  2:01         ` Mukesh Rathor
2013-05-21  7:14           ` Jan Beulich
2013-05-15  0:52 ` [PATCH 20/20] PVH xen: PVH dom0 creation Mukesh Rathor

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=20130515184207.0f50b06d@mantra.us.oracle.com \
    --to=mukesh.rathor@oracle.com \
    --cc=JBeulich@suse.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).