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

Re: [Xen-devel] [PATCH v3 09/14] AMD/IOMMU: split amd_iommu_init_one()


  • To: Jan Beulich <JBeulich@xxxxxxxx>
  • From: "Woods, Brian" <Brian.Woods@xxxxxxx>
  • Date: Fri, 19 Jul 2019 18:36:41 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=amd.com;dmarc=pass action=none header.from=amd.com;dkim=pass header.d=amd.com;arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KfANS4wSx2EwnHmZYcEtGzpQssINyLv13jORKiSfn+0=; b=ULjYC4TgaAerkDHm6crB4iTl0IYyaT+M2/mABrM9tmmsRaoQdOU/CYpKt8mDUz7V1GtSWbuQ79LIIK+gOKf+b6WLrHjuppulynxXOa55KcpRz+7QN4lA5j37GY20KGfuw19TI7IIliSc0mgyADswZycBM2zgJnAeqK/FEc5oP5Y7lEl+pdGogaC1SnJDuN9YH55Jj9KDAIHJH+/85yg7Mq1TCeYN6d/t/40c5eGOZZWBtSSwhAl6gfZsqRm07f1+QTuEpGrB+ECntGsOwWEAy+vfnbXPx/ccLzXtYysZPP3hplDQIZMlYWIlc6aPINuYcX7Kcnf7cnYR/BJAuQmVvA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c/rLA6ihfqQnHOrkXrdG2E86AIljXO3O5zz5wnK4UzmSl/MK0DLogzlj2N+aYfx7g/z5ov7iUhFPLIIWG9+S6zd2c8SFBpHUSNnMEaQ9WCmevquCfnEe+ATqMndbSG80O/P9pnT9627pKqFvIYDr9PXG0qyTYDmszQ3LvigCGOdNq5ZuoO3BCR+uX3LkMgcqsGLHNiKNVBeqWdOq+n/mGoHZhJdD/JQbQ4DXr+0UnOulOA3iCSAGsORMePyYjCrBhqOb38R3Dw0xaof1zNHSIHMXKb/GBYY/P0MmAGSH191LBbMzMixGiuUfMZgu4NPCgJUGTxi+vavR8u2ns2EdOQ==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=Brian.Woods@xxxxxxx;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "Woods, Brian" <Brian.Woods@xxxxxxx>, "Suthikulpanit, Suravee" <Suravee.Suthikulpanit@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Delivery-date: Fri, 19 Jul 2019 18:36:46 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVO/Up+mMK2rYsWEmGw2zAQbNEg6bSSeOA
  • Thread-topic: [PATCH v3 09/14] AMD/IOMMU: split amd_iommu_init_one()

On Tue, Jul 16, 2019 at 04:39:10PM +0000, Jan Beulich wrote:
> Mapping the MMIO space and obtaining feature information needs to happen
> slightly earlier, such that for x2APIC support we can set XTEn prior to
> calling amd_iommu_update_ivrs_mapping_acpi() and
> amd_iommu_setup_ioapic_remapping().
> 
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

Acked-by: Brian Woods <brian.woods@xxxxxxx>

> --- a/xen/drivers/passthrough/amd/iommu_init.c
> +++ b/xen/drivers/passthrough/amd/iommu_init.c
> @@ -970,14 +970,6 @@ static void * __init allocate_ppr_log(st
>   
>   static int __init amd_iommu_init_one(struct amd_iommu *iommu)
>   {
> -    if ( map_iommu_mmio_region(iommu) != 0 )
> -        goto error_out;
> -
> -    get_iommu_features(iommu);
> -
> -    if ( iommu->features.raw )
> -        iommuv2_enabled = 1;
> -
>       if ( allocate_cmd_buffer(iommu) == NULL )
>           goto error_out;
>   
> @@ -1202,6 +1194,23 @@ static bool_t __init amd_sp5100_erratum2
>       return 0;
>   }
>   
> +static int __init amd_iommu_prepare_one(struct amd_iommu *iommu)
> +{
> +    int rc = alloc_ivrs_mappings(iommu->seg);
> +
> +    if ( !rc )
> +        rc = map_iommu_mmio_region(iommu);
> +    if ( rc )
> +        return rc;
> +
> +    get_iommu_features(iommu);
> +
> +    if ( iommu->features.raw )
> +        iommuv2_enabled = true;
> +
> +    return 0;
> +}
> +
>   int __init amd_iommu_init(void)
>   {
>       struct amd_iommu *iommu;
> @@ -1232,7 +1241,7 @@ int __init amd_iommu_init(void)
>       radix_tree_init(&ivrs_maps);
>       for_each_amd_iommu ( iommu )
>       {
> -        rc = alloc_ivrs_mappings(iommu->seg);
> +        rc = amd_iommu_prepare_one(iommu);
>           if ( rc )
>               goto error_out;
>       }
> 

-- 
Brian Woods

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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