All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Felix Schmoll <eggi.innovations@gmail.com>
Cc: xen-devel@lists.xenproject.org, Wei Liu <wei.liu2@citrix.com>
Subject: Re: [GSoC] GSoC Introduction : Fuzzing Xen hypercall interface
Date: Wed, 22 Mar 2017 08:52:59 +0000	[thread overview]
Message-ID: <20170322085258.s6wcyqgz5vgomsja@citrix.com> (raw)
In-Reply-To: <CAK1m5j6v5=A0=YbyiW4bO0RHjTLwy7n0yS2v3DOw859TvQ8qYg@mail.gmail.com>

On Wed, Mar 22, 2017 at 09:47:06AM +0100, Felix Schmoll wrote:
> 2017-03-21 17:14 GMT+01:00 Wei Liu <wei.liu2@citrix.com>:
> 
> > On Tue, Mar 21, 2017 at 04:13:24PM +0000, Wei Liu wrote:
> > > On Mon, Mar 20, 2017 at 09:12:54AM +0100, Felix Schmoll wrote:
> > > [...]
> > > > From 7e50f50b2a1e95cbc813354d68c71315d4d1394b Mon Sep 17 00:00:00 2001
> > > > From: Felix Schmoll <eggi.innovations@gmail.com>
> > > > Date: Thu, 16 Mar 2017 07:11:00 +0100
> > > > Subject: [PATCH 1/2] First idea on domain_id-hypercall implementation
> > > >
> > > > ---
> > > >  xen/arch/x86/hypercall.c    | 1 +
> > > >  xen/common/kernel.c         | 6 ++++++
> > > >  xen/include/public/xen.h    | 1 +
> > > >  xen/include/xen/hypercall.h | 5 +++++
> > > >  4 files changed, 13 insertions(+)
> > > >
> > > > diff --git a/xen/arch/x86/hypercall.c b/xen/arch/x86/hypercall.c
> > > > index e30181817a..caf8565809 100644
> > > > --- a/xen/arch/x86/hypercall.c
> > > > +++ b/xen/arch/x86/hypercall.c
> > > > @@ -69,6 +69,7 @@ const hypercall_args_t
> > > > hypercall_args_table[NR_hypercalls] =
> > > >      ARGS(dm_op, 3),
> > > >      ARGS(mca, 1),
> > > >      ARGS(arch_1, 1),
> > > > +    ARGS(domain_id, 2),
> > > >  };
> > > >
> > >
> > > I know now.
> > >
> > > You did add your hypercall to pv/hypercall.c and hvm/hypercall.c.
> >
> > "didn't"
> >
> 
> I also noticed that, but it still doesn't work. Here is what I last tried
> (I removed the unused arguments and made it a little simpler), relative to
> "staging":
> 
>  diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
> index 2d97d36c38..1e152c8a07 100644
> --- a/tools/libxc/include/xenctrl.h
> +++ b/tools/libxc/include/xenctrl.h
> @@ -1569,6 +1569,7 @@ int xc_domctl(xc_interface *xch, struct xen_domctl
> *domctl);
>  int xc_sysctl(xc_interface *xch, struct xen_sysctl *sysctl);
> 
>  int xc_version(xc_interface *xch, int cmd, void *arg);
> +int xc_domid(xc_interface *xch);
> 
>  int xc_flask_op(xc_interface *xch, xen_flask_op_t *op);
> 
> diff --git a/tools/libxc/xc_private.c b/tools/libxc/xc_private.c
> index 72e6242417..37b11e41a9 100644
> --- a/tools/libxc/xc_private.c
> +++ b/tools/libxc/xc_private.c
> @@ -530,6 +530,12 @@ int xc_version(xc_interface *xch, int cmd, void *arg)
>      return rc;
>  }
> 
> +int xc_domid(xc_interface *xch)
> +{
> +    return xencall0(xch->xcall, __HYPERVISOR_domain_id);
> +}
> +
> +
>  unsigned long xc_make_page_below_4G(
>      xc_interface *xch, uint32_t domid, unsigned long mfn)
>  {
> diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
> index 614501f761..eddb264f2d 100644
> --- a/xen/arch/arm/traps.c
> +++ b/xen/arch/arm/traps.c
> @@ -1297,6 +1297,7 @@ static arm_hypercall_t arm_hypercall_table[] = {
>      HYPERCALL(platform_op, 1),
>      HYPERCALL_ARM(vcpu_op, 3),
>      HYPERCALL(vm_assist, 2),
> +    HYPERCALL(domain_id, 0),
>  };
> 
>  #ifndef NDEBUG
> diff --git a/xen/arch/x86/hvm/hypercall.c b/xen/arch/x86/hvm/hypercall.c
> index e7238ce293..7677520290 100644
> --- a/xen/arch/x86/hvm/hypercall.c
> +++ b/xen/arch/x86/hvm/hypercall.c
> @@ -125,6 +125,7 @@ static const hypercall_table_t hvm_hypercall_table[] = {
>      HYPERCALL(hvm_op),
>      HYPERCALL(sysctl),
>      HYPERCALL(domctl),
> +    HYPERCALL(domain_id),
>  #ifdef CONFIG_TMEM
>      HYPERCALL(tmem_op),
>  #endif
> diff --git a/xen/arch/x86/hypercall.c b/xen/arch/x86/hypercall.c
> index e30181817a..b68d0aef40 100644
> --- a/xen/arch/x86/hypercall.c
> +++ b/xen/arch/x86/hypercall.c
> @@ -45,6 +45,7 @@ const hypercall_args_t
> hypercall_args_table[NR_hypercalls] =
>      COMP(set_timer_op, 1, 2),
>      ARGS(event_channel_op_compat, 1),
>      ARGS(xen_version, 2),
> +    ARGS(domain_id, 0),
>      ARGS(console_io, 3),
>      ARGS(physdev_op_compat, 1),
>      ARGS(grant_table_op, 3),
> diff --git a/xen/arch/x86/pv/hypercall.c b/xen/arch/x86/pv/hypercall.c
> index 9d29d2f088..1e67eb3312 100644
> --- a/xen/arch/x86/pv/hypercall.c
> +++ b/xen/arch/x86/pv/hypercall.c
> @@ -50,6 +50,7 @@ static const hypercall_table_t pv_hypercall_table[] = {
>      COMPAT_CALL(set_timer_op),
>      HYPERCALL(event_channel_op_compat),
>      COMPAT_CALL(xen_version),
> +    HYPERCALL(domain_id),
>      HYPERCALL(console_io),
>      COMPAT_CALL(physdev_op_compat),
>      COMPAT_CALL(grant_table_op),


You also need to put the pointer into the correct slot in various
tables. The hypercall dispatching machinery uses table[HYPERCALL_NUM] to
look up the function to call.

From the look of your patch you failed to do that. I haven't done
through checking though.

Wei.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2017-03-22  8:53 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-12 20:48 [GSoC] GSoC Introduction : Fuzzing Xen hypercall interface Felix Ekkehard Schmoll
2017-03-13 11:14 ` Wei Liu
2017-03-16 15:53   ` Felix Schmoll
2017-03-16 16:27     ` Wei Liu
     [not found]       ` <CAK1m5j4UbGV9JZiXJ2Lo3=ztrgsCsFg7Vp--dAHfgOert7KkMw@mail.gmail.com>
     [not found]         ` <20170320161847.kic6b524lodgr25u@citrix.com>
2017-03-20 16:47           ` Felix Schmoll
2017-03-21 12:24             ` Wei Liu
     [not found]         ` <20170321161324.hmsnybth3ktjbzpk@citrix.com>
     [not found]           ` <20170321161442.tpjjtecv6qmsgmev@citrix.com>
2017-03-22  8:47             ` Felix Schmoll
2017-03-22  8:52               ` Wei Liu [this message]
2017-03-22  9:54                 ` Felix Schmoll
2017-03-22 11:21                   ` Wei Liu
2017-03-23  7:18                     ` Felix Schmoll
2017-03-23  7:19                       ` Felix Schmoll
2017-03-24  7:34                     ` Felix Schmoll
2017-03-24 12:13                       ` Juergen Gross
2017-03-24 12:56                       ` Wei Liu
2017-03-26 11:33                         ` Felix Schmoll
2017-03-26 13:04                           ` Wei Liu
2017-03-27 13:07                             ` Felix Schmoll
2017-03-28  9:21                               ` Lars Kurth
2017-03-28 11:54                                 ` Wei Liu
2017-03-29  5:52                                   ` Felix Schmoll
2017-03-29 10:41                                     ` Wei Liu
2017-03-29 14:24                                       ` Felix Schmoll
2017-03-29 15:54                                         ` Wei Liu
2017-03-29 18:19                                           ` Felix Schmoll

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=20170322085258.s6wcyqgz5vgomsja@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=eggi.innovations@gmail.com \
    --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.