All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Tian, Kevin" <kevin.tian@intel.com>
To: Jan Beulich <jbeulich@suse.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: RE: [PATCH 2/2] VT-d: use clear_page() in alloc_pgtable_maddr()
Date: Fri, 17 Jul 2020 02:49:04 +0000	[thread overview]
Message-ID: <MWHPR11MB1645486699AEF7BF39B652518C7C0@MWHPR11MB1645.namprd11.prod.outlook.com> (raw)
In-Reply-To: <14f8b940-252f-9837-8958-5e76e1c3f06f@suse.com>

> From: Jan Beulich <jbeulich@suse.com>
> Sent: Wednesday, July 15, 2020 6:04 PM
> 
> For full pages this is (meant to be) more efficient. Also change the
> type and reduce the scope of the involved local variable.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Kevin Tian <kevin.tian@intel.com>

> 
> --- a/xen/drivers/passthrough/vtd/iommu.c
> +++ b/xen/drivers/passthrough/vtd/iommu.c
> @@ -199,7 +199,6 @@ static void sync_cache(const void *addr,
>  uint64_t alloc_pgtable_maddr(unsigned long npages, nodeid_t node)
>  {
>      struct page_info *pg, *cur_pg;
> -    u64 *vaddr;
>      unsigned int i;
> 
>      pg = alloc_domheap_pages(NULL, get_order_from_pages(npages),
> @@ -210,8 +209,9 @@ uint64_t alloc_pgtable_maddr(unsigned lo
>      cur_pg = pg;
>      for ( i = 0; i < npages; i++ )
>      {
> -        vaddr = __map_domain_page(cur_pg);
> -        memset(vaddr, 0, PAGE_SIZE);
> +        void *vaddr = __map_domain_page(cur_pg);
> +
> +        clear_page(vaddr);
> 
>          if ( (iommu_ops.init ? &iommu_ops : &vtd_ops)->sync_cache )
>              sync_cache(vaddr, PAGE_SIZE);


      parent reply	other threads:[~2020-07-17  2:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-15 10:02 [PATCH 0/2] VT-d: XSA-321 follow-up Jan Beulich
2020-07-15 10:03 ` [PATCH 1/2] VT-d: install sync_cache hook on demand Jan Beulich
2020-07-16 10:14   ` Roger Pau Monné
2020-07-16 10:25     ` Jan Beulich
2020-07-16 10:34       ` Roger Pau Monné
2020-07-17  2:48   ` Tian, Kevin
2020-07-15 10:04 ` [PATCH 2/2] VT-d: use clear_page() in alloc_pgtable_maddr() Jan Beulich
2020-07-16 10:15   ` Roger Pau Monné
2020-07-17  2:49   ` Tian, Kevin [this message]

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=MWHPR11MB1645486699AEF7BF39B652518C7C0@MWHPR11MB1645.namprd11.prod.outlook.com \
    --to=kevin.tian@intel.com \
    --cc=jbeulich@suse.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.