Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp1234230rdb; Sat, 7 Oct 2023 20:18:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFqce6aURT8NEA3bjvA41x0zUWmSMh2/HmByHz/ZDesRIEhdLx0LMwaoVfSSm0AMBqP45Lv X-Received: by 2002:a05:6870:560a:b0:1d6:79e2:8484 with SMTP id m10-20020a056870560a00b001d679e28484mr14386544oao.22.1696735091859; Sat, 07 Oct 2023 20:18:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1696735091; cv=pass; d=google.com; s=arc-20160816; b=WE4QoYm++wXiGSIf+ytsv1tRcbf99K+Wx0Y38+mY2PV6tiU8mEVsXl1fj2T3m58XRo E/urLDB49vgA2hAbtff4LO+NZDpLDvyvA4zQJ5Kq9FTDqSqg4UA6TX64oDzwzj3GUPZu T3wVJRFS77C/PUtfWG7y4Q2jWLrcv9Avc5H92tRi/SB+ABqr9TZvWUAbSmKMCGq/mokw A9jE0mDDJBA2MwXMOga+5QFE0bWff0dtiF8O3p7JOUse2z5rxciS8eXqtNAMRypGQC/L T7ZWyDChHTH04Z3s6Q/Hz5VGMoNMbs1wCcUMRGRHYjY8OwDCYb368gL888Yn755q0Xb1 8e+Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=BmAQQl8A0PCsUojiB3YSOfAuymoeUEitnUHJzywMjMY=; fh=t5wS6LIn7PN23P9QjgHk61MahuHsm8cqRvwc1Ik5Vn0=; b=yLd1KHb6yTEkRnm9G9wxcUNUB0yg3OskNWXNfKD1DmVl7rqsksj4qg1e9Hr5Epr8Xc HKRoIpKabwe6ZwCOhaLfUGYleEsCyVXPWug6j10664LsUSQa5ykIBDRomD/sEsYZw0ko kTkecnp01Lw8wNfvOYFBialqDxL/KgxVeyxcLBa0nG3WkiLjsz8QaMt3ZqdZZATfE+Et 40fsEVJoks6E4p9qxRabv3X4/OsEjkfUg05Bzuz3Gpd4yWM+TVlWtXnJ/KfhgaTaNxRL d1JrGAXGOzLIwZL1eqCfYOIgKDAemN0InZrOAPcsvD3qmoSGYV+wn+YEuEgRNp4LwJsq 80nQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@jaguarmicro.com header.s=selector2 header.b=JuT9CDWY; arc=pass (i=1 spf=pass spfdomain=jaguarmicro.com dkim=pass dkdomain=jaguarmicro.com dmarc=pass fromdomain=jaguarmicro.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=jaguarmicro.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id q6-20020a17090311c600b001c732b6869csi7495246plh.63.2023.10.07.20.18.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 20:18:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@jaguarmicro.com header.s=selector2 header.b=JuT9CDWY; arc=pass (i=1 spf=pass spfdomain=jaguarmicro.com dkim=pass dkdomain=jaguarmicro.com dmarc=pass fromdomain=jaguarmicro.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=jaguarmicro.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 706F38031C44; Sat, 7 Oct 2023 20:18:10 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344312AbjJHDSC (ORCPT + 99 others); Sat, 7 Oct 2023 23:18:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234218AbjJHDSA (ORCPT ); Sat, 7 Oct 2023 23:18:00 -0400 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2079.outbound.protection.outlook.com [40.107.215.79]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EA27BF; Sat, 7 Oct 2023 20:17:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OLbsNRIMq26TQYoedyoYH83d/Jl3qMB1lsgtD1qJYjxRbgn1MLAMCoNFAkIgHCfwTL2ig8wQTSRm81QhCu67PhvXkPDXr0+2nYua9hz8gf8WYHReYjLS7zsb9c/UoOIaqUXhdWescIGDpSe5BD2Z9PL2KAVm3Dt+Je/0tNGpLJhyC2qK70ItmHG/O0KH82m9kPEuBYRgSyY8mmHlCF/kcKylRxTlT8e9d2znJho2WEAeS9p0Iwibf0z3Zdd4r4klltifK+gCAonBGDxWmXVPxt7BPUiAaVUPCgNMFms2VWJ6U6DPXVj0xBjArpAqFbGve5C1OmfyoQ9bW+I/g2ZK5g== 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=BmAQQl8A0PCsUojiB3YSOfAuymoeUEitnUHJzywMjMY=; b=im2EoKIQ8KYAGJvuRKhFnpahAsqN5d/2t0mpgyl9dLZjk3NMuJN+3/liE6K32T9t1CkImW1ejqpzuNr2VdV2ICSrIFrHVXpdoLvLX1b+M/H+LA1hVHhCSgsEWcd55a+Rg0y+GwkfrHYvYIgKuDI4x6dshVnBGMdu4Sv3yYWTtuLgmIQdDFIViYCDOa9nq2QLuykIJnWgIJx5HxNE8NOuoJ5TvZxS6fztSD6EUvQqY/eyL97+Oj/4f13W14Ih5IS4D6ZL8UzXDJaWOBAXofwNusM1lDsQQsKawKLuXq7XurwpXppqJMckmonVIdb+ILMf8qgN787iTSdICjpNB1T/Kw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=jaguarmicro.com; dmarc=pass action=none header.from=jaguarmicro.com; dkim=pass header.d=jaguarmicro.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jaguarmicro.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BmAQQl8A0PCsUojiB3YSOfAuymoeUEitnUHJzywMjMY=; b=JuT9CDWYYRv+I/4PyMezFl+iR3tTpD/dEbqRaC1UnqweBhyXJQUQir5cDzm2F/4ttlo+U+awTCG+dlCVzoSf/IrsQtO6nxLqgb3NuBdOXc9B/0mEFXWwt3gPEb4zHA+p9il6OVA5Lz70bS/DPiS853pFEW0/1mdCpiwoaonjBQxMKfDRs2GmD3AcT3rNT9pC6TmxQTruxwnV0VR6dsdJpTpZWG+jnteQ595IbzcCZQoHYRoUtzjFVKxjM1oosQbyPCiCRZ5R4J5r+9Z3+PbSpp8ZaLyW5iiiWXAiLlLTdA94Ola48/pGg6TU879jP3jAn26qt3x4+ZO4Ielm/Jp/1Q== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=jaguarmicro.com; Received: from PSAPR06MB3942.apcprd06.prod.outlook.com (2603:1096:301:2b::5) by TYZPR06MB6514.apcprd06.prod.outlook.com (2603:1096:400:454::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.41; Sun, 8 Oct 2023 03:17:54 +0000 Received: from PSAPR06MB3942.apcprd06.prod.outlook.com ([fe80::e5ee:587c:9e8e:1dbd]) by PSAPR06MB3942.apcprd06.prod.outlook.com ([fe80::e5ee:587c:9e8e:1dbd%4]) with mapi id 15.20.6863.032; Sun, 8 Oct 2023 03:17:54 +0000 From: liming.wu@jaguarmicro.com To: "Michael S . Tsirkin" , Jason Wang Cc: kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Liming Wu Subject: [PATCH v2 1/2] tools/virtio: Add dma sync api for virtio test Date: Sun, 8 Oct 2023 11:17:33 +0800 Message-Id: <20231008031734.1095-1-liming.wu@jaguarmicro.com> X-Mailer: git-send-email 2.34.0.windows.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: TYAPR01CA0053.jpnprd01.prod.outlook.com (2603:1096:404:2b::17) To PSAPR06MB3942.apcprd06.prod.outlook.com (2603:1096:301:2b::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PSAPR06MB3942:EE_|TYZPR06MB6514:EE_ X-MS-Office365-Filtering-Correlation-Id: 6b7873b4-fe76-4f89-619c-08dbc7ad2942 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BZpiVRySAxrpOELbK2TL6Q2neFcAWJTPTp32LrLD6qns+LN1XrrpQxSlmg9LR//p1GLVXbpkTIpm9TDbR+tjsJEIb77P7AYMJ4xVsr7Guw+GMCfDXH9zPKgG65DkGw8WHAHmkhJwOKP4DkL9WBFgt14TO5/abFLUkB1qga9xSSf8rwodjDNnzG4nlGtxu7xEX78ddccjpm/JE5kGuQr8IKnPxg5eHSVSfEY7ZhcLTcKpfMnYnzRczPSuRlmXTu4O+1SBWSWPPj9J67k6kH8VV+lpd0Py04HSqwM32+23TGt8EyUAAHuUXOPVxmv7YrLQGLklok2HM6dWyf9zhLfU+Z/ixGQSePO6ag2wxxpetre3+VTpCd77oq1ySRu8pZNAv8uNNxvYUScb0W7XKiGrz1OedluAArG+KeJ3ktziz96cRjzY+uvHnSVWpdyKqYz+xLPzre5V+3BA3u//N3O9vzIEe/C3WMHcRe3ITy2LSvGLIVekTI6MSvhFDl3aO9LVUE9GskuhLFSIhmUNL3JW0sWG7KetjlJQeLzQcc216uExu+/HVDt8vJKAuw8OHYnL2L4LRYwNIeWs5sl9EtvACDBSVdNetD0oIaZSqLwM/VcoVc/WycpuUdqjHdv4pQn5 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PSAPR06MB3942.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(366004)(136003)(39830400003)(396003)(346002)(230922051799003)(186009)(1800799009)(64100799003)(451199024)(478600001)(66946007)(110136005)(66476007)(66556008)(6636002)(6486002)(316002)(38350700002)(6506007)(2616005)(6666004)(38100700002)(9686003)(26005)(1076003)(107886003)(52116002)(6512007)(36756003)(41300700001)(4326008)(5660300002)(8936002)(8676002)(2906002)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?LOEOmlp1k57CfPJsvCNqUG9tXTKcuKiMdzS5yViuSpv34TAuxrhA1SGBdiFm?= =?us-ascii?Q?b6eh66qr86kBo9CGL1Us1RUF4u2KgJYHeYi6n7B3C2Zh7rjcI5/QoZhQo6Xp?= =?us-ascii?Q?VQ6PgmxHTgAnaWprotU1hwb/glOCfqwiGfXcm2n01NrmQatx9FL14OGTvf9N?= =?us-ascii?Q?9Rt7qcJB6axrHk84Ump/nd5t/cjt7nyedQOxPrxJ4xDf2hNDsVVzKXkJdm9T?= =?us-ascii?Q?yPa1wJFWqMv0yGPH8oCeX9184cJnc1V1dY4LtudLzpDVsdkgNLSW0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eQe8DmIX7HzhGbe1ONwM/?= =?us-ascii?Q?madbnp7M8FbPiRlnuh3//jmZ8bTb70CtuY2XtLxy0FqXhY0YJ1i93p9VCX+m?= =?us-ascii?Q?i067MsUTmmL1b5V7KtUbf5+MsvWGe11Q7p6DYBKk/2VzBdqvRDbMeOYKe8TY?= =?us-ascii?Q?3BESrZ/0ZnaGTR365cd4QvAo7BhW6KTJ++hed/AmFTuz17pb0LoAJT/cuyoF?= =?us-ascii?Q?mn4nccvGgyBeZnuJCPjFeaJlh4k/lcS/ExLzpOoWb7kFihzcV6ddtbRvSyXH?= =?us-ascii?Q?wjTrX6MjkbpLfsBTT1ZXsc+uUjLAs9FklnOxTL9FpWeie3IkfVTLZhXDC7NC?= =?us-ascii?Q?JWU+vbZ/UER9pgn3ZF1Nf+XLJvt9Ib6pBy/KYsw/yctn54JHv7hiwLgNf/Os?= =?us-ascii?Q?WqqFw0o1JfI2wRZotRZXF/pl99QSHunC0GsCq7+8n/A6zd7DKwjU7e79eeLQ?= =?us-ascii?Q?oA=3D=3D?= X-OriginatorOrg: jaguarmicro.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6b7873b4-fe76-4f89-619c-08dbc7ad2942 X-MS-Exchange-CrossTenant-AuthSource: PSAPR06MB3942.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Oct 2023 03:17:54.0880 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 1e45a5c2-d3e1-46b3-a0e6-c5ebf6d8ba7b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: SDvbADrDZ0nQhg2JBWOnNsJpHOJSfLvEXzteuTn6xM4sABD87aENqfRI55a1o4FFWq8Rttb//xd1l+dBDX/hEzkD2dulvVsstPCPyJJEuXA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB6514 X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sat, 07 Oct 2023 20:18:10 -0700 (PDT) From: Liming Wu Fixes: 8bd2f71054bd ("virtio_ring: introduce dma sync api for virtqueue") also add dma sync api for virtio test. Signed-off-by: Liming Wu --- tools/virtio/linux/dma-mapping.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tools/virtio/linux/dma-mapping.h b/tools/virtio/linux/dma-mapping.h index 834a90bd3270..822ecaa8e4df 100644 --- a/tools/virtio/linux/dma-mapping.h +++ b/tools/virtio/linux/dma-mapping.h @@ -24,11 +24,23 @@ enum dma_data_direction { #define dma_map_page(d, p, o, s, dir) (page_to_phys(p) + (o)) #define dma_map_single(d, p, s, dir) (virt_to_phys(p)) +#define dma_map_single_attrs(d, p, s, dir, a) (virt_to_phys(p)) #define dma_mapping_error(...) (0) #define dma_unmap_single(d, a, s, r) do { (void)(d); (void)(a); (void)(s); (void)(r); } while (0) #define dma_unmap_page(d, a, s, r) do { (void)(d); (void)(a); (void)(s); (void)(r); } while (0) +#define sg_dma_address(sg) (0) +#define dma_need_sync(v, a) (0) +#define dma_unmap_single_attrs(d, a, s, r, t) do { \ + (void)(d); (void)(a); (void)(s); (void)(r); (void)(t); \ +} while (0) +#define dma_sync_single_range_for_cpu(d, a, o, s, r) do { \ + (void)(d); (void)(a); (void)(o); (void)(s); (void)(r); \ +} while (0) +#define dma_sync_single_range_for_device(d, a, o, s, r) do { \ + (void)(d); (void)(a); (void)(o); (void)(s); (void)(r); \ +} while (0) #define dma_max_mapping_size(...) SIZE_MAX #endif -- 2.34.1