Hi Yonghyun,
On 2020/2/20 8:12, Yonghyun Hwang wrote:
Hello Baolu,
Yes, pfn_to_dma_pte() doesn't put 0 for level. However, it's hard for
me to get that without comment, which is the reason why I put a dummy
"if" there. Anyway, what about the following code?
static inline unsigned long offset_m
Hello Baolu,
Yes, pfn_to_dma_pte() doesn't put 0 for level. However, it's hard for
me to get that without comment, which is the reason why I put a dummy
"if" there. Anyway, what about the following code?
static inline unsigned long offset_mask(int level)
{
return BIT_MASK(level_to_offset_bits
Hi,
On 2020/2/20 2:51, Yonghyun Hwang wrote:
Hello Lu and Moritz,
I think it's better to keep "if (level > 1)" because
level_to_offset_bits() returns (unsigned int) -1 * LEVEL_STRIDE if level
becomes 0.
@level will never be 0 in this case.
Best regards,
baolu
static inline unsigned int
intel_iommu_iova_to_phys() has a bug when it translates an IOVA for a huge
page onto its corresponding physical address. This commit fixes the bug by
accomodating the level of page entry for the IOVA and adds IOVA's lower
address to the physical address.
Signed-off-by: Yonghyun Hwang
---
drivers
Hello Lu and Moritz,
I think it's better to keep "if (level > 1)" because level_to_offset_bits()
returns (unsigned int) -1 * LEVEL_STRIDE if level becomes 0.
static inline unsigned int level_to_offset_bits(int level)
{
return (level - 1) * LEVEL_STRIDE;
}
On Tue, Feb 18, 2020 at 8:42 PM Moritz
Hi Baolu, Yonghyun
On Wed, Feb 19, 2020 at 11:15:36AM +0800, Lu Baolu wrote:
> Hi Yonghyun,
>
> Thanks for the patch.
>
> On 2020/2/19 6:23, Yonghyun Hwang wrote:
> > intel_iommu_iova_to_phys() has a bug when it translates an IOVA for a huge
> > page onto its corresponding physical address. This
Hi Yonghyun,
Thanks for the patch.
On 2020/2/19 6:23, Yonghyun Hwang wrote:
intel_iommu_iova_to_phys() has a bug when it translates an IOVA for a huge
page onto its corresponding physical address. This commit fixes the bug by
accomodating the level of page entry for the IOVA and adds IOVA's low
intel_iommu_iova_to_phys() has a bug when it translates an IOVA for a huge
page onto its corresponding physical address. This commit fixes the bug by
accomodating the level of page entry for the IOVA and adds IOVA's lower
address to the physical address.
Signed-off-by: Yonghyun Hwang
---
drivers