On 6/17/19 4:51 PM, Jan Kiszka wrote:
> On 17.06.19 15:13, Mario Mintel wrote:
>> See Intels VT-d Architectures Specification, chapter 5.1.3:
>> "Maximum number of IRTEs in an Interrupt Remapping Table is 64K."
>>
>> Hence the max numbers of IRTEs is 65535 so we can limit the index to 16
>> bits.
>>
>> Signed-off-by: Mario Mintel <[email protected]>
>> ---
>>   hypervisor/arch/x86/vtd.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/hypervisor/arch/x86/vtd.c b/hypervisor/arch/x86/vtd.c
>> index 8e076b4b..d0dd4fd8 100644
>> --- a/hypervisor/arch/x86/vtd.c
>> +++ b/hypervisor/arch/x86/vtd.c
>> @@ -556,7 +556,7 @@ static void vtd_init_unit(void *reg_base, void
>> *inv_queue)
>>       vtd_update_gcmd_reg(reg_base, VTD_GCMD_IRE, 1);
>>   }
>>   -static void vtd_update_irte(unsigned int index, union vtd_irte
>> content)
>> +static void vtd_update_irte(u16 index, union vtd_irte content)
>>   {
>>       const struct vtd_entry inv_int = {
>>           .lo_word = VTD_REQ_INV_INT | VTD_INV_INT_INDEX |
>>
> 
> I don't see the value of this change, though. Actually, doesn't the
> compiler even bark at us then when passing in a wider type (which we do
> so far)?

ATM, everything is fine with the code. But as soon as we would pass
anything wider than 16 bit, we would get a proper warning with this
patch. There's no reason why index should be 32 bit wide.

  Ralf

> 
> Jan
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jailhouse-dev/55662300-f216-0e53-be0a-0860d3505eb4%40oth-regensburg.de.
For more options, visit https://groups.google.com/d/optout.

Reply via email to