public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bjorn.helgaas@hp.com>
To: "Yu, Fenghua" <fenghua.yu@intel.com>
Cc: "Luck, Tony" <tony.luck@intel.com>,
	Jesse Barnes <jbarnes@virtuousgeek.org>,
	David Woodhouse <dwmw2@infradead.org>,
	Ingo Molnar <mingo@elte.hu>, Avi Kivity <avi@redhat.com>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	Andrew Morton <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	"linux-ia64@vger.kernel.org" <linux-ia64@vger.kernel.org>
Subject: Re: [PATCH 1/2]Add Variable Page Size and IA64 Support in Intel IOMMU: Generic Part
Date: Fri, 03 Oct 2008 15:33:09 +0000	[thread overview]
Message-ID: <200810030933.10627.bjorn.helgaas@hp.com> (raw)
In-Reply-To: <A6AD88C3F2289247BE726C37303E1EB88408ADFF@orsmsx505.amr.corp.intel.com>

On Thursday 02 October 2008 03:46:06 pm Yu, Fenghua wrote:
> >> The current Intel IOMMU code assumes that both host page size and Intel IOMMU page size are 4K. The first patch supports variable page size. This provides support for IA64 which has multiple page sizes.
> >>
> >> This patch also adds some other code hooks for IA64 platform including DMAR_OPERATION_TIMEOUT definition, .
> 
> >Can you split this patch up?  It contains several logically separate
> changes:
> >  - casting things to unsigned long long
> >  - adding stuff under #ifdef CONFIG_IA64
> >  - page size changes
> >  - whitespace changes
> 
> Depends on who is picking up the generic patch. If it's needed, I can split it into multiple patches.

Regardless of who's picking up the patch, splitting it makes it
easier to review and easier to spot bugs, and makes bisection yield
better information.

> >> @@ -510,7 +514,7 @@ int alloc_iommu(struct dmar_drhd_unit *drhd)
> >>
> >>       iommu->seq_id = iommu_allocated++;
> >>
> >> -     iommu->reg = ioremap(drhd->reg_base_addr, PAGE_SIZE_4K);
> >> +     iommu->reg = ioremap(drhd->reg_base_addr, IOMMU_PAGE_SIZE);
> >>       if (!iommu->reg) {
> >>               printk(KERN_ERR "IOMMU: can't map the region\n");
> >
> >This printk should include a clue, like the IOMMU ID and/or address
> >we tried to map.
> 
> This is a good comment. This patch set is mainly for porting IOMMU to IA64. I will add IOMMU ID in a follow-up clean-up patch.

Since you're not actually adding the printk in this patch, it sounds
fair to clean it up in a follow-up patch.

> >> -#define PAGE_SHIFT_4K                (12)
> >> -#define PAGE_SIZE_4K         (1UL << PAGE_SHIFT_4K)
> >> -#define PAGE_MASK_4K         (((u64)-1) << PAGE_SHIFT_4K)
> >> -#define PAGE_ALIGN_4K(addr)  (((addr) + PAGE_SIZE_4K - 1) & PAGE_MASK_4K)
> >> +#define IOMMU_PAGE_SHIFT     (12)
> >> +#define IOMMU_PAGE_SIZE              (1UL << IOMMU_PAGE_SHIFT)
> >> +#define IOMMU_PAGE_MASK              (((u64)-1) << IOMMU_PAGE_SHIFT)
> >> +#define IOMMU_PAGE_ALIGN(addr)       \
> >> +     (((addr) + IOMMU_PAGE_SIZE - 1) & IOMMU_PAGE_MASK)
> >>
> >> -#define IOVA_PFN(addr)               ((addr) >> PAGE_SHIFT_4K)
> >> +#define IOVA_PFN(addr)               ((addr) >> PAGE_SHIFT)
> >
> >These are pretty generic names (IOMMU_PAGE_SHIFT, IOVA_PFN, etc),
> >but the definitions seem to be specific to VT-d.  I can't tell if
> >this file is supposed to be sort of generic, or if it's Intel-specific.
> 
> I can change IOMMU_PAGE_SHIFT etc to VTD_PAGE_SHIFT etc and change IOVA_PFN to VTD_IOVA_PFN. What do you think?

Those sound good to me.

Bjorn


  reply	other threads:[~2008-10-03 15:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <BAE9DCEF64577A439B3A37F36F9B691C0339372B@orsmsx418.amr.corp.intel.com>
     [not found] ` <617E1C2C70743745A92448908E030B2A02AD5AD7@scsmsx411.amr.corp.intel.com>
2008-05-02 22:26   ` [PATCH] Handle invalid ACPI SLIT table Fenghua Yu
2008-10-01 16:57   ` [PATCH 1/2]Add Variable Page Size and IA64 Support in Intel IOMMU: Generic Part Fenghua Yu
2008-10-02  8:29     ` [PATCH 1/2]Add Variable Page Size and IA64 Support in Intel Ingo Molnar
2008-10-02 22:06       ` Yu, Fenghua
2008-10-03  8:54         ` Ingo Molnar
2008-10-02 15:31     ` [PATCH 1/2]Add Variable Page Size and IA64 Support in Intel IOMMU: Generic Part Bjorn Helgaas
2008-10-02 21:46       ` [PATCH 1/2]Add Variable Page Size and IA64 Support in Intel Yu, Fenghua
2008-10-03 15:33         ` Bjorn Helgaas [this message]
2008-10-04  0:21           ` Yu, Fenghua
2008-10-07  0:01     ` [PATCH V2 1/2] Add Variable Page Size and IA64 Support in Intel IOMMU: Generic Part Fenghua Yu
2009-08-04 22:10   ` [PATCH 2/4] Bug Fix drivers/pci/intel-iommu.c: secure sg_next() calling Fenghua Yu
2009-08-05  8:09     ` [PATCH 2/4] Bug Fix drivers/pci/intel-iommu.c: secure David Woodhouse

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=200810030933.10627.bjorn.helgaas@hp.com \
    --to=bjorn.helgaas@hp.com \
    --cc=akpm@linux-foundation.org \
    --cc=avi@redhat.com \
    --cc=dwmw2@infradead.org \
    --cc=fenghua.yu@intel.com \
    --cc=jbarnes@virtuousgeek.org \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=sfr@canb.auug.org.au \
    --cc=tony.luck@intel.com \
    /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