From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 78EEC42925; Wed, 12 Apr 2023 10:54:27 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4A68B410F3; Wed, 12 Apr 2023 10:54:27 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 50D064067B for ; Wed, 12 Apr 2023 10:54:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681289665; x=1712825665; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=Lf8hM52ErynyVL1dgOEDMwcuY54arBZkbhocgf3y044=; b=QrMTsx+eTIeiXCUvVhVEjXdSqUbscmNcDoj1ulsamYudACb5/1QlgzCn 5JCb9DAKZz6Xv9aTGaykOC6F+THKn2bNdk5lyRKv+XEd1rdsi3zwMTB0K 7ecWmMXzv6K+ZinTSLQzlw9wKS5vpbwlCic3C0AZpiaoSnTX/ZDzpg1cO ikYLH3wy+O1BfZlwWxAFjYZG7/AEfYPi0F8fcP4+sbDVUULmFhRItoGRJ /pKZ/dTpABqSuGUtFh3FH/C0Jji5obFVIxBwy1p7Wrgn15Anmw224aiaA 9MZmPsVUQ6c3/TBS2afMn2YbA5qrTBfeEKq0fmF5g9F3r7CIU1DNOuTwd A==; X-IronPort-AV: E=McAfee;i="6600,9927,10677"; a="342597136" X-IronPort-AV: E=Sophos;i="5.98,338,1673942400"; d="scan'208";a="342597136" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Apr 2023 01:54:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10677"; a="1018671304" X-IronPort-AV: E=Sophos;i="5.98,338,1673942400"; d="scan'208";a="1018671304" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by fmsmga005.fm.intel.com with ESMTP; 12 Apr 2023 01:54:23 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Wed, 12 Apr 2023 01:54:23 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Wed, 12 Apr 2023 01:54:23 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23 via Frontend Transport; Wed, 12 Apr 2023 01:54:23 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.102) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.23; Wed, 12 Apr 2023 01:54:23 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=C/4or/RS+8a7RILqrSEGYBo7PUn8yABiPWy/Mc1wVw5ur5/c7CO9cZAV7jWHgKtgH99Yu8ehBNAF7uFsbVqDfrNf3qknYr+swHBGccFElWTJhw48+BhK+VwxnYXsxs5amGv8nqMumPHdgCQatxBHUJsj2NRQnkKskeC0rjJQQ/8ml5Q9b3Ir1wuB1az6a1+FxINYH8ziHnMrhdEyWEopgZzspyHkHxzmkqteHpu5iz0Iet6BRP/XqMs3AeXFgMv7l4j82Nc4/MZ9Sg7ahcg/ZqDNSaiEcNtGs5tXz7dMYPQN3G/rzmLWXTp+ei/47O5mHRtwdw3gAlH9gXxRpGyamQ== 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=cbN7jtHTgHuXyzVsf0X9ulJ1hIV2HTO2ZfQAxOax4zg=; b=bbEXTuCzfa+oF5w/BNzX4EOxze+v73w6R1YeLGO98FrtaZqSV2rst96yRiwLSe8qwPc6j0rfv2XNxKVc9Lr7R4EZH8p14mso4FA2yQ75tYoUeZUwjE1LxHyNFyOgwhLX+XtMub7YkuPNvvtpZvDfSNN3bH4CMCPi7OAWn176Qe3hSoMc6HW5U5lrwagp/x3aPKifGTQf68sBI06tu8IO8pE0MGftGFCFAQVnKqkV5WKAAx6u7RcnaE/AYpkf5gADLpsfIiWJuRRsG6hxKFmxEwY3TYnEQsH9sbaHB//uu0fuaTpEP6mEDTkAy8h1NeuA/Du+EL3rQ4Z3yR31btMh6A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) by IA1PR11MB6491.namprd11.prod.outlook.com (2603:10b6:208:3a5::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.35; Wed, 12 Apr 2023 08:54:21 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::695b:260c:f397:2b69]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::695b:260c:f397:2b69%4]) with mapi id 15.20.6298.030; Wed, 12 Apr 2023 08:54:21 +0000 Date: Wed, 12 Apr 2023 09:54:15 +0100 From: Bruce Richardson To: Tyler Retzlaff CC: , , , , Subject: Re: [PATCH v4 02/14] eal: use rtm and xtest intrinsics Message-ID: References: <1680558751-17931-1-git-send-email-roretzla@linux.microsoft.com> <1681247548-18590-1-git-send-email-roretzla@linux.microsoft.com> <1681247548-18590-3-git-send-email-roretzla@linux.microsoft.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1681247548-18590-3-git-send-email-roretzla@linux.microsoft.com> X-ClientProxiedBy: LO2P265CA0197.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:9e::17) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|IA1PR11MB6491:EE_ X-MS-Office365-Filtering-Correlation-Id: 18c5ba9c-6b6e-4d8e-4a85-08db3b3381e3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /AYH2/er6WgDNq6tEjbObvS/Rc/HR7JSPZyJTV3j8zHlC5clGoWEJywVYM0zDh5B7OPm8fq0IzdTPj81Po3FnB5vqest1MXhdOhQZFmgUFzLWzC6uHLP6AIy/wwbjQ5C59n2a+UUiLXrlSUlpo5vqeQcD7uPFvfxy6pMaFo9tfBpq28B0yeq65lkqWDe/2roENAv8WGyVB64LlIDoIvom0EgXnyxqBMivvSX/V8JV9xQhN2wNsNF4LsqviqxrchhMq0OzrNVIoa+ywH9pmx+XoarAS/e2g8egcmclfnf+TuJKsjKkJeQEvrfSO9KeafvZIHB2EZyERz6VeF3JUkSvtG0IA6RXYCrypewdvN+nqCLZFt5Xtcgbl0Fc9pLsh+MbjHMuEt/9QYPObo8d3v9Th/804Y/PvGusx7EMgq18PrKy+flVs5e+N1Grjt9J20L0FWVDAt/rUYzqCc3kvwpOp5OCqreLZsvMtHiCyHBNWLh+W8Ij/yZp0AI+q7sjjb3AlmZ4CIq9p/w8bnGPg8OQRoCyjOAqxn+OETJHN0zFLE= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS0PR11MB7309.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(346002)(376002)(396003)(366004)(39860400002)(136003)(451199021)(86362001)(6486002)(478600001)(41300700001)(316002)(6916009)(8676002)(4326008)(66946007)(66476007)(966005)(66556008)(8936002)(2906002)(5660300002)(44832011)(38100700002)(82960400001)(186003)(26005)(6512007)(6506007)(6666004)(83380400001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?DdUHAL11DsBJdL79QMigcQ+79Mv440KQvyYU1JmN6exgEqNl2/ju4msCwvK/?= =?us-ascii?Q?HLa+BaxfoRef0L6kBK1vE6PZvm3Ir0QoMaCsJET8cWUZLqVZXXsh8qj7K5mh?= =?us-ascii?Q?+nd8GdmeNXgYOzJjfxNRcfGey8N4asie1ZaweFAa+mDTiD0qC8qahYr/UOzx?= =?us-ascii?Q?ofumilklcuOvsJmoCHl0/knZvyzwYEsts/+1RW459SviYWV4RDJmTU4D7Fet?= =?us-ascii?Q?NJvCIWZCK3iKeZNoZX6F5+Ql9IyCTiQchAHVQmxxINLAu2Q78SMx564Fm2VZ?= =?us-ascii?Q?wq3pQuQZ0tsGBEknygeUhcIa/bNYz45WwocSuRVhDiE7TdJ/Etnb6GMU5q05?= =?us-ascii?Q?WotrWxPlLFYCik/tS1L2baisB8vbmJBKdcJoT2Ef/qw5cYKQ/Xdsgqqm2kK4?= =?us-ascii?Q?GdySc32jt5o7CldUeJ3npgieNFDmfpOuGgIxOD5xDNnW94CYXxK6F8MWV54h?= =?us-ascii?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UqXr3o/zdKVayza?= =?us-ascii?Q?0iGd3vUjfPp8+QhpaFdgR7rsDfgo9PaTr9ky2I3BPcVf5l6ZbeX/eNLWOec3?= =?us-ascii?Q?YuwoIMtpfaNkaZ8BzElh3IrWpg3rnwk20sa1BMaqsGMCgnqGdkLjh/OZxxBx?= =?us-ascii?Q?5q2HqpHK9P1QzN7NCnUu02yP+hzaOO4xD7xXhXU+7m5I3IWL//MOu+ykv9nC?= =?us-ascii?Q?uuV6MbGxJc67jeapbxhBjpJlSzbFZWkhmnYA+hFhQWuBGD0UPSNtvaO/mpHc?= =?us-ascii?Q?PQ=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 18c5ba9c-6b6e-4d8e-4a85-08db3b3381e3 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Apr 2023 08:54:21.3353 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 8ZlslZxsuuC4b/IAVt/KJ5xppa3700Ye2HmSQp1jUAPAFibWlUDbI3uke447TaSyww99e+Xo6LiLh6krzfS9ylak1X4SuIQjOesYUrArRhc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR11MB6491 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Tue, Apr 11, 2023 at 02:12:16PM -0700, Tyler Retzlaff wrote: > Inline assembly is not supported for MSVC x64. Convert code to use > _xend, _xabort and _xtest intrinsics. > > Signed-off-by: Tyler Retzlaff > --- Subject to the CI not reporting any errors: Acked-by: Bruce Richardson > config/x86/meson.build | 6 ++++++ > lib/eal/x86/include/rte_rtm.h | 18 +++++------------- > 2 files changed, 11 insertions(+), 13 deletions(-) > > diff --git a/config/x86/meson.build b/config/x86/meson.build > index 54345c4..4c0b06c 100644 > --- a/config/x86/meson.build > +++ b/config/x86/meson.build > @@ -30,6 +30,12 @@ if cc.get_define('__SSE4_2__', args: machine_args) == '' > machine_args += '-msse4' > endif > > +# enable restricted transactional memory intrinsics > +# https://gcc.gnu.org/onlinedocs/gcc/x86-transactional-memory-intrinsics.html > +if cc.get_id() != 'msvc' > + machine_args += '-mrtm' > +endif > + > base_flags = ['SSE', 'SSE2', 'SSE3','SSSE3', 'SSE4_1', 'SSE4_2'] > foreach f:base_flags > compile_time_cpuflags += ['RTE_CPUFLAG_' + f] > diff --git a/lib/eal/x86/include/rte_rtm.h b/lib/eal/x86/include/rte_rtm.h > index 36bf498..b84e58e 100644 > --- a/lib/eal/x86/include/rte_rtm.h > +++ b/lib/eal/x86/include/rte_rtm.h > @@ -5,6 +5,7 @@ > #ifndef _RTE_RTM_H_ > #define _RTE_RTM_H_ 1 > > +#include > > /* Official RTM intrinsics interface matching gcc/icc, but works > on older gcc compatible compilers and binutils. */ > @@ -28,31 +29,22 @@ > static __rte_always_inline > unsigned int rte_xbegin(void) > { > - unsigned int ret = RTE_XBEGIN_STARTED; > - > - asm volatile(".byte 0xc7,0xf8 ; .long 0" : "+a" (ret) :: "memory"); > - return ret; > + return _xbegin(); > } > > static __rte_always_inline > void rte_xend(void) > { > - asm volatile(".byte 0x0f,0x01,0xd5" ::: "memory"); > + _xend(); > } > > /* not an inline function to workaround a clang bug with -O0 */ > -#define rte_xabort(status) do { \ > - asm volatile(".byte 0xc6,0xf8,%P0" :: "i" (status) : "memory"); \ > -} while (0) > +#define rte_xabort(status) _xabort(status) > > static __rte_always_inline > int rte_xtest(void) > { > - unsigned char out; > - > - asm volatile(".byte 0x0f,0x01,0xd6 ; setnz %0" : > - "=r" (out) :: "memory"); > - return out; > + return _xtest(); > } > > #ifdef __cplusplus > -- > 1.8.3.1 >