Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2187481rwl; Thu, 13 Apr 2023 02:58:52 -0700 (PDT) X-Google-Smtp-Source: AKy350bLa/oT4M/DRYcilg4Cyru8Wc4/7IfAnFmgjjECyR5FJrAiEmibmISTkVpBDWTWhKh6/WN9 X-Received: by 2002:a05:6a20:428c:b0:ec:6f00:1a47 with SMTP id o12-20020a056a20428c00b000ec6f001a47mr981347pzj.32.1681379932666; Thu, 13 Apr 2023 02:58:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681379932; cv=none; d=google.com; s=arc-20160816; b=Yvv0dL3belpE8bI/m0zVYuLiVpMzasPqW0zqQoc7K2Z1BzZ4QmuEUPO90DWkzvs702 RSWsvqcSmE8W8cz90k1PTBAlBIiSrpXT59l9aYD85Pvqp06dvwUcbDTc8rVBy1sUp2nv lNYxdNhoJAJfXdlfKmDB1xMUQxmVXbsKU7yNllBYi873PfH+a8Tc9Va+v+ZKhX9nHIEy 2TQVid5sSbce6Bd0YZ1u+FwQaqsk67tJ+CwdXAxeKZ5H1ug8iXCnVBZnNoljL5/IVenH Z66QX/K43T5R1+j/CRXnvyitFdneI7M04IwP4sfNQmp9f+oiFo+P+NbDCVIQWOq2BHco ruvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=K1UDydjY2vGQxFnh+Wabu+cdGry34M9+GynRxmYMIBM=; b=p97X5GJj8/mVXrTUMLMCp52758Q/h8AVJ8aZiRAoFvxBM8/eNfNRJY7+kYnJlYNZ63 Vcgq3dpv2/TF+GEXgrC0ve8AoTkDDA6gGufIpZW3CrDTiXASUPacj9rMIE34CU81TPvK H1sFTgXLcUov1l7paL4RljjBsjw9UCsrVW9IjykwdPSQNRh0nrt2pN6JtgVPBK4b+b81 e6bDuZ+mHh6Ki3t744fpSi2RoWiVFfRVtdk3dmVRusAxAF6JSD2rimolvZHUIM6lvkDp Y3sUJjuezxRlft9Xe9PdsrFohcaCLq+NuYOYY835g88Zw/E4A+IiCEtVIAzrOYBwMQA5 gVew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@8bytes.org header.s=default header.b=U0ypDiQk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y4-20020a634944000000b0051916fa6d91si1688757pgk.328.2023.04.13.02.58.41; Thu, 13 Apr 2023 02:58:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@8bytes.org header.s=default header.b=U0ypDiQk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229836AbjDMJ6I (ORCPT + 99 others); Thu, 13 Apr 2023 05:58:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229593AbjDMJ6H (ORCPT ); Thu, 13 Apr 2023 05:58:07 -0400 Received: from mail.8bytes.org (mail.8bytes.org [85.214.250.239]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 61C866583 for ; Thu, 13 Apr 2023 02:58:06 -0700 (PDT) Received: from 8bytes.org (p200300c27714bc0086ad4f9d2505dd0d.dip0.t-ipconnect.de [IPv6:2003:c2:7714:bc00:86ad:4f9d:2505:dd0d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.8bytes.org (Postfix) with ESMTPSA id 6C50C243D2F; Thu, 13 Apr 2023 11:58:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=8bytes.org; s=default; t=1681379885; bh=Y40rcWs5DQa6d27AKOzN6Tedv3haYVyMXAYVrYXRWL0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=U0ypDiQk9tFmBmEF12v95LPN3aNT+EENoZyaqs8yktk1rvQ0r/tNUqE5/7k2zvhEm 3f+d7Y9slV+hpe2eY+xQqOEso/LkDh7FGZQfs0LDx2NcHxcWnraIMSgrGZ/HQchWNZ dIeNYHn13zuGy0I5y/ipCupR8UViRg3lrGCxTL/pb4b1hgfjuBWpnH6WA4KDqv1CrF 93ulzsPk+4pWA2kb/85ERr0eM3ACrdhzKbCdmaeE13LSYtpoetWnFbQNh93g+NWGbA j8Smn1FG6fPplfpFtCs58Kvjzf4bKh49f9CEHxcPVYedHKSHtgsyO0BXYsarSKoTBy 19xbXhrwX0ePQ== Date: Thu, 13 Apr 2023 11:58:04 +0200 From: Joerg Roedel To: Kishon Vijay Abraham I Cc: Will Deacon , Robin Murphy , Vasant Hegde , Suravee Suthikulpanit , Santosh Shukla , "Nikunj A . Dadhania" , iommu@lists.linux.dev, linux-kernel@vger.kernel.org, Joao Martins , Alejandro Jimenez Subject: Re: [PATCH v2] iommu/amd: Fix "Guest Virtual APIC Table Root Pointer" configuration in IRTE Message-ID: References: <20230405130317.9351-1-kvijayab@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230405130317.9351-1-kvijayab@amd.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 05, 2023 at 01:03:17PM +0000, Kishon Vijay Abraham I wrote: > commit b9c6ff94e43a ("iommu/amd: Re-factor guest virtual APIC > (de-)activation code") while refactoring guest virtual APIC > activation/de-activation code, stored information for activate/de-activate > in "struct amd_ir_data". It used 32-bit integer data type for storing the > "Guest Virtual APIC Table Root Pointer" (ga_root_ptr), though the > "ga_root_ptr" is actually a 40-bit field in IRTE (Interrupt Remapping > Table Entry). > > This causes interrupts from PCIe devices to not reach the guest in the case > of PCIe passthrough with SME (Secure Memory Encryption) enabled as _SME_ > bit in the "ga_root_ptr" is lost before writing it to the IRTE. > > Fix it by using 64-bit data type for storing the "ga_root_ptr". While at > that also change the data type of "ga_tag" to u32 in order to match > the IOMMU spec. > > Fixes: b9c6ff94e43a ("iommu/amd: Re-factor guest virtual APIC (de-)activation code") > Cc: stable@vger.kernel.org # v5.4+ > Reported-by: Alejandro Jimenez > Reviewed-by: Suravee Suthikulpanit > Signed-off-by: Kishon Vijay Abraham I Applied, thanks.