Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755791AbcDGJnh (ORCPT ); Thu, 7 Apr 2016 05:43:37 -0400 Received: from mx2.suse.de ([195.135.220.15]:57246 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755551AbcDGJnf (ORCPT ); Thu, 7 Apr 2016 05:43:35 -0400 Date: Thu, 7 Apr 2016 11:43:33 +0200 From: Borislav Petkov To: Dmitry Vyukov Cc: Andi Kleen , zengzhaoxiu@163.com, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Denys Vlasenko , Andrew Morton , Kees Cook , LKML , Zhaoxiu Zeng Subject: Re: [PATCH v2 10/30] Add x86-specific parity functions Message-ID: <20160407094333.GD3866@pd.tnic> References: <57031D9D.801@gmail.com> <1459934085-7152-1-git-send-email-zengzhaoxiu@163.com> <87wpoay10o.fsf@tassilo.jf.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 727 Lines: 24 On Thu, Apr 07, 2016 at 08:31:09AM +0200, Dmitry Vyukov wrote: > Hweight custom calling convention caused crashes with KCOV coverage. > We had to disable instrumentation of the file. I guess we can do something like this: if (likely(static_cpu_has(X86_FEATURE_POPCNT))) asm volatile(POPCNT32 : "="REG_OUT (res) : REG_IN (w)); else res = __sw_hweight32(w); and get rid of the custom calling convention. Along with some numbers showing that the change doesn't cause any noticeable slowdown... -- Regards/Gruss, Boris. SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg) --