From nobody Sun Nov 24 03:52:55 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=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1727458254; cv=pass; d=zohomail.com; s=zohoarc; b=d9xSLRpeXOwSgsXl4irz7Y4GoZTO/jrszuXeZowX5R3wvSIoFQCEnsedmhAbYBDers9QUmnMeZ29nM71Gv9AukGH66RbeyiPdIUjogCCevPBUM9qDIwT6UHvAGH+xnonXcXU7EtH8S41yMY/6IGFmgvENAC+OjNQEnvo1f8MbUw= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727458254; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=fiUFtG59lhwAG6HF/G8uqYCoEBCj23N1msfxsyHPVus=; b=RBExbdPA/7v99lQpUWLnvJvkGY9nQBc/kzbdG6w4Q3QgjotpDbUKPaHWdIWqx6gdIBlYx7AOe/R/Mkr8EQ4zKPTb2uq12cep3/GlPg/HIzheWK1xDWhWSrQFJ428jGVRodgxfg3moHCXM7SzbPI9RRsSxHsDRlh3yRfgXUygHbQ= ARC-Authentication-Results: i=2; 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=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1727458254969652.902836139575; Fri, 27 Sep 2024 10:30:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1suEnW-0008SI-JU; Fri, 27 Sep 2024 13:30:30 -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 1suEnU-0008Jq-NN for qemu-devel@nongnu.org; Fri, 27 Sep 2024 13:30:28 -0400 Received: from mail-dm6nam04on20620.outbound.protection.outlook.com ([2a01:111:f403:2409::620] helo=NAM04-DM6-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1suEnR-0002rr-V6 for qemu-devel@nongnu.org; Fri, 27 Sep 2024 13:30:28 -0400 Received: from SJ0PR03CA0144.namprd03.prod.outlook.com (2603:10b6:a03:33c::29) by DM4PR12MB6352.namprd12.prod.outlook.com (2603:10b6:8:a0::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.28; Fri, 27 Sep 2024 17:30:14 +0000 Received: from SJ5PEPF000001EE.namprd05.prod.outlook.com (2603:10b6:a03:33c:cafe::d8) by SJ0PR03CA0144.outlook.office365.com (2603:10b6:a03:33c::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.19 via Frontend Transport; Fri, 27 Sep 2024 17:30:14 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by SJ5PEPF000001EE.mail.protection.outlook.com (10.167.242.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8005.15 via Frontend Transport; Fri, 27 Sep 2024 17:30:12 +0000 Received: from volcano-ed17host-rhel.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 27 Sep 2024 12:30:10 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=nHalfYaSUESeWaqwoZeLCzYBfwfza3sRcUdH8bzJE/pgaH6vKjYF6sTLAzL4r41pmd8TtiUvZ0n9ukFloAjvSomt1WP7CEbZnjsOW+UE5PiK/rIVQCPNAOtDh6GP1jly8DGm3YID8555whGWh0QdX+iphJxgDeuXAwh0Imlef3cjVv965IvvhDgNk3Sqc6c0FY56jsRv1WY33nkdqC4PbTh7v0jy6ZdgGcozBhLY3g40thWZGbu7YWaAKJQ9KlYwMTzXGyhqWdb0o6uMJPn05aePmPnoWHZciz5TnGcez7lG/chBpyxpc6gvJY8TP3hg1btCJ+FPD8dILfMRXMf/wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=fiUFtG59lhwAG6HF/G8uqYCoEBCj23N1msfxsyHPVus=; b=rCMdzLBZ/uR2UgEwok4HOvrjUgJFrmAKd6zcJ+TbLEHJoiCz9jFB1SQkX3ucz4TNhMlqKRNUix2FMNb+/UG8k4CFez1m7KrgFWB2RFfxuaql39b96O54o1/Br5w6kjWDv1M1yweqSN4gcP1FMyfFXrqTvyyIJze7tOMeiEaXoT28aax5lVqyCaGuO/lOOjWrxZG4J64WYTwKw0jfpP/jzsxufrSxQKa5Ok3uFSXUhOdF56Kv9U8i616QueQl5xmi3cjI+cJQImloHcX6W7JEfJxo8QS+zMpHDOFkIjs5XBct7ka2WSvXtxplnmQeUQdQV79bSpy5phKbxJ5MpBrNRg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=temperror (sender ip is 165.204.84.17) smtp.rcpttodomain=nongnu.org smtp.mailfrom=amd.com; dmarc=temperror action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fiUFtG59lhwAG6HF/G8uqYCoEBCj23N1msfxsyHPVus=; b=BgL1xRYFP2hv5bOeGoMFpHEMKkH8JIJu1Z+VskdqwdvIORlPGnJiKLnkyNaEWMzvq9k/k0hYJyRC8AxAYIEWFal8Gfmk8ZYcL+5J8YtW9YN5u8jB8snjWfgHSjaXEyTuKA2kXaZ/3sWCK5SVnUYJwvZLbhhcRdiHvo3gstZBKw0= X-MS-Exchange-Authentication-Results: spf=temperror (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=temperror action=none header.from=amd.com; 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: TempError (protection.outlook.com: error in processing during lookup of amd.com: DNS Timeout) From: Santosh Shukla To: CC: , , , , , , , , Subject: [PATCH v3 4/5] amd_iommu: Send notification when invalidate interrupt entry cache Date: Fri, 27 Sep 2024 12:29:12 -0500 Message-ID: <20240927172913.121477-5-santosh.shukla@amd.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20240927172913.121477-1-santosh.shukla@amd.com> References: <20240927172913.121477-1-santosh.shukla@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ5PEPF000001EE:EE_|DM4PR12MB6352:EE_ X-MS-Office365-Filtering-Correlation-Id: 8ce5044d-6ae9-4cfa-090e-08dcdf1a0b27 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|376014|82310400026|36860700013; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?uQUqonsNO3UHrqV7ArciE0Da7ewrOTxOf1QfJXQK++TrJY9puB9LORVMVZQb?= =?us-ascii?Q?HlUQctzUjg8MkqKN58mlaL+7UpIFU8CVREvlYaJOUjBKn6tkZ1rnfwik6sTc?= =?us-ascii?Q?9zqxUJ3Y9gMJNeiH2qbDxHyOCGDxhWjzdub5ivgoUOIw8Js/K+O8Zl9Fr8n5?= =?us-ascii?Q?3p3ec1UzfpzhHehmS/Gr9IU5TR3qfKDKxbQb/v3KUewb3xeylaZOz4WJviBk?= =?us-ascii?Q?mU//fh1zJgTpveFDbXkQkPr+3hurrQToYNukSEbaIbzeyTghnuVqxvEwxKU4?= =?us-ascii?Q?WMehKHPGLHWz+JPzvMLHcPRGQlRf5bP443kHMKhGFxV6xwnWZMJAj3YFeDvj?= =?us-ascii?Q?1tEXnx/59Ro6phGz0fyYo976+NtlW91eqQIEKGXHe1qOzkbg2ckzxPrNNPHB?= =?us-ascii?Q?MpZzpfsJyvW4a7P2Xpf8kdtOrcjDsB4c4KfPqhl0fKPOURqMEcMqxSVYrtd6?= =?us-ascii?Q?u6beQIg6pTBQoMg5b6I9brZf8ApPYjOITuYbESU2TgZGzSkTuUMZS651k/Jg?= =?us-ascii?Q?xu8akkT3zEGShEdTe6vgYzsuMsSQAISMuo3UOWWqs4DEBJGz6HRk9EgK7WdT?= =?us-ascii?Q?1+3Q7cJDXVcT9SfOgZKXx//OXZJcvT7TOnIPpVp5gqJ1Ab/fyjgen0YttRn4?= =?us-ascii?Q?MEHxq5vanAsqOK6M1OHMBEk6AA3C1/5crSWQ0/HxJ520ntY0L3q+Wsrv36uu?= =?us-ascii?Q?186p5RMm8WVKPr5cbxxo+URktdFhga9S3MQFyviLUwWog1ThFEawFseqnVe8?= =?us-ascii?Q?ub/+isF+M4/mP1UOf8p9W9PCRIp5rivqxTZJcRmVqGb/CGLurSnioOPAMl4k?= =?us-ascii?Q?BqF9Sg5Oj/yhhQUEIBUyqQn0DbsDxFj4ocKRxcdJVVEpsW4edf4pZAJSZc2h?= =?us-ascii?Q?AplCs3ec0EcW7v319MHUAzklRQ2mzTwVNbmKPpAxcG0IGzYWXNMUTJPCNbgU?= =?us-ascii?Q?hVWgoS43DLGpOAF7ZY2Z8OU68ntdY5J2etmfOF/ka5M6qzXHyD5GGUVry/fa?= =?us-ascii?Q?JDirsOd/5+C9FOsFWbB//o+Ypp1MHv/f6TeoCMrafdzpchim4ckSwWrNzQrm?= =?us-ascii?Q?Wl2H6DGZVQyFR7PdbvJ+s+EEp/QjeG5rlrdoPgdhL3uqInYwzaeM/vXV4EgZ?= =?us-ascii?Q?RNUe0s9enQVgNmSTSq5Zp/IpkbICkvPMl6hnPLGo9R/7eZwHGo4YiFUxrLvv?= =?us-ascii?Q?Vs7/FEz+/sbtP6yR5wItuTL+jJfD+w87hqEZLl6e7AevsARCrbyrLhkw3V9D?= =?us-ascii?Q?DX1JtdSefRnzmmBBAMPDElfU1uohenEC6569sZevS/vXSdCikqr4Dosj8tOq?= =?us-ascii?Q?+2kjWnnY45l6Sozq7eOKadZgpr6OwzQcD67IP0XHsgE/HMdAluggNbK9P9kC?= =?us-ascii?Q?AFMRimjo/PRihW4CVsQfk4jz1a9VgswdvbA6oBx72vQZ3QCJ55iZK86vcCJY?= =?us-ascii?Q?xpnWyk8nT7HV5S0Dd6TtYk2nqjTxNPNK?= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(1800799024)(376014)(82310400026)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2024 17:30:12.7612 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8ce5044d-6ae9-4cfa-090e-08dcdf1a0b27 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ5PEPF000001EE.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6352 Received-SPF: permerror client-ip=2a01:111:f403:2409::620; envelope-from=Santosh.Shukla@amd.com; helo=NAM04-DM6-obe.outbound.protection.outlook.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.15, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-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 @amd.com) X-ZM-MESSAGEID: 1727458255929116600 Content-Type: text/plain; charset="utf-8" From: Suravee Suthikulpanit In order to support AMD IOMMU interrupt remapping emulation with PCI pass-through devices, QEMU needs to notify VFIO when guest IOMMU driver updates and invalidate the guest interrupt remapping table (IRT), and communicate information so that the host IOMMU driver can update the shadowed interrupt remapping table in the host IOMMU. Therefore, send notification when guest IOMMU emulates the IRT invalidation commands. Reviewed-by: Alejandro Jimenez Signed-off-by: Suravee Suthikulpanit Signed-off-by: Santosh Shukla --- v3: - Fixed the typos in patch description. hw/i386/amd_iommu.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c index 9b923f6eb482..38297376e7a9 100644 --- a/hw/i386/amd_iommu.c +++ b/hw/i386/amd_iommu.c @@ -431,6 +431,12 @@ static void amdvi_complete_ppr(AMDVIState *s, uint64_t= *cmd) trace_amdvi_ppr_exec(); } =20 +static void amdvi_intremap_inval_notify_all(AMDVIState *s, bool global, + uint32_t index, uint32_t mask) +{ + x86_iommu_iec_notify_all(X86_IOMMU_DEVICE(s), global, index, mask); +} + static void amdvi_inval_all(AMDVIState *s, uint64_t *cmd) { if (extract64(cmd[0], 0, 60) || cmd[1]) { @@ -438,6 +444,9 @@ static void amdvi_inval_all(AMDVIState *s, uint64_t *cm= d) s->cmdbuf + s->cmdbuf_head); } =20 + /* Notify global invalidation */ + amdvi_intremap_inval_notify_all(s, true, 0, 0); + amdvi_iotlb_reset(s); trace_amdvi_all_inval(); } @@ -486,6 +495,9 @@ static void amdvi_inval_inttable(AMDVIState *s, uint64_= t *cmd) return; } =20 + /* Notify global invalidation */ + amdvi_intremap_inval_notify_all(s, true, 0, 0); + trace_amdvi_intr_inval(); } =20 --=20 2.43.5