[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH for-4.20?] x86/dom0: be less restrictive with the Interrupt Address Range


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 17 Feb 2025 09:49:18 +0100
  • Autocrypt: addr=jbeulich@xxxxxxxx; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL
  • Cc: oleksii.kurochko@xxxxxxxxx, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Jürgen Groß <jgross@xxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 17 Feb 2025 08:49:22 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 14.02.2025 14:57, Roger Pau Monné wrote:
> On Fri, Feb 14, 2025 at 02:01:09PM +0100, Jan Beulich wrote:
>> On 12.02.2025 16:38, Roger Pau Monne wrote:
>>> There's also the following restriction noted in Intel VT-d:
>>>
>>>> Software must not program paging-structure entries to remap any address to
>>>> the interrupt address range. Untranslated requests and translation requests
>>>> that result in an address in the interrupt range will be blocked with
>>>> condition code LGN.4 or SGN.8. Translated requests with an address in the
>>>> interrupt address range are treated as Unsupported Request (UR).
>>>
>>> However this restriction doesn't apply to the identity mappings possibly
>>> created for dom0, since the interrupt address range is never subject to DMA
>>> remapping.
>>
>> Coming back to this also with your on-demand-p2m-populating patch in mind:
>> I'm having some trouble following your comment on this quotation. The doc
>> text is quite clear that page table entries must not point at the interrupt
>> address range. They don't make an exception for identity mappings. And we
>> don't know how the IOMMUs internally work, e.g. what sanity checks they do
>> (and what failure thereof would result in).
> 
> My understanding is that address translation will never happen for the
> interrupt address range, so whatever gets mapped on that range will
> never be translated by the IOMMU.  Hence for the specific case here,
> there will never be untranslated request that result in an address in
> the interrupt address range, because translation is not done for input
> addresses in the interrupt address range.
> 
> Sorry, hope the above makes sense, I'm having a hard time trying to
> write down what I understand happens when the IOMMU handles accesses
> to the interrupt address range.
> 
> Maybe a diagram would be easier.  This is my understanding of how
> translation works in the IOMMU:
> 
>  input address -> translation -> output address
> 
> However input addresses that are in the interrupt address range are
> not subject to translation, and hence there's no output address that
> can be subject to the quoted VT-d paragraph.

I agree this is a possible (and plausible) interpretation of that text.
I'm merely unconvinced it's the only possible one.

Jan

>> Instead I'm now wondering whether we don't need to
>> - prevent ept_set_entry() from propagating to the IOMMU mappings targeting
>>   the interrupt range,
>> - demand non-shared page tables if any such mapping is to be established
>>   in the CPU page tables.
>>
>> Then again I won't assert that my interpretation of that quoted text makes
>> sense at all.
> 
> See above, *I think* the quoted paragraph only applies to output
> addresses, and in the case of mappings created on the interrupt
> address range there's simply no output address.
> 
> Thanks, Roger.




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.