From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8BD49C47257 for ; Mon, 4 May 2020 18:01:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 60AB32073B for ; Mon, 4 May 2020 18:01:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588615314; bh=DP6GuHWBhLYSM0nwAlW4kAgEOkm3d3zWXYfhE4/nkek=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=HWUKwf+Kc7LLSBQoaaVP7itPw3av4fKN0Xco2vi7UURdVaRN58Ao/hV9oOJXZN44B x9wbxsOQj2D1J+r45tZtNoGhd4MWvOTAjjzHzCVVMs8iVsYDSNxyOnIIJxzC5ZYNSY 8YBjyrIkyYMvnJNWJnPezdmjbDCsSadqoY/IV0O4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731238AbgEDSBx (ORCPT ); Mon, 4 May 2020 14:01:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:57704 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731196AbgEDSBv (ORCPT ); Mon, 4 May 2020 14:01:51 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1089020707; Mon, 4 May 2020 18:01:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588615311; bh=DP6GuHWBhLYSM0nwAlW4kAgEOkm3d3zWXYfhE4/nkek=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e/Jv8JMEgBZ+efvcydL5P9/yjfnO7tvklvJmhzvHvOAY1dybeCAUWvjjWiFlV6AOQ V8fJKXig+G2qSx19Ni39b6R9L8ldAzkD8mPpIkjYUGWmx7eaE8yLBSAz4IVUgu41k0 AJPUxwwBkytdgTGnbjv0agD8ZwAHVPjFIvi0kiI8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Suravee Suthikulpanit , Joerg Roedel Subject: [PATCH 4.19 25/37] iommu/amd: Fix legacy interrupt remapping for x2APIC-enabled system Date: Mon, 4 May 2020 19:57:38 +0200 Message-Id: <20200504165450.998396217@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200504165448.264746645@linuxfoundation.org> References: <20200504165448.264746645@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Suravee Suthikulpanit commit b74aa02d7a30ee5e262072a7d6e8deff10b37924 upstream. Currently, system fails to boot because the legacy interrupt remapping mode does not enable 128-bit IRTE (GA), which is required for x2APIC support. Fix by using AMD_IOMMU_GUEST_IR_LEGACY_GA mode when booting with kernel option amd_iommu_intr=legacy instead. The initialization logic will check GASup and automatically fallback to using AMD_IOMMU_GUEST_IR_LEGACY if GA mode is not supported. Fixes: 3928aa3f5775 ("iommu/amd: Detect and enable guest vAPIC support") Signed-off-by: Suravee Suthikulpanit Link: https://lore.kernel.org/r/1587562202-14183-1-git-send-email-suravee.suthikulpanit@amd.com Signed-off-by: Joerg Roedel Signed-off-by: Greg Kroah-Hartman --- drivers/iommu/amd_iommu_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/iommu/amd_iommu_init.c +++ b/drivers/iommu/amd_iommu_init.c @@ -2836,7 +2836,7 @@ static int __init parse_amd_iommu_intr(c { for (; *str; ++str) { if (strncmp(str, "legacy", 6) == 0) { - amd_iommu_guest_ir = AMD_IOMMU_GUEST_IR_LEGACY; + amd_iommu_guest_ir = AMD_IOMMU_GUEST_IR_LEGACY_GA; break; } if (strncmp(str, "vapic", 5) == 0) {