From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752458AbcHHSEv (ORCPT ); Mon, 8 Aug 2016 14:04:51 -0400 Received: from mail.skyhub.de ([78.46.96.112]:47247 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752132AbcHHSEt (ORCPT ); Mon, 8 Aug 2016 14:04:49 -0400 Date: Mon, 8 Aug 2016 20:04:30 +0200 From: Borislav Petkov To: ville.syrjala@linux.intel.com Cc: linux-kernel@vger.kernel.org, x86@kernel.org, Borislav Petkov , "H . Peter Anvin" , Andy Lutomirski , Brian Gerst , Denys Vlasenko , Linus Torvalds , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Jiri Kosina Subject: Re: [PATCH] x86/hweight: Don't clobber %rdi Message-ID: <20160808180430.GE511@nazgul.tnic> References: <1470677729-10561-1-git-send-email-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1470677729-10561-1-git-send-email-ville.syrjala@linux.intel.com> User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org + jikos. On Mon, Aug 08, 2016 at 08:35:29PM +0300, ville.syrjala@linux.intel.com wrote: > From: Ville Syrjälä > > The caller expects %rdi to remain intact, push+pop it make that happen. Hmm, I've been staring at asm for the last hours and my head is spinning now, so can you please point me at the exact where this happens. I can't find it in x86_perf_event_update(). I'm guessing even though %rdi is callee-clobbered but since we're spelling the asm for gcc, it can't know what happens to %rdi in order to stash it away for the caller. In any case, it is not a good idea to do the compiler's work. :-\ Thanks. -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply. --