From patchwork Wed Feb 16 10:30:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 12748398 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 679CBC433EF for ; Wed, 16 Feb 2022 10:31:29 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.273927.469228 (Exim 4.92) (envelope-from ) id 1nKHaY-0006Td-Qv; Wed, 16 Feb 2022 10:31:10 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 273927.469228; Wed, 16 Feb 2022 10:31:10 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nKHaY-0006Su-Kp; Wed, 16 Feb 2022 10:31:10 +0000 Received: by outflank-mailman (input) for mailman id 273927; Wed, 16 Feb 2022 10:31:09 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nKHaX-0006QF-Qp for xen-devel@lists.xenproject.org; Wed, 16 Feb 2022 10:31:09 +0000 Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com [216.71.155.175]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 8b42a3d6-8f13-11ec-b215-9bbe72dcb22c; Wed, 16 Feb 2022 11:31:06 +0100 (CET) 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: 8b42a3d6-8f13-11ec-b215-9bbe72dcb22c DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1645007466; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=zVlywzfrFYT4j81Q9eKIZ01umyrGNIbePcDAlJ1CQAQ=; b=BaHpv8bOn0iSO14nCmuxM7hGFaqbjwCescefJUWFPQYCVRJCYJOGIA4+ 8Kd3/OaD2BI2XlFfxOH6pGdn9aH6g2LemPHT7X9MVWhqCCO2dQlMuwLEw 2lq8FWw91qp7YijQCu8qq3bb6ikGEbYsWA6I3vVtOKTh9ZYyVDYxHiasi E=; Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com IronPort-SDR: l/PpeIPovc6mK8WJ6pMCVSoyEj//rpDQ3TlaOQcYkHIVuCtOyGQDoQ+cAwvOR/zNXPMU5HdnP8 fotCSggbygUc5GPMeVYxYCGyc4bvvzFKMaWGz93oplz6yN3YpoIkGLRWkAZkc96nRhSGJuE8wR eDK5e+2zP1tOkcTMQEAL2A7t2UuLmGQiMgjU7KN3XDXMZlPVXTQZkOfsAUJiCbhw7ih1cEFlpK /YgTzhqj/0YOQQiQtTl01wJAjkq8P+CCx44nFV2MOiufZ/VBIXEaa8rdGwvTUdLUAN6WoAZiAB h38ZMtlKSdgVxUoM2dmsEi0z X-SBRS: 5.1 X-MesageID: 64225270 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:epsup6uf1Qub65YOrZr9gz2wrefnVL1ZMUV32f8akzHdYApBsoF/q tZmKWHXMv/ZYTf1L9x0YNnkoEpTuMXczoJqQABv/CxnRCIT+JbJXdiXEBz9bniYRiHhoOOLz Cm8hv3odp1coqr0/0/1WlTZQP0VOZigHtIQMsadUsxKbVIiGHd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nJ5MwFRbU/tLEfxf08HVcBCSAqsZj8 aar0RnWQMRfSl06XtrWcv+m03i4oWMZxLBpR0LNL9QKIBfs/YFmJjbflPgyJ81QexzPyiHDj 1SdAAsCpPmLqIgwqYGbiaeBpoavMu1/AksFQDWLsefobXHXpzPxz5VBXeCEeSHmeFn1oKjyN /9Iy/zcMeEcmAoYuYRLDLs2n7k14MHipuEGw108TmnLdVmiFphpPmKCgZtUrqRIy7JU5Vm2V 0aI9oUIMLmFIpq4QlsYJQ5jZeWfz/AE3DLV6K1tckn94SZ2+puBUFlTYEbQ2HAMcuMtPdN32 /olte4X9xe720gjPduxhyxJ83iBcy4bWKI9u5BGWILmh2LHEL2ZjUAw3sMu3KyyVg== IronPort-HdrOrdr: A9a23:7yYfb6OaXjbvo8BcTjujsMiBIKoaSvp037BK7S1MoNJuEvBw9v re+MjzsCWftN9/Yh4dcLy7VpVoIkmskKKdg7NhXotKNTOO0AeVxelZhrcKqAeQeREWmNQ96U 9hGZIOdeEZDzJB/LrHCN/TKade/DGFmprY+9s31x1WPGZXgzkL1XYDNu6ceHcGIjVuNN4CO7 e3wNFInDakcWR/VLXAOpFUN9Kz3uEijfjdEGY7OyI= X-IronPort-AV: E=Sophos;i="5.88,373,1635220800"; d="scan'208";a="64225270" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=C/mkjCdRUppdNHAnl2tHU0LDQ+bt4tk+sCtUB2CNhfwe3xMMbgMjgurhKOf7savGtdxJcsj28tOPvx7Ym4AGck+fD45u8BFrkHcW9zUwakKaJzDebTj941rDSJ61xgidY6hYhgoWdHoBIiSVSPWKFOmrPUWIGlHgM+Xy0VXrdaAnSWOL9rtQM6aIucvs8MKv71AqPJksan3I/JX2sH6j2OnBiaYj9dkiaBhGcOk21bguUf2uK7O7ycibzTHcl5yUwMVGCrWaO2eLkvDKN0NibEJMt3tbaDVJjeucB3w6DMf+qRggpwYPdzag+fU9URLflvDxSdhGjO58XynNzUd0Iw== 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=h8Tgei5/cDOMx9szRnWDQ16i7axYk3kXvj6N3RsL58M=; b=AMGQdgwIqdxY9da3YIyRG4WtLFw/nQToUcQ+5heQeheQAFTqO86+6rHLbqyVz9fzQlA5A/nrXhg4A6fx2ul5Usbgk4cZrmiFYVEma/gToq2CBsrBP7M+JMhdyvNZsxwkexfE293CGJaooKk7CC7IG1RcDzrday2/R9ZgPZewNFjCN8Kh9PZhy3gj4fjFpLSOnQeP/3xQjaJvMNuRLmO+Lp2AnM14Q1xRpCVoKVD6hXrjs8ZldSeU3+kA/70ajnnqHHq4bQjt+TDJw3Bv9H8tz1F7v+YrJngtzHkWUlqYGFsFjj2m3nTiTGhT4/v8EMweXkiv1hI46lwQECuPvEDkPQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=h8Tgei5/cDOMx9szRnWDQ16i7axYk3kXvj6N3RsL58M=; b=JfI+VDXna+Abmnlj+sNBDLrqMzek/AyqdBb8L5zcVXwNo0QZELrT0tiRNy5BudgLpC0SDYZCPZTpGRNwz5Dq6fA6ifK/IWSWPFsWWw3A5qnyCTvqCif1ws0RtdRJj591UlTuy6rrNc/t/iJBaDHRbs+VeTw3wXmecbMo1uIluhI= From: Roger Pau Monne To: CC: , Roger Pau Monne , Jan Beulich , Andrew Cooper , Wei Liu Subject: [PATCH v2 1/5] x86/cpuid: add CPUID flag for Extended Destination ID support Date: Wed, 16 Feb 2022 11:30:22 +0100 Message-ID: <20220216103026.11533-2-roger.pau@citrix.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220216103026.11533-1-roger.pau@citrix.com> References: <20220216103026.11533-1-roger.pau@citrix.com> X-ClientProxiedBy: LO4P265CA0023.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2ae::13) To SA0PR03MB5610.namprd03.prod.outlook.com (2603:10b6:806:b2::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b67c13fd-2d8d-496c-9c3c-08d9f1376aa3 X-MS-TrafficTypeDiagnostic: SJ0PR03MB6256:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lF0Lw1gFJ5/NKLbaFuMXzRM+sZD+7lU8nZxIUpOiZfh1Q7nnAlGpdaRkZYRko0Lb7raOmEkNLARQP4efaKwEXMeJgsL5iAZxq4sjBo9zv53SzthwsOjg87COpSUrAoLV2rhukDqgGPyWIifsxypQSC9ceN3yfvu7zwtpHhuYZj3tuNSjXX1uP7AxTdbe2yc0QkaCI+UXMPVuqKCSHqaSsU1UJwdKSRR8MUzZZZLcVnvhdAvCFnMmbn5lOJAiswxNBAuYdoY2Q61Q6YlEzovhs5anpaSYN/uIu3LghGVCBciZQdBuhOObnJSPayFRxKP1kSYK6PRkI0NBmJ+qPHH89PlMuuKgieZlJ3t1F0aXE6hmfXkBGEirALGAy/A/vsVQBVjoiSjhRx+P2jUipZGSOPYGiy5ui9vIzHTTsI8VpNM6UQSGB+lX5+Yju8YVbS/LibZ1G8jvKyOdUu+TY9tPdyj403/Wt3og3oZcwNCM2PjtUhwJr+/pkI7EF2rlPcOsn+nlz8C+si0w7PJJT7oHUaartry6MJamcKXR6uMhrH7zIdt5499oSLchXPFJtTiyIdWtTYd4zp24x6S8nqN7+wMxI+mqMepljyve+Px04lazgEzPW8RPMTv+s4lRofC+wsulzrrZyfVc2stmFhBsBoq9A729f1E5PsbnEdKV+4FELwcogSjbxjB0U86ULOpei4wy3JmCNpIqmbpJV6F1olPBtouoxvkcPtDsqnVaWA8= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA0PR03MB5610.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(8676002)(2616005)(66946007)(6506007)(6512007)(316002)(26005)(1076003)(66556008)(508600001)(86362001)(6486002)(6916009)(6666004)(54906003)(966005)(82960400001)(66476007)(83380400001)(4326008)(38100700002)(36756003)(5660300002)(2906002)(8936002)(186003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?7JVaB3eplJSkIhGFw4OJLmdZjK9+?= =?utf-8?q?YbK8Ukhii9pRg+FXJPJTizfvZeGI7SFch0n3aMzR2nGBkppYRNf6Lj/JmEJcdUbcF?= =?utf-8?q?LCigSJQEvtgTbp6YX8ZfboI8lPr0rhsIcEQKlToAjzI5D8UUTJI3Y1MNdnRCzhjXN?= =?utf-8?q?ZBiNpzJg1fAgsBdQ/Jd15o3lPsX09NRqjhzcxJkB9IiWkWgpaTUiPsYy7AKtVKbgg?= =?utf-8?q?LgxF0qAg4PNEwQizDwdW0U3dxuvVErI/Ybj45byk7pNuHd5tvH9CJFvfIFXNmjQTu?= =?utf-8?q?sxrLPFQYZanII2V+ov1UfstvTTfVjraKe/Nu1L0LgLzpqPVMX070QlvrWcqvAdoHq?= =?utf-8?q?HLxLn0sswIINyOKNI+il0iKue0I0S7zvRKSH/TvM4rRGtMl2VkWgPSezhfXou6GgX?= =?utf-8?q?b/xEbVrtIZ5WhE2bOglOlYP3bNo7XnYLaUnjCQvBM3FhMU8WC8m3z/T47mE7VxWo5?= =?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?5hODwEjL/+CtSwjJh6C8XVad16h8QBqcfrU5xhS7LqKsRwLnA3y0Vp6E/RBTeZE61?= =?utf-8?q?eslDJ+YbNMvHeogIMCooUG8f4dCW/QYCKsHlKTRh2i9VybgkL/d1tmdbxCrm2PyX7?= =?utf-8?q?2BDCNmrzOt8GtVU0HvEp48yGEWWh6+Mmwr0G1Gznzr1h4oLlyaQkejj+/v/8dx9SR?= =?utf-8?q?NK5Qpk6Ybt8Znw0E+t57Ob38kYtVGx5GuUPJFC9b0yI1el+KfZhOofY=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: b67c13fd-2d8d-496c-9c3c-08d9f1376aa3 X-MS-Exchange-CrossTenant-AuthSource: SA0PR03MB5610.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Feb 2022 10:30:56.6269 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: bH2vgfAnvnQWt7K6aFpUsSlyLq2k2gOWiq4YOLFmoNIZ8bLts5zybpa/QV/eh15Sw/hNt8muWnSYtH1rnShSBQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB6256 X-OriginatorOrg: citrix.com Introduce the CPUID flag to be used in order to signal the support for using an extended destination ID in IO-APIC RTEs and MSI address fields. Such format expands the maximum target APIC ID from 255 to 32768 without requiring the usage of interrupt remapping. The design document describing the feature can be found at: http://david.woodhou.se/15-bit-msi.pdf Signed-off-by: Roger Pau Monné Reviewed-by: Jan Beulich --- Changes since v1: - New in this version. --- xen/include/public/arch-x86/cpuid.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/xen/include/public/arch-x86/cpuid.h b/xen/include/public/arch-x86/cpuid.h index ce46305bee..49bcc93b6b 100644 --- a/xen/include/public/arch-x86/cpuid.h +++ b/xen/include/public/arch-x86/cpuid.h @@ -102,6 +102,12 @@ #define XEN_HVM_CPUID_IOMMU_MAPPINGS (1u << 2) #define XEN_HVM_CPUID_VCPU_ID_PRESENT (1u << 3) /* vcpu id is present in EBX */ #define XEN_HVM_CPUID_DOMID_PRESENT (1u << 4) /* domid is present in ECX */ +/* + * Bits 55:49 from the IO-APIC RTE and bits 11:5 from the MSI address can be + * used to store high bits for the Destination ID. This expands the Destination + * ID field from 8 to 15 bits, allowing to target APIC IDs up 32768. + */ +#define XEN_HVM_CPUID_EXT_DEST_ID (1u << 5) /* * Leaf 6 (0x40000x05) From patchwork Wed Feb 16 10:30:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 12748400 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 87D42C433FE for ; Wed, 16 Feb 2022 10:31:29 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.273928.469235 (Exim 4.92) (envelope-from ) id 1nKHaZ-0006Zz-5g; Wed, 16 Feb 2022 10:31:11 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 273928.469235; Wed, 16 Feb 2022 10:31:11 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nKHaY-0006WF-Te; Wed, 16 Feb 2022 10:31:10 +0000 Received: by outflank-mailman (input) for mailman id 273928; Wed, 16 Feb 2022 10:31:10 +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 1nKHaX-0006Q9-Nb for xen-devel@lists.xenproject.org; Wed, 16 Feb 2022 10:31:09 +0000 Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com [216.71.145.153]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 8be89e14-8f13-11ec-8eb8-a37418f5ba1a; Wed, 16 Feb 2022 11:31:07 +0100 (CET) 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: 8be89e14-8f13-11ec-8eb8-a37418f5ba1a DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1645007467; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=5wpWq0tN4xgsFJ1RqLxQToz/62F/R49dfWtSuwedAS8=; b=bzGDrsmZ3xV7Bv0VNz4RvJjbwfupD86ilWjxlhOFM4SX7zqvZMLJNDhP kLSgxR9vIPI10uUkBE9zzjGLCgckHCAp7z5nUK1JDlvGHsxA1rWDyyCbN R5ZZgFE+bXd4UYDlK34JmABp5Dz5I/ZvStrF42sGGSsb8chqwzheWaFAn s=; Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com IronPort-SDR: l9s/CC/67+Z/Ak4p6MqD2jRDxR9fIcFd+rrjm4ovNnX2CEqrU3XCTVQUA1uwUKyHfVAxTjtysX 8hxjiVEr7eDNhSYaqLpnck90BasA8lGzNcrllV4v8r7fK0XP2/jE0fwdPQFJyiHmEYcrTUHya7 AwEs9KSSy+qX12eSjWkSN7URZN5qLn5e0UIceCUX1TnNlzM0cqR+qUQkyee30jN7QrSjfeBTyU +sFvqnNyoCPGqE5blDUrSK2F6fiKPG8fsienlqeEPvEl9uHVmSdWbT8+wd6rWdbiyOdl5ijhbv NvNGDsCubsvR5fW+/Kd4agXU X-SBRS: 5.1 X-MesageID: 64324541 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:tKQDfa05+wtRyT7PM/bD5XF2kn2cJEfYwER7XKvMYLTBsI5bpzYGz DRNXTvQOvbcamrwc91wPd/k9xsE68LWn9JjSAs+pC1hF35El5HIVI+TRqvS04J+DSFhoGZPt Zh2hgzodZhsJpPkS5PE3oHJ9RGQ74nRLlbHILOCanAZqTNMEn9700o5wrBh2+aEvPDia++zk YKqyyHgEAfNNw5cagr4PIra9XuDFNyr0N8plgRWicJj5TcypFFMZH4rHomjLmOQf2VhNrXSq 9Avbl2O1jixEx8FUrtJm1tgG6EAaua60QOm0hK6V0U+6/TrS+NbPqsTbZIhhUlrZzqhlv5/7 OVn8tuMWQINNa7HmfYWQwd5DHQrVUFG0OevzXmXtMWSywvNcmf2wuUoB0YzVWEa0r8pWycUr 6VecW1TKEDY7w616OvTpu1EnMMsIdOtJIoCknph0SvYHbAtRpWrr6Diu4MDhmtt2pkm8fD2T ZcyUyZ2ZwT8aj5fCAgnT8kxtfyuvyyqG9FfgA3M/vdmi4TJ9yRzzbzsPdz9atGMA8JPkS6wv Xna9m70BhUbMt23yjef9H+owOjVkkvTWo0IE6aj3uV3m1DVzWsWYDUUX1ampfiyimalRslSb UcT/0IGvaU0sUCmUNT5dxm5u2Kf+A4RXcJKFO834x3LzbDbiy6VGW0bFBZAbtI8vcM7TDBs0 UWG9/v2ARR/vbvTTmiSnop4thvrZ3JTdzVbI3ZZE01VuLEPvb3fkDrGYNhHIITyyeHlHBX7w DuLviMumZQM2JtjO7qAwXjLhDelp57sRwEz5xnKUm/N0j6VdLJJdKTztwGFsK8owJKxCwDY4 SNaw5T2APUmUMnV/BFhVtnhC11ACxytFDTHyWBiEJA6n9hG0y7yJNsAiN2SyaoADy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88,373,1635220800"; d="scan'208";a="64324541" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bsIM4EBCg7e5qfHeW0KF51iSlKyOnSlD8wJ9TO8+ub19wN7+/VrlUHHA7VSWhBd37EVBE6tK81mC+fBbZDYk24zf+dm4R81Us82i6vlItZNyDjLbkBDvwGAUEIP5A9YSvo47/Q92xsWtvCV5GWI4sNAjAdKAqTWk6mnO3iKel5Zela9icxS3PEgYzbiaP54Qs4ZAnAgUC7KDxNsmZFfpTv42SHY3UN+opRFuw5fL2lcVIPMkKkP0wdbGrUjEaBP3EvsNBxdeywJB7JR437FIH73zdecO5iVxo/sA0V1yj1/awpReGhg0WrF+g94BPs/HKSk/eZIzF2eFwOB8wc8waQ== 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=FFQhQkphMi6Ap1Mi8N3n2KqtwVj5MU8P14jt20/cQvs=; b=Nxa7TfdIU2IVKfv0n2dfuFWNv3F72kb+IQEfB4DKBRU7AEDjta9wpsHSAo/4AjZePdXCUwWQzwpSFvEHWDgUrDmGyYD963o5T1e2TYgZaQNerg9JLGS8jeAc6fnLXltkAh0sOiU3kThDNpWp+ErHdaZCCCN0lho1+YBxJHhFutFyy6DxpfRf4jL2J20ZUyyUEK3qLBG5Reh933/WT9QrlI8QMSv0ZpPXy5SPE1b/klmiN4cwVOw1Wzl4wsQuW0Qr8sKLJr9wXvW4YOp/wIoRGjnKaBwMx1e4A7keHFcY0J2sZ2ygjqV0lFY1l8ai7y4xadEiOJI6PUTR1n4kZQzD7A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FFQhQkphMi6Ap1Mi8N3n2KqtwVj5MU8P14jt20/cQvs=; b=GSaHanj6KPwiXs4RuhFvwcczj4ifcnb/qt3SIFUJbUeIxrlcePvuxAqTC3NpXwEhterlc/y0HkQYxts/rH3NhmVPqZlxyVKKLzvcdS2HnL4HBsQ6uCGcTDrZO9J7VbDgFwiQPfIcV5NCUNON5LYnRMuFIjJ+idW/wGUAHLjBR2Q= From: Roger Pau Monne To: CC: , Roger Pau Monne , Wei Liu , Anthony PERARD , Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall , Stefano Stabellini , Juergen Gross Subject: [PATCH v2 2/5] xen/vioapic: add support for the extended destination ID field Date: Wed, 16 Feb 2022 11:30:23 +0100 Message-ID: <20220216103026.11533-3-roger.pau@citrix.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220216103026.11533-1-roger.pau@citrix.com> References: <20220216103026.11533-1-roger.pau@citrix.com> X-ClientProxiedBy: LO4P123CA0303.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:196::20) To SA0PR03MB5610.namprd03.prod.outlook.com (2603:10b6:806:b2::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fd3498a2-37f4-4737-ece1-08d9f1376d63 X-MS-TrafficTypeDiagnostic: SJ0PR03MB6256:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FkqpVYHhUxSDYLy3rTJyukU8sNMWcddPAhRN4TKmVE2Y7h9sDtA6UN/242WcyANkQXea5WM1JV3tO6LULh7qGL+SVYfn0bVEIHDjB60NGBL+Z/9Z9nCAIkvWAu9ye034UA/WEDyJShG4UsFlrEgX7+kKIOvxwynwVYAic1iRm7mIt7rDtivJqHeuPspMUkbtRkeyD5kOVwD/3/6d982sSO8OLmWsZkg1/x/7hh2lP58vWJHJRqFb6jY31WNlBKg1iwLYXXEmOyswcuVb5t5Mpw8nah/VTJx67OWPChzEbTWOFuvpGl1Dsz18uYQp/C3cDXw/XF1BesjdSl/q1EDjL9ywWn9fX9LwCE8yazyvIp3ZbJOGpv/4sNvDkYX5DQXKUyrvzpOZIOywzbmyRrezS4ksd9YyMVdhycr0bUEgFooy8X2M9ph+bMZ8wQ0imxpGMERjQ0ZZ/+ZCliEwCipvm26hb+Gz+KFhAqaODJxsnKMPyhRGAo34iEeHyrSGlmPo9w4ZHCqHgyELNO59EqcK+16Qi+qCve2NBSyR/MM5uIAqs/m9etBeIik7gKHj2qmFF5lowMOPg/c6j5pnFRBBIOATd5FlfFFUzM1S2P+mMrf9utof+afnkk1GgW9otOEMEab3aRVyQiDzmLtVnuD41cK58DmZ1626Z9dfH+SGW0geYbx1Wi4ti81/DK9JrATJJt6EkrQNYuCZqF1SrAGVmQPc5QyHjPy8ORoOHzi5Zpk= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA0PR03MB5610.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(8676002)(2616005)(66946007)(6506007)(6512007)(316002)(26005)(1076003)(66556008)(508600001)(86362001)(6486002)(6916009)(6666004)(54906003)(966005)(82960400001)(66476007)(83380400001)(4326008)(38100700002)(36756003)(5660300002)(2906002)(8936002)(186003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?kODmHXHU92q7102SzOloJQWEQJrn?= =?utf-8?q?5KJMAKr2SMt5wTh1bVKgMd+ghB73uk92YoV+MQ8miHWp8jnF4Hu4BCsFIov5EwWab?= =?utf-8?q?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iMkGYP3sVtgkqIp8Db1UyNptuEcXmrxU1UtGri+Wkjjg6xs0uF6N8TXZB?= =?utf-8?q?FC7LiP5Kd96xW2QEc4TuJY44HGDlc2TKz/hQdgkUsrT6a/FIvWLPH5sbfpYmzdc3v?= =?utf-8?q?+gKkgd27H015DnEsmenB/vdTaTpx3JDBDNPZNEyvsaGooftXUJpO/nkqGA9/IDbrq?= =?utf-8?q?sGCGrFFxSXE/F/oFaaP+dX9CyF+H/rpVr/hFmqPip5J8puBPYKy5E5YxQr8mUIzaE?= =?utf-8?q?zIqHM3VqmTB46OHXcs9wzlUVTPyzZ013C4qDCKjpfUTklg/NnuAC/dwEDyFOilKo8?= =?utf-8?q?4ZbnWGmX7t4F1Nb2BBXnnctf/wYaHA4yG7IEqtqLf7cF3jAbyWAnb2lOYtVh+pYlv?= =?utf-8?q?tGXQrnOGPSh5YIc9AkrZTAE1egIcqgQWx8LZwBORCXNPzYy39RfGmH5sZTgymKWS3?= =?utf-8?q?V3aoL3qNyz9SX6P5ugk//orzxPclo0Xx7fWcAIdyNfX5uRXNyOqHgbCYnKgw+pgJm?= =?utf-8?q?u/PsMBMyiALZWYGd9mFRyEYOIWAEobmMhQmm21t72Cic3BuVqKzMSkHtmEnOz5Stt?= =?utf-8?q?Sojhs5B7y4IvaSwDMTHtMLwsHBiIsgCHJTDlnVkPJxNjIxjscZVTYao=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: fd3498a2-37f4-4737-ece1-08d9f1376d63 X-MS-Exchange-CrossTenant-AuthSource: SA0PR03MB5610.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Feb 2022 10:31:01.2115 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: b2uxp29TvFaZ0eFye0mvPOHQV0+JON70DgKdeQ6AVypuzaaoTc2y/Rk4Zq3Lbot9FNGaj4JOnNV7iwsGBFOs+g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB6256 X-OriginatorOrg: citrix.com Such field uses bits 55:48, but for the purposes the register will be used use bits 55:49 instead. Bit 48 is used to signal an RTE entry is in remappable format which is not supported by the vIO-APIC. Use the extended destination ID to store the high bits from the destination ID, thus expanding the size of the destination ID field to 15 bits, allowing an IO-APIC to target APIC IDs up to 32768. A description of the feature can be found at: http://david.woodhou.se/15-bit-msi.pdf Note this is already supported by QEMU/KVM and HyperV. Introduce an option in xl.cfg to allow switching off the feature. Signed-off-by: Roger Pau Monné --- Changes since v1: - Expand commit message, add reference document. - Add xl option to disable the feature. --- docs/man/xl.cfg.5.pod.in | 10 ++++++++++ tools/include/libxl.h | 8 ++++++++ tools/libs/light/libxl_create.c | 6 ++++++ tools/libs/light/libxl_types.idl | 1 + tools/libs/light/libxl_x86.c | 12 ++++++++++++ tools/xl/xl_parse.c | 3 +++ xen/arch/x86/domain.c | 10 +++++++++- xen/arch/x86/hvm/vioapic.c | 3 +++ xen/arch/x86/include/asm/domain.h | 3 +++ xen/arch/x86/setup.c | 1 + xen/include/public/arch-x86/hvm/save.h | 4 +++- xen/include/public/arch-x86/xen.h | 2 ++ xen/include/public/domctl.h | 2 +- 13 files changed, 62 insertions(+), 3 deletions(-) diff --git a/docs/man/xl.cfg.5.pod.in b/docs/man/xl.cfg.5.pod.in index b98d161398..349e0b432a 100644 --- a/docs/man/xl.cfg.5.pod.in +++ b/docs/man/xl.cfg.5.pod.in @@ -2901,6 +2901,16 @@ option. If using this option is necessary to fix an issue, please report a bug. +=item B + +(HVM/PVH only) Signal the hypervisor whether the guest should be allowed to use +extended destination ID for interrupt messages. Such feature allow expanding +the target APIC ID from 8 to 15bits without requiring the usage of an emulated +IOMMU with interrupt remapping. Note this requires guest support and might not +be exposed to the guest even if explicitly set due to other constrains. + +Default: enabled + =back =head1 SEE ALSO diff --git a/tools/include/libxl.h b/tools/include/libxl.h index 51a9b6cfac..35329bca50 100644 --- a/tools/include/libxl.h +++ b/tools/include/libxl.h @@ -527,6 +527,14 @@ */ #define LIBXL_HAVE_MAX_GRANT_VERSION 1 +/* + * LIBXL_HAVE_X86_EXT_DEST_ID indicates the toolstack can signal to the + * hypervisor whether the domain wants to use the extended destination ID mode + * for interrupt messages. This is done by setting the libxl_domain_build_info + * arch_x86.ext_dest_id field. + */ +#define LIBXL_HAVE_X86_EST_DEST_ID 1 + /* * libxl ABI compatibility * diff --git a/tools/libs/light/libxl_create.c b/tools/libs/light/libxl_create.c index 7499922088..66ecfbdf4d 100644 --- a/tools/libs/light/libxl_create.c +++ b/tools/libs/light/libxl_create.c @@ -2330,6 +2330,12 @@ int libxl_domain_create_restore(libxl_ctx *ctx, libxl_domain_config *d_config, */ libxl_defbool_setdefault(&d_config->b_info.arch_x86.msr_relaxed, true); + /* + * Do not enable the extended destination ID for restored domains unless + * explicitly set. + */ + libxl_defbool_setdefault(&d_config->b_info.arch_x86.ext_dest_id, false); + return do_domain_create(ctx, d_config, domid, restore_fd, send_back_fd, params, ao_how, aop_console_how); } diff --git a/tools/libs/light/libxl_types.idl b/tools/libs/light/libxl_types.idl index 2a42da2f7d..bbfe218c48 100644 --- a/tools/libs/light/libxl_types.idl +++ b/tools/libs/light/libxl_types.idl @@ -648,6 +648,7 @@ libxl_domain_build_info = Struct("domain_build_info",[ ("vuart", libxl_vuart_type), ])), ("arch_x86", Struct(None, [("msr_relaxed", libxl_defbool), + ("ext_dest_id", libxl_defbool), ])), # Alternate p2m is not bound to any architecture or guest type, as it is # supported by x86 HVM and ARM support is planned. diff --git a/tools/libs/light/libxl_x86.c b/tools/libs/light/libxl_x86.c index 1feadebb18..68f4de7ea9 100644 --- a/tools/libs/light/libxl_x86.c +++ b/tools/libs/light/libxl_x86.c @@ -14,6 +14,11 @@ int libxl__arch_domain_prepare_config(libxl__gc *gc, break; case LIBXL_DOMAIN_TYPE_PV: config->arch.emulation_flags = 0; + if (libxl_defbool_val(d_config->b_info.arch_x86.ext_dest_id)) + { + LOG(ERROR, "Extended Destination ID not supported for PV guests"); + return ERROR_INVAL; + } break; default: abort(); @@ -22,6 +27,8 @@ int libxl__arch_domain_prepare_config(libxl__gc *gc, config->arch.misc_flags = 0; if (libxl_defbool_val(d_config->b_info.arch_x86.msr_relaxed)) config->arch.misc_flags |= XEN_X86_MSR_RELAXED; + if (libxl_defbool_val(d_config->b_info.arch_x86.ext_dest_id)) + config->arch.misc_flags |= XEN_X86_EXT_DEST_ID; return 0; } @@ -824,6 +831,8 @@ void libxl__arch_domain_build_info_setdefault(libxl__gc *gc, { libxl_defbool_setdefault(&b_info->acpi, true); libxl_defbool_setdefault(&b_info->arch_x86.msr_relaxed, false); + libxl_defbool_setdefault(&b_info->arch_x86.ext_dest_id, + b_info->type != LIBXL_DOMAIN_TYPE_PV); } int libxl__arch_passthrough_mode_setdefault(libxl__gc *gc, @@ -880,6 +889,9 @@ void libxl__arch_update_domain_config(libxl__gc *gc, */ libxl_defbool_setdefault(&dst->b_info.arch_x86.msr_relaxed, libxl_defbool_val(src->b_info.arch_x86.msr_relaxed)); + /* Force Extended Destination ID so it's part of the migration data. */ + libxl_defbool_setdefault(&dst->b_info.arch_x86.ext_dest_id, + libxl_defbool_val(src->b_info.arch_x86.ext_dest_id)); } /* diff --git a/tools/xl/xl_parse.c b/tools/xl/xl_parse.c index 117fcdcb2b..b609b76779 100644 --- a/tools/xl/xl_parse.c +++ b/tools/xl/xl_parse.c @@ -2761,6 +2761,9 @@ skip_usbdev: xlu_cfg_get_defbool(config, "vpmu", &b_info->vpmu, 0); + xlu_cfg_get_defbool(config, "ext_dest_id", &b_info->arch_x86.ext_dest_id, + 0); + xlu_cfg_destroy(config); } diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index ef1812dc14..9764f42878 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -685,12 +685,19 @@ int arch_sanitise_domain_config(struct xen_domctl_createdomain *config) } } - if ( config->arch.misc_flags & ~XEN_X86_MSR_RELAXED ) + if ( config->arch.misc_flags & + ~(XEN_X86_MSR_RELAXED | XEN_X86_EXT_DEST_ID) ) { dprintk(XENLOG_INFO, "Invalid arch misc flags %#x\n", config->arch.misc_flags); return -EINVAL; } + if ( !hvm && (config->arch.misc_flags & XEN_X86_EXT_DEST_ID) ) + { + dprintk(XENLOG_INFO, + "Extended Destination ID only supported for HVM\n"); + return -EINVAL; + } return 0; } @@ -862,6 +869,7 @@ int arch_domain_create(struct domain *d, domain_cpu_policy_changed(d); d->arch.msr_relaxed = config->arch.misc_flags & XEN_X86_MSR_RELAXED; + d->arch.ext_dest_id = config->arch.misc_flags & XEN_X86_EXT_DEST_ID; return 0; diff --git a/xen/arch/x86/hvm/vioapic.c b/xen/arch/x86/hvm/vioapic.c index 553c0f76ef..a02bd16b4b 100644 --- a/xen/arch/x86/hvm/vioapic.c +++ b/xen/arch/x86/hvm/vioapic.c @@ -424,6 +424,9 @@ static void vioapic_deliver(struct hvm_vioapic *vioapic, unsigned int pin) ASSERT(spin_is_locked(&d->arch.hvm.irq_lock)); + if ( d->arch.ext_dest_id ) + dest |= vioapic->redirtbl[pin].fields.virt_ext_dest_id << 8; + HVM_DBG_LOG(DBG_LEVEL_IOAPIC, "dest=%x dest_mode=%x delivery_mode=%x " "vector=%x trig_mode=%x", diff --git a/xen/arch/x86/include/asm/domain.h b/xen/arch/x86/include/asm/domain.h index e62e109598..83a1608212 100644 --- a/xen/arch/x86/include/asm/domain.h +++ b/xen/arch/x86/include/asm/domain.h @@ -440,6 +440,9 @@ struct arch_domain /* Don't unconditionally inject #GP for unhandled MSRs. */ bool msr_relaxed; + /* Use the Extended Destination ID to expand APIC ID. */ + bool ext_dest_id; + /* Emulated devices enabled bitmap. */ uint32_t emulation_flags; } __cacheline_aligned; diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index 115f8f6517..4aaa6ebc07 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -782,6 +782,7 @@ static struct domain *__init create_dom0(const module_t *image, dom0_cfg.arch.emulation_flags |= XEN_X86_EMU_LAPIC | XEN_X86_EMU_IOAPIC | XEN_X86_EMU_VPCI; + dom0_cfg.arch.misc_flags |= XEN_X86_EXT_DEST_ID; } if ( iommu_enabled ) diff --git a/xen/include/public/arch-x86/hvm/save.h b/xen/include/public/arch-x86/hvm/save.h index 773a380bc2..253dc89a04 100644 --- a/xen/include/public/arch-x86/hvm/save.h +++ b/xen/include/public/arch-x86/hvm/save.h @@ -376,7 +376,9 @@ union vioapic_redir_entry uint8_t trig_mode:1; uint8_t mask:1; uint8_t reserve:7; - uint8_t reserved[4]; + uint8_t reserved[3]; + uint8_t :1; + uint8_t virt_ext_dest_id:7; uint8_t dest_id; } fields; }; diff --git a/xen/include/public/arch-x86/xen.h b/xen/include/public/arch-x86/xen.h index 7acd94c8eb..06d64a309f 100644 --- a/xen/include/public/arch-x86/xen.h +++ b/xen/include/public/arch-x86/xen.h @@ -317,6 +317,8 @@ struct xen_arch_domainconfig { * doesn't allow the guest to read or write to the underlying MSR. */ #define XEN_X86_MSR_RELAXED (1u << 0) +/* Select whether to use Extended Destination ID for interrupt messages. */ +#define XEN_X86_EXT_DEST_ID (1u << 1) uint32_t misc_flags; }; diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h index b85e6170b0..31ec083cb0 100644 --- a/xen/include/public/domctl.h +++ b/xen/include/public/domctl.h @@ -38,7 +38,7 @@ #include "hvm/save.h" #include "memory.h" -#define XEN_DOMCTL_INTERFACE_VERSION 0x00000014 +#define XEN_DOMCTL_INTERFACE_VERSION 0x00000015 /* * NB. xen_domctl.domain is an IN/OUT parameter for this operation. From patchwork Wed Feb 16 10:30:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 12748401 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 11FC4C4332F for ; Wed, 16 Feb 2022 10:31:30 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.273929.469256 (Exim 4.92) (envelope-from ) id 1nKHad-0007Em-JL; Wed, 16 Feb 2022 10:31:15 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 273929.469256; Wed, 16 Feb 2022 10:31:15 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nKHad-0007Ed-Fe; Wed, 16 Feb 2022 10:31:15 +0000 Received: by outflank-mailman (input) for mailman id 273929; Wed, 16 Feb 2022 10:31:14 +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 1nKHac-0006Q9-FD for xen-devel@lists.xenproject.org; Wed, 16 Feb 2022 10:31:14 +0000 Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com [216.71.155.168]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 8e511560-8f13-11ec-8eb8-a37418f5ba1a; Wed, 16 Feb 2022 11:31:12 +0100 (CET) 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: 8e511560-8f13-11ec-8eb8-a37418f5ba1a DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1645007472; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=qxuQethwfQpd/T7pRowavpDI1K+1cW3pPru2nYffN4w=; b=M6sHPKZlDaNeNu3A0KUjstX4UJr0fTttHj4+oM6OZTUaAt71+1Kc9ZCG 11RT6Vb6ly2od0RqLp1eshprAPd7I5c3pWXBBzKtuOttGiED29pcnqN5f tkDymR9wcchVCMLmzkqrNA6P7EAkvRHiQL8kP84moVnb3LlSl58o+modT k=; Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com IronPort-SDR: 5UUH/pGaBEsRVlYbTpZCdYq6JNxUhg8Jt/SXXMhMVSgSoqglBWAJscGkv0uGKOQOFztYHdrrYv xGcOlsA7kB6/GVZwjDCVbtPsVHNVauQ6+rU04S5JS3yES5dHiYNdMzGvohyhE8okxyxlGqmqK5 A2iWXKU+8LrtT8U/tdYJQiKe+52+ObI70WQkanmKNjINxndjlq4Jvdch6+M4ogb01XApOYyiAG NSu2IDAMyoShcwUlLPmi4KLaigulYY+/F+sg8JpdIxdMCXaFrA4TGh/denCGHtpQrTX+R42KN2 dPib3g8d3oQuQf7B451t44ZE X-SBRS: 5.1 X-MesageID: 63768772 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:eMcmuqlMvDGQ5msBefar5s/o5gwgIURdPkR7XQ2eYbSJt1+Wr1Gzt xJKD2yEOvfbYzekeNAkaYrg9RsA7MTdnd9rQARvrCo3RSMWpZLJC+rCIxarNUt+DCFioGGLT Sk6QoOdRCzhZiaE/n9BClVlxJVF/fngqoDUUYYoAQgsA180IMsdoUg7wbRh2Nc22YHR7z6l4 rseneWOYDdJ5BYsWo4kw/rrRMRH5amaVJsw5zTSVNgT1LPsvyB94KE3fMldG0DQUIhMdtNWc s6YpF2PEsE1yD92Yj+tuu6TnkTn2dc+NyDW4pZ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TWtO7kNSTT8me575VHVeKEIWLUWG/uof3wb uRJ1fDsdvYAmQ8S4YZ7Fr9qy4M45sfu+OAGnlg1Qi2TYg3yWL16I3SA0c1ejYF3x+dU6VmsR 0aC2thGIrHVasnrJ0EceVg+ZeOZ2PBKxjSLtaYpIF/37TNc9aacVRkAJAGFjSFQIecnMI4hx ut96sca5xbm10gvO9eCyCtV636NPjoLVKB+7sMWB4riiwwKzFBeYMODVn+qsc/XM9gcYFM3J jK0hbbZg+UOz0XPRHM/CHzR0LcPnp8Joh1LkAcPKlnhdgApXRPrMMm9KQgKczk= IronPort-HdrOrdr: A9a23:zw2NzaCBFdlHGiHlHelW55DYdb4zR+YMi2TDt3oddfWaSKylfq GV7ZAmPHrP4gr5N0tOpTntAse9qBDnhPtICOsqTNSftWDd0QPFEGgL1+DfKlbbak/DH4BmtJ uJc8JFeaDN5VoRt7eH3OFveexQv+Vu88qT9JnjJ28Gd3AMV0n5hT0JcTpyFCdNNW97LKt8Lr WwzOxdqQGtfHwGB/7LfEXsD4D41qT2fIuNW29/OyIa X-IronPort-AV: E=Sophos;i="5.88,373,1635220800"; d="scan'208";a="63768772" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cIfh7YMa0TpVXz1blYI4bBZwY2rlL5JrXyB35aPVYn6p2JQ+uU5fJZA7IsHcxQCx9GMKi2hz46oU/cUXOuuwoQV90q3LRPQ+tlznnfLfTlgVcDjxWKH0s9+KIyKt+n3tjfoPWFyIrGmp4e2BLI/D4ZvfAV60T95NoQbfqK+lVPXzSBKJtcSpMhFI/heTzFS69cxKLa7ctkueA/1lBZVgtP3RwQBlp7czllOiU7oHZDNM7LcAoYgX7eq+dkS0Xp6rWQiAz0iGccJ3VUHJbGUOdodujc5uZ2RkZdSykW2/8bdV6+UxTcFhfaESNBKl760IH81aAYrqWGwy7CeiIeomhQ== 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=SBfiZgeoEobC8xSnV92kybukGWhlimNIsfw/oOQii3E=; b=AJCQ4he8iuQZaTnHzpCeZVNvdQxouBB6WDyCohKOh4UG7sBpr842JLfao0w5qlIDSLTqD+VeeU59e3LZWWoUfB5/nFvg8sDV6qg8NvC6Ng7cW3OoFN5fUPtsr47JIyr1oM3vEtjcvV7fU71kDXleIbbnWhBKhEq+ctLlpY/wkrAHTT1b6A+jtLX8gNAPzYO70+ipJHW0TvYkzwhM/FuNq6P1iAORKWVeUiD0ke38fKgY3ZNF5zZ2sZG8ay4JDYAxFtHEZ04qgi5vY5bzjEMngzJtMq1Q2paleZ0Yrsx9Ui79Vxz3zTevei8OVeTNvAt3qknVoQrpyS2w7EoR5F/4Ew== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SBfiZgeoEobC8xSnV92kybukGWhlimNIsfw/oOQii3E=; b=U18ys0vn/HVPNPrPBFEy6ER7io1JgTzdWTT82u/42wGcpfcwbaCFRlMikwNxwMr+WaPh6bCrLYbv/c1ap8ZLOtLbDjiY6iN0mHv4JJnFBI+MygcaBbCCVKodfVKKqD0C3r2nD/u1o9WxowYj1wgOjWGJvL6VGAJ4PZOJZUX4fIY= From: Roger Pau Monne To: CC: , Roger Pau Monne , Jan Beulich , Andrew Cooper , Wei Liu , George Dunlap , Julien Grall , Stefano Stabellini , Paul Durrant Subject: [PATCH v2 3/5] x86/vmsi: add support for extended destination ID in address field Date: Wed, 16 Feb 2022 11:30:24 +0100 Message-ID: <20220216103026.11533-4-roger.pau@citrix.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220216103026.11533-1-roger.pau@citrix.com> References: <20220216103026.11533-1-roger.pau@citrix.com> X-ClientProxiedBy: LO4P123CA0347.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:18d::10) To SA0PR03MB5610.namprd03.prod.outlook.com (2603:10b6:806:b2::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4795dab4-8efd-449e-e579-08d9f137702c X-MS-TrafficTypeDiagnostic: SJ0PR03MB6256:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YVWifTXL7IE5EOwo4WPERPxbr8F6V+r4qnEwt0ktehPM69LQQxvijuPy3EuoNXRHnFOYOyJ2oq9jlN4/Rq/Vbtxd+ktcWaFJTivvi6YtVhindWGjSRR4b+/2Z4ryZlfwfi8on9KBGqq12XiH/eFviikGwnflnr/fg6VTE573HbBBq6OS37upnliEo3OvxSONVaeCjrODS5DdJpoyuPjElkeIn+sEPeseyHYe7x/xBhufxRwRJ42oVTFrA/Wd6fsvDafhL8G8YyoD5vqWktVyx1PKzVMRX+AkxKyIbLkEI0oqegRGxdeGA2/2QCGJighOABIJNxI9WL9jf8gtozbYhocfGUJb8A0w/Up24/tgVYI3sPQvvKY77ntq5XyEppaamfzbNiAhxJA8MAulmhNgkGHx+qsGw6u1w206nMEV66087Rb2v0RqpVND0f/kgtk8FB/4fuKibXqG3I0cNt7bc0zOMwzr2WPo0nR8XLRwn1GYDhIZDIWTbTe9qA870pEnskgjB36zjaFiiaQaPIvFVHBXVhqocETYF8LnpONxGjiCzurUNDGIC9NoyZ/xE2686113roM2D+r5yj0xnBdiR7JCAKw/OzBX2T+E2LpaDsJSFADYGafmQZAyWbQHJVUoZNsos2j0Jj2pom0c9FC27A== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA0PR03MB5610.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(8676002)(2616005)(66946007)(6506007)(6512007)(316002)(26005)(1076003)(66556008)(508600001)(86362001)(6486002)(6916009)(6666004)(54906003)(82960400001)(66476007)(83380400001)(4326008)(38100700002)(36756003)(5660300002)(2906002)(8936002)(30864003)(186003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?YtTo9nwChojKL8NfbMhOKwyJU5V8?= =?utf-8?q?d6/s+hrNlVwxhFJ9FzxIeiE1su5Trc3lX+708IjUqV2oWYUU7KS/VbWoMpgXbOTEF?= =?utf-8?q?V5H3YXF/iVFmDLcXA0rQ5iWcq+AohJg3lTS4o8X0/LvoRUkH5+ClEYAs+QM9tK/h0?= =?utf-8?q?yPAdf2TK4HVo41oJq/1VGiNlLU2t7j3YwxjFWOhpmmX08QD4t0sT/hadQAshFdLhL?= =?utf-8?q?E+AwT0cbVp5G3a7zp963VEnYdGIsmNz3wq9WgOoGG9lGro4WcLrCy/0Jy1t1ByOuX?= =?utf-8?q?uOCGlO9tJNMtuWbUR+n7DBW2gOwiAJhPsX+T1d5YzvwvnHrNLdmd5cQTFj/+XtL1M?= =?utf-8?q?LqJ6KIVmaWXn6iYQ+7Fado2IgbCJ9pjR/3RWFkKO+qriP598ODCR8TEGHiuHkk4vy?= =?utf-8?q?GPfIm8bNtn7L7EpBdokmhqyOAhzYMBTL2ETDXkPshntFkJcpiGUbqUiqoOw3OKt3A?= =?utf-8?q?gFSeLHPoNw5Kl9U1Nbb+B7D4RqnwZrs5vZXIuianfpehCFXpFXNad2+Py6qpyNZMl?= =?utf-8?q?aRUe1+/Cp1P0STkLrh4leYjqhYEii1WWDXEwWGWjI7dR4JKwW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8?= =?utf-8?q?/Wsx+B/kfimsqyN7y/OXF4B85yaslYpj5G90BKvZyoVwO9ivdJULypvTgQzxuHq03?= =?utf-8?q?PJmsqUWXwVxRzgn77Xf4XQ3mn7bPdRzVWTr+eeFBfTMua+s9ujd3QAI=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 4795dab4-8efd-449e-e579-08d9f137702c X-MS-Exchange-CrossTenant-AuthSource: SA0PR03MB5610.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Feb 2022 10:31:05.9008 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 1oofrVM9duc4RJd50aJ4155qdwSeyM6/PzwtMT3n2sxyegzuqHF8Uiwq1ihL9hQ2v4Fw7qz5mK7ygWm5MPGgkQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB6256 X-OriginatorOrg: citrix.com Both QEMU/KVM and HyperV support using bits 11:5 from the MSI address field in order to store the high part of the target APIC ID. This allows expanding the maximum APIC ID usable without interrupt remapping support from 255 to 32768. Note the interface used by QEMU for emulated devices (via the XEN_DMOP_inject_msi hypercall) already passes both the address and data fields into Xen for processing, so there's no need for any change to QEMU there. However for PCI passthrough devices QEMU uses the XEN_DOMCTL_bind_pt_irq hypercall which does need a modification to the gflags field in order to pass an APIC destination ID greater than 255. Take the opportunity to make the domain parameter of hvm_girq_dest_2_vcpu_id const while modifying the other function parameters. Also adjust dest_mode when touching related code to make it bool. Signed-off-by: Roger Pau Monné Reviewed-by: Jan Beulich --- Changes since v1: - Do not expose extended destination ID support. - Use d->arch.ext_dest_id. - Add comment clarifying the usage of MSI_ADDR_VIRT_EXT_DEST_ID_MASK. --- xen/arch/x86/hvm/irq.c | 5 +++- xen/arch/x86/hvm/vmsi.c | 43 +++++++++++++++++++++--------- xen/arch/x86/include/asm/hvm/hvm.h | 5 ++-- xen/arch/x86/include/asm/msi.h | 7 +++++ xen/drivers/passthrough/x86/hvm.c | 11 +++++++- xen/drivers/vpci/msi.c | 2 +- xen/include/public/domctl.h | 1 + xen/include/xen/vpci.h | 2 +- 8 files changed, 58 insertions(+), 18 deletions(-) diff --git a/xen/arch/x86/hvm/irq.c b/xen/arch/x86/hvm/irq.c index 52aae4565f..e10e085a55 100644 --- a/xen/arch/x86/hvm/irq.c +++ b/xen/arch/x86/hvm/irq.c @@ -383,7 +383,7 @@ int hvm_set_pci_link_route(struct domain *d, u8 link, u8 isa_irq) int hvm_inject_msi(struct domain *d, uint64_t addr, uint32_t data) { uint32_t tmp = (uint32_t) addr; - uint8_t dest = (tmp & MSI_ADDR_DEST_ID_MASK) >> MSI_ADDR_DEST_ID_SHIFT; + unsigned int dest = MASK_EXTR(tmp, MSI_ADDR_DEST_ID_MASK); uint8_t dest_mode = !!(tmp & MSI_ADDR_DESTMODE_MASK); uint8_t delivery_mode = (data & MSI_DATA_DELIVERY_MODE_MASK) >> MSI_DATA_DELIVERY_MODE_SHIFT; @@ -391,6 +391,9 @@ int hvm_inject_msi(struct domain *d, uint64_t addr, uint32_t data) >> MSI_DATA_TRIGGER_SHIFT; uint8_t vector = data & MSI_DATA_VECTOR_MASK; + if ( vector && d->arch.ext_dest_id ) + dest |= MASK_EXTR(tmp, MSI_ADDR_VIRT_EXT_DEST_ID_MASK) << 8; + if ( !vector ) { int pirq = ((addr >> 32) & 0xffffff00) | dest; diff --git a/xen/arch/x86/hvm/vmsi.c b/xen/arch/x86/hvm/vmsi.c index 13e2a190b4..4af550cc2a 100644 --- a/xen/arch/x86/hvm/vmsi.c +++ b/xen/arch/x86/hvm/vmsi.c @@ -66,7 +66,7 @@ static void vmsi_inj_irq( int vmsi_deliver( struct domain *d, int vector, - uint8_t dest, uint8_t dest_mode, + unsigned int dest, bool dest_mode, uint8_t delivery_mode, uint8_t trig_mode) { struct vlapic *target; @@ -107,11 +107,14 @@ void vmsi_deliver_pirq(struct domain *d, const struct hvm_pirq_dpci *pirq_dpci) { uint32_t flags = pirq_dpci->gmsi.gflags; int vector = pirq_dpci->gmsi.gvec; - uint8_t dest = (uint8_t)flags; + unsigned int dest = MASK_EXTR(flags, XEN_DOMCTL_VMSI_X86_DEST_ID_MASK); bool dest_mode = flags & XEN_DOMCTL_VMSI_X86_DM_MASK; uint8_t delivery_mode = MASK_EXTR(flags, XEN_DOMCTL_VMSI_X86_DELIV_MASK); bool trig_mode = flags & XEN_DOMCTL_VMSI_X86_TRIG_MASK; + if ( d->arch.ext_dest_id ) + dest |= MASK_EXTR(flags, XEN_DOMCTL_VMSI_X86_EXT_DEST_ID_MASK); + HVM_DBG_LOG(DBG_LEVEL_IOAPIC, "msi: dest=%x dest_mode=%x delivery_mode=%x " "vector=%x trig_mode=%x\n", @@ -123,7 +126,8 @@ void vmsi_deliver_pirq(struct domain *d, const struct hvm_pirq_dpci *pirq_dpci) } /* Return value, -1 : multi-dests, non-negative value: dest_vcpu_id */ -int hvm_girq_dest_2_vcpu_id(struct domain *d, uint8_t dest, uint8_t dest_mode) +int hvm_girq_dest_2_vcpu_id(const struct domain *d, unsigned int dest, + bool dest_mode) { int dest_vcpu_id = -1, w = 0; struct vcpu *v; @@ -636,15 +640,21 @@ void msix_write_completion(struct vcpu *v) } #ifdef CONFIG_HAS_VPCI -static unsigned int msi_gflags(uint16_t data, uint64_t addr, bool masked) +static unsigned int msi_gflags(uint16_t data, uint64_t addr, bool masked, + bool ext_dest_id) { + unsigned int dest = MASK_EXTR(addr, MSI_ADDR_DEST_ID_MASK); + + if ( ext_dest_id ) + dest |= MASK_EXTR(addr, MSI_ADDR_VIRT_EXT_DEST_ID_MASK) << 8; + /* * We need to use the DOMCTL constants here because the output of this * function is used as input to pt_irq_create_bind, which also takes the * input from the DOMCTL itself. */ - return MASK_INSR(MASK_EXTR(addr, MSI_ADDR_DEST_ID_MASK), - XEN_DOMCTL_VMSI_X86_DEST_ID_MASK) | + return MASK_INSR(dest, XEN_DOMCTL_VMSI_X86_DEST_ID_MASK) | + MASK_INSR(dest, XEN_DOMCTL_VMSI_X86_EXT_DEST_ID_MASK) | MASK_INSR(MASK_EXTR(addr, MSI_ADDR_REDIRECTION_MASK), XEN_DOMCTL_VMSI_X86_RH_MASK) | MASK_INSR(MASK_EXTR(addr, MSI_ADDR_DESTMODE_MASK), @@ -698,7 +708,8 @@ static int vpci_msi_update(const struct pci_dev *pdev, uint32_t data, .irq_type = PT_IRQ_TYPE_MSI, .u.msi.gvec = (vector & ~vector_mask) | ((vector + i) & vector_mask), - .u.msi.gflags = msi_gflags(data, address, (mask >> i) & 1), + .u.msi.gflags = msi_gflags(data, address, (mask >> i) & 1, + pdev->domain->arch.ext_dest_id), }; int rc = pt_irq_create_bind(pdev->domain, &bind); @@ -826,8 +837,13 @@ void vpci_msi_arch_init(struct vpci_msi *msi) msi->arch.pirq = INVALID_PIRQ; } -void vpci_msi_arch_print(const struct vpci_msi *msi) +void vpci_msi_arch_print(const struct vpci_msi *msi, const struct domain *d) { + unsigned long dest = MASK_EXTR(msi->address, MSI_ADDR_DEST_ID_MASK); + + if ( d->arch.ext_dest_id ) + dest |= MASK_EXTR(msi->address, MSI_ADDR_VIRT_EXT_DEST_ID_MASK) << 8; + printk("vec=%#02x%7s%6s%3sassert%5s%7s dest_id=%lu pirq: %d\n", MASK_EXTR(msi->data, MSI_DATA_VECTOR_MASK), msi->data & MSI_DATA_DELIVERY_LOWPRI ? "lowest" : "fixed", @@ -835,8 +851,7 @@ void vpci_msi_arch_print(const struct vpci_msi *msi) msi->data & MSI_DATA_LEVEL_ASSERT ? "" : "de", msi->address & MSI_ADDR_DESTMODE_LOGIC ? "log" : "phys", msi->address & MSI_ADDR_REDIRECTION_LOWPRI ? "lowest" : "fixed", - MASK_EXTR(msi->address, MSI_ADDR_DEST_ID_MASK), - msi->arch.pirq); + dest, msi->arch.pirq); } void vpci_msix_arch_mask_entry(struct vpci_msix_entry *entry, @@ -891,11 +906,16 @@ void vpci_msix_arch_init_entry(struct vpci_msix_entry *entry) int vpci_msix_arch_print(const struct vpci_msix *msix) { + const struct domain *d = msix->pdev->domain; unsigned int i; for ( i = 0; i < msix->max_entries; i++ ) { const struct vpci_msix_entry *entry = &msix->entries[i]; + unsigned long dest = MASK_EXTR(entry->addr, MSI_ADDR_DEST_ID_MASK); + + if ( d->arch.ext_dest_id ) + dest |= MASK_EXTR(entry->addr, MSI_ADDR_VIRT_EXT_DEST_ID_MASK) << 8; printk("%6u vec=%02x%7s%6s%3sassert%5s%7s dest_id=%lu mask=%u pirq: %d\n", i, MASK_EXTR(entry->data, MSI_DATA_VECTOR_MASK), @@ -904,8 +924,7 @@ int vpci_msix_arch_print(const struct vpci_msix *msix) entry->data & MSI_DATA_LEVEL_ASSERT ? "" : "de", entry->addr & MSI_ADDR_DESTMODE_LOGIC ? "log" : "phys", entry->addr & MSI_ADDR_REDIRECTION_LOWPRI ? "lowest" : "fixed", - MASK_EXTR(entry->addr, MSI_ADDR_DEST_ID_MASK), - entry->masked, entry->arch.pirq); + dest, entry->masked, entry->arch.pirq); if ( i && !(i % 64) ) { struct pci_dev *pdev = msix->pdev; diff --git a/xen/arch/x86/include/asm/hvm/hvm.h b/xen/arch/x86/include/asm/hvm/hvm.h index b44bbdeb21..37e9d4c0fc 100644 --- a/xen/arch/x86/include/asm/hvm/hvm.h +++ b/xen/arch/x86/include/asm/hvm/hvm.h @@ -270,11 +270,12 @@ uint64_t hvm_get_guest_time_fixed(const struct vcpu *v, uint64_t at_tsc); int vmsi_deliver( struct domain *d, int vector, - uint8_t dest, uint8_t dest_mode, + unsigned int dest, bool dest_mode, uint8_t delivery_mode, uint8_t trig_mode); struct hvm_pirq_dpci; void vmsi_deliver_pirq(struct domain *d, const struct hvm_pirq_dpci *); -int hvm_girq_dest_2_vcpu_id(struct domain *d, uint8_t dest, uint8_t dest_mode); +int hvm_girq_dest_2_vcpu_id(const struct domain *d, unsigned int dest, + bool dest_mode); enum hvm_intblk hvm_interrupt_blocked(struct vcpu *v, struct hvm_intack intack); diff --git a/xen/arch/x86/include/asm/msi.h b/xen/arch/x86/include/asm/msi.h index e228b0f3f3..9d9509a368 100644 --- a/xen/arch/x86/include/asm/msi.h +++ b/xen/arch/x86/include/asm/msi.h @@ -54,6 +54,13 @@ #define MSI_ADDR_DEST_ID_SHIFT 12 #define MSI_ADDR_DEST_ID_MASK 0x00ff000 #define MSI_ADDR_DEST_ID(dest) (((dest) << MSI_ADDR_DEST_ID_SHIFT) & MSI_ADDR_DEST_ID_MASK) +/* + * Use the reserved bits 11:5 to store the high part of the APIC ID, that + * allows expanding the destination field from 8 to 15 bits. Note this is a + * feature only present in virtualized hardware and currently only exposed to + * guests but not used by the hypervisor itself. + */ +#define MSI_ADDR_VIRT_EXT_DEST_ID_MASK 0x0000fe0 /* MAX fixed pages reserved for mapping MSIX tables. */ #define FIX_MSIX_MAX_PAGES 512 diff --git a/xen/drivers/passthrough/x86/hvm.c b/xen/drivers/passthrough/x86/hvm.c index 0b37cd145b..9c42ebe17a 100644 --- a/xen/drivers/passthrough/x86/hvm.c +++ b/xen/drivers/passthrough/x86/hvm.c @@ -269,7 +269,8 @@ int pt_irq_create_bind( { case PT_IRQ_TYPE_MSI: { - uint8_t dest, delivery_mode; + unsigned int dest; + bool delivery_mode; bool dest_mode; int dest_vcpu_id; const struct vcpu *vcpu; @@ -346,6 +347,10 @@ int pt_irq_create_bind( /* Calculate dest_vcpu_id for MSI-type pirq migration. */ dest = MASK_EXTR(pirq_dpci->gmsi.gflags, XEN_DOMCTL_VMSI_X86_DEST_ID_MASK); + if ( d->arch.ext_dest_id ) + dest |= MASK_EXTR(pirq_dpci->gmsi.gflags, + XEN_DOMCTL_VMSI_X86_EXT_DEST_ID_MASK); + dest_mode = pirq_dpci->gmsi.gflags & XEN_DOMCTL_VMSI_X86_DM_MASK; delivery_mode = MASK_EXTR(pirq_dpci->gmsi.gflags, XEN_DOMCTL_VMSI_X86_DELIV_MASK); @@ -789,6 +794,10 @@ static int _hvm_dpci_msi_eoi(struct domain *d, XEN_DOMCTL_VMSI_X86_DEST_ID_MASK); bool dest_mode = pirq_dpci->gmsi.gflags & XEN_DOMCTL_VMSI_X86_DM_MASK; + if ( d->arch.ext_dest_id ) + dest |= MASK_EXTR(pirq_dpci->gmsi.gflags, + XEN_DOMCTL_VMSI_X86_EXT_DEST_ID_MASK); + if ( vlapic_match_dest(vcpu_vlapic(current), NULL, 0, dest, dest_mode) ) { diff --git a/xen/drivers/vpci/msi.c b/xen/drivers/vpci/msi.c index 5757a7aed2..e1d8c1d6f2 100644 --- a/xen/drivers/vpci/msi.c +++ b/xen/drivers/vpci/msi.c @@ -297,7 +297,7 @@ void vpci_dump_msi(void) printk(" vectors max: %u enabled: %u\n", pdev->msi_maxvec, msi->vectors); - vpci_msi_arch_print(msi); + vpci_msi_arch_print(msi, d); } msix = pdev->vpci->msix; diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h index 31ec083cb0..ba71ce1148 100644 --- a/xen/include/public/domctl.h +++ b/xen/include/public/domctl.h @@ -588,6 +588,7 @@ struct xen_domctl_bind_pt_irq { #define XEN_DOMCTL_VMSI_X86_DELIV_MASK 0x007000 #define XEN_DOMCTL_VMSI_X86_TRIG_MASK 0x008000 #define XEN_DOMCTL_VMSI_X86_UNMASKED 0x010000 +#define XEN_DOMCTL_VMSI_X86_EXT_DEST_ID_MASK 0xfe0000 uint64_aligned_t gtable; } msi; diff --git a/xen/include/xen/vpci.h b/xen/include/xen/vpci.h index e8ac1eb395..354b37ef9c 100644 --- a/xen/include/xen/vpci.h +++ b/xen/include/xen/vpci.h @@ -162,7 +162,7 @@ int __must_check vpci_msi_arch_enable(struct vpci_msi *msi, void vpci_msi_arch_disable(struct vpci_msi *msi, const struct pci_dev *pdev); void vpci_msi_arch_update(struct vpci_msi *msi, const struct pci_dev *pdev); void vpci_msi_arch_init(struct vpci_msi *msi); -void vpci_msi_arch_print(const struct vpci_msi *msi); +void vpci_msi_arch_print(const struct vpci_msi *msi, const struct domain *d); /* Arch-specific vPCI MSI-X helpers. */ void vpci_msix_arch_mask_entry(struct vpci_msix_entry *entry, From patchwork Wed Feb 16 10:30:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 12748402 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 59C41C433F5 for ; Wed, 16 Feb 2022 10:31:38 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.273931.469267 (Exim 4.92) (envelope-from ) id 1nKHap-0007mn-1Q; Wed, 16 Feb 2022 10:31:27 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 273931.469267; Wed, 16 Feb 2022 10:31:27 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nKHao-0007me-Tr; Wed, 16 Feb 2022 10:31:26 +0000 Received: by outflank-mailman (input) for mailman id 273931; Wed, 16 Feb 2022 10:31:25 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nKHan-0006QF-EG for xen-devel@lists.xenproject.org; Wed, 16 Feb 2022 10:31:25 +0000 Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com [216.71.145.142]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 9537cde4-8f13-11ec-b215-9bbe72dcb22c; Wed, 16 Feb 2022 11:31:23 +0100 (CET) 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: 9537cde4-8f13-11ec-b215-9bbe72dcb22c DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1645007483; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=1VExplsUc/jMeyloOEDLZd1rMjs8V3xmSLjMalaWzI4=; b=XbVYHOLHMrOO9ITwKlTWiaiRZOKVNftuW8GAAm7HkPgliOju+xER/nuc qAOHG34PTRH5FVKjhkJVlGhE2BTzKGCsn5fBtdkuzjQG/eAlmJxx9LUp1 oNVtH76i0LTnJnap+A4eDTJh2P3C4j3sWtcKXYGDIW6iz0ycgG9ItWUyD Y=; Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com IronPort-SDR: 9RFSBtBq4Pch33H8W5zita2dZl0xNQOZt0DTr0jfD0dIhVtdBPTHBIhpU2ke/IF1qtV2elJlE5 Rs0Jk6ci02cmzf6E+2bp54ydJ+HQBHzgFQYqA94nFIllpPM1KeYBhKm061/5H4IU0amyaNyagL HVRqDUgW1De9Z2WZX1kKpE+qVs0DkqSeWMavi1LKG85C5ShOhcMYxVp/2RVNFKEmln0nrrkTJb SD3UFpr1bedhXHYme/scgQS6H8TEZBpjApDbirwOLMK/VCL/ETp5Lp8IHqY8Odd4MyRGkXfMD8 GaNJriYGTEpG1CMYQt1XniZb X-SBRS: 5.1 X-MesageID: 64733272 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:YPwM1qDd/H3NyxVW/3blw5YqxClBgxIJ4kV8jS/XYbTApG4lhTABy WMWUGGH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XU5u2BcwXhStiZUQEZA/0s1B+MdfHxPpOLPMfIOh4nNGPONYpF pHpje3bWa8RItkGkhxABaTAQHtKLkT731nfYHD8PVDSvfdIHmT0xzMtRSO2nAEmBSurr8ou5 bqm0wLQW50YQAp+Ss3RbZqSI5mZ5BDxQcp+ABnFJMd9YkLp/NQ4IiD9lKZvccoNNQ/C1n2R0 APPWUUUouzEookU9tjVhP/b89f1QrUmRkcKTXPG6buWNDXB+jbxy4F3T+vVLyvWU3n5+fv+a LwNne38KvAOgH1Dr5F4T+Rw1as76ta2/+1aww1oEW/ldVOuDr88cHCK0dMW7v9Gx6NDuBvwU UWKo4EINbKMMcLjMVgQOAt6MbjTiaBKwmHftK1nLl/76Sl7+Ku8fX9TZxTc2jZAKLZVMZ8+x btzssAh9AHi2AEhNcyLj34I+j3UfGAASaguqroTHJTv1lgw0lhHbJHRVn327ZWIZ4keO0UmO GbJ1q/LhrAazUveaXsjU3PK2LMF15gJvRlLyn4EJkiIxYWZ1qNmgkUJ/GRlVBlRwzVGz/l3a zpiOEBCLKmT+ytl2ZpYVGe2FgAdXBCU9yQdEbfSeLE1m6VwalHwEQ== IronPort-HdrOrdr: A9a23:zcv1g68hp5DBu5b8h6Zuk+AiI+orL9Y04lQ7vn2ZKSY5TiVXra CTdZUgpHvJYVMqMk3I9uruBEDtex3hHP1OkOws1NWZLWrbUQKTRekP0WKL+Vbd8kbFh4xgPM lbEpSXCLfLfCVHZcSR2njFLz73quP3j5xBho3lvglQpRkBUdAG0+/gYDzraXGfQmN9dPwEPa vZ3OVrjRy6d08aa8yqb0N1JdQq97Xw5evbiQdtPW9e1DWz X-IronPort-AV: E=Sophos;i="5.88,373,1635220800"; d="scan'208";a="64733272" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=juG7/FEdqHumFa+gHTrl5r6QMIltR7s/13Q6RqdSclJnLUKqcyaHz6eh7AROR8zHUjsnZTMmg5ELQk9N4uhgoq0V/bZlWuwvmtb/AxpY+ld9o1DXsVDHj+xpu8DPF45Un8rR2bEYPBRcr3D3C3WALU95Jw7VCWaueC+E6nlxs6ZF5YdRGX4A34TSW6ep/mBcnaBGNe6UkAPNXlaVCCO4rP6QayBtOpXiF2d5FCpItysIiHCxRR85PVmQKJMHGVoE1O1DAwKguZePs1WGa7G8+LO4ey33dNlKQSsXI2aF5EUZrtNcvP2puUEbeYmpCq90wMr69SPqWHc2eq3gnCIT5w== 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=XYwFCVS+ocU5eNhwXct/uBxkJGH3tqXX4XbY/zZKx+U=; b=JFaGh/16tx+W/G4q4YjPIVXzYUvG6gsRFv/nx5aHsdLJQtBHEjcBdg4ivJPLlTa+m/8Chzm4hsUbh1CZHrCdSDL5z7QMBYw4WB3A0LoMu/Wu7QvB+WWB2uCZI5+YCzPZYQsvIb8Bq+D7CRFdtnOPc8aXfkWcdu7sq0JplMIMEifCxavxnag2VwtwkS0ihDyMuF/xVDU9mntW+qvZcF5bpX1GZnqBD37sbXFHiCnpdxTbxm158c660+/XfZeFBtCMo6/b21V5sQp9BMkDjNsWvpqB7oMrPt/Ezp51Zsp0XfKMM4cDuDw20tNwsEO6WTBR0IVdd+D+ecxIK5SSPP5IWQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XYwFCVS+ocU5eNhwXct/uBxkJGH3tqXX4XbY/zZKx+U=; b=txZwMqYsW50k+0//sD3ONK0h0taQRHuCoKH0KK1BGhQN2Hmpqx8woPJ1Gh61kvJypzEYbMCQzKGGtxZ5wL909wZdyp5eofvgWX3tapUoMZTl+mqIOuDYYShKrNV/iht02MNljBMxkGFY1MKAAapHrzd+SRkUF/0cEIPmwNBlpJg= From: Roger Pau Monne To: CC: , Roger Pau Monne , "Stefano Stabellini" , Julien Grall , "Bertrand Marquis" , Volodymyr Babchuk , Andrew Cooper , George Dunlap , Jan Beulich , Wei Liu , Paul Durrant Subject: [PATCH v2 RFC 4/5] x86/ioreq: report extended destination ID support by emulators Date: Wed, 16 Feb 2022 11:30:25 +0100 Message-ID: <20220216103026.11533-5-roger.pau@citrix.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220216103026.11533-1-roger.pau@citrix.com> References: <20220216103026.11533-1-roger.pau@citrix.com> X-ClientProxiedBy: LO4P123CA0369.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:18e::14) To SA0PR03MB5610.namprd03.prod.outlook.com (2603:10b6:806:b2::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a2437f4a-f332-4497-152a-08d9f13773b7 X-MS-TrafficTypeDiagnostic: SJ0PR03MB6256:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:497; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Tm73xpCiLc9BBWUUXdOcox7iX0NkzpD9OZhf7gRpmVsxu2yAh3PdDsqIOeA1x3jv82fpUrkKSfn8qSsQHa/GzE3EgHAQddsMBSZuDW2zQ6VhBWqRar2Hrly7vFUkOmLHLv4bgYQYRRfHiZICTc0IjZrBRaMqKMNcu3CmM/Ace6gZ3GQ79BtYeKXqOceXqzULzI6x1QYjcjMF75Os085qkoXdtLtm1SDvjNbeD1H+015y93cN36TdFK7dkDbmap+SjYoK1xNDDt9tEBak78XNmft6Eg6VxV29FLbk/Wap/6MD1jC4W19wcWK8Qk1Iezo7XbkNJMcpl/PDuIlkGInW6xV5gcbfFPOv5PXk9KWrdNDgmFwlRykupzZ9DAMNmpbQvYodCGYfKy+joWPP+7S98OIFUWWJtiVtzGc3O5rJAfxZYrp57ZaW/GZrH4jZpw3cI343bU1Sxvsjvfu17mncNZ0FTLzcrdJbpQl/vMp8pcno9sAS2iZJkMpQr9CGBVQQmtnUd0cSyxzhIgAgMJVp9mOxB5wjPdLUameGPLyCbDmftjkZY3o6NkdvLENMTbNCoYEfJh/aBvdsoQAJoDBkgcTyo6TQ9pzQxknk0MmZ16X6gFBHFt9aNM/Yy01ZK+TzN1qnxlWsXEM4XW2GI6cfRg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA0PR03MB5610.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(8676002)(2616005)(66946007)(6506007)(6512007)(316002)(26005)(1076003)(66556008)(508600001)(86362001)(6486002)(6916009)(6666004)(54906003)(82960400001)(66476007)(83380400001)(4326008)(38100700002)(36756003)(5660300002)(2906002)(8936002)(186003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?yiwKCdgw56MUO09TPVDtmMXUPgB9?= =?utf-8?q?SZMniKbPoqlNBWxBB5ld9FXEmRxDI8nkZYX99Zum96+4ouSNKoF04igGYQPi+sH9U?= =?utf-8?q?dOhU42koOvo1yz9q6gY6sgnhCQC/mKFAVq/lLf1B//42HNP5FIWWr+ZrzERA0OCzG?= =?utf-8?q?l6+cMj9ezP8UJ6ObUfvqf3KbcQLIlvpoMPpTQC+0MK7z6ax9dpo++jOCf8SLB7842?= =?utf-8?q?u3MKSJHSHx0sQDuo5D2ypx8uRhR4ipUuf8Dk0c8o/nKsKNt5zRpnOG6gTVCIyg3ik?= =?utf-8?q?5CV2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Y2wFVlrWQDbGD3/aRVUtlkBarP3bBNa+wdhka0+g3pAh4Axbfd5Xad3E?= =?utf-8?q?ACEVKvXDYx0n/yayYChkEHuRQFCmeTCm04zqmMwHbYFrJ/maEbC1OBVR6w+mlfZX4?= =?utf-8?q?2uxMMC+ywCNmce4SaxWlqhAQq/C2yjKTv+ilsXlQ9OghMPDCsoAr3obkc85XltDGC?= =?utf-8?q?3rH0MjusRxy0GOmtPoSLk05RDdpBUk9bTkIVUHg5tDKL4b5gGh7VGBK1T8rWv4szP?= =?utf-8?q?TcKtVZ59otbzG/1PDeIt7WJ1wmUecPd/TKfZ2L+fazHMmRlovqt90eDDcx+Akg+eO?= =?utf-8?q?SkSTCMBcq1S16h5RR2xUv/lflUKP0YWd6pMSRH8iqOVhrRg+Kz2Vn2Q0WJoSVUFWR?= =?utf-8?q?80G8L5XInDczUnogga5mwkCU2h4lOOZO7twKYwOU5F+W6fPU/iXOXE8=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: a2437f4a-f332-4497-152a-08d9f13773b7 X-MS-Exchange-CrossTenant-AuthSource: SA0PR03MB5610.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Feb 2022 10:31:11.7916 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: mltvKfNvcl6pyi61VvYLnLydlELmpEFUe7KQze6cTLgm5z1vQw4wcoN698ctwaexuJTu9xIIe3+DcSjEHF8CMA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB6256 X-OriginatorOrg: citrix.com Introduce a new arch specific field to report whether an emulator supports the Extended Destination ID field, so that the hypervisor can refrain from exposing the feature if one of the emulators doesn't support it. Signed-off-by: Roger Pau Monné --- Changes since v1: - New in this version. --- RFC: I find this kind of clumsy. In fact fully emulated devices should already support Extended Destination ID without any modifications, because XEN_DMOP_inject_msi gets passed the address and data fields, so the hypervisor extracts the extended destination ID from there. PCI passthrough devices however use xc_domain_update_msi_irq and that has leaked the gflags parameter in the API, even worse the position of the flags are hardcoded in QEMU. Should the clearing of ext_dest_id be limited to the domain using an IOMMU? RFC: Only enable ext_dest_id if max_cpu > 128? So the device model is aware the domain must use ext_dest_id? (implies device model knows APIC ID = CPU ID * 2) --- xen/arch/arm/ioreq.c | 5 +++++ xen/arch/x86/hvm/ioreq.c | 7 +++++++ xen/common/ioreq.c | 8 +++++--- xen/include/public/hvm/dm_op.h | 6 +++++- xen/include/xen/ioreq.h | 2 ++ 5 files changed, 24 insertions(+), 4 deletions(-) diff --git a/xen/arch/arm/ioreq.c b/xen/arch/arm/ioreq.c index 308650b400..7d56d022c8 100644 --- a/xen/arch/arm/ioreq.c +++ b/xen/arch/arm/ioreq.c @@ -185,6 +185,11 @@ void arch_ioreq_domain_init(struct domain *d) { } +void arch_ioreq_server_create(struct domain *d, int bufioreq_handling, + ioservid_t *id, unsigned int arch_flags) +{ +} + /* * Local variables: * mode: C diff --git a/xen/arch/x86/hvm/ioreq.c b/xen/arch/x86/hvm/ioreq.c index 02ad9db565..3276f0360d 100644 --- a/xen/arch/x86/hvm/ioreq.c +++ b/xen/arch/x86/hvm/ioreq.c @@ -336,6 +336,13 @@ void arch_ioreq_domain_init(struct domain *d) register_portio_handler(d, 0xcf8, 4, hvm_access_cf8); } +void arch_ioreq_server_create(struct domain *d, int bufioreq_handling, + ioservid_t *id, unsigned int arch_flags) +{ + if ( !(arch_flags & X86_SUPPORTS_EXT_DEST_ID) ) + d->arch.ext_dest_id = false; +} + /* * Local variables: * mode: C diff --git a/xen/common/ioreq.c b/xen/common/ioreq.c index 689d256544..d4d5c653c7 100644 --- a/xen/common/ioreq.c +++ b/xen/common/ioreq.c @@ -636,7 +636,7 @@ static void ioreq_server_deinit(struct ioreq_server *s) } static int ioreq_server_create(struct domain *d, int bufioreq_handling, - ioservid_t *id) + ioservid_t *id, unsigned int arch_flags) { struct ioreq_server *s; unsigned int i; @@ -681,6 +681,8 @@ static int ioreq_server_create(struct domain *d, int bufioreq_handling, if ( id ) *id = i; + arch_ioreq_server_create(d, bufioreq_handling, id, arch_flags); + spin_unlock_recursive(&d->ioreq_server.lock); domain_unpause(d); @@ -1340,11 +1342,11 @@ int ioreq_server_dm_op(struct xen_dm_op *op, struct domain *d, bool *const_op) *const_op = false; rc = -EINVAL; - if ( data->pad[0] || data->pad[1] || data->pad[2] ) + if ( data->pad[0] || data->pad[1] ) break; rc = ioreq_server_create(d, data->handle_bufioreq, - &data->id); + &data->id, data->arch_flags); break; } diff --git a/xen/include/public/hvm/dm_op.h b/xen/include/public/hvm/dm_op.h index fa3f083fed..c6c575328b 100644 --- a/xen/include/public/hvm/dm_op.h +++ b/xen/include/public/hvm/dm_op.h @@ -67,7 +67,11 @@ typedef uint16_t ioservid_t; struct xen_dm_op_create_ioreq_server { /* IN - should server handle buffered ioreqs */ uint8_t handle_bufioreq; - uint8_t pad[3]; + +/* Signals Xen the emulator supports the Extended Destination ID field. */ +#define X86_SUPPORTS_EXT_DEST_ID (1u << 0) + uint8_t arch_flags; + uint8_t pad[2]; /* OUT - server id */ ioservid_t id; }; diff --git a/xen/include/xen/ioreq.h b/xen/include/xen/ioreq.h index a26614d331..f4566a1254 100644 --- a/xen/include/xen/ioreq.h +++ b/xen/include/xen/ioreq.h @@ -127,6 +127,8 @@ bool arch_ioreq_server_destroy_all(struct domain *d); bool arch_ioreq_server_get_type_addr(const struct domain *d, const ioreq_t *p, uint8_t *type, uint64_t *addr); void arch_ioreq_domain_init(struct domain *d); +void arch_ioreq_server_create(struct domain *d, int bufioreq_handling, + ioservid_t *id, unsigned int arch_flags); #endif /* __XEN_IOREQ_H__ */ From patchwork Wed Feb 16 10:30:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 12748403 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 2EF1EC433EF for ; Wed, 16 Feb 2022 10:31:42 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.273935.469278 (Exim 4.92) (envelope-from ) id 1nKHas-0008Fl-C4; Wed, 16 Feb 2022 10:31:30 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 273935.469278; Wed, 16 Feb 2022 10:31:30 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nKHas-0008Fc-79; Wed, 16 Feb 2022 10:31:30 +0000 Received: by outflank-mailman (input) for mailman id 273935; Wed, 16 Feb 2022 10:31:28 +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 1nKHaq-0006Q9-NP for xen-devel@lists.xenproject.org; Wed, 16 Feb 2022 10:31:28 +0000 Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com [216.71.145.153]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 98259578-8f13-11ec-8eb8-a37418f5ba1a; Wed, 16 Feb 2022 11:31:27 +0100 (CET) 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: 98259578-8f13-11ec-8eb8-a37418f5ba1a DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1645007487; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=KVCefupHgl8iFdyKIZI5zs9ugkHZAyHUnwwPql0iuFo=; b=V9HO7z9y8PiO9ppmYQsisY+je46MQnmiwboCEx7ixgzzmtlv45hYw0J5 fgDseYoM5YeqTtl6cx71fLZV28dT2EfRsWeaXMfl9EJz5AzfQ1K/FNrXv 5GANCsda5ob3nbYMC5l0hHzg+YyifygLrXMvcriwD6PkWJwSSVPQOqWqd M=; Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com IronPort-SDR: LthxVy3Hwp8STD4YSf3vcQJjZHGMS97ClxTWIh5IUC6RJxFlWH4iIsel9KiPpUZzCHt10sN1Hk esZC7vatKtESDd7d1H9WqEsaJvn1TTpjTU/UNelDpdRYT9pCs2kKEhIktdYSh1Qpv10zdwfm5t TTf1qk435/x/Y3+xd78ioqb8k5uND56y4PNSCOe1TCDGKNBp7u+P/uP1JbqLMvwp/xKSeezGrz /llCdYFo1Ta1uBV129s7qwGBwaRXqNhejcVA7liIQ2NAUuvQg1X8C5LSqu/sXyTGJzZepemT// 0KqkE7Jr7yXh5pQVzTU81lr4 X-SBRS: 5.1 X-MesageID: 64324582 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:B3wBtq9ijiB1h3pxrU/CDrUDa3mTJUtcMsCJ2f8bNWPcYEJGY0x3z jYeXmyHMvyPZDGkfd5wPt6w/U4Gu8LXy4Q2TAVt/ng8E34SpcT7XtnIdU2Y0wF+jyHgoOCLy +1EN7Es+ehtFie0Si9AttENlFEkvU2ybuOU5NXsZ2YhFWeIdA970Ug5w7Rg3NYx6TSEK1jlV e3a8pW31GCNg1aYAkpMg05UgEoy1BhakGpwUm0WPZinjneH/5UmJMt3yZWKB2n5WuFp8t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M0yblDCby xyXEVETouyU+90599zAhKalqYa1ErQhQhoGTjeDtbvvbHvU5Guux4NEQd2kRzGFWTOm4rima MVU0+r4bK8NkmFVvtcuCL1s168/uYfi/ucI0gR+EXzXRF23Ebc8cGKe1MxCu6ARlL9UvQy6B hCG9tVAYOjbPcrkFBgaJRY/b/TF3vYRw2GA4fMwKUT8xSl24LvYDhkCY0jS0HRQfOlvLYco4 eY9o8pHuQWwhy0jPsuCki0JpX+HKWYNUvl/u5wXaGMxZtHHFr2WjUTgNxLL IronPort-HdrOrdr: A9a23:LFarF6/jX2G81IlLkK1uk+AiI+orL9Y04lQ7vn2ZKSY5TiVXra CTdZUgpHvJYVMqMk3I9uruBEDtex3hHP1OkOws1NWZLWrbUQKTRekP0WKL+Vbd8kbFh4xgPM lbEpSXCLfLfCVHZcSR2njFLz73quP3j5xBho3lvglQpRkBUdAG0+/gYDzraXGfQmN9dPwEPa vZ3OVrjRy6d08aa8yqb0N1JdQq97Xw5evbiQdtPW9e1DWz X-IronPort-AV: E=Sophos;i="5.88,373,1635220800"; d="scan'208";a="64324582" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gy3ojG65/3ycyR8hUILUqnRS4wjtamO5WafkAN25MnuyjjzC8/LhbFaMklPkWjcwNEcszzGjsvziodBR6aYIJ1b0MS4ZAcnbqvK1+V3DolCnqMRl4APgMweWHy3NugsROhUzSXRox3hbJ/CbTxmAGOQoiIO7h0hGg473crapK5WF3hhUFZ0IEJ1cpMIzFGqsWmBwI2+Kt0UGDcKdsmcEvuWpSx01RcaRlRMCe7yI7VRWAnLWPekU3nc2HzlZJ1K3cNJqb1vl1MkPRvIpqIWTADfmH8Y50Tc/sCoVKNpLvuEPdyvcvWRHWOihENeGGiQtesKKB7kd8BWgOk4FyTEE8w== 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=75VO+AU8QH9BrocEyWlwWVKugRCjMn/bwURNP9DnhoU=; b=hUi9WfY686v8Zx/hREPgGrgmCd2ZReXcy94bPAxZU4DU+P2yOPUXUjMpta6CdLDiX3tNtxGJD/ZK7DGHEAdekPBgddZ6JqLeGxEwjVZ87AnUewxMHPtsNB8o215r1HG6S+8lsqN5l8UFHh3Lew8BsHY01EuvzZcovC/QaDWcIEa545kcAeyfY2Ps6k4jGidFwbhlLYALRYhm/opfM0Y/83qskaos3hljpPRdErjrTrdJk2QKiu29HM1ZsZjSUMHy0mos5M0pcgqeLjNwhCaP/upM5ZBtLocNFPjNC/5lXqoe4/PL+/WIWo3iHCpOY2uM/LUlceVjJx4ft+24ra3vpQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=75VO+AU8QH9BrocEyWlwWVKugRCjMn/bwURNP9DnhoU=; b=r5eGgGtTzW95gYGRIcZbcRXIqEW2ueJo17jsSUOMF14+tI1Ld4LHfz5BCgDkWPzRi5r6WiLj70iWYXL6KwqvAI6a13FdHihPSRFGAtXMJFl2NkPlmKckn+KAleZNOS7/shsrMlqTxmOcLWtBUcUAZ2FVtvCk90WeEVHbB+57tJs= From: Roger Pau Monne To: CC: , Roger Pau Monne , Jan Beulich , Andrew Cooper , Wei Liu Subject: [PATCH v2 5/5] x86/cpuid: expose EXT_DEST_ID feature if supported Date: Wed, 16 Feb 2022 11:30:26 +0100 Message-ID: <20220216103026.11533-6-roger.pau@citrix.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220216103026.11533-1-roger.pau@citrix.com> References: <20220216103026.11533-1-roger.pau@citrix.com> X-ClientProxiedBy: LO4P123CA0131.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:193::10) To SA0PR03MB5610.namprd03.prod.outlook.com (2603:10b6:806:b2::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 97ff082c-8541-4ed1-23c9-08d9f13776e9 X-MS-TrafficTypeDiagnostic: SJ0PR03MB6256:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ElJ9y0OO2Z/5hfcleDQHwhADR64BcfYyqqHIky+V05axd5LK5dV3O8Et6k6gtbywDL9UT8OPXJFKA7Hg55Oh4yZy/yu7OELNk1kiT+WlPHiA3pnDVf5XTdaw83uvW2JnM1lnAuUmr+XApCXxFnPXOJ46OeWrj87XDx7J9p2PTIPStZ3y179purMdn3utGnkWyJnXLq7UiYyZijKV4kxNuuWSCeltat7Up5H6CQRZpnXRR/LT52ijR+Lf6cDDEo7sq4F8OG72gb4q+NYBHxnoitOtIX9icamjuJRVYA76XSH/hdbCUH4QoNd9m3OQkrbulnsFM7s+xIYHM7Qp5rCYpr0he1VetcWS9psj11s6OQjgG3yOWKMrtnlLhnDVWUyvlkKSxJCJOEtEbuoBDYW05FjUWDPm2jci+wjNrSKboHAEBv6N+0pCwL9K+IdDO9gTKrI1AOHema0cLYcXixSFkybjocFp4qKc3ak8Nm1TIADtJSNSS/pP6nfvrJB3UXK/NWKi2fWEV3DS0MNIMZvvPleOBAvHWwRh1I2fUmXjlYhFFFK7RRv3h7PSPJr3+D1aMlF5yH3Ng3CIaPLsqqpnArCV2cnEQJwx3M3gvJincsQuwjqJl1zaq8lvFRlDzwsQuQDybhUJIbMhcBkrReRy/w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA0PR03MB5610.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(8676002)(2616005)(66946007)(6506007)(6512007)(316002)(26005)(1076003)(66556008)(508600001)(86362001)(6486002)(6916009)(6666004)(54906003)(4744005)(82960400001)(66476007)(4326008)(38100700002)(36756003)(5660300002)(2906002)(8936002)(186003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?TNwIwqZiVJJSQfytI2Myf0lt3OlM?= =?utf-8?q?tHWDOUihmHXWN7CsrbEqCd9fAzsa5fIKWQvTaXkqVfoq4NcvkzSkuzUbfQEnEHsUR?= =?utf-8?q?+3K0F3Vli9mBpcfvWjsL5IAhZE08VBdmoGimEA0xQ5LQDiZqdpV60MRHmZiJybQOb?= =?utf-8?q?4CT/lIElMIPvRM9LP83SW9qCm6xgy/9lKXsh6McTHqTnGK5qOGvkQIxbDIWmGuYjw?= =?utf-8?q?ghEVvXUvYFdJCxuCZb7+975mb9he3Jmx+/neqE1Jokws1c0JkBJIq8QJHefS5GpFs?= =?utf-8?q?NaLA4f7WKnb6A9F9wjztUxWZ12vBrd6dYM+/4Qgjsf1SgbiEz4IfJyNPO0yH9/T1O?= =?utf-8?q?T8ul2d3wfv9ktOsUD4OW4jPvWMIIWo7+w30EZeqn1LMfJcDyva+cb9Ipt4coy28v1?= =?utf-8?q?LclXGBXjBGO6IVYmRmyeX/NCT3oX6uGzYyZnlL7PfXI5GMntsrCnIqg6JT7G/y1Dt?= =?utf-8?q?T2pW92aXE+4WQiIGuVfJZw7zm8U60qvCo9pRcjA8nDG3fVmcMGxeXXeVmk5Yuyzlc?= =?utf-8?q?+p/qZj4cWzXRrZAcdInaGFbW1AeKYpHF1J9/nwScW5AT3nZd2T69gy1Orso00pveS?= =?utf-8?q?/rMGDdAsLns5ub81cz4Nw/RA6IeNZSnlutgZqIy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t8dY36Qp0ce8N3Cb9abCMb7Uz9Uifm?= =?utf-8?q?hOflBYKptZ34BNCDrTpiZ2wyUns5uVhMoYjOoR6Ze9u64ptT0o5H8V4=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 97ff082c-8541-4ed1-23c9-08d9f13776e9 X-MS-Exchange-CrossTenant-AuthSource: SA0PR03MB5610.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Feb 2022 10:31:17.1058 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: fep66e4T7ZJttA4ygpzVmzXhvXPvob/iv0lNGE7js+c8HVIH9bEl4a5lqWCvxrLii1uFuhBDqvS8UhBl5UUXrA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB6256 X-OriginatorOrg: citrix.com Expose the feature if available for the domain. Signed-off-by: Roger Pau Monné Acked-by: Jan Beulich --- Note: con not be committed ahead of the rest of the series. --- Changes since v1: - New in this version (split from previous patch). --- xen/arch/x86/traps.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index 485bd66971..5b24688b07 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -1150,6 +1150,9 @@ void cpuid_hypervisor_leaves(const struct vcpu *v, uint32_t leaf, res->a |= XEN_HVM_CPUID_DOMID_PRESENT; res->c = d->domain_id; + if ( d->arch.ext_dest_id ) + res->a |= XEN_HVM_CPUID_EXT_DEST_ID; + break; case 5: /* PV-specific parameters */