Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp900837iob; Wed, 4 May 2022 10:14:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHeEdk8ihoZefeO3zTAvbduz6Pgvj+dOuRmtJxVRycsCiBYZitgIg7RYpGUe/MII43Sb/W X-Received: by 2002:a17:907:7241:b0:6f3:cef2:1031 with SMTP id ds1-20020a170907724100b006f3cef21031mr21293135ejc.98.1651684443828; Wed, 04 May 2022 10:14:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651684443; cv=none; d=google.com; s=arc-20160816; b=As2vdiqDNJ8S3V5u581O86zqQK4kXSPLWBI3D+LQ0zlkmgRDQwHbLnvtgKoWP2bfit wCZjQEz/nH9Tx8T1d2IvD93dZjtPk+LSYgBUhszOCOEyvqs49wO20Ru7eXWnuktHSVva H8t+0YlrUrRJKW3c6foPeI7YPO83fTPouJONZ0MMn7EUS8m1NeUUB/gs3m9PbSUoJfha F/MUkbZrMel+IwKAX5HeimBhFGpxnNg7z5t8nYUGRA3U2MQZs6bLPn2NOA7zb2v/6Lw3 dt9+HVA+XzOwWNz0MyUKp+E9dleEUskQA4O2g8xYfAqouyKP9DmvDLnsGbOZwEg/zhZW z58g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=387nuMEPmIevlM1DMf2vs4wOzPcNxY2iRDTji3yEfrY=; b=QQU561F7ZIyT/4i/BYAcyGSnJ39G1/fymX6dUvtrzpUrq4s99yOMhUvLtVOW+2w/+g D5rAbt/zyr1Flznmq7uLGwrUV4hcG9SDZgePsjkRm7II3mcRaU00QGQAZdOv/KH85P+E ykezO0eX56iyu2xv8HBrcFmb+CDRXK9xVrudmPH6jAv5IK/Fbwi8tjEi1u2mWnvY5zjO rYe8AdHMvC+QJDbumakt3BF9G/VBTLaKTOJGQJjG1ztvXvyfPzxERHFvVRlQCf8Ma3cT KqPmRDGjfUUQ6RCgx2JliWxmGmRuDu7CrXQDqL92wNTRhnbpViLgihbPiAdjlyPCdHH2 bGjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ScROUhuo; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e15-20020a056402190f00b00427c65dc295si8534419edz.266.2022.05.04.10.13.28; Wed, 04 May 2022 10:14:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ScROUhuo; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347744AbiEDKLJ (ORCPT + 99 others); Wed, 4 May 2022 06:11:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235489AbiEDKLI (ORCPT ); Wed, 4 May 2022 06:11:08 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A987F24967; Wed, 4 May 2022 03:07:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1651658853; x=1683194853; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=9twPMGUhGLkTOQzFXdvf7xUT5W9ZWvaoGTeC5Py9svk=; b=ScROUhuouH6wXM3AX0Wcuu3T2SJwyk2wUiWKMygVNxWQUOPrpVmc4A+E KCk7ZiEQXHcqyXRP8J+4gn0YhY7puHO9WV4TJMc8tAQDwdhtJyPRCjbR3 MxBk7kuV++14ydyc85jHYUq/K8S1b3Z0a/cufFejtxyDeT1oGsIKMZUyo mTBbGmZOrkuBpDtk8v0SzkPabT7K85B7y3SyeUahB/oSHLIdBmNZEPicW XuBHFH7oVAG5Km51d4vTJ99Jhz7vbu454Jp0YlRkLb2BacqsZLtfkjBGf R8NSsIVmYDsFvNYaauaPUGKErNf6A0whqkjPMO4uINTd1pHsNPkSvcYwk A==; X-IronPort-AV: E=McAfee;i="6400,9594,10336"; a="255185928" X-IronPort-AV: E=Sophos;i="5.91,197,1647327600"; d="scan'208";a="255185928" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 May 2022 03:07:33 -0700 X-IronPort-AV: E=Sophos;i="5.91,197,1647327600"; d="scan'208";a="568039833" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 May 2022 03:07:30 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.95) (envelope-from ) id 1nmBuo-00Bq4L-Ux; Wed, 04 May 2022 13:07:26 +0300 Date: Wed, 4 May 2022 13:07:26 +0300 From: Andy Shevchenko To: "Jason A. Donenfeld" Cc: Stafford Horne , Mikulas Patocka , Linus Torvalds , Andy Shevchenko , device-mapper development , Linux Kernel Mailing List , Linux Crypto Mailing List , Herbert Xu , "David S. Miller" , Mike Snitzer , Mimi Zohar , Milan Broz Subject: Re: [PATCH v2] hex2bin: make the function hex_to_bin constant-time Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE 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-crypto@vger.kernel.org On Wed, May 04, 2022 at 11:57:29AM +0200, Jason A. Donenfeld wrote: > On Wed, May 04, 2022 at 11:42:27AM +0200, Jason A. Donenfeld wrote: > > So more likely is that this patch just helps unmask a real issue > > elsewhere -- linker, compiler, or register restoration after preemption. > > I don't think there's anything to do with regards to the patch of this > > thread, as it's clearly fine. > > The problem even goes away if I just add a nop... Alignment? Compiler bug? HW issue? > diff --git a/lib/hexdump.c b/lib/hexdump.c > index 06833d404398..ace74f9b3d5a 100644 > --- a/lib/hexdump.c > +++ b/lib/hexdump.c > @@ -46,6 +46,7 @@ EXPORT_SYMBOL(hex_asc_upper); > int hex_to_bin(unsigned char ch) > { > unsigned char cu = ch & 0xdf; > + __asm__("l.nop 0"); > return -1 + > ((ch - '0' + 1) & (unsigned)((ch - '9' - 1) & ('0' - 1 - ch)) >> 8) + > ((cu - 'A' + 11) & (unsigned)((cu - 'F' - 1) & ('A' - 1 - cu)) >> 8); > -- With Best Regards, Andy Shevchenko