From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750886AbdE0Rqg (ORCPT ); Sat, 27 May 2017 13:46:36 -0400 Received: from mail-qk0-f179.google.com ([209.85.220.179]:34316 "EHLO mail-qk0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750783AbdE0Rqb (ORCPT ); Sat, 27 May 2017 13:46:31 -0400 MIME-Version: 1.0 In-Reply-To: <20170524120405.19079-4-vkuznets@redhat.com> References: <20170524120405.19079-1-vkuznets@redhat.com> <20170524120405.19079-4-vkuznets@redhat.com> From: Andy Shevchenko Date: Sat, 27 May 2017 20:46:30 +0300 Message-ID: Subject: Re: [PATCH v4 03/10] x86/hyper-v: make hv_do_hypercall() inline To: Vitaly Kuznetsov Cc: devel@linuxdriverproject.org, "x86@kernel.org" , "linux-kernel@vger.kernel.org" , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Steven Rostedt , Jork Loeser , Simon Xiao , Andy Lutomirski Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 24, 2017 at 3:03 PM, Vitaly Kuznetsov wrote: > We have only three call sites for hv_do_hypercall() and we're going to > change HVCALL_SIGNAL_EVENT to doing fast hypercall so we can inline this > function for optimization. > > Hyper-V top level functional specification states that r9-r11 registers > and flags may be clobbered by the hypervisor during hypercall and with > inlining this is somewhat important, add the clobbers. > + u32 control_hi = control >> 32; > + u32 control_lo = control & 0xFFFFFFFF; > + u32 input_address_hi = input_address >> 32; > + u32 input_address_lo = input_address & 0xFFFFFFFF; > + u32 output_address_hi = output_address >> 32; > + u32 output_address_lo = output_address & 0xFFFFFFFF; Yes, I have noticed it was in older code, but see, all conjunctions above are redundant. Besides that, you may consider to use upper_32_bits() / lower_32_bits() macros. -- With Best Regards, Andy Shevchenko