All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Mukesh Rathor <mukesh.rathor@oracle.com>
Cc: George.Dunlap@eu.citrix.com, tim@xen.org, eddie.dong@intel.com,
	keir.xen@gmail.com, jun.nakajima@intel.com,
	xen-devel@lists.xenproject.org
Subject: Re: [V8 PATCH 5/8] pvh dom0: Add and remove foreign pages
Date: Tue, 08 Apr 2014 08:36:55 +0100	[thread overview]
Message-ID: <5343C33702000078000066B3@nat28.tlf.novell.com> (raw)
In-Reply-To: <20140407181150.0008e838@mantra.us.oracle.com>

>>> On 08.04.14 at 03:11, <mukesh.rathor@oracle.com> wrote:
> On Mon, 07 Apr 2014 07:57:56 +0100
> "Jan Beulich" <JBeulich@suse.com> wrote:
>> In the end I think we'll want to make them all report proper error
>> codes...
> 
> Ok, how about the following patch then? If it's OK, I'd like to submit
> independently.

Yes, I just now stumbled across this oddity too. Looks generally
like what we want - a couple of comments below.

> @@ -696,7 +695,7 @@ long arch_do_domctl(
>  
>              if ( paging_mode_translate(d) )
>                  for ( i = 0; i < nr_mfns; i++ )
> -                    add |= !clear_mmio_p2m_entry(d, gfn + i);
> +                    add |= !!clear_mmio_p2m_entry(d, gfn + i);

No need for the double !!, and in fact ...

>              ret = iomem_deny_access(d, mfn, mfn + nr_mfns - 1);
>              if ( !ret && add )
>                  ret = -EIO;

... you should be propagating the error code here anyway rather
than making one up.

> @@ -124,15 +124,16 @@ nestedhap_fix_p2m(struct vcpu *v, struct p2m_domain *p2m,
>          gfn = (L2_gpa >> PAGE_SHIFT) & mask;
>          mfn = _mfn((L0_gpa >> PAGE_SHIFT) & mask);
>  
> -        rv = set_p2m_entry(p2m, gfn, mfn, page_order, p2mt, p2ma);
> +        rc = set_p2m_entry(p2m, gfn, mfn, page_order, p2mt, p2ma);
>      }
>  
>      p2m_unlock(p2m);
>  
> -    if (rv == 0) {
> +    if ( rc )
> +    {
>          gdprintk(XENLOG_ERR,
> -		"failed to set entry for %#"PRIx64" -> %#"PRIx64"\n",
> -		L2_gpa, L0_gpa);
> +		"failed to set entry for %#"PRIx64" -> %#"PRIx64" rc:%d\n",
> +		L2_gpa, L0_gpa, rc);

Together with the other coding style cleanup you should also get rid
of the hard tabs here.

> @@ -769,26 +769,28 @@ set_mmio_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn)
>      }
>  
>      P2M_DEBUG("set mmio %lx %lx\n", gfn, mfn_x(mfn));
> -    rc = set_p2m_entry(p2m, gfn, mfn, PAGE_ORDER_4K, p2m_mmio_direct, p2m->default_access);
> +    rc = set_p2m_entry(p2m, gfn, mfn, PAGE_ORDER_4K, p2m_mmio_direct,
> +                       p2m->default_access);
>      gfn_unlock(p2m, gfn, 0);
> -    if ( 0 == rc )
> +    if ( rc )
>          gdprintk(XENLOG_ERR,
> -            "set_mmio_p2m_entry: set_p2m_entry failed! mfn=%08lx\n",
> -            mfn_x(get_gfn_query_unlocked(p2m->domain, gfn, &ot)));
> +            "set_mmio_p2m_entry: set_p2m_entry failed! mfn=%08lx rc:%d\n",
> +            mfn_x(get_gfn_query_unlocked(p2m->domain, gfn, &ot)), rc);

Again, if you already alter this and do minor cleanup at once, this
should become

	printk(XENLOG_G_ERR "d%d: ...", ...);

or the "set_mmio_p2m_entry:" prefix should be dropped.

> @@ -835,12 +839,13 @@ set_shared_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn)
>          set_gpfn_from_mfn(mfn_x(omfn), INVALID_M2P_ENTRY);
>  
>      P2M_DEBUG("set shared %lx %lx\n", gfn, mfn_x(mfn));
> -    rc = set_p2m_entry(p2m, gfn, mfn, PAGE_ORDER_4K, p2m_ram_shared, p2m->default_access);
> +    rc = set_p2m_entry(p2m, gfn, mfn, PAGE_ORDER_4K, p2m_ram_shared, 
> +                       p2m->default_access);
>      gfn_unlock(p2m, gfn, 0);
> -    if ( 0 == rc )
> +    if ( rc )
>          gdprintk(XENLOG_ERR,
> -            "set_shared_p2m_entry: set_p2m_entry failed! mfn=%08lx\n",
> -            mfn_x(get_gfn_query_unlocked(p2m->domain, gfn, &ot)));
> +            "set_shared_p2m_entry: set_p2m_entry failed! mfn=%08lx rc:%d\n",
> +            mfn_x(get_gfn_query_unlocked(p2m->domain, gfn, &ot)), rc);

Similarly here.

Jan

  reply	other threads:[~2014-04-08  7:36 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-22  1:39 [V8 PATCH 0/8] pvh dom0 Mukesh Rathor
2014-03-22  1:39 ` [V8 PATCH 1/8] pvh dom0: move some pv specific code to static functions Mukesh Rathor
2014-03-22  1:39 ` [V8 PATCH 2/8] pvh dom0: construct_dom0 changes Mukesh Rathor
2014-03-26 19:05   ` George Dunlap
2014-03-27 10:14     ` Jan Beulich
2014-03-27 10:55       ` George Dunlap
2014-03-27 11:03         ` George Dunlap
2014-03-27 15:04         ` Jan Beulich
2014-03-27 15:30           ` Tim Deegan
2014-04-05  0:53             ` Mukesh Rathor
2014-04-07  7:30               ` Jan Beulich
2014-04-07  9:27               ` George Dunlap
2014-03-22  1:39 ` [V8 PATCH 3/8] pvh dom0: Introduce p2m_map_foreign Mukesh Rathor
2014-03-24  9:00   ` Jan Beulich
2014-03-27 12:29   ` George Dunlap
2014-04-05  0:57     ` Mukesh Rathor
2014-03-22  1:39 ` [V8 PATCH 4/8] pvh dom0: make xsm_map_gmfn_foreign available for x86 Mukesh Rathor
2014-03-25 17:53   ` Daniel De Graaf
2014-03-22  1:39 ` [V8 PATCH 5/8] pvh dom0: Add and remove foreign pages Mukesh Rathor
2014-03-24  9:26   ` Jan Beulich
2014-04-05  1:17     ` Mukesh Rathor
2014-04-07  6:57       ` Jan Beulich
2014-04-08  1:11         ` Mukesh Rathor
2014-04-08  7:36           ` Jan Beulich [this message]
2014-04-08 14:01             ` Tim Deegan
2014-04-08 14:07               ` Jan Beulich
2014-04-08 14:18                 ` Tim Deegan
2014-04-08 15:40                   ` George Dunlap
2014-04-11  1:33     ` Mukesh Rathor
2014-04-11  8:02       ` Jan Beulich
2014-03-22  1:39 ` [V8 PATCH 6/8] pvh dom0: allow get_pg_owner for translated domains Mukesh Rathor
2014-03-24  9:31   ` Jan Beulich
2014-04-01 14:31     ` George Dunlap
2014-04-05  0:59       ` Mukesh Rathor
2014-03-22  1:39 ` [V8 PATCH 7/8] pvh dom0: add check for pvh in vioapic_range Mukesh Rathor
2014-03-24  9:34   ` Jan Beulich
2014-04-01 14:40     ` George Dunlap
2014-04-01 15:09       ` Jan Beulich
2014-04-05  1:00         ` Mukesh Rathor
2014-04-07  6:59           ` Jan Beulich
2014-04-07  9:28             ` George Dunlap
2014-04-08  1:00               ` Mukesh Rathor
2014-04-08  8:21                 ` Jan Beulich
2014-03-22  1:39 ` [V8 PATCH 8/8] pvh dom0: add opt_dom0pvh to setup.c Mukesh Rathor
2014-03-24  9:35   ` Jan Beulich
2014-03-24  8:57 ` [V8 PATCH 0/8] pvh dom0 Jan Beulich
2014-03-24 21:36   ` Mukesh Rathor
2014-03-28 17:36 ` Roger Pau Monné
2014-03-28 19:48   ` Mukesh Rathor
2014-04-01 16:04 ` George Dunlap
2014-04-02  1:22   ` 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=5343C33702000078000066B3@nat28.tlf.novell.com \
    --to=jbeulich@suse.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=eddie.dong@intel.com \
    --cc=jun.nakajima@intel.com \
    --cc=keir.xen@gmail.com \
    --cc=mukesh.rathor@oracle.com \
    --cc=tim@xen.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.