From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id E3452A04B6; Mon, 12 Oct 2020 21:52:56 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 768751D9B6; Mon, 12 Oct 2020 21:52:55 +0200 (CEST) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by dpdk.org (Postfix) with ESMTP id 123811D973 for ; Mon, 12 Oct 2020 21:52:53 +0200 (CEST) Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 09CJWKF5093599; Mon, 12 Oct 2020 15:52:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=BmWGHl1+QzRomgmNBFt4CPJE7h0GEPEL/7Ob5fUzjbc=; b=mv+d+c/ngrexW2hJtX7byIrda9zxHXV2P7clTkJgd6BzF48dnfRHKTrLWXETWNCveigW 1LnTC2dXmqXZYs0b5VBmL9Mnxn7/RZNsd3AUx7KdppP85DwjovLcnh/fYrQiomVFJG8u sRt1/nLz7Js8qVKa5bJ18PmD2pmZzxQc65ioQ9Nmu8cMk9MkH26hCzxB65/XyQk13349 zlMN3PUrHkz0VxSjjJ6F/Uh0o74qABMTxKDvjdItEgbEjGLEdZiEre4elAdp3Rse4//1 XXvNFxdLbDzCcOcLV0MpE1+6xcls1mg75pQOk4lq8KZAv8IyBHSz20lK9TZuoL+iUWvB zA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 344w3t8te2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 12 Oct 2020 15:52:47 -0400 Received: from m0098393.ppops.net (m0098393.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 09CJYn7Q099165; Mon, 12 Oct 2020 15:52:47 -0400 Received: from ppma02wdc.us.ibm.com (aa.5b.37a9.ip4.static.sl-reverse.com [169.55.91.170]) by mx0a-001b2d01.pphosted.com with ESMTP id 344w3t8tds-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 12 Oct 2020 15:52:47 -0400 Received: from pps.filterd (ppma02wdc.us.ibm.com [127.0.0.1]) by ppma02wdc.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 09CJpYkJ009533; Mon, 12 Oct 2020 19:52:45 GMT Received: from b03cxnp08028.gho.boulder.ibm.com (b03cxnp08028.gho.boulder.ibm.com [9.17.130.20]) by ppma02wdc.us.ibm.com with ESMTP id 3434k9a4ee-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 12 Oct 2020 19:52:45 +0000 Received: from b03ledav003.gho.boulder.ibm.com (b03ledav003.gho.boulder.ibm.com [9.17.130.234]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 09CJqiKB64291172 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 12 Oct 2020 19:52:45 GMT Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D5A9A6A04F; Mon, 12 Oct 2020 19:52:44 +0000 (GMT) Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1A56C6A04D; Mon, 12 Oct 2020 19:52:44 +0000 (GMT) Received: from Davids-MBP.randomparity.org (unknown [9.211.73.22]) by b03ledav003.gho.boulder.ibm.com (Postfix) with ESMTP; Mon, 12 Oct 2020 19:52:43 +0000 (GMT) To: Anatoly Burakov , dev@dpdk.org Cc: Jan Viktorin , Ruifeng Wang , Ray Kinsella , Neil Horman , Bruce Richardson , Konstantin Ananyev , david.hunt@intel.com, liang.j.ma@intel.com, jerinjacobk@gmail.com, thomas@monjalon.net, timothy.mcdaniel@intel.com, gage.eads@intel.com, chris.macnamara@intel.com References: <532f45c5d79b4c30a919553d322bb66e91534466.1602258833.git.anatoly.burakov@intel.com> From: David Christensen Message-ID: Date: Mon, 12 Oct 2020 12:52:43 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-10-12_15:2020-10-12, 2020-10-12 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 priorityscore=1501 impostorscore=0 bulkscore=0 phishscore=0 suspectscore=0 clxscore=1011 malwarescore=0 lowpriorityscore=0 adultscore=0 spamscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010120141 Subject: Re: [dpdk-dev] [PATCH v5 03/10] eal: add intrinsics support check infrastructure X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 10/9/20 9:02 AM, Anatoly Burakov wrote: > Currently, it is not possible to check support for intrinsics that > are platform-specific, cannot be abstracted in a generic way, or do not > have support on all architectures. The CPUID flags can be used to some > extent, but they are only defined for their platform, while intrinsics > will be available to all code as they are in generic headers. > > This patch introduces infrastructure to check support for certain > platform-specific intrinsics, and adds support for checking support for > IA power management-related intrinsics for UMWAIT/UMONITOR and TPAUSE. > > Signed-off-by: Anatoly Burakov > --- ... snip ... > diff --git a/lib/librte_eal/ppc/include/rte_power_intrinsics.h b/lib/librte_eal/ppc/include/rte_power_intrinsics.h > index 70fd7b094f..d63ad86849 100644 > --- a/lib/librte_eal/ppc/include/rte_power_intrinsics.h > +++ b/lib/librte_eal/ppc/include/rte_power_intrinsics.h > @@ -17,6 +17,10 @@ extern "C" { > /** > * This function is not supported on PPC64. > * > + * @warning It is responsibility of the user to check if this function is > + * supported at runtime using `rte_cpu_get_features()` API call. Failing to do > + * so may result in an illegal CPU instruction error. > + * > * @param p > * Address to monitor for changes. Must be aligned on an 64-byte boundary. > * @param expected_value > @@ -43,6 +47,10 @@ static inline void rte_power_monitor(const volatile void *p, > /** > * This function is not supported on PPC64. > * > + * @warning It is responsibility of the user to check if this function is > + * supported at runtime using `rte_cpu_get_features()` API call. Failing to do > + * so may result in an illegal CPU instruction error. > + * > * @param tsc_timestamp > * Maximum TSC timestamp to wait for. > * > diff --git a/lib/librte_eal/ppc/rte_cpuflags.c b/lib/librte_eal/ppc/rte_cpuflags.c > index 3bb7563ce9..eee8234384 100644 > --- a/lib/librte_eal/ppc/rte_cpuflags.c > +++ b/lib/librte_eal/ppc/rte_cpuflags.c > @@ -108,3 +108,9 @@ rte_cpu_get_flag_name(enum rte_cpu_flag_t feature) > return NULL; > return rte_cpu_feature_table[feature].name; > } > + > +void > +rte_cpu_get_intrinsics_support(struct rte_cpu_intrinsics *intrinsics) > +{ > + memset(intrinsics, 0, sizeof(*intrinsics)); > +} > diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map > index a93dea9fe6..ed944f2bd4 100644 > --- a/lib/librte_eal/rte_eal_version.map > +++ b/lib/librte_eal/rte_eal_version.map > @@ -400,6 +400,7 @@ EXPERIMENTAL { > # added in 20.11 > __rte_eal_trace_generic_size_t; > rte_service_lcore_may_be_active; > + rte_cpu_get_intrinsics_support; > }; > > INTERNAL { Acked-by: David Christensen