From nobody Wed May 15 02:42:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1694276712; cv=none; d=zohomail.com; s=zohoarc; b=gRUXUWlWmtKk0cdeqIeZ2PSR1G7/liGcnNSSYctrp67wva4LM2mfjmPblvgKFCjtaY9Z9XJvz9cakYwuhloDEcuTaPBTg3kzsJdjoJZy0vHKrspni6QY2OjyF3BpTtUyzR7tjufSBfFdzSHE/jYSKp+3a9uN2bKJ+f46Q7MIdTY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1694276712; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject; bh=zkebMQRumeFLdwtK0AMLRKP+R2TVkhDXpdruazqZgcA=; b=mBk6EzcOR3Hz0CxVl7UJygbX350ByhWYIn0gsFS9ZrBPmIBN5PjAoPoHl6a/6G3cZiKfpSafCnDTrAB/ABJ48G2vSK5NdBE0571vcwY/+SyuxJsYvUaJyD6abyexLUTFFzPGtdM/F4OTPl30V/KpW7iLboICm/q2R7JEbPi5mwY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1694276712000594.851852389107; Sat, 9 Sep 2023 09:25:12 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qf0ks-0006SM-EF; Sat, 09 Sep 2023 12:24:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qf0kr-0006S7-PV for qemu-devel@nongnu.org; Sat, 09 Sep 2023 12:24:17 -0400 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qf0kp-0008TF-Ax for qemu-devel@nongnu.org; Sat, 09 Sep 2023 12:24:17 -0400 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1c39a4f14bcso3870155ad.3 for ; Sat, 09 Sep 2023 09:24:14 -0700 (PDT) Received: from fedora.flets-east.jp ([2400:4050:a840:1e00:d54:e521:8bac:7bed]) by smtp.gmail.com with ESMTPSA id jd2-20020a170903260200b001bb99e188fcsm3437804plb.194.2023.09.09.09.24.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Sep 2023 09:24:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1694276653; x=1694881453; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=zkebMQRumeFLdwtK0AMLRKP+R2TVkhDXpdruazqZgcA=; b=QKdF+jN9WMvUVCh0pwTk67OvEOoYRLJYgBoMKgYxp/Nxxmf/x5sUsJlN6KOBu6TEnj qvsWamVu71soYqCpWUWWEYdPc1Km3NwdpMKKoJJMea6gEDzZtlz7Grj5VNXxavQj1qHg QbahXm4M8Kr86IQWaARk6u40X7XboL+TPQVQDtCoJ6uyclUU8ffzzR+4m0OHMxUuh+kL t9xYhW3kMaDAg4JTEMYytfvI9/IHqX19nHeG+T+03MSQtD5zONfVlbxrYPWB/9/oPTcp uPQUyic0HF66aBJRoy6HBhHl0f22MzlNJbWFdHnqSnO5q/mdYqAfr294l92HiyYYCxJn xMbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694276653; x=1694881453; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=zkebMQRumeFLdwtK0AMLRKP+R2TVkhDXpdruazqZgcA=; b=EI4x2pqCqZFSescN+mcZoV/qJ96UEFF/imo1LtgswNQ286AbVnQWsQyXHStElbRjtl BUSXJdYDoudvgD0cd+C4QAR4qpy73+cw7kPBmnkRd7TfCJDhOWZ7f0TvsXqe5AcI8R3M 4Ca24UANEsyNZ5aTjj6UwQUCntDS0lVvD/t2Ku80ZlStv2rQCNJ27dHh4Gy5zmmFOjZj kL0Xwm6xWylr4C921sxKN7VDZDqDLGxi21wbhhCJb01YPa1Co+WxcDTlrazzZzvXGUge NckLAqtgTy+Q71IJGhP/22WDVfuyygXuiNpa2DZq3v78iCLj/0cepymQRoNehLvg8co3 NPkQ== X-Gm-Message-State: AOJu0Yw/Wf3BWmVOsNRSstJhzrgY1PduMirWusO0gaS2g/+jN+nGIa8j hDNzz78QNKc8nYFcwPDqHbeLtY3t+gn1X6y0luc= X-Google-Smtp-Source: AGHT+IGD9QKloaF6g4VMk8CEGUQSNzb4CN/Uvj0fUGeFMtbkFB/RxrDrxpFfaP5p7Oyi6zhw25/clA== X-Received: by 2002:a17:902:f54b:b0:1bc:28a8:f856 with SMTP id h11-20020a170902f54b00b001bc28a8f856mr7219646plf.47.1694276653429; Sat, 09 Sep 2023 09:24:13 -0700 (PDT) From: Akihiko Odaki To: Cc: qemu-devel@nongnu.org, Marcel Apfelbaum , "Michael S. Tsirkin" , Eduardo Habkost , Richard Henderson , Paolo Bonzini , Akihiko Odaki Subject: [PATCH] amd_iommu: Fix APIC address check Date: Sun, 10 Sep 2023 01:23:53 +0900 Message-ID: <20230909162355.384982-1-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::62a; envelope-from=akihiko.odaki@daynix.com; helo=mail-pl1-x62a.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1694276713287100001 Content-Type: text/plain; charset="utf-8" An MSI from I/O APIC may not exactly equal to APIC_DEFAULT_ADDRESS. In fact, Windows 17763.3650 configures I/O APIC to set the dest_mode bit. Check only the 12 bits that are known to be fixed for I/O APIC-generated MSIs. Fixes: 577c470f43 ("x86_iommu/amd: Prepare for interrupt remap support") Signed-off-by: Akihiko Odaki --- hw/i386/amd_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c index 4655cd801f..3ac0d0098d 100644 --- a/hw/i386/amd_iommu.c +++ b/hw/i386/amd_iommu.c @@ -1268,7 +1268,7 @@ static int amdvi_int_remap_msi(AMDVIState *iommu, return -AMDVI_IR_ERR; } =20 - if ((origin->address & AMDVI_MSI_ADDR_LO_MASK) !=3D APIC_DEFAULT_ADDRE= SS) { + if ((origin->address & 0xfff00000) !=3D APIC_DEFAULT_ADDRESS) { trace_amdvi_err("MSI is not from IOAPIC."); return -AMDVI_IR_ERR; } --=20 2.41.0