From patchwork Wed Mar 29 10:18:10 2023 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: 13192278 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 C8BA4C74A5B for ; Wed, 29 Mar 2023 10:22:02 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.516154.799828 (Exim 4.92) (envelope-from ) id 1phSwG-0000Vk-Ex; Wed, 29 Mar 2023 10:21:56 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 516154.799828; Wed, 29 Mar 2023 10:21:56 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1phSwG-0000Vd-C3; Wed, 29 Mar 2023 10:21:56 +0000 Received: by outflank-mailman (input) for mailman id 516154; Wed, 29 Mar 2023 10:21:54 +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 1phSwE-0000AN-Ax for xen-devel@lists.xenproject.org; Wed, 29 Mar 2023 10:21:54 +0000 Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com [216.71.155.175]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 83f93df2-ce1b-11ed-85db-49a42c6b2330; Wed, 29 Mar 2023 12:21:52 +0200 (CEST) Received: from mail-bn7nam10lp2101.outbound.protection.outlook.com (HELO NAM10-BN7-obe.outbound.protection.outlook.com) ([104.47.70.101]) by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 29 Mar 2023 06:21:38 -0400 Received: from SJ0PR03MB6360.namprd03.prod.outlook.com (2603:10b6:a03:395::11) by PH0PR03MB6940.namprd03.prod.outlook.com (2603:10b6:510:16e::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6222.35; Wed, 29 Mar 2023 10:21:36 +0000 Received: from SJ0PR03MB6360.namprd03.prod.outlook.com ([fe80::48a7:d1ab:897:acda]) by SJ0PR03MB6360.namprd03.prod.outlook.com ([fe80::48a7:d1ab:897:acda%6]) with mapi id 15.20.6178.041; Wed, 29 Mar 2023 10:21:36 +0000 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: 83f93df2-ce1b-11ed-85db-49a42c6b2330 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1680085312; h=from:to:cc:subject:date:message-id: content-transfer-encoding:mime-version; bh=GgzvQ4F97uMh6hQ3cKDDJg2+/D82P4paLoBbMztQgYE=; b=cvnvmoP4R/Lj0L5M429EDwTEh7aJo+mPf/A7uR/E1Q+mH1+RQijEUjlH 3yyLa1LFq69l6IHubnqwAo1vl+8MAuc66IxLIX4N68OEEU5NatNUwGACc y/Ak4S5VcBYjhNZU8M1XnL9x7eHHzlgwiiEq/TyG/Utq8pHPU2J1wStUy E=; X-IronPort-RemoteIP: 104.47.70.101 X-IronPort-MID: 102857261 X-IronPort-Reputation: None X-IronPort-Listener: OutboundMail X-IronPort-SenderGroup: RELAY_O365 X-IronPort-MailFlowPolicy: $RELAYED IronPort-Data: A9a23:9JUsM6oJSSfGGex5NXgzlXeoO0leBmIKZBIvgKrLsJaIsI4StFCzt garIBnUb/uKMDf2LdgkaYjk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7hGhdf7zdNHJcqUzuwYMC/lhAqEbJloH5eCoDc2iuey70tCqq iFnz4Qe+BIr1/BdGC8phXgnyHmzTYV8nfnjXuVm2Hqr8DVTC8zT5Mpv/MRTjLpr24b+P1s2q NC2GyU87JREBP7hSz4o/zFTQtjmEaYqWcr1cQTk3tce40Db6I5l/1owGplVLM7WA7q4oEuF+ djSOna+fZtaFufK0vUu2F+qebcLEgbL1OjeAwvq8aV2z9ZkDRS1E0D3vESmX8G6dYUV4REz/ 6sCNUmqJh+CustKY5tDuYIRsW6TkbXRwjXDW6UKVP7UIkaJnP2rYLt6rld3pDnRHUx9upypH 39aiIZiYZrEHieSvFmnac7vywleV/NEwgEkaplltpEUr6VfsuZDcTMciFqryKamYRgPiTqYY fOBHtoOY6dEYKXI/cu4+TfYegmFZBMarxghv8LH3Szn+nsFqrG8sTmTde7HsucLd9jYBK0Pk c+ X-IronPort-AV: E=Sophos;i="5.98,300,1673931600"; d="scan'208";a="102857261" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A2IaZAR5vPZAk/isGePCrxrxNs0Kn6y9ikSt2Q89VMyv8c/UrAr8HljfVLEv8GdPSGe+lhNTHlbo9zAL+NWrlYp5osggMFJu6YItD9kWOw8jtq/Xnu6Ya1QJ7BWhg6XWImU0hoVh4zmf/OceCr+3CnT8I17nnXBiFY4A91hTeFtZ1kiMr6WwIol5j1uINIvL1I3ueDcMHR238+gX6GI4UkBXKH9ZcsIX6arIzIFrhrrkY1N1Hx/BuydUb60gqpwVJ8QSxvFa+Wl2rOPUTP5hgYJkzUrKSQbZhcRieMlo7E7SNcVpczh5GJL0fkrYJbVpy8bMIWbHi4Y51PpI29tNPQ== 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=GBcikQid1EDsNKVmlhoAesovXe8SAQfNny1rvck7MW4=; b=TyzBoTPpJLj3nfCkblAAUY66i4P5J/JX5Qovwqne8VjrGY1nVAvn2mLsBaGOgNDG6LxFrPr3RmFqnny9P6MrtKlmU5h+flP5x654QmGxKCRQpkfRzts0wSUYAPLWwTQfzRvskvZwxeHtL3bgAuNGoFiw+b16eAHS1we6h0kZzHA5WJ5EfKcwQ3DBWwW062X17uMiU8Y4HqBKs5ULL5jPw75BX2Un5lj58btXEuCy+cSiWvFK59a09RRsGxnu9w9a/8b1frwRNy7hRKvVZuDMILB9p0OK9SEIFtZbHrcocd6XVYVArnWL8rJ01Lh6OHP9uC3C2+gsgj1c12glxhNohQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; 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=GBcikQid1EDsNKVmlhoAesovXe8SAQfNny1rvck7MW4=; b=bhz+H6GD+MtpaZkzz1G7eQG6yLfxiCLJIijOK6CpFuOSFwkMjuKFhlyZ+FuBeydqHdoEIKKbCaVN9EAHDQWcGYXqvu8xKGz3WzSrlvhn2AyOgwpCBcKBsIoFoEw3bm/IS7AgzfkqHjMarN5McGCSbs5KDhaasws+sbFPtxZhnfQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com; From: Roger Pau Monne To: xen-devel@lists.xenproject.org Cc: jbeulich@suse.com, Roger Pau Monne Subject: [PATCH] vpci/msix: restore PBA access length and alignment restrictions Date: Wed, 29 Mar 2023 12:18:10 +0200 Message-Id: <20230329101810.84726-1-roger.pau@citrix.com> X-Mailer: git-send-email 2.40.0 X-ClientProxiedBy: LO4P265CA0238.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:350::11) To SJ0PR03MB6360.namprd03.prod.outlook.com (2603:10b6:a03:395::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR03MB6360:EE_|PH0PR03MB6940:EE_ X-MS-Office365-Filtering-Correlation-Id: 7128f24e-ec8a-4a87-fa31-08db303f6042 X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: REENbcAroG1WWJHJJ+Tn53SljIdFat1+X2oiIJbUqOeVsQ/dy5Al/5wtMqb9pnoby02ZlvaR1EiFp0GvJs5vlEBCZkq+/cb34TjnTxuaIy1o/5N3Xq5lg3p58x8EMdp9q3BGpseWGIJz+ogBihE2iI1KjQJfhtO2wteCmPMovNRuDoVCjOri7de/1b9WyQ4yJqaYVkPmCmSt08a2VBJKFD0Aam4dJ+CSFGRsqlXJQrSs2jC6+pzV9U8kRm6PMnfzvsJDhWVbmEUVB7cgkFN3Orh5IHqG2bQQl/PO7Xf3dYuSSjV+Bp3Pu4G81h2bTfn5MCbGoK4FqWougoU4XsvaBipvGNFhVLMIsSp57TnqToc2g0aNVURKS0AjxEdDRVchqZGa+Lz9ql4qC7SZzWc8ycZSdwESeFn5+Jl+/qFmwueFUSTq8Nf5ltFU4/7fr6uOXRl03su2zVcCui2gOL21+vTPX0olYz236x65Hsxk8adjaEe0E/Z1LzE9junt0tiyPgnHth20Te9VhbPDG4VNv+Dl+J5zMQpMtKwAeUFu3ojRi6Q1B/7ypirXB5HYo4Re X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6360.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(396003)(136003)(346002)(39860400002)(376002)(451199021)(83380400001)(1076003)(6666004)(107886003)(82960400001)(26005)(478600001)(316002)(6506007)(36756003)(8676002)(66476007)(66946007)(66556008)(6916009)(86362001)(4326008)(41300700001)(6512007)(2616005)(6486002)(38100700002)(5660300002)(8936002)(2906002)(186003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?7LA3Mlifs4lzn3OHP623b7Dn8imj?= =?utf-8?q?eXC9v1+A1D1z1VpDhO2y72JNIRzVlcSiT5wbXO/ejRO5A7O8kNs56RVdh9HZ4rCCu?= =?utf-8?q?74c5LxJeQmH/uYwAtMTiqHMHR/SUdMvOBFy8PK8CiRD5ZrqeVtDKncPMOdwFMXPYW?= =?utf-8?q?/fnaoeiw/V/HnGoagjgAk5mj0i3A62gzlAxJwdL6uP01B3ZdHEXhfvg2m8vjyS5bG?= =?utf-8?q?pa1JUYO84pGC9BD055/9bs+z7SZJ+xc0GQPuN6iOU6p9mx4PkCMfCt2FSVCLHBcL6?= =?utf-8?q?uxtlaQuyz0yR9JLzcUUhx+szxGUCDZqxUMcIU852qCKCPyIrJ7jMTX61Fjkfz4xaF?= =?utf-8?q?0vmGeZX3OqGx+J3KiXMfUZluheiK3qzLm1uvq6fyUH2u/6wSmK24+kcCfSwG2+0vR?= =?utf-8?q?ZhhMV8QgbC8qtExF+NbTlTSj+Fappd8kamieAFma0IjTdZ77l+G2tjxaoSidc0ll5?= =?utf-8?q?ThAO+HMo0EHfmQawAkRPGuHUDOj4uJudOw4ZK3SChwbw9RV+l+7H6TvMkeuHLrZ2V?= =?utf-8?q?2UtA6ZQu8ayC/nev90q0WpcWBStKpxMsk5WIZzBc5um6vawr1sM9PJ6U0VpoPLuAZ?= =?utf-8?q?hpZxDrrlTpMVEfVqe8gF6UJ0Xi6lRQDSFrDCFgm7D2sm5J8wcM3YTrElTBtWj4POB?= =?utf-8?q?6LpQxaenJa7E4k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iSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: QMQq+ifS9ww4cSH1RWg0yjBqZ0XfCCTveaxNwczdjjc1B29o/uoqyyrkjz3NQDXyfQpAowvnc6kENrdDLBLu0wxgi4meEJj8r5hbA9wTYIDmdWs9wuEjiLm1aqJuvsgKoCiwQBhrIQJJ78lujOc9+JN/RVnzO1wMFtvbqOEaMpm7Ty1SolXuLltlz9sUyxhdSfpWC8vF/Yz8qJ1M/O11L1k5/9SICJv6IEdQ1+C+5VbyMGaKNDFo/bWnX+pOU1tZW/KSDUqToO5DPeCxpJozwuL/BcwAc02xvfRoMRgLIXhKJrRQWFvCtuu5qkS0RQ+Lpu9oJXi/z7TW9E9SFXBkVEWip7kY2+1BHJWUbNboROcDkO/qtllR/7fd0KvF7tYm6xXc7BBLriV3BIKGeIhxTy3jchOL0J5PPpYFXujetdFsu9keMWCDNWYjocQXybaEinT8c5j8GqtExGFNychOtgIWtQY/RFo94Kjb54lhycvIRuCzW/OqwPnKdsaAwblEmC9Me0bIoF3jXfF9QmSseyopZfpbMaGJ8tdljdqgz/nQaZJyMBJMQGvErheZ8rjYRn9gimzY59/ABE0XCj/pmB/Rg2sav9mSKAPTNsNFpbgEzajgCPsMbHrb/hfnReZA4e7ulNgsI3Nq/1NLsBO3IHKC3OkoPw6gSe+xPHUMlNqttVcPQ0crxPd/gIbPzCxJbFrnBv+wiiWZV/VYyo9hEVtDKTGUCxN9AqZPQdQoUrPemeTxp9GwDX9xpTb8YzqgbM4gB/Nfx1/bUNmiqXtVK7bE9XNWoaggZ8FBSbgN2heLTuXG8Rz+bzsx+E9D9JPw X-OriginatorOrg: citrix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7128f24e-ec8a-4a87-fa31-08db303f6042 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6360.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Mar 2023 10:21:36.2100 (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: v2E7w6pWb5pGsTV/0r8eXjKOWgRUZxuTvLAw5oLTd1IyoRF/Gv5s/T6wnoWRGsRmRjWmJPZtFUCxsSS/HrWthA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR03MB6940 Accesses to the PBA array have the same length and alignment limitations as accesses to the MSI-X table: "For all accesses to MSI-X Table and MSI-X PBA fields, software must use aligned full DWORD or aligned full QWORD transactions; otherwise, the result is undefined." Introduce such length and alignment checks into the handling of PBA accesses for vPCI. This was a mistake of mine for not reading the specification correctly. Note that accesses must now be aligned, and hence there's no longer a need to check that the end of the access falls into the PBA region as both the access and the region addresses must be aligned. Fixes: b177892d2d ('vpci/msix: handle accesses adjacent to the MSI-X table') Reported-by: Jan Beulich Signed-off-by: Roger Pau Monné Reviewed-by: Jan Beulich --- xen/drivers/vpci/msix.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/xen/drivers/vpci/msix.c b/xen/drivers/vpci/msix.c index 99dd249c15..25bde77586 100644 --- a/xen/drivers/vpci/msix.c +++ b/xen/drivers/vpci/msix.c @@ -278,6 +278,11 @@ static int adjacent_read(const struct domain *d, const struct vpci_msix *msix, if ( !adjacent_handle(msix, addr + len - 1) ) return X86EMUL_OKAY; + if ( VMSIX_ADDR_IN_RANGE(addr, vpci, VPCI_MSIX_PBA) && + !access_allowed(msix->pdev, addr, len) ) + /* PBA accesses must be aligned and 4 or 8 bytes in size. */ + return X86EMUL_OKAY; + slot = get_slot(vpci, addr); if ( slot >= ARRAY_SIZE(msix->table) ) return X86EMUL_OKAY; @@ -419,9 +424,8 @@ static int adjacent_write(const struct domain *d, const struct vpci_msix *msix, * assumed to be equal or bigger (8 bytes) than the length of any access * handled here. */ - if ( (VMSIX_ADDR_IN_RANGE(addr, vpci, VPCI_MSIX_PBA) || - VMSIX_ADDR_IN_RANGE(addr + len - 1, vpci, VPCI_MSIX_PBA)) && - !is_hardware_domain(d) ) + if ( VMSIX_ADDR_IN_RANGE(addr, vpci, VPCI_MSIX_PBA) && + (!access_allowed(msix->pdev, addr, len) || !is_hardware_domain(d)) ) /* Ignore writes to PBA for DomUs, it's undefined behavior. */ return X86EMUL_OKAY;