All of lore.kernel.org
 help / color / mirror / Atom feed
From: KyongHo Cho <pullip.cho@samsung.com>
To: Ohad Ben-Cohen <ohad@wizery.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Joerg Roedel <Joerg.Roedel@amd.com>,
	Hiroshi DOYU <Hiroshi.DOYU@nokia.com>,
	linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	David Brown <davidb@codeaurora.org>,
	linux-omap@vger.kernel.org, David Woodhouse <dwmw2@infradead.org>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [RFC 7/7] iommu/core: split mapping to page sizes as supported by the hardware
Date: Wed, 7 Sep 2011 17:05:16 +0900	[thread overview]
Message-ID: <CAHQjnOMnOjAJ6QuuLmLa1UKvTRHfyyjiUYrfvzLx8FSsCixxng@mail.gmail.com> (raw)
In-Reply-To: <CAK=WgbZPFryzCFLa5AhAYDmH1S8c3x-OsSTyxYeq0WLAe8VyTg@mail.gmail.com>

On Wed, Sep 7, 2011 at 3:01 PM, Ohad Ben-Cohen <ohad@wizery.com> wrote:
> Hi Cho,
>
> On Wed, Sep 7, 2011 at 4:30 AM, KyongHo Cho <pullip.cho@samsung.com> wrote:
>> Please find the following link that I submitted for our IOMMU.
>> https://lkml.org/lkml/2011/7/3/152
>>
>> s5p_iommu_map/unmap accepts any order of physical address and iova
>> without support of your suggestion if the order is not less than PAGE_SHIFT
>
> That's exactly what I'm trying to prevent; there's no reason to
> duplicate the exact same logic in every iommu driver.
>
> As a result, your map function is quite big (it even duplicates the
> same logic for every page size it tries).
>
I agree that my map function is big :)
However, it is faster because it does not calculate the given order and
not call any function.

> Try to rebase your patch on the "iommu/core: split mapping to page
> sizes as supported by the hardware" patch I've just sent, and see how
> significantly simpler your code becomes.
>
> Relying on a single implementation, provided by the IOMMU core, means
> less code to maintain (and debug) and a consistent behavior (across
> all supported hardware) exposed to users of the IOMMU API.
>
>> But I think IOMMU API must not expect that the caller of iommu_map() knows
>> about the restriction of IOMMU API implementation.
>
> Right. But I don't think there's any disagreement here ?
>
Yes, sorry:)

> If any, then I think that s5p_iommu_map() is more limited than what I
> propose: if it is given a 64KB region aligned only to a 4KB address,
> it will BUG_ON() it. While not ideal, I don't think there's any reason
> not to map it using 4KB pages (which is exactly what the new
> iommu_map() I propose will do).
>
It is a logical error because the caller of iommu_map() gives
4KB aligned physical address while saying that it is 64KB aligned.
I think it must not be happened .

> Thanks,
> Ohad.

Thank you.

KyongHo.

WARNING: multiple messages have this Message-ID (diff)
From: pullip.cho@samsung.com (KyongHo Cho)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC 7/7] iommu/core: split mapping to page sizes as supported by the hardware
Date: Wed, 7 Sep 2011 17:05:16 +0900	[thread overview]
Message-ID: <CAHQjnOMnOjAJ6QuuLmLa1UKvTRHfyyjiUYrfvzLx8FSsCixxng@mail.gmail.com> (raw)
In-Reply-To: <CAK=WgbZPFryzCFLa5AhAYDmH1S8c3x-OsSTyxYeq0WLAe8VyTg@mail.gmail.com>

On Wed, Sep 7, 2011 at 3:01 PM, Ohad Ben-Cohen <ohad@wizery.com> wrote:
> Hi Cho,
>
> On Wed, Sep 7, 2011 at 4:30 AM, KyongHo Cho <pullip.cho@samsung.com> wrote:
>> Please find the following link that I submitted for our IOMMU.
>> https://lkml.org/lkml/2011/7/3/152
>>
>> s5p_iommu_map/unmap accepts any order of physical address and iova
>> without support of your suggestion if the order is not less than PAGE_SHIFT
>
> That's exactly what I'm trying to prevent; there's no reason to
> duplicate the exact same logic in every iommu driver.
>
> As a result, your map function is quite big (it even duplicates the
> same logic for every page size it tries).
>
I agree that my map function is big :)
However, it is faster because it does not calculate the given order and
not call any function.

> Try to rebase your patch on the "iommu/core: split mapping to page
> sizes as supported by the hardware" patch I've just sent, and see how
> significantly simpler your code becomes.
>
> Relying on a single implementation, provided by the IOMMU core, means
> less code to maintain (and debug) and a consistent behavior (across
> all supported hardware) exposed to users of the IOMMU API.
>
>> But I think IOMMU API must not expect that the caller of iommu_map() knows
>> about the restriction of IOMMU API implementation.
>
> Right. But I don't think there's any disagreement here ?
>
Yes, sorry:)

> If any, then I think that s5p_iommu_map() is more limited than what I
> propose: if it is given a 64KB region aligned only to a 4KB address,
> it will BUG_ON() it. While not ideal, I don't think there's any reason
> not to map it using 4KB pages (which is exactly what the new
> iommu_map() I propose will do).
>
It is a logical error because the caller of iommu_map() gives
4KB aligned physical address while saying that it is 64KB aligned.
I think it must not be happened .

> Thanks,
> Ohad.

Thank you.

KyongHo.

  reply	other threads:[~2011-09-07  8:05 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-02 17:32 [PATCH/RFC 0/7] iommu: fixes & extensions Ohad Ben-Cohen
2011-09-02 17:32 ` Ohad Ben-Cohen
2011-09-02 17:32 ` Ohad Ben-Cohen
2011-09-02 17:32 ` [PATCH 1/7] iommu/omap-iovmm: support non page-aligned buffers in iommu_vmap Ohad Ben-Cohen
2011-09-02 17:32   ` Ohad Ben-Cohen
2011-09-02 17:32   ` Ohad Ben-Cohen
2011-09-02 17:32 ` [PATCH 2/7] iommu/omap: cleanup: remove a redundant statement Ohad Ben-Cohen
2011-09-02 17:32   ` Ohad Ben-Cohen
2011-09-02 17:32   ` Ohad Ben-Cohen
2011-09-02 17:32 ` [PATCH 3/7] iommu/core: use the existing IS_ALIGNED macro Ohad Ben-Cohen
2011-09-02 17:32   ` Ohad Ben-Cohen
2011-09-02 17:32   ` Ohad Ben-Cohen
2011-09-02 17:32 ` [PATCH 4/7] iommu/omap: ->unmap() should return order of unmapped page Ohad Ben-Cohen
2011-09-02 17:32   ` Ohad Ben-Cohen
2011-09-02 17:32   ` Ohad Ben-Cohen
2011-09-02 17:32 ` [PATCH 5/7] iommu/msm: " Ohad Ben-Cohen
2011-09-02 17:32   ` Ohad Ben-Cohen
2011-09-02 17:32   ` Ohad Ben-Cohen
2011-09-02 18:36   ` David Brown
2011-09-02 18:36     ` David Brown
2011-09-02 18:36     ` David Brown
2011-09-02 17:32 ` [RFC 6/7] iommu/core: add fault reporting Ohad Ben-Cohen
2011-09-02 17:32   ` Ohad Ben-Cohen
2011-09-02 17:32   ` Ohad Ben-Cohen
2011-09-05 10:00   ` Roedel, Joerg
2011-09-05 10:00     ` Roedel, Joerg
2011-09-05 10:00     ` Roedel, Joerg
2011-09-07 16:36     ` Ohad Ben-Cohen
2011-09-07 16:36       ` Ohad Ben-Cohen
2011-09-07 16:36       ` Ohad Ben-Cohen
2011-09-02 17:32 ` [RFC 7/7] iommu/core: split mapping to page sizes as supported by the hardware Ohad Ben-Cohen
2011-09-02 17:32   ` Ohad Ben-Cohen
2011-09-02 17:32   ` Ohad Ben-Cohen
2011-09-07  1:30   ` KyongHo Cho
2011-09-07  1:30     ` KyongHo Cho
2011-09-07  6:01     ` Ohad Ben-Cohen
2011-09-07  6:01       ` Ohad Ben-Cohen
2011-09-07  8:05       ` KyongHo Cho [this message]
2011-09-07  8:05         ` KyongHo Cho
2011-09-07  9:16         ` Ohad Ben-Cohen
2011-09-07  9:16           ` Ohad Ben-Cohen
2011-09-08 12:51           ` KyongHo Cho
2011-09-08 12:51             ` KyongHo Cho
2011-09-08 14:03             ` Ohad Ben-Cohen
2011-09-08 14:03               ` Ohad Ben-Cohen
2011-09-07  9:49         ` Ohad Ben-Cohen
2011-09-07  9:49           ` Ohad Ben-Cohen
2011-09-06 10:15 ` [PATCH/RFC 0/7] iommu: fixes & extensions Roedel, Joerg
2011-09-06 10:15   ` Roedel, Joerg
2011-09-06 10:15   ` Roedel, Joerg
2011-09-06 11:28   ` Ohad Ben-Cohen
2011-09-06 11:28     ` Ohad Ben-Cohen
2011-09-06 11:28     ` Ohad Ben-Cohen

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=CAHQjnOMnOjAJ6QuuLmLa1UKvTRHfyyjiUYrfvzLx8FSsCixxng@mail.gmail.com \
    --to=pullip.cho@samsung.com \
    --cc=Hiroshi.DOYU@nokia.com \
    --cc=Joerg.Roedel@amd.com \
    --cc=arnd@arndb.de \
    --cc=davidb@codeaurora.org \
    --cc=dwmw2@infradead.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=ohad@wizery.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 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.