From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755646AbdBQJn6 (ORCPT ); Fri, 17 Feb 2017 04:43:58 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:56438 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754504AbdBQJnz (ORCPT ); Fri, 17 Feb 2017 04:43:55 -0500 Date: Fri, 17 Feb 2017 10:42:39 +0100 From: Peter Zijlstra To: Waiman Long Cc: Jeremy Fitzhardinge , Chris Wright , Alok Kataria , Rusty Russell , Ingo Molnar , Thomas Gleixner , "H. Peter Anvin" , linux-arch@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, xen-devel@lists.xenproject.org, kvm@vger.kernel.org, Pan Xinhui , Paolo Bonzini , Radim =?utf-8?B?S3LEjW3DocWZ?= , Boris Ostrovsky , Juergen Gross Subject: Re: [PATCH v4 1/2] x86/paravirt: Change vcp_is_preempted() arg type to long Message-ID: <20170217094239.GA6500@twins.programming.kicks-ass.net> References: <1487194670-6319-1-git-send-email-longman@redhat.com> <1487194670-6319-2-git-send-email-longman@redhat.com> <20170216160930.GC6515@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 16, 2017 at 04:02:57PM -0500, Waiman Long wrote: > On 02/16/2017 11:09 AM, Peter Zijlstra wrote: > > On Wed, Feb 15, 2017 at 04:37:49PM -0500, Waiman Long wrote: > >> The cpu argument in the function prototype of vcpu_is_preempted() > >> is changed from int to long. That makes it easier to provide a better > >> optimized assembly version of that function. > >> > >> For Xen, vcpu_is_preempted(long) calls xen_vcpu_stolen(int), the > >> downcast from long to int is not a problem as vCPU number won't exceed > >> 32 bits. > >> > > Note that because of the cast in PVOP_CALL_ARG1() this patch is > > pointless. > > > > Then again, it doesn't seem to affect code generation, so why not. Takes > > away the reliance on that weird cast. > > I add this patch because I am a bit uneasy about clearing the upper 32 > bits of rdi and assuming that the compiler won't have a previous use of > those bits. It gives me peace of mind. So currently the PVOP_CALL_ARG#() macros force cast everything to (unsigned long) anyway, but it would be good not to rely on that I think, so yes.