Message ID | 20240603055917.18735-6-clement.mathieu--drif@eviden.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7270BC41513 for <qemu-devel@archiver.kernel.org>; Mon, 3 Jun 2024 06:01:19 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces@nongnu.org>) id 1sE0jj-0006jO-Rm; Mon, 03 Jun 2024 02:00:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <clement.mathieu--drif@eviden.com>) id 1sE0jd-0006fp-Dd for qemu-devel@nongnu.org; Mon, 03 Jun 2024 01:59:57 -0400 Received: from smarthost4.eviden.com ([80.78.11.85]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <clement.mathieu--drif@eviden.com>) id 1sE0jb-00071T-K4 for qemu-devel@nongnu.org; Mon, 03 Jun 2024 01:59:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1717394395; x=1748930395; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=203ROX01K1oZ6NurPajI+Um1ICvecqjwliaqm20TbZQ=; b=mOSCSaXANm2TviAb3Od1PoQLxyUuJYIwnTFHAo5FdhvXEDwiRbscsDii 1nCpvS7EUpkFxXDzaZAhlHvrZ33LucWd4lTm4bKO1c+s9EbuGvo12zpjD 9IMprGeKPU4g0emeEpxs3gQJMcDlDkIQLf4TVrq0GnUjp98aYHjxoKx/V ccx1eD5FIs5Qn96xwk7ieXyCUE+06kNDS5rvnb6YWHQ1HDIBYvoACEFrR VouwQPMfTVKK2/xiK/fzsgCR7N7NoxCRW6+5sXkCAm4/CnEKNJhexlRMN pAX0RffUAPt6bZ4Zbz8X8K4J6CrDqzqrMQA/2dw4GetClh8lQ/GD4HSgn A==; X-IronPort-AV: E=Sophos;i="6.08,210,1712613600"; d="scan'208";a="13815876" X-MGA-submission: MDFIMSir7WyOvmNlNCMWQuHO8ua305Yft/0rJtq9gCn1w9wUj6Iiev3w7qwllUExa2KV3cbDPJ6jnSbIX9P2onjK5XE1iz3Rtjs5vfUgF9Jy4jK8fU4XQdIodyC+eom0DUsDCFZeay7DK6EdkrT1n4VxgtmpdmAZ3IwpJmwfVO8QvQ== Received: from mail-he1eur01lp2050.outbound.protection.outlook.com (HELO EUR01-HE1-obe.outbound.protection.outlook.com) ([104.47.0.50]) by smarthost4.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2024 07:59:47 +0200 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F3jFefsWBXGpD4A1LnlZUIHkdHhLE0YQEnOHvrLh9UFYfa37LK9zSvyZOuzJ00wi/5HcOkwSR/f6/tqtZNPrAqCQgOcPdarAlj7DaBAU+mTQFwYCryLtIeNesjKthFJnSFfsHHUKlM62BveRZUfJOjfpu7V3N4EzbmLfkEuOEmrEqsbYhyOWF/cEEKr+IuFNmO8CSH+rs+TC987mqu0kASyHMXTS3gNppfJoifjP/h3Svm26mw1kNBm7FBnRbVoj+JwFZp5sArqVHTv4DOdWF/2YdiQ7JdM/ZoVB9OjTQKRvaA8oR6Bkgl+GE1Ut5OsTN91Wx20qFXrKfqHTYKznJw== 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=203ROX01K1oZ6NurPajI+Um1ICvecqjwliaqm20TbZQ=; b=LwmKp2KAwidt8A728pxyBtBMNsx7j0r18ZW7YTP7uo/3ccArOUQiISUxHhSyUHaUDNW0S15uZ2AZASJq5jscFaQ/HpHC/llV32DOfdWTYvn9uAhMbjA8Yz1h6Ct+6vSDLheYBRIYCaCDxMoKdQrFdAnD7/jwG8jWE3kcLnpZX3XIJfKD0thmF6JawT4KAP/pzfIRXki5NYgxHPZ0grnCuCq/hAGSMp+3l4uzOnOAMwoIsCf+B6Ypp03TZB8IRUBxbLrVatNLv+mcAZgdR1r5HuDoeBvxLbdTu2SfFbmpEfSzwyW2A6Fa6GnYsCWkSCbegDK3PmeGIyI9dar599QP9w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=eviden.com; dmarc=pass action=none header.from=eviden.com; dkim=pass header.d=eviden.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Eviden.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=203ROX01K1oZ6NurPajI+Um1ICvecqjwliaqm20TbZQ=; b=mEcGzkFjwBbzDT2BGhGxaWYu/vplKbeYj18gSXYuAYLNF3QzNf2w7QtEhuQ2vcMOXfc+3MhoD0EetEIKF1h4k38lHMoLsTIH4sMPNbMcJs4q3NAoMn7H3LeT9RV/03YU7kXoLmLRiw5XzrtYaCOHHWiyNkruhQ0FBjMTmdrdA1mqxp90VGXNiHTqh9+z/vPmqTW7RTYorixyPvsIZOgOga+ZKWr/kE+IxfduiHGQ8aYGJE5R1TuXusSJRXEVRoKJAq4ryKDgIGkohvhdtNZlMgp+RQ+WFRdbMmlcuw1QE5zQbQDMq/79dQQN7FyxbyigxHvLGuoSkOSt+/ecMHNA9g== Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by VI1PR07MB6238.eurprd07.prod.outlook.com (2603:10a6:800:136::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.21; Mon, 3 Jun 2024 05:59:43 +0000 Received: from AM8PR07MB7602.eurprd07.prod.outlook.com ([fe80::fbd7:ca71:b636:6f9d]) by AM8PR07MB7602.eurprd07.prod.outlook.com ([fe80::fbd7:ca71:b636:6f9d%5]) with mapi id 15.20.7633.021; Mon, 3 Jun 2024 05:59:43 +0000 From: CLEMENT MATHIEU--DRIF <clement.mathieu--drif@eviden.com> To: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org> CC: "jasowang@redhat.com" <jasowang@redhat.com>, "zhenzhong.duan@intel.com" <zhenzhong.duan@intel.com>, "kevin.tian@intel.com" <kevin.tian@intel.com>, "yi.l.liu@intel.com" <yi.l.liu@intel.com>, "joao.m.martins@oracle.com" <joao.m.martins@oracle.com>, "peterx@redhat.com" <peterx@redhat.com>, "mst@redhat.com" <mst@redhat.com>, CLEMENT MATHIEU--DRIF <clement.mathieu--drif@eviden.com> Subject: [PATCH ats_vtd v5 05/22] memory: add permissions in IOMMUAccessFlags Thread-Topic: [PATCH ats_vtd v5 05/22] memory: add permissions in IOMMUAccessFlags Thread-Index: AQHatXs7UOkkuRjbokmLCeDI0yIErQ== Date: Mon, 3 Jun 2024 05:59:43 +0000 Message-ID: <20240603055917.18735-6-clement.mathieu--drif@eviden.com> References: <20240603055917.18735-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240603055917.18735-1-clement.mathieu--drif@eviden.com> Accept-Language: en-GB, fr-FR, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=eviden.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: AM8PR07MB7602:EE_|VI1PR07MB6238:EE_ x-ms-office365-filtering-correlation-id: 804830d2-5778-415c-d827-08dc83925d87 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230031|376005|366007|1800799015|38070700009; x-microsoft-antispam-message-info: =?utf-8?q?48sYEvgJSM+8tpMLyaYpdMFweoiFTvR?= =?utf-8?q?P0wmfgXe5NtWuo+evtpp63jDmYaNoNHEJ22R+FSQdG7Y9YGoHpgqxs/e9U2MXBBl0?= =?utf-8?q?Xj/pQCLT8quDaqnjC2PnlqMgZ1qfisMyUuisDso1jIWIK9DkSRO3MNaOQep/pVwNp?= =?utf-8?q?u9w7C+VPR6h+OD5O5YUnchdAcNJWlWQjGmZyI6gWHG3pZ/kCs9b84b0TluKQ2UHYf?= =?utf-8?q?T0gaU3H/jEBDGHX/wNOIPtULS2aH8KP5Zrh55GkMIk8XZHoBmypJyKysxa56uHU47?= =?utf-8?q?w8ieYKrO7C4JNs0Ke1t7KcRkbj6bZcXpfNoy2Q/zlf09cn22nDSividQ/FRTXo7Lr?= =?utf-8?q?6K9sqKg6p+gPLnhvvc44rF60pyoyCrIv3xp+dZnjctte3FzMIpHrZIlqHvwD+uNSb?= =?utf-8?q?SrL2ST2EHPBBqGPnLV29FoI3dBSkeolSqHWK3xFxDvxZSnrktetIang2eXQpjVcdh?= =?utf-8?q?zcBewnHBNDeOMByV8+hFx81uadiVCHfgmmr8gR47ROR9pJVzft6tzjoRdvbK0gIZP?= =?utf-8?q?5N/M4j8+8kvHRr17gbIxPZf4ZEwAx6EeYhRDUewAcqD70oALupHiQzIp55LR3BPY7?= =?utf-8?q?UIb5OdHtfKRzBStfhdDKgpp8PuCP2+O4/Y/VljwqR7gqRQYz1UCtKAEsDkZeSR4KF?= =?utf-8?q?+tsQO6/GZPd4GMHSCZCLK36PQNTspc7YePxzXlFqD9/4H/DUklYYefRWPC5yOir/K?= =?utf-8?q?z6fcqO3V3ApW8DQ+HuUTJHCcDOwR0xl6gieSR1kGDKUIB6nPal0Fv6Ka3s8pEQaoU?= =?utf-8?q?a7AHqZDp6RZg5iutRut0GLYXQbiXaYMnXqCVVqbe268DlHcgA3cxcGmLoHwzOVUrj?= =?utf-8?q?2WNxbLftFvfXsaxSn+LN4Vg/GXLbNtBe9SQIwwT7X96xs6gB18sIlkt11+dxPrjHc?= =?utf-8?q?u4qSJIRGXFZkvBErVY34akM3B0baAsyeIS199Y6my9WWhnT56MVqXuuS/SZaM73NH?= =?utf-8?q?cUDjXXW2ojAgul7wbGNoCu7ZwM7/UM3m3ZWdiUCjEAPYPGtg5xXdoIM6gUGIh7WWN?= =?utf-8?q?sJy55Q7OYIku99LdHpuQaxHw6+gNhvE/bzbFK4OAO8OTQ02NeUa25wZO1Op33ihis?= =?utf-8?q?0DN7SC+/1P+O4JAfgNZvfUmiN06BhoSLQx3IcqicyCLbG3NPwmIgZ2RBSZBsAzOLr?= =?utf-8?q?ewiT8N6XZvEORE0Whf39ND3UKvMfUliRxfmvgBPbmicVvnjm69pYTbcuDbRK02PJd?= =?utf-8?q?GITW6qXKu9qi4WUzPHv9/TAJO9YOEE7xBB7aEYnenq6YrKCo6vc87eso/Vawu3Y1x?= =?utf-8?q?4eK+eb136ELcEajRbzHW3j7rFFXuw3ecV+g=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM8PR07MB7602.eurprd07.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376005)(366007)(1800799015)(38070700009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?xKDbjYkOQsXPdck5Dvbudm4bmi+1?= =?utf-8?q?Cej9tbfRAMOjVHXbq3+xq0TWXuI2YAhikKy4uBwSRXihrZaidsKZYTN/ffaADc3wJ?= =?utf-8?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D0dX2+7S7Xj82HjFd+N66jC1uRKeFUt12wuf4Jm/wCQSOo382x+8pUQxJYeW?= =?utf-8?q?1auBwW3ACMXTRY6RjoJZlgquq2NkIK3QfVupwAmhooypsts9k+hhS326LCxyFPgsl?= =?utf-8?q?0H7EcmUlxTifZ0/W+j3HAI2X8BQ+r7BcumkYEoqbycaQRzY5t8qmwSAj1PVKybZmn?= =?utf-8?q?SKbz+qiZznBFd5xBVObXC8xu7iiegYraos5edBMti8WkuHAQhwo2As3hBDCB7oO1L?= =?utf-8?q?7IhY2D1/gC+gF32XiljLS1fojBfOqTwWXAB8nXY3ug4uTlixLKq+SAr6ZX0u/joUY?= =?utf-8?q?EZ8bp9hA/kLTIcqzAp8dRembTi3Mhue+9RsL8l8oAesV7WI8Hmhuj/FijGsaSKR/g?= =?utf-8?q?pJ0PV+qy+QOWAhGzR1l8lGWWLPuWRL6v0mVGCcYhuDRJhDh4R7pBN8jwL/8R7js9Z?= =?utf-8?q?WqqEaxFsbysYCNXdor14PJo5K8GUmlihlGMTIiyV9BlV7UsF0flJxK2YrODlceMuP?= =?utf-8?q?vSgnJUpACHOdireTk+yezvUr0dJuS6xcU6IpuoRnpsDb5by5OGsHwC9neLH6Xi/HN?= =?utf-8?q?ovqp+UjQIrX04aBAXRKN+3owppMkFxi9Vc7U2PrHQSrQussPLl7whtA=3D?= Content-Type: text/plain; charset="utf-8" Content-ID: <EE9234D91C23FF48802DB9A2A92422E2@eurprd07.prod.outlook.com> Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-OriginatorOrg: eviden.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AM8PR07MB7602.eurprd07.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 804830d2-5778-415c-d827-08dc83925d87 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jun 2024 05:59:43.7160 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 7d1c7785-2d8a-437d-b842-1ed5d8fbe00a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Xm9QNxmm6BXizoxGNq4C8Tx0XYtxcDWPhwYAmOYhkU5MYnRZHcVENnmi50RtvPP/5lefcetgQiewf2KXEzYA0Rdhp1q8pB1rSSt+9AOjAX49RB9VDjHVTRJjlDjpuFVF X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB6238 Received-SPF: pass client-ip=80.78.11.85; envelope-from=clement.mathieu--drif@eviden.com; helo=smarthost4.eviden.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org |
Series |
ATS support for VT-d
|
expand
|
diff --git a/include/exec/memory.h b/include/exec/memory.h index dadb5cd65a..0067b2266a 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -110,15 +110,34 @@ struct MemoryRegionSection { typedef struct IOMMUTLBEntry IOMMUTLBEntry; -/* See address_space_translate: bit 0 is read, bit 1 is write. */ +/* + * See address_space_translate: + * - bit 0 : read + * - bit 1 : write + * - bit 2 : exec + * - bit 3 : priv + * - bit 4 : global + * - bit 5 : untranslated only + */ typedef enum { IOMMU_NONE = 0, IOMMU_RO = 1, IOMMU_WO = 2, IOMMU_RW = 3, + IOMMU_EXEC = 4, + IOMMU_PRIV = 8, + IOMMU_GLOBAL = 16, + IOMMU_UNTRANSLATED_ONLY = 32, } IOMMUAccessFlags; -#define IOMMU_ACCESS_FLAG(r, w) (((r) ? IOMMU_RO : 0) | ((w) ? IOMMU_WO : 0)) +#define IOMMU_ACCESS_FLAG(r, w) (((r) ? IOMMU_RO : 0) | \ + ((w) ? IOMMU_WO : 0)) +#define IOMMU_ACCESS_FLAG_FULL(r, w, x, p, g, uo) \ + (IOMMU_ACCESS_FLAG(r, w) | \ + ((x) ? IOMMU_EXEC : 0) | \ + ((p) ? IOMMU_PRIV : 0) | \ + ((g) ? IOMMU_GLOBAL : 0) | \ + ((uo) ? IOMMU_UNTRANSLATED_ONLY : 0)) struct IOMMUTLBEntry { AddressSpace *target_as;