[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-stable] [PATCH v2 1/2] exec: add page_mask for flatview_do_tra
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-stable] [PATCH v2 1/2] exec: add page_mask for flatview_do_translate |
Date: |
Fri, 6 Oct 2017 14:48:22 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 |
On 06/10/2017 14:46, Maxime Coquelin wrote:
>>> addr = ((iotlb.translated_addr & ~iotlb.addr_mask)
>>> | (addr & iotlb.addr_mask));
>>> - *plen = MIN(*plen, (addr | iotlb.addr_mask) - addr + 1);
>>> + page_mask = iotlb.addr_mask;
>>
>> Should this be "page_mask &= iotlb.addr_mask"?
>>
>> If you have multiple IOMMUs on top of each other (yeah, I know...) I
>> think the smallest size should win. This is also consistent with the
>> MIN in the line below.
>
> I agree, but changin to "page_mask &= iotlb.addr_mask" will not be
> enough, we also have to change the init value. Else we will always end
> up with 0xfff.
>
> Maybe we could do as plen was handled before, i.e. setting page_mask
> init value to (hwaddr)(-1), and after the loop set it to
> ~TARGET_PAGE_MASK if it hasn't been changed.
>
> Does that sound reasonable?
True that, in fact it makes sense for the "IOTLB entry" to represent all
of memory if there's no IOMMU at all.
Thanks,
Paolo
- [Qemu-stable] [PATCH v2 0/2] exec: further refine address_space_get_iotlb_entry(), Maxime Coquelin, 2017/10/06
- [Qemu-stable] [PATCH v2 2/2] exec: simplify address_space_get_iotlb_entry, Maxime Coquelin, 2017/10/06
- [Qemu-stable] [PATCH v2 1/2] exec: add page_mask for flatview_do_translate, Maxime Coquelin, 2017/10/06
- Re: [Qemu-stable] [PATCH v2 1/2] exec: add page_mask for flatview_do_translate, Paolo Bonzini, 2017/10/06
- Re: [Qemu-stable] [PATCH v2 1/2] exec: add page_mask for flatview_do_translate, Maxime Coquelin, 2017/10/06
- Re: [Qemu-stable] [PATCH v2 1/2] exec: add page_mask for flatview_do_translate,
Paolo Bonzini <=
- Re: [Qemu-stable] [PATCH v2 1/2] exec: add page_mask for flatview_do_translate, Maxime Coquelin, 2017/10/06
- Re: [Qemu-stable] [PATCH v2 1/2] exec: add page_mask for flatview_do_translate, Peter Xu, 2017/10/09
- Re: [Qemu-stable] [PATCH v2 1/2] exec: add page_mask for flatview_do_translate, Maxime Coquelin, 2017/10/09
- Re: [Qemu-stable] [PATCH v2 1/2] exec: add page_mask for flatview_do_translate, Peter Xu, 2017/10/09