From patchwork Sun Jun 30 12:33:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Chen, Jiqian" X-Patchwork-Id: 13717111 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.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 9ABCBC27C4F for ; Sun, 30 Jun 2024 12:34:40 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.751116.1159026 (Exim 4.92) (envelope-from ) id 1sNtlI-0000WU-8t; Sun, 30 Jun 2024 12:34:32 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 751116.1159026; Sun, 30 Jun 2024 12:34:32 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sNtlI-0000WL-5l; Sun, 30 Jun 2024 12:34:32 +0000 Received: by outflank-mailman (input) for mailman id 751116; Sun, 30 Jun 2024 12:34:31 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sNtlG-0007C1-Vp for xen-devel@lists.xenproject.org; Sun, 30 Jun 2024 12:34:30 +0000 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on20614.outbound.protection.outlook.com [2a01:111:f403:2009::614]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 18532fa6-36dd-11ef-90a3-e314d9c70b13; Sun, 30 Jun 2024 14:34:30 +0200 (CEST) Received: from CH2PR07CA0006.namprd07.prod.outlook.com (2603:10b6:610:20::19) by DS0PR12MB9324.namprd12.prod.outlook.com (2603:10b6:8:1b6::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.29; Sun, 30 Jun 2024 12:34:23 +0000 Received: from CH1PEPF0000A34A.namprd04.prod.outlook.com (2603:10b6:610:20:cafe::78) by CH2PR07CA0006.outlook.office365.com (2603:10b6:610:20::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.29 via Frontend Transport; Sun, 30 Jun 2024 12:34:23 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by CH1PEPF0000A34A.mail.protection.outlook.com (10.167.244.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7741.18 via Frontend Transport; Sun, 30 Jun 2024 12:34:23 +0000 Received: from cjq-desktop.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; Sun, 30 Jun 2024 07:34:19 -0500 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 18532fa6-36dd-11ef-90a3-e314d9c70b13 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y5KE5lmkOD+fbuNRjvVaRO4XuvsR85SCt2IPqhsPlxM0luPx7tJySuRqrqPXETcac1qIxOyvtHkHiWCWTxxe24SHxOBbC6TJvRMeAMsiaX33I8vAl3Sx2TuNTPLNO4DlMKW3MpVep97OKLngBzTDeI4lMWaMj3dY7+yXZkCqiVqR6B0FiDTYgEJMcVyNAjM4RujPjABlkjdP1t0ejyQfLcqcmW1y8VNLHZp8q3t80PHJ6BNJiqMMSSBsUldkhx+xOlF95pMK27gY5IYlFlidl8fVHxIW8YonMQKL/fb72Cs6Pak42lGdP/54Tl9T+foo7LEvHag0buXXy/Yygq49Uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=8/A6f8iRXUzEPbO8B0mLZ/2d23qq0f+RU7w4EWufx0c=; b=Qjke6Ibo4hGRvkJ+whaZ97hQy+KNMgNsm6SBS05QxHALmaPyU74Vt+4PMKNMVuCMgg1SfrwDhXXjemRNt7PcgS+tzK14j3BmL7tUJpOvrUNq6+NTH4fUjBy2qbdQYLVbFjh0NrvtcsVr7duc70RWq+WK2f9nHQt/WGcp25TRJKE+jyGKggH/G5knLZFBMQG2P1TMDbp0dscEF+0M/35GOK9KGDNvTWScpdUbR0GkYPUMQIWH1qA1HCIDAxVzBL7ePgIkXYaOoMcGqZcI0y8WBrb1wF9o3QwMmLEQLMPBcV25M+eXWt65PJMH9N63hcl5A6G9BgHSoB6uNSjo4eAOlQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) 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=8/A6f8iRXUzEPbO8B0mLZ/2d23qq0f+RU7w4EWufx0c=; b=Ys0CYFw3eGnVt3GTTyZid/dw7sNOeZvcoOHrPLwT6b12c6z76I6oZMxJZStvFVqA2Gc4+MpWB3HNQZw0FLuLamO+B6sJl1qWkYM3Er2X174As410Gv91CA03HpKFJR2yFWP+C5H3+BGWnMVeP0EPu4H311C8WrPWE+R2J3MqwqU= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C From: Jiqian Chen To: CC: Jan Beulich , Andrew Cooper , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Wei Liu , George Dunlap , Julien Grall , Stefano Stabellini , Anthony PERARD , "Juergen Gross" , "Daniel P . Smith" , Stewart Hildebrand , Huang Rui , Jiqian Chen , Huang Rui Subject: [XEN PATCH v11 6/8] tools/libxc: Allow gsi be mapped into a free pirq Date: Sun, 30 Jun 2024 20:33:42 +0800 Message-ID: <20240630123344.20623-7-Jiqian.Chen@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240630123344.20623-1-Jiqian.Chen@amd.com> References: <20240630123344.20623-1-Jiqian.Chen@amd.com> MIME-Version: 1.0 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: CH1PEPF0000A34A:EE_|DS0PR12MB9324:EE_ X-MS-Office365-Filtering-Correlation-Id: 5c7a08a3-11b2-4ea9-9d94-08dc9900f920 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|82310400026|36860700013|376014|1800799024; X-Microsoft-Antispam-Message-Info: 1lqTe4oKDSfpeo/Fu97gTNQKXXHVSXAjgNVlBTG+P0Qyo3TyLP7A+CJDtyelT44JzQwdlZN0m9fqzk/WtpeHTX76zFMPj6TiCIV7n9mHCPAIx6QO5E31RMu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+6SprDUi34GaP7PnpktsTzIo4aT2V63cP/6v+IJXCSrCaeCEN/LmozgJ0Uyf/JlvQ/GTid8lig5pEpglyZ+1iFfWwN42qw5lUR/FPvktQI6RG1d1aUhVmrLGLJv02rvZPq4GNP603uuosHsRj3+34KdKfvkpEuYE1VKg9/eN+xUAJejh4lSzWpzWScMWEMuIAHerUgV/Ce5UpY56LY9IWOI/Nh4iyo73P/xXZFUVaVvPHgDp8bQjaFhRs85bwQQ33ncUAxPS5279NT+ 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)(7416014)(82310400026)(36860700013)(376014)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jun 2024 12:34:23.7544 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5c7a08a3-11b2-4ea9-9d94-08dc9900f920 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: CH1PEPF0000A34A.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB9324 Hypercall PHYSDEVOP_map_pirq support to map a gsi into a specific pirq or a free pirq, it depends on the parameter pirq(>0 or <0). But in current xc_physdev_map_pirq, it set *pirq=index when parameter pirq is <0, it causes to force all cases to be mapped to a specific pirq. That has some problems, one is caller can't get a free pirq value, another is that once the pecific pirq was already mapped to other gsi, then it will fail. So, change xc_physdev_map_pirq to allow to pass negative parameter in and then get a free pirq. Signed-off-by: Jiqian Chen Signed-off-by: Huang Rui Signed-off-by: Jiqian Chen --- tools/libs/ctrl/xc_physdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/libs/ctrl/xc_physdev.c b/tools/libs/ctrl/xc_physdev.c index 460a8e779ce8..e9fcd755fa62 100644 --- a/tools/libs/ctrl/xc_physdev.c +++ b/tools/libs/ctrl/xc_physdev.c @@ -50,7 +50,7 @@ int xc_physdev_map_pirq(xc_interface *xch, map.domid = domid; map.type = MAP_PIRQ_TYPE_GSI; map.index = index; - map.pirq = *pirq < 0 ? index : *pirq; + map.pirq = *pirq; rc = do_physdev_op(xch, PHYSDEVOP_map_pirq, &map, sizeof(map));