Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1458803 > unrolled thread
| Started by | Joerg Roedel <joro@8bytes.org> |
|---|---|
| First post | 2016-08-09 16:40 +0200 |
| Last post | 2016-08-09 16:40 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PART2 PATCH v5 01/12] iommu/amd: Detect and enable guest vAPIC support Joerg Roedel <joro@8bytes.org> - 2016-08-09 16:40 +0200
| From | Joerg Roedel <joro@8bytes.org> |
|---|---|
| Date | 2016-08-09 16:40 +0200 |
| Subject | Re: [PART2 PATCH v5 01/12] iommu/amd: Detect and enable guest vAPIC support |
| Message-ID | <s4gmd-n3-9@gated-at.bofh.it> |
On Mon, Jul 25, 2016 at 04:32:00AM -0500, Suthikulpanit, Suravee wrote:
> @@ -2147,10 +2186,16 @@ static int __init early_amd_iommu_init(void)
> * remapping tables.
> */
> ret = -ENOMEM;
> - amd_iommu_irq_cache = kmem_cache_create("irq_remap_cache",
> - MAX_IRQS_PER_TABLE * sizeof(u32),
> - IRQ_TABLE_ALIGNMENT,
> - 0, NULL);
> + if (!AMD_IOMMU_GUEST_IR_GA(amd_iommu_guest_ir))
> + amd_iommu_irq_cache = kmem_cache_create("irq_remap_cache",
> + MAX_IRQS_PER_TABLE * sizeof(u32),
> + IRQ_TABLE_ALIGNMENT,
> + 0, NULL);
> + else
> + amd_iommu_irq_cache = kmem_cache_create("irq_remap_cache",
> + MAX_IRQS_PER_TABLE * (sizeof(u64) * 2),
> + IRQ_TABLE_ALIGNMENT,
> + 0, NULL);
Its better to calculate only the size-parameter in the if-statement and
make kmem_cache_create use that one.
> if (!amd_iommu_irq_cache)
> goto out;
>
> @@ -2403,6 +2448,21 @@ static int __init parse_amd_iommu_dump(char *str)
> return 1;
> }
>
> +static int __init parse_amd_iommu_intr(char *str)
> +{
> + for (; *str; ++str) {
> + if (strncmp(str, "legacy", 6) == 0) {
> + amd_iommu_guest_ir = AMD_IOMMU_GUEST_IR_LEGACY;
> + break;
> + }
> + if (strncmp(str, "vapic", 5) == 0) {
> + amd_iommu_guest_ir = AMD_IOMMU_GUEST_IR_VAPIC;
> + break;
> + }
> + }
> + return 1;
> +}
> +
> static int __init parse_amd_iommu_options(char *str)
> {
> for (; *str; ++str) {
> @@ -2511,6 +2571,7 @@ static int __init parse_ivrs_acpihid(char *str)
>
> __setup("amd_iommu_dump", parse_amd_iommu_dump);
> __setup("amd_iommu=", parse_amd_iommu_options);
> +__setup("amd_iommu_intr=", parse_amd_iommu_intr);
This parameter needs to be documented in Documentation/kernel-parameters.txt
Back to top | Article view | linux.kernel
csiph-web