RE: [RFCv2 PATCH 7/7] iommu/amd: Add nested domain attach/detach support

From: Tian, Kevin
Date: Mon Jan 22 2024 - 03:58:00 EST


> From: Suravee Suthikulpanit <suravee.suthikulpanit@xxxxxxx>
> Sent: Friday, January 12, 2024 8:07 AM
>
>
> - /* Use system default */
> - tmp = amd_iommu_gpt_level;
> + if (amd_iommu_domain_is_nested(pdom)) {
> + /*
> + * For nested domain, guest provide guest-paging mode.
> + * We need to check host capability before setting the mode.
> + */
> + tmp = pdom->guest_paging_mode;
> + if (tmp > amd_iommu_gpt_level) {
> + pr_err("Cannot support Guest paging mode=%#x
> (dom_id=%#x).\n",
> + pdom->guest_paging_mode, pdom->id);
> + tmp = amd_iommu_gpt_level;
> + }

why not returning error to the caller