Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp291836imm; Thu, 28 Jun 2018 20:26:05 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeH46PJBr/qKNrXLZNyGfmUQHRJD9V6Jr774rnm1w6jOhwLTMmznul+SAo0+qhElo+k27G6 X-Received: by 2002:a17:902:528a:: with SMTP id a10-v6mr4992220pli.73.1530242765477; Thu, 28 Jun 2018 20:26:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530242765; cv=none; d=google.com; s=arc-20160816; b=Fda2UMWXTOVIDufVbgv/EwMAYgpfq3DiQ+/wObzJdA8ZFqGSA6HyGma8yWgYzj7zXw UEFGUtbtN+l4TkxR6thD4ZYbWjgIsK/cABDqo6tebt9SxeEiIv059+AMxj4lBpe5Naku a+3UYhgaCI1ZfPVukI/jneb2ehGFtVHG8wlbn3PBMIlgQtNR12dTS2OhXBAKRBzlGyKE EFmr/lgAMATNr6iA2KdshUg2li7HlES0JJbf2vh2JsKFvZAFAzKpR9MTxz4smeffMHvs ZEhUC6yY4DrcdDdi+sLhLSOlfDeG7BvFZHrK3wDbEav3vXBaHZ/6IZthZguZr6PHASyZ jb4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=uslorXHKUsP90Ro+VunUhygg4k6hTwg+WTaSewIcvfQ=; b=HIL89WIpeDP+ZilHbQrrnkn33rU1A62J2UvfFecKsemj/ptXZ6+ids6q6pTFx+93uJ iQKWvNyby2swDTz5cRF5uPnMgoIrVsc97IkQuPa8C5b3SsCFLxzVjj5OD6PMsfVYv+US RUFWLcgWr/cWWFgxXS50s8kjwiylCsc8JHng1JxTZng7u+Ik03c1v5mDh0plDvRccwsv ofDeK4pFZWunXH9cAU6IKFgvUSY20/Skz1Z5Z7pXeVaJP4lCyIziEu7e49yusNTvPAUi Db2CMs4zvAKFSSDAJPHcVCC6oToIOVn/k5gCRjWCiIaQHpUr+2dB1dPzi9uT5vfA1/64 mRNQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y23-v6si2785485pfb.284.2018.06.28.20.25.18; Thu, 28 Jun 2018 20:26:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967989AbeF1SuP (ORCPT + 99 others); Thu, 28 Jun 2018 14:50:15 -0400 Received: from mga09.intel.com ([134.134.136.24]:26182 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966880AbeF1SuM (ORCPT ); Thu, 28 Jun 2018 14:50:12 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Jun 2018 11:50:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,284,1526367600"; d="scan'208";a="211959149" Received: from bee.sh.intel.com (HELO bee) ([10.239.97.14]) by orsmga004.jf.intel.com with ESMTP; 28 Jun 2018 11:49:53 -0700 Received: from kbuild by bee with local (Exim 4.84_2) (envelope-from ) id 1fYbzM-000Wfd-29; Fri, 29 Jun 2018 02:49:52 +0800 Date: Fri, 29 Jun 2018 02:49:43 +0800 From: kbuild test robot To: Vitaly Kuznetsov Cc: kbuild-all@01.org, kvm@vger.kernel.org, x86@kernel.org, Paolo Bonzini , Radim =?utf-8?B?S3LEjW3DocWZ?= , Roman Kagan , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , "Michael Kelley (EOSG)" , Mohammed Gamal , Cathy Avery , Wanpeng Li , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/5] KVM: x86: hyperv: introduce vp_index_to_vcpu_idx mapping Message-ID: <201806290206.aMbkOcrB%fengguang.wu@intel.com> References: <20180628135313.17468-3-vkuznets@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180628135313.17468-3-vkuznets@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: lkp@intel.com X-SA-Exim-Scanned: No (on bee); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Vitaly, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on kvm/linux-next] [also build test WARNING on v4.18-rc2 next-20180628] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Vitaly-Kuznetsov/KVM-x86-hyperv-PV-IPI-support-for-Windows-guests/20180629-011544 base: https://git.kernel.org/pub/scm/virt/kvm/kvm.git linux-next reproduce: # apt-get install sparse make ARCH=x86_64 allmodconfig make C=1 CF=-D__CHECK_ENDIAN__ sparse warnings: (new ones prefixed by >>) >> arch/x86/kvm/hyperv.c:156:15: sparse: incompatible types in comparison expression (different address spaces) arch/x86/kvm/hyperv.c:195:15: sparse: incompatible types in comparison expression (different address spaces) vim +156 arch/x86/kvm/hyperv.c 136 137 static u32 vp_idx_to_vcpu_idx(struct kvm *kvm, u32 vp_idx) 138 { 139 struct kvm_hv *hv = &kvm->arch.hyperv; 140 u32 vcpu_idx = U32_MAX, tmp_vp_idx; 141 int l_index = 0, r_index, tmp_index; 142 struct vp_idx_map *map; 143 144 /* 145 * Make an educated guess: vp_idx is initialized to == vcpu_idx, it 146 * stays this way unless changed by userspace. 147 */ 148 if (vp_idx < KVM_MAX_VCPUS) { 149 struct kvm_vcpu *vcpu = kvm_get_vcpu(kvm, vp_idx); 150 151 if (vcpu && vcpu_to_hv_vcpu(vcpu)->vp_index == vp_idx) 152 return vp_idx; 153 } 154 155 rcu_read_lock(); > 156 map = rcu_dereference(hv->vp_idx_map); 157 if (!map) 158 goto unlock; 159 160 r_index = map->len - 1; 161 162 while (r_index >= l_index) { 163 tmp_index = (r_index + l_index)/2; 164 tmp_vp_idx = map->vp_idx_elem[tmp_index].vp_idx; 165 166 if (tmp_vp_idx == vp_idx) { 167 vcpu_idx = map->vp_idx_elem[tmp_index].vcpu_idx; 168 break; 169 } else if (tmp_vp_idx < vp_idx) { 170 l_index = tmp_index + 1; 171 } else /* (tmp_vp_idx > vp_idx) */ { 172 r_index = tmp_index - 1; 173 } 174 }; 175 176 unlock: 177 rcu_read_unlock(); 178 179 return vcpu_idx; 180 } 181 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation