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

Re: [Xen-devel] [PATCH V3 4/29] tools/libacpi: Add DMA remapping reporting (DMAR) ACPI table structures



On 2017年10月18日 22:36, Roger Pau Monné wrote:
> On Thu, Sep 21, 2017 at 11:01:45PM -0400, Lan Tianyu wrote:
>> From: Chao Gao <chao.gao@xxxxxxxxx>
>>
>> Add dmar table structure according Chapter 8 "BIOS Considerations" of
>> VTd spec Rev. 2.4.
>>
>> VTd 
>> spec:http://www.intel.com/content/dam/www/public/us/en/documents/product-specifications/vt-directed-io-spec.pdf
>>
>> Signed-off-by: Chao Gao <chao.gao@xxxxxxxxx>
>> Signed-off-by: Lan Tianyu <tianyu.lan@xxxxxxxxx>
>> ---
>>  tools/libacpi/acpi2_0.h | 61 
>> +++++++++++++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 61 insertions(+)
>>
>> diff --git a/tools/libacpi/acpi2_0.h b/tools/libacpi/acpi2_0.h
>> index 2619ba3..758a823 100644
>> --- a/tools/libacpi/acpi2_0.h
>> +++ b/tools/libacpi/acpi2_0.h
>> @@ -422,6 +422,65 @@ struct acpi_20_slit {
>>  };
>>  
>>  /*
>> + * DMA Remapping Table header definition (DMAR)
>> + */
>> +
>> +/*
>> + * DMAR Flags.
>> + */
>> +#define ACPI_DMAR_INTR_REMAP        (1 << 0)
>> +#define ACPI_DMAR_X2APIC_OPT_OUT    (1 << 1)
>> +
>> +struct acpi_dmar {
>> +    struct acpi_header header;
>> +    uint8_t host_address_width;
>> +    uint8_t flags;
>> +    uint8_t reserved[10];
>> +};
>> +
>> +/*
>> + * Device Scope Types
>> + */
>> +#define ACPI_DMAR_DEVICE_SCOPE_PCI_ENDPOINT             0x01
>> +#define ACPI_DMAR_DEVICE_SCOPE_PCI_SUB_HIERARACHY       0x01
>                                                            ^0x02
>> +#define ACPI_DMAR_DEVICE_SCOPE_IOAPIC                   0x03
>> +#define ACPI_DMAR_DEVICE_SCOPE_HPET                     0x04
>> +#define ACPI_DMAR_DEVICE_SCOPE_ACPI_NAMESPACE_DEVICE    0x05
> 
> Maybe you could try to reduce the length of the defines?

Sure. Will update.

> 
>> +
>> +struct dmar_device_scope {
>> +    uint8_t type;
>> +    uint8_t length;
>> +    uint8_t reserved[2];
>> +    uint8_t enumeration_id;
>> +    uint8_t bus;
>> +    uint16_t path[0];
>> +};
>> +
>> +/*
>> + * DMA Remapping Hardware Unit Types
>> + */
>> +#define ACPI_DMAR_TYPE_HARDWARE_UNIT        0x00
>> +#define ACPI_DMAR_TYPE_RESERVED_MEMORY      0x01
>> +#define ACPI_DMAR_TYPE_ATSR                 0x02
>> +#define ACPI_DMAR_TYPE_HARDWARE_AFFINITY    0x03
>> +#define ACPI_DMAR_TYPE_ANDD                 0x04
> 
> I think you either use acronyms for all of them (like ATSR and ANDD)
> or not. But mixing acronyms with full names is confusing.

OK. Will update.

-- 
Best regards
Tianyu Lan

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

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