Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp818004rdb; Fri, 6 Oct 2023 23:56:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHH9AkRNud13VuaGZfEJ/5tDcvVhT2AHeY2LkkGciMzOebRfhcagcugrq5LG8ANG8PPB9l2 X-Received: by 2002:a17:902:eed2:b0:1c5:b4a1:ff3 with SMTP id h18-20020a170902eed200b001c5b4a10ff3mr10165718plb.40.1696661783291; Fri, 06 Oct 2023 23:56:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1696661783; cv=pass; d=google.com; s=arc-20160816; b=qTIL+CwrFrBGvBxJ8tv9SRycjT2aX3zn1uIbb+bLUkZVJ2Bl8F1zHbeJMW8qcjKo3Q ewy4qTZsXamblCpsoGBY614w7D3rguJfxZO8kY3+y96wdyKP4OFQ8+eCrb7IH2OFDjKm WwrSpSEamSzA6xMPAK4fc00g8Gskx7JnxGpW2a5cIJU+P63sVZQAUq10+HFeXYU7SpXV 6ias9U9jywBVwVngIjJTcP0kzQhnrnNJBJafT0LACIJaiu24XmhwrTrf1zEVqQLYtkzk Htx4jr0FyZGznh1eUQ7sAXIWcJJ5DQ18Tk/flt8BINCbOko3wWV0yqi07N9h6YTdU4de eaHg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=BmAQQl8A0PCsUojiB3YSOfAuymoeUEitnUHJzywMjMY=; fh=t5wS6LIn7PN23P9QjgHk61MahuHsm8cqRvwc1Ik5Vn0=; b=Sezf5jxagUAFLo4InfBR1gBBXSIFYhMGAaBxCmQeomqaBOGd8mXXtD9ehIl2OFuWkX w/d1O+Br/8M1r93EDzgWzl4FVwoH7BTXJsE8fvaBTRNsG2gmxSVG//Ixz41QGVqdf1w2 37xBXQAgtPIEoD0ccus8Xiq8Ikn464sbERJ26+ha7tbfjiMy4yB8Tlm63nyfLxC8LkMi iBtH9DyR/xKbd+rQAuugRfhO3GrK++7MUIm6vUBubm3l5LikHAMxLZULKN4kLQXQr7rP GkoUKZfZp4Y+UkKSnU36OhtRaRVn4xd0fBfVRC10scTFHRzelxCR3kjbeXjJc7BAlR4B wLVA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@jaguarmicro.com header.s=selector2 header.b=ni413uTq; 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 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id c16-20020a170902d49000b001c724f997ffsi5702006plg.131.2023.10.06.23.56.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 23:56:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@jaguarmicro.com header.s=selector2 header.b=ni413uTq; 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 2620:137:e000::3:8 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 fry.vger.email (Postfix) with ESMTP id 89A2780AB598; Fri, 6 Oct 2023 23:56:20 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343619AbjJGG4L (ORCPT + 99 others); Sat, 7 Oct 2023 02:56:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343578AbjJGG4K (ORCPT ); Sat, 7 Oct 2023 02:56:10 -0400 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2069.outbound.protection.outlook.com [40.107.215.69]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C184BD; Fri, 6 Oct 2023 23:56:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kcmWn73NH/rVMhw/IkIFC85s0jMGle0p11r5FcEwCWbeeMjp30bqjOaDlhsved+IEkVTOiYojGjGCOMi9ciu8PNFyWYz0qILd4ZfBpVPLQY6V3/OBxt/lYuCHQ0zP8J49RPr+5Zr4icGuT1Jt2iXzdD1iKJRYPuc6xPkaK1GSMVo/DsgWdDZ101RXnKrJbyVkdMxTpGhAaOUOsT6UcEjRHUb7vXNHNvsFN0buZRZ9xgajIvh4+xFrluJQ14xzNgfQLcNAXJw9BUtTeizDYdao1+nzJHSAbUwav/P6oZzU1ceaUB7WiulHZHh6yaXzQW9tVuMJJQnovdkcgtUGZTKmw== 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=hUNFkve3v18jVluqmMjUoSFiu5OZTZdjLsD1VP31L2OWcYsJ66c1SYjagxNI83U4MXeJJsfCERBxYIz4qEJgF9XhOjQMunQdQWHb7kvdbUnkF9nH4u8qkzIru9FD215dWMKInyJ5J42+62w3zN03Rs95WnRYkcwu4GF5bcXoAMHyDR1jC1UxhX5qVR2Rh9wb3srxxEN1xL0I06ESwzrmjgOP1sKSNqivgwxKYG+DQq6DvyG8ctML16bnIl2rRiFb5W7m90v7LR6c9VE5WCN2JvlQTHN1+LL89nJ+tVs8/9Y0uT2Yok/F2vKfa2uIGDbht7LSxc2e/53wLEly8SmdqQ== 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=ni413uTqNxlw65q8g1WBi5WYN4ope1u1IugbcVoHFwbzic0ZOwToku4hmnegEmJemQGp+uK4xpyGeKYvwbNf8BdDwJPiRNX5Rneiw2MksJpXjcCFK/P2Z7iXzhYo8stfCEb/wJp4n20JxI0wQSY3zriSbr8zc+0uzPv2d0AxpQv5mOYWuQTTgtlJGuXTzx9QGkxYa7sMRibrfRQW8RXMAkQm/mt7/m+nOHc+Shq8PhCtc8IFMEJ0SGndmh9URzVE8TAJnLLQniXrotdNbJDTenW5+W4PXhgWDhlaAC5Bt3Anvd42xNo8ZnClifTerELx5lClc2iuuFem/9Lk3jjDqw== 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 TYZPR06MB6745.apcprd06.prod.outlook.com (2603:1096:400:45a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.38; Sat, 7 Oct 2023 06:56:04 +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.6838.033; Sat, 7 Oct 2023 06:56:04 +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: Sat, 7 Oct 2023 14:55:46 +0800 Message-Id: <20231007065547.1028-1-liming.wu@jaguarmicro.com> X-Mailer: git-send-email 2.34.0.windows.1 In-Reply-To: <20230927111904-mutt-send-email-mst@kernel.org> References: <20230927111904-mutt-send-email-mst@kernel.org> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI2PR02CA0050.apcprd02.prod.outlook.com (2603:1096:4:196::11) To PSAPR06MB3942.apcprd06.prod.outlook.com (2603:1096:301:2b::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PSAPR06MB3942:EE_|TYZPR06MB6745:EE_ X-MS-Office365-Filtering-Correlation-Id: d4f1d500-c40f-47ff-a437-08dbc7027934 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PqOhxHxAd2s811+oko7SrSKHuGTxtjtKq3gy/veBMuZPJoe3qRjPlPh5oJwMaAEfa06bI3FXnb8GLuyk1eMRuJmTADD67JeKKaEAyTEJZZqfajvhtq8vqE+ORgSlMHcMDaMePRXIxDKCGmDQuz4Q8jAVJY4U5CTDmAGMX8b12lCq/CuJ2npxP237x3JzJ0L43EiYXDWE+qAXf/CgKrMSR9iPIBSuZXqJisr31UhFcDYQw3BF1QPgeTEaURqvBVuwF3v+ukgM0Fb97uvLZJs1S+BHS0+iFIsq5Gxt4uuJHqYeThAyShWTxZWDruQqx4WgDGIrGKkUUr+RMXhOcWbDdvLX6RF2OrPVuH8gzXS7LurxaK9tuyskRhSXSz/Y2AoZNuuv/fnW4V/F7kLgCMsfpm8u99lOWGps7nG+Yo2bO+sOj7O2hCb2dEAv03Cobruw+tl4Z/PshLbuChQrfvw4JDb2Qxk1sRVRAeeh7mHyEMOatW4TsujpjLBdwsFOcWy7nWN3Ux5fNHfYHtXYXuu49JrJGaUPh0iwwus7zgTvq/MoFw0UXro4u1En625AZKYKcyESR7QSg2hvEIvnrexoTTfZO081CdDROHS6TEB0AMJP3o4RifbduHXbdOb3JrTb 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)(366004)(136003)(396003)(376002)(346002)(39830400003)(230922051799003)(64100799003)(451199024)(186009)(1800799009)(2906002)(4326008)(8936002)(5660300002)(8676002)(86362001)(36756003)(316002)(41300700001)(6636002)(66946007)(66556008)(66476007)(110136005)(9686003)(6486002)(6512007)(478600001)(6666004)(2616005)(38100700002)(38350700002)(1076003)(26005)(107886003)(6506007)(52116002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?ayjCmb2+9IZR6IrAZ9de4Cvsj6BQD0QnerNq8r8IW6AySnkHLG8yuv7tsw/6?= =?us-ascii?Q?1+FjHX2oY9WRcsIh4jvPrxnIdHgfyVfGO01PUs3cEDPg0SF6kixsJwSjuI7t?= =?us-ascii?Q?vEqD3yyddjNtS0soQY5HDdjylmFgLkbs37WQlp/AJ9LHa9U2cqLX2Sgld77O?= =?us-ascii?Q?47jlNmFF0BtnnxUtJ6U+KHgMSwSlgFT9mCC4QyOrYstlrAeWOZSk61e0SyH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8ZJamg3hrYK7AahEDP4nIQdhH4/Xkwv?= =?us-ascii?Q?fvcylJOHqDC7LGGB7fhJ07HYrzkEKXXug96SwqIIR2k+5HL0n0rVVj54UHfd?= =?us-ascii?Q?CUlSb/fExnvv7oy+SErYtj1mbQ8yr1IqXs8+PTPaY6CkxdijnQh7TGm71BIW?= =?us-ascii?Q?p1mtIeoSrcR21H02lSkzu50IU71J+daqNSvamRSikuAfvqQZe7v9nv6guY3Z?= =?us-ascii?Q?kecjzMOUlPvgPa65qPoApLeButUqW+pw3ux7ztc19BfhdqrBm8X3lUYx4crK?= =?us-ascii?Q?0Wp49HRTRlZRMRUrtr/4ALe423h4aVvULcDaO0sd/wt5Q3E7GDz99TPeKbZk?= =?us-ascii?Q?cbcq5hHCTAEf9ewZttgDpyBE3Eu+um1knPl44pmV3TBI2gF4spbdBAfLV4qd?= =?us-ascii?Q?x5mCa5Nt6s0EPRk2fY9xMCAff2gO0hm1lfta4iFIOhb3UCgpxRQzVchVeR7q?= =?us-ascii?Q?BJCY9zmaKR6PmccEf5pylNY+L9UcDeP/MehFhrecUlxAZcgVol/QItnIIA0K?= =?us-ascii?Q?OA=3D=3D?= X-OriginatorOrg: jaguarmicro.com X-MS-Exchange-CrossTenant-Network-Message-Id: d4f1d500-c40f-47ff-a437-08dbc7027934 X-MS-Exchange-CrossTenant-AuthSource: PSAPR06MB3942.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Oct 2023 06:56:04.2418 (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: LekE///l/2t/emQ5tachb38OXYW27x+mM0rETfEwh2Eh/QM+5GhyDNTwvPpA0f7Gsuc+tjyalG/G5VN/MUVfM26BuFm36kQI6qgY+W4IYY4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB6745 X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email 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 (fry.vger.email [0.0.0.0]); Fri, 06 Oct 2023 23:56:20 -0700 (PDT) X-Spam-Level: ** 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