From: "Jan Beulich" <JBeulich@suse.com>
To: Paul Lai <paul.c.lai@intel.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>, ravi.sahita@intel.com
Subject: Re: [PATCH v1 Altp2m cleanup 3/3] Making altp2m struct dynamically allocated.
Date: Tue, 28 Jun 2016 04:13:53 -0600 [thread overview]
Message-ID: <57726A0102000078000F95DB@prv-mh.provo.novell.com> (raw)
In-Reply-To: <1466525090-1692-4-git-send-email-paul.c.lai@intel.com>
>>> On 21.06.16 at 18:04, <paul.c.lai@intel.com> wrote:
> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -5228,7 +5228,7 @@ static int do_altp2m_op(
>
> if ( (a.cmd != HVMOP_altp2m_get_domain_state) &&
> (a.cmd != HVMOP_altp2m_set_domain_state) &&
> - !d->arch.altp2m_active )
> + ! altp2m_active(d) )
Stray blank.
> @@ -5262,11 +5262,11 @@ static int do_altp2m_op(
> break;
> }
>
> - ostate = d->arch.altp2m_active;
> - d->arch.altp2m_active = !!a.u.domain_state.state;
> + ostate = altp2m_active(d);
> + set_altp2m_active(d, !!a.u.domain_state.state);
Bogus tab indentation.
> --- a/xen/arch/x86/mm/p2m.c
> +++ b/xen/arch/x86/mm/p2m.c
> @@ -193,12 +193,15 @@ static void p2m_teardown_altp2m(struct domain *d)
>
> for ( i = 0; i < MAX_ALTP2M; i++ )
> {
> - if ( !d->arch.altp2m_p2m[i] )
> + if ( !d->arch.altp2m->altp2m_p2m[i] )
> continue;
> - p2m = d->arch.altp2m_p2m[i];
> + p2m = d->arch.altp2m->altp2m_p2m[i];
> p2m_free_one(p2m);
> - d->arch.altp2m_p2m[i] = NULL;
> + d->arch.altp2m->altp2m_p2m[i] = NULL;
> }
> +
> + if (d->arch.altp2m)
Missing blanks.
> + xfree(d->arch.altp2m);
But the conditional is pointless anyway.
> @@ -206,10 +209,12 @@ static int p2m_init_altp2m(struct domain *d)
> unsigned int i;
> struct p2m_domain *p2m;
>
> - mm_lock_init(&d->arch.altp2m_list_lock);
> + d->arch.altp2m = xzalloc(struct altp2m_domain);
> +
> + mm_lock_init(&d->arch.altp2m->altp2m_list_lock);
Missing error check.
> --- a/xen/include/asm-x86/domain.h
> +++ b/xen/include/asm-x86/domain.h
> @@ -274,6 +274,13 @@ struct monitor_write_data {
> uint64_t cr4;
> };
>
> +struct altp2m_domain {
> + bool_t altp2m_active;
> + struct p2m_domain *altp2m_p2m[MAX_ALTP2M];
> + mm_lock_t altp2m_list_lock;
> + uint64_t *altp2m_eptp;
> +};
No point prefixing all the fields with altp2m_. And also the structure
now doesn't belong here anymore - it should move to e.g. p2m.h.
> @@ -320,10 +327,13 @@ struct arch_domain
> mm_lock_t nested_p2m_lock;
>
> /* altp2m: allow multiple copies of host p2m */
> + /*
> bool_t altp2m_active;
> struct p2m_domain *altp2m_p2m[MAX_ALTP2M];
> mm_lock_t altp2m_list_lock;
> - uint64_t *altp2m_eptp;
> + uint64_t *altp2m_eptp;
> + */
What's the purpose of this comment?
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-06-28 10:14 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-21 16:04 [PATCH v1 Altp2m cleanup 0/3] Cleaning up altp2m code Paul Lai
2016-06-21 16:04 ` [PATCH v1 Altp2m cleanup 1/3] altp2m cleanup work Paul Lai
2016-06-23 15:44 ` Jan Beulich
2016-06-23 18:23 ` Lai, Paul C
2016-06-24 6:18 ` Jan Beulich
2016-06-24 15:19 ` Lai, Paul C
2016-08-02 16:39 ` George Dunlap
2016-08-02 16:49 ` George Dunlap
2016-06-21 16:04 ` [PATCH v1 Altp2m cleanup 2/3] Move altp2m specific functions to altp2m files Paul Lai
2016-06-24 10:27 ` George Dunlap
2016-06-28 9:57 ` Jan Beulich
2016-06-21 16:04 ` [PATCH v1 Altp2m cleanup 3/3] Making altp2m struct dynamically allocated Paul Lai
2016-06-28 10:13 ` Jan Beulich [this message]
2016-06-22 7:28 ` [PATCH v1 Altp2m cleanup 0/3] Cleaning up altp2m code Jan Beulich
[not found] ` <8CA46881B83C354B99AD61C20C93EB1BD995FB@ORSMSX109.amr.corp.intel.com>
[not found] ` <576AD0B502000078000F7C22@prv-mh.provo.novell.com>
2016-06-22 16:31 ` Lai, Paul C
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=57726A0102000078000F95DB@prv-mh.provo.novell.com \
--to=jbeulich@suse.com \
--cc=paul.c.lai@intel.com \
--cc=ravi.sahita@intel.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 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).