xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Kevin Tian <kevin.tian@intel.com>, Keir Fraser <keir@xen.org>,
	Jun Nakajima <jun.nakajima@intel.com>, Tim Deegan <tim@xen.org>,
	Eddie Dong <eddie.dong@intel.com>,
	suravee.suthikulpanit@amd.com,
	xen-devel <xen-devel@lists.xenproject.org>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>
Subject: Re: [PATCH v2 6/6] x86/P2M: cleanup
Date: Tue, 22 Apr 2014 13:37:22 +0100	[thread overview]
Message-ID: <53566282.3030002@citrix.com> (raw)
In-Reply-To: <53567D6C020000780000ABDE@nat28.tlf.novell.com>


[-- Attachment #1.1: Type: text/plain, Size: 3388 bytes --]

On 22/04/14 13:32, Jan Beulich wrote:
> - don't abuse __PAGE_HYPERVISOR
> - don't use bogus constructs like mfn_x(_mfn())
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Andrew Cooper<andrew.cooper3@citrix.com>

>
> --- a/xen/arch/x86/mm/p2m-pt.c
> +++ b/xen/arch/x86/mm/p2m-pt.c
> @@ -193,7 +193,7 @@ p2m_next_level(struct p2m_domain *p2m, v
>              return -ENOMEM;
>  
>          new_entry = l1e_from_pfn(mfn_x(page_to_mfn(pg)),
> -                                 __PAGE_HYPERVISOR | _PAGE_USER);
> +                                 P2M_BASE_FLAGS | _PAGE_RW);
>  
>          switch ( type ) {
>          case PGT_l3_page_table:
> @@ -229,7 +229,7 @@ p2m_next_level(struct p2m_domain *p2m, v
>          flags = l1e_get_flags(*p2m_entry);
>          pfn = l1e_get_pfn(*p2m_entry);
>  
> -        l1_entry = map_domain_page(mfn_x(page_to_mfn(pg)));
> +        l1_entry = __map_domain_page(pg);
>          for ( i = 0; i < L2_PAGETABLE_ENTRIES; i++ )
>          {
>              new_entry = l1e_from_pfn(pfn + (i * L1_PAGETABLE_ENTRIES), flags);
> @@ -238,7 +238,7 @@ p2m_next_level(struct p2m_domain *p2m, v
>          }
>          unmap_domain_page(l1_entry);
>          new_entry = l1e_from_pfn(mfn_x(page_to_mfn(pg)),
> -                                 __PAGE_HYPERVISOR|_PAGE_USER); //disable PSE
> +                                 P2M_BASE_FLAGS | _PAGE_RW); /* disable PSE */
>          p2m_add_iommu_flags(&new_entry, 2, IOMMUF_readable|IOMMUF_writable);
>          p2m->write_p2m_entry(p2m, gfn, p2m_entry, new_entry, 3);
>      }
> @@ -273,7 +273,7 @@ p2m_next_level(struct p2m_domain *p2m, v
>          unmap_domain_page(l1_entry);
>          
>          new_entry = l1e_from_pfn(mfn_x(page_to_mfn(pg)),
> -                                 __PAGE_HYPERVISOR|_PAGE_USER);
> +                                 P2M_BASE_FLAGS | _PAGE_RW);
>          p2m_add_iommu_flags(&new_entry, 1, IOMMUF_readable|IOMMUF_writable);
>          p2m->write_p2m_entry(p2m, gfn, p2m_entry, new_entry, 2);
>      }
> @@ -929,7 +929,7 @@ long p2m_pt_audit_p2m(struct p2m_domain 
>                  gfn += 1 << (L4_PAGETABLE_SHIFT - PAGE_SHIFT);
>                  continue;
>              }
> -            l3e = map_domain_page(mfn_x(_mfn(l4e_get_pfn(l4e[i4]))));
> +            l3e = map_domain_page(l4e_get_pfn(l4e[i4]));
>              for ( i3 = 0;
>                    i3 < L3_PAGETABLE_ENTRIES;
>                    i3++ )
> @@ -964,7 +964,7 @@ long p2m_pt_audit_p2m(struct p2m_domain 
>                      }
>                  }
>  
> -                l2e = map_domain_page(mfn_x(_mfn(l3e_get_pfn(l3e[i3]))));
> +                l2e = map_domain_page(l3e_get_pfn(l3e[i3]));
>                  for ( i2 = 0; i2 < L2_PAGETABLE_ENTRIES; i2++ )
>                  {
>                      if ( !(l2e_get_flags(l2e[i2]) & _PAGE_PRESENT) )
> @@ -1000,7 +1000,7 @@ long p2m_pt_audit_p2m(struct p2m_domain 
>                          continue;
>                      }
>  
> -                    l1e = map_domain_page(mfn_x(_mfn(l2e_get_pfn(l2e[i2]))));
> +                    l1e = map_domain_page(l2e_get_pfn(l2e[i2]));
>  
>                      for ( i1 = 0; i1 < L1_PAGETABLE_ENTRIES; i1++, gfn++ )
>                      {
>
>
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel


[-- Attachment #1.2: Type: text/html, Size: 4208 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

  reply	other threads:[~2014-04-22 12:37 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-22 12:22 [PATCH v2 0/6] x86/P2M: reduce time bulk type changes take Jan Beulich
2014-04-22 12:28 ` [PATCH v2 1/6] x86/EPT: don't walk entire page tables when globally changing types Jan Beulich
2014-04-24 15:41   ` Tim Deegan
2014-04-24 16:20     ` Jan Beulich
2014-04-25  8:44       ` Tim Deegan
2014-04-25 19:37   ` Konrad Rzeszutek Wilk
2014-04-28  7:19     ` Jan Beulich
2014-04-22 12:29 ` [PATCH v2 2/6] x86/EPT: don't walk entire page tables when changing types on a range Jan Beulich
2014-04-24 16:00   ` Tim Deegan
2014-04-22 12:30 ` [PATCH v2 3/6] x86/P2M: simplify write_p2m_entry() Jan Beulich
2014-04-24 16:00   ` Tim Deegan
2014-04-24 16:22     ` Jan Beulich
2014-04-22 12:30 ` [PATCH v2 4/6] x86/NPT: don't walk entire page tables when changing types on a range Jan Beulich
2014-04-24 16:25   ` Tim Deegan
2014-04-25  6:13     ` Jan Beulich
2014-04-25  8:43       ` Tim Deegan
2014-04-22 12:31 ` [PATCH v2 5/6] x86/NPT: don't walk entire page tables when globally changing types Jan Beulich
2014-04-24 16:28   ` Tim Deegan
2014-04-22 12:32 ` [PATCH v2 6/6] x86/P2M: cleanup Jan Beulich
2014-04-22 12:37   ` Andrew Cooper [this message]
2014-04-24 16:30   ` Tim Deegan

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=53566282.3030002@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=eddie.dong@intel.com \
    --cc=jun.nakajima@intel.com \
    --cc=keir@xen.org \
    --cc=kevin.tian@intel.com \
    --cc=suravee.suthikulpanit@amd.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 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).