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 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 05A60CCF9E3 for ; Tue, 4 Nov 2025 18:03:14 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vGLM7-0008PO-4f; Tue, 04 Nov 2025 13:02:08 -0500 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 1vGLIU-0003dd-16; Tue, 04 Nov 2025 12:58:30 -0500 Received: from mail-southcentralusazlp170130001.outbound.protection.outlook.com ([2a01:111:f403:c10c::1] helo=SA9PR02CU001.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 1vGLIS-0007ao-A5; Tue, 04 Nov 2025 12:58:21 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=lp2jeMFmBz81XAsDfoLeINVE7IzUvTLVlWOhdR3GpAveMCOvKDTvkq2Cnu6gKehzTEqqieHvzyCWGHuwKAzn07w352lXJKPUPtJN0QHgVyPAQ1+hWjQShKRCdiJk0SBqnAt/e1s5IN1Jt7ya5o0XWFgcviY1o2U92obsqfTvP+Vu518G2P4B0nWk0yHx0jy7PIpQJzbheZ1otoJaqeLpcqtuiwUequIVkcAG8Jrek1HfXDEQtzUEEpu16FFQGfMMAHeS+iLMxD6yJQkpQ0R5CnTjq1+DEXvYzCjPp9hoagoRjaeeC7m1vr9WuZBVy6oBskf+r/1Isse0ELh4hBdUPw== 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=ZQWVHrN+Gj8syVpU70/Pec49UmvQPqFfwIuGqK4KrjI=; b=PU9lhZWNWYuxG2mD70IUcXGOuthbhexBbAiDPOVF2pkL4l8Fo5NarWBvEj1ApWLQQAwR+P/Fys8m5+oU0vBkrmGV7IknZvC9+yrObpg7xm3wfTLVLhaoW+/TnVK2p6TB8puz1FDh0z33ePstTwbWRwyP86xbsCqoEHXlDdMWyFGt1os7llrYsFVVBvvYzDRATRbHUy5Tg4eC5FKOwOf+uo0DqTHsV1z9vyfxBunxcZOslGy8K46GET1c57a0eJz+V2XZioON7j0SnL16L2idE+dDBuGvkv4sZv2MGAhgN+Kw9sCqrIRxL0V7L/cUPqZLS4l1ThbxLq9velrFbMmuMQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=intel.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZQWVHrN+Gj8syVpU70/Pec49UmvQPqFfwIuGqK4KrjI=; b=d74bhJ0TQT4mrywqAeXGmz4Owd2m7ghgkzxWrVL5kfKh2Vv8ivY/rCzgaqFEuOSjIfz6Nc+ZSpI3A45MTgU3Jz32SZV2NzXbPRm4mX9OJQykj/CtYa56w7s//OeMZx7apSfurEbBdr8g4xz1u2pgm4kzrqTWam5DAvaBm4CPNTnjx/LYbjpdv8kbHMJ9r2Vz6mSmgQluwvNLXA1glvnmWPE9CfwpsF8y71i00NWuepXXqdfpbtP5HH45+NEbIv4WO5AllsZmOIFxxsAefA+1Xc3TXo8U75Ty5O0eJoUsij7MY0gSwcUHWtBIBpvdipTyNZYM9EZaZYG77zt4bNmBpQ== Received: from DS7PR05CA0096.namprd05.prod.outlook.com (2603:10b6:8:56::28) by CH3PR12MB8403.namprd12.prod.outlook.com (2603:10b6:610:133::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9298.7; Tue, 4 Nov 2025 17:58:11 +0000 Received: from DS1PEPF00017092.namprd03.prod.outlook.com (2603:10b6:8:56:cafe::17) by DS7PR05CA0096.outlook.office365.com (2603:10b6:8:56::28) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9298.7 via Frontend Transport; Tue, 4 Nov 2025 17:57:58 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by DS1PEPF00017092.mail.protection.outlook.com (10.167.17.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9298.6 via Frontend Transport; Tue, 4 Nov 2025 17:58:11 +0000 Received: from rnnvmail204.nvidia.com (10.129.68.6) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Tue, 4 Nov 2025 09:57:56 -0800 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail204.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Tue, 4 Nov 2025 09:57:55 -0800 Received: from Asurada-Nvidia (10.127.8.11) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20 via Frontend Transport; Tue, 4 Nov 2025 09:57:54 -0800 Date: Tue, 4 Nov 2025 09:57:53 -0800 From: Nicolin Chen To: Jason Gunthorpe CC: Shameer Kolothum , Eric Auger , "qemu-arm@nongnu.org" , "qemu-devel@nongnu.org" , "peter.maydell@linaro.org" , "ddutile@redhat.com" , "berrange@redhat.com" , Nathan Chen , Matt Ochs , "smostafa@google.com" , "wangzhou1@hisilicon.com" , "jiangkunkun@huawei.com" , "jonathan.cameron@huawei.com" , "zhangfei.gao@linaro.org" , "zhenzhong.duan@intel.com" , "yi.l.liu@intel.com" , Krishnakant Jaju Subject: Re: [PATCH v5 15/32] hw/pci/pci: Introduce optional get_msi_address_space() callback Message-ID: References: <318947de-4467-4ced-a5d2-929e3df210ef@redhat.com> <20251104142052.GD1537560@nvidia.com> <20251104145157.GF1537560@nvidia.com> <20251104151234.GG1537560@nvidia.com> <20251104153535.GH1537560@nvidia.com> <20251104174152.GI1537560@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20251104174152.GI1537560@nvidia.com> X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF00017092:EE_|CH3PR12MB8403:EE_ X-MS-Office365-Filtering-Correlation-Id: 12319ac0-4014-4548-d545-08de1bcbb81c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|82310400026|7416014|376014|36860700013; X-Microsoft-Antispam-Message-Info: =?us-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sfPyrDVl7x0UzTUGNCQGkhWJy1?= =?us-ascii?Q?/hXG8P4016mtX/O9/OmcQlkokL+sdE5XdeJlRtDWzYI2KbtgvOvZ3na3lXip?= =?us-ascii?Q?WkULSK4ieBJq/TzODPQJaEoJFlykDr0L8qFpnz/mHI7FKs0T494wdCnwBt67?= =?us-ascii?Q?480yMkWmtxwe4rjktPDlmTvzlxxxwny7tRGEfYnPtpZR9uplzXuQQxhwUESH?= =?us-ascii?Q?4nfa7mh0EUiKsG8GfKf9q/SiziMEvWUUzSCZOzBAVnnxGNAj4o2AmUOpdRUn?= =?us-ascii?Q?+KM1Yf6x5L22kvgUo3mXKHNlxCx2GpqVrIx9QQZIweb2+xHAXVqzOwGR+VAF?= =?us-ascii?Q?3b1SoLIB5WlwOjCb/NBkxAGs31Iw+RW1nKZNoSvjajCRlcQaC44/xLmaVJML?= =?us-ascii?Q?P2yJYBiu4kajVYXu9Y/KxS5y3T/G768KtmkmXqo6QXpBwKnddSIuX9i7dNRf?= =?us-ascii?Q?wXr2W+xUextVGVcRZwjPTz/nn/6zy0JhqLeUnpQ9w2ZwY2bkMuFo0LU1+ijz?= =?us-ascii?Q?leG7pK1F+GXWC3+nB0nQDCZ4cbwdIqQyaM8Y94gXyypSlXrEseGpfcNooXni?= =?us-ascii?Q?OcycX7d//UGqj/9xccUlWZAJ2BInRtAWxsqDhb67YXiKscofJPWcZ5VVs4n1?= =?us-ascii?Q?Ka+CDlDBdI1BcPNg6uZFpGblcXbZfxru63Te3y/eArbZXR28bPfrzAa2uBEJ?= =?us-ascii?Q?Tx3f1tU3KmZfLj3KLuI=3D?= X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230040)(1800799024)(82310400026)(7416014)(376014)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Nov 2025 17:58:11.2975 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 12319ac0-4014-4548-d545-08de1bcbb81c X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF00017092.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8403 Received-SPF: permerror client-ip=2a01:111:f403:c10c::1; envelope-from=nicolinc@nvidia.com; helo=SA9PR02CU001.outbound.protection.outlook.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, DKIMWL_WL_HIGH=-0.788, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FORGED_SPF_HELO=1, SPF_HELO_PASS=-0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-arm@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-arm-bounces+qemu-arm=archiver.kernel.org@nongnu.org Sender: qemu-arm-bounces+qemu-arm=archiver.kernel.org@nongnu.org On Tue, Nov 04, 2025 at 01:41:52PM -0400, Jason Gunthorpe wrote: > On Tue, Nov 04, 2025 at 09:11:55AM -0800, Nicolin Chen wrote: > > On Tue, Nov 04, 2025 at 11:35:35AM -0400, Jason Gunthorpe wrote: > > > On Tue, Nov 04, 2025 at 03:20:59PM +0000, Shameer Kolothum wrote: > > > > > On Tue, Nov 04, 2025 at 02:58:44PM +0000, Shameer Kolothum wrote: > > > > > > > Sure it is trapped, but nothing should be looking at the MSI address > > > > > > > from the guest, it is meaningless and wrong information. Just ignore > > > > > > > it. > > > > > > > > > > > > Hmm.. we need to setup the doorbell address correctly. > > > > > > > > > > > If we don't do the translation here, it will use the Guest IOVA > > > > > > address. Remember, we are using the IORT RMR identity mapping to get > > > > > > MSI working. > > > > > > > > > > Either you use the RMR value, which is forced by the kernel into the > > > > > physical MSI through iommufd and kernel ignores anything qemu > > > > > does. So fully ignore the guest's vMSI address. > > > > > > > > Well, we are sort of trying to do the same through this patch here. > > > > But to avoid a "translation" completely it will involve some changes to > > > > Qemu pci subsystem. I think this is the least intrusive path I can think > > > > of now. And this is a one time setup mostly. > > > > > > Should be explained in the commit message that the translation is > > > pointless. I'm not sure about this, any translation seems risky > > > because it could fail. The guest can use any IOVA for MSI and none may > > > fail. > > > > In the current design of KVM in QEMU, it does a generic translation > > from gIOVA->gPA for the doorbell location to inject IRQ, whether VM > > has an accelerated IOMMU or an emulated IOMMU. > > And what happens if the translation fails because there is no mapping? > It should be ignored for this case and not ignored for others. It errors out and does no injection. IOW, yea, "ignored". Nicolin