From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 90ACFC6FA86 for ; Mon, 19 Sep 2022 15:32:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230302AbiISPcV (ORCPT ); Mon, 19 Sep 2022 11:32:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230286AbiISPbz (ORCPT ); Mon, 19 Sep 2022 11:31:55 -0400 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D3C9439BBD for ; Mon, 19 Sep 2022 08:31:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663601507; x=1695137507; h=date:from:to:cc:subject:message-id:mime-version; bh=gi+NOEY838Xp8H/ea9C/6X1+pNOsIXiCaKGf9WsJupg=; b=c7jXwWOM5ZOOARi/4kkcosYIB24yFeSRsl13LOVU0zmiL/uHhh8LwXZU wbgyosZ4vKarfVoUOO4WokJBjelSu5X/kWbNYEtO/zhda4ntndL+wJGVr tP2p/PX3xyZ9FdqIn7r0htTK8dfXoOqL7eAXwSpEVxVYOUoAGaamy5XJY U01drGDPWeWRNkRo6TDGYOX+MRoILJAT127Rwcn9ZBA9eFVRzJygzJh8B 2KzpTas7cY00gVGoy27qUQaf7/BdnxegpVYoyooKUDAf2TE3mbj8CMlKc q+sUHip9t9+GYjz4wCE12qx+demo+3tlfgfDR42qduBhgSAuwd3pHnJdv A==; X-IronPort-AV: E=McAfee;i="6500,9779,10475"; a="279812885" X-IronPort-AV: E=Sophos;i="5.93,328,1654585200"; d="scan'208";a="279812885" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Sep 2022 08:31:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,328,1654585200"; d="scan'208";a="569694966" Received: from lkp-server01.sh.intel.com (HELO c0a60f19fe7e) ([10.239.97.150]) by orsmga003.jf.intel.com with ESMTP; 19 Sep 2022 08:31:44 -0700 Received: from kbuild by c0a60f19fe7e with local (Exim 4.96) (envelope-from ) id 1oaIkJ-00023a-1G; Mon, 19 Sep 2022 15:31:43 +0000 Date: Mon, 19 Sep 2022 23:31:21 +0800 From: kernel test robot To: Sean Christopherson Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org, Paolo Bonzini Subject: arch/x86/kvm/mmu/paging_tmpl.h:106:24: sparse: sparse: cast truncates bits from constant value (ffffffffff000 becomes fffff000) Message-ID: <202209192330.x51kM4LB-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sean, FYI, the error/warning was bisected to this commit, please ignore it if it's irrelevant. tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 521a547ced6477c54b4b0cc206000406c221b4d6 commit: 70e41c31bc7776b262cd9f524df3dfc2b5869a0a KVM: x86/mmu: Use common logic for computing the 32/64-bit base PA mask date: 3 months ago config: x86_64-randconfig-s022-20220919 (https://download.01.org/0day-ci/archive/20220919/202209192330.x51kM4LB-lkp@intel.com/config) compiler: gcc-11 (Debian 11.3.0-5) 11.3.0 reproduce: # apt-get install sparse # sparse version: v0.6.4-39-gce1a6720-dirty # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=70e41c31bc7776b262cd9f524df3dfc2b5869a0a git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git git fetch --no-tags linus master git checkout 70e41c31bc7776b262cd9f524df3dfc2b5869a0a # save the config file mkdir build_dir && cp config build_dir/.config make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=x86_64 SHELL=/bin/bash arch/x86/kvm/ If you fix the issue, kindly add following tag where applicable Reported-by: kernel test robot sparse warnings: (new ones prefixed by >>) arch/x86/kvm/mmu/mmu.c:610:9: sparse: sparse: context imbalance in 'walk_shadow_page_lockless_begin' - different lock contexts for basic block arch/x86/kvm/mmu/mmu.c: note: in included file (through include/linux/rbtree.h, include/linux/mm_types.h, arch/x86/kvm/irq.h): include/linux/rcupdate.h:726:9: sparse: sparse: context imbalance in 'walk_shadow_page_lockless_end' - unexpected unlock arch/x86/kvm/mmu/mmu.c:2550:9: sparse: sparse: context imbalance in 'mmu_try_to_unsync_pages' - different lock contexts for basic block arch/x86/kvm/mmu/mmu.c: note: in included file: >> arch/x86/kvm/mmu/paging_tmpl.h:106:24: sparse: sparse: cast truncates bits from constant value (ffffffffff000 becomes fffff000) arch/x86/kvm/mmu/paging_tmpl.h:426:24: sparse: sparse: cast truncates bits from constant value (ffffffffff000 becomes fffff000) arch/x86/kvm/mmu/mmu.c:4618:57: sparse: sparse: cast truncates bits from constant value (ffffff33 becomes 33) arch/x86/kvm/mmu/mmu.c:4620:56: sparse: sparse: cast truncates bits from constant value (ffffff0f becomes f) arch/x86/kvm/mmu/mmu.c:4622:57: sparse: sparse: cast truncates bits from constant value (ffffff55 becomes 55) vim +106 arch/x86/kvm/mmu/paging_tmpl.h b3fcdb04a98035 arch/x86/kvm/mmu/paging_tmpl.h Sean Christopherson 2022-06-14 103 e04da980c35d75 arch/x86/kvm/paging_tmpl.h Joerg Roedel 2009-07-27 104 static gfn_t gpte_to_gfn_lvl(pt_element_t gpte, int lvl) 5fb07ddb183eb4 drivers/kvm/paging_tmpl.h Avi Kivity 2007-11-21 105 { e04da980c35d75 arch/x86/kvm/paging_tmpl.h Joerg Roedel 2009-07-27 @106 return (gpte & PT_LVL_ADDR_MASK(lvl)) >> PAGE_SHIFT; 5fb07ddb183eb4 drivers/kvm/paging_tmpl.h Avi Kivity 2007-11-21 107 } 5fb07ddb183eb4 drivers/kvm/paging_tmpl.h Avi Kivity 2007-11-21 108 :::::: The code at line 106 was first introduced by commit :::::: e04da980c35d75fa050ba4009ad99025432d8d7d KVM: MMU: make page walker aware of mapping levels :::::: TO: Joerg Roedel :::::: CC: Avi Kivity -- 0-DAY CI Kernel Test Service https://01.org/lkp