Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp726833rdd; Tue, 9 Jan 2024 19:15:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IGpbsffcMrBa+0RUUmZ12B3DlXzgWiBU6FV4Tr1pT3g0s0wYAOemxnVI62XIeaQX6AX/PDT X-Received: by 2002:ac8:5a4e:0:b0:429:ae9c:1f85 with SMTP id o14-20020ac85a4e000000b00429ae9c1f85mr558811qta.24.1704856512069; Tue, 09 Jan 2024 19:15:12 -0800 (PST) Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id w13-20020ac857cd000000b00427786eadc3si3360681qta.299.2024.01.09.19.15.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 19:15:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-21682-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Ra++eKzx; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-21682-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21682-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id C3C021C25482 for ; Wed, 10 Jan 2024 03:15:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7D4DD4A3E; Wed, 10 Jan 2024 03:14:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Ra++eKzx" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 61261D518; Wed, 10 Jan 2024 03:14:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1704856496; x=1736392496; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=4w1ZQPNnVxlmjwOgbJTBzyh5z4OM+JdEKU9rTOTdWO4=; b=Ra++eKzx2GgcEdsysSzKfKen2YLqVQhy1sFi2ItWaoFQqKqr+S8wxcGB vRnvghqVBHWlf+3cg0ecBPxlHnZvKpu0nlqKlHzc7h9IFYZj8DLXoxod3 S06xxdYHwqo0us1/qOw9pHcBCFLkB68XMoDNU9Pstycgs1BH+VKFfPZjo 7P4W1tS3DT7S5ZI4MgbouQzQhuc23HIUwR6sWTeqD6pv0MfQFPZCh0AU8 O+VPF4UHB20BLI+ul5hsDkn9QG8UVkaM1Rw66KmNvxETbp7uSLwf7dB/R RV4akHiXZvh8ugp5/QOlGXWhe22W6yai/cYbc8ShMGBsJHUmKD2ck97Ia w==; X-IronPort-AV: E=McAfee;i="6600,9927,10947"; a="11881070" X-IronPort-AV: E=Sophos;i="6.04,184,1695711600"; d="scan'208";a="11881070" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jan 2024 19:14:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.04,184,1695711600"; d="scan'208";a="24106229" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmviesa001.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 09 Jan 2024 19:14:41 -0800 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 9 Jan 2024 19:14:40 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 9 Jan 2024 19:14:40 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Tue, 9 Jan 2024 19:14:40 -0800 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.169) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Tue, 9 Jan 2024 19:14:39 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=At9N0mGmKR3vHN1OzwbuBEhoNimz9RKKO5wwYCjxZlZg3zjodWRt2Q0pPGi1clN4UIbYgGL8Uf9nxeya/0nIjktTreD+6WKwFAsnvEqli8uTvN1vDqryFTFqwns4Dm1LtC2C/85+Uiy3H3uZ7+4g+1DS+LzWponmDM3NOfFoG4xW9Uq8uq2+oXRbr5IiEBy/T8JVNtqZCPj6tSw00Z88SEpLTZzfGrkj0QUtegcfOzHfrLRFwdQw++Ia5n2XkdH+54WZZss9QTv5dwMVZIXGgrP/c+FbJ6k8loy/0mxNQLDHB3g1+XvrFwHA0cbVhBveehLa13X8slTqPGl1TRwiNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nPf+xCaUpSXPk/tcRw4M3rKQok9PQGCPMfmGO5tMiFo=; b=R2ajKGLDLu/rPxIIV5yszr7I+cOlOW4eqrsX6C8g3v6qn92Y/ge1X9HSIlE6fssMIh82k5cPRLtBm3ShBPKggkeAX2RliJ85XIzBysSSk9aW50O6z6zOigph4sIzPFRkO6YjoP+phU1mko4U+5t6GQXmkpCEuUmE45X5zroQysGfCDvjAtXpMq769/qILZTtuHrcQ9xp9tyRAoO0StDUGjr/9+MDH4am4Gs1zBxEySuVxE2lH5/u6Spb6jatZUZi5e1qOFmXdSRBwaNMS2+KgwT65hOswZNzZ10qzpEGMAle8Dfkb4goguIxeV6Gr/gIDT/eGKhiuvjO4Yf7O8J2yA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from CY5PR11MB6392.namprd11.prod.outlook.com (2603:10b6:930:37::15) by DM4PR11MB7376.namprd11.prod.outlook.com (2603:10b6:8:100::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.23; Wed, 10 Jan 2024 03:14:32 +0000 Received: from CY5PR11MB6392.namprd11.prod.outlook.com ([fe80::b99c:f603:f176:aca]) by CY5PR11MB6392.namprd11.prod.outlook.com ([fe80::b99c:f603:f176:aca%5]) with mapi id 15.20.7159.020; Wed, 10 Jan 2024 03:14:31 +0000 Date: Wed, 10 Jan 2024 11:10:13 +0800 From: Yujie Liu To: Sean Christopherson CC: Vitaly Kuznetsov , kernel test robot , , , "Paolo Bonzini" , Subject: Re: arch/x86/kvm/vmx/hyperv.h:79:30: sparse: sparse: cast truncates bits from constant value (1b009b becomes 9b) Message-ID: References: <202311302231.sinLrAig-lkp@intel.com> <87v89jmc3q.fsf@redhat.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: SG2PR02CA0078.apcprd02.prod.outlook.com (2603:1096:4:90::18) To CY5PR11MB6392.namprd11.prod.outlook.com (2603:10b6:930:37::15) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY5PR11MB6392:EE_|DM4PR11MB7376:EE_ X-MS-Office365-Filtering-Correlation-Id: d691c4d3-7db9-4131-d851-08dc118a439f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bio4ysZTFwYQnuOY4ou1CZIdVQ4goRvMjaifKgpMghrtAkgJiq3A5FRWOSO1/3sMUwXIAHobbBRg9XHGnhnnqzAfSpXNHqN4YuP93v0yvTzyHDDRiQv1hxDq7orbVma6U9pXBAouIc0o8PQ235zvWfKxQ8SrPCqLfG30fCjJBjnjGA0BWRHpJq5pqstcFnsrfLf6hSnHiYRt+s7uYxdyupTbvf2TeC6pMVYJAP+rUhFX+KwMsxk7fG0usYohcBK/Kk5xXbv/U0nC/CFOUDuSLWfRMwbXCI0iZi+J1BEMgTF80z2SrCUT6sW2TrYmQJcAnkKTAWdHagiQiMIZXSokDr+nXTWrOlfsJXDKSZOMlrwHq3MNKk/zK7D/D1Cv2r8IAXPiqrD6IJkWp7Uxe6g4ewqaLT2GG1zIip4AKyMrJG4raA1OdLlb8Kt+qJIunK3cYjvdkUEOtZgiDu7qxwMplEvgpZ2viMfPw0UekMpUgJ+xwDLqrQesU9Dj6BLnizFQsOZiNXReUjbADOLnZnFWwUTxhJDwzzDjg1sMS41mbHeJ3ammDDJ/R1KjiT1iOZa3+MSkHEhQ4M1wkG4yBsEh3ZtyS3XLtF+941Z7qA6vA7u/b04Gc/Wz0Vs6fWkiF/fl8dVM6s9KFb3hTXTsEko1sg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY5PR11MB6392.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(7916004)(346002)(376002)(136003)(39860400002)(366004)(396003)(230922051799003)(230273577357003)(230173577357003)(451199024)(1800799012)(186009)(64100799003)(83380400001)(26005)(33716001)(38100700002)(2906002)(5660300002)(4326008)(8676002)(8936002)(44832011)(478600001)(9686003)(6512007)(6506007)(6666004)(66476007)(966005)(54906003)(6486002)(6916009)(66946007)(66556008)(316002)(41300700001)(82960400001)(86362001)(67856001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?ZHNVuzsnr9DmxGiteLWOYpM5RYwAgXs828ZcrWqIswJ0mfhfkAVrPGuL+W1T?= =?us-ascii?Q?qmRaPoV1zPlSOHrV/m845X4jjZDRAFfcTLRM8QapyG3OtTIFoCEVQ13HpSVY?= =?us-ascii?Q?sP57geSNNRyhuzIkn4NAB1cEQAEqUPPjhZK4yq1sT/TvBTXzaWYglNh/JOrx?= =?us-ascii?Q?X40LUyEZkdQNkS9m9YJyGsCBw6L/cEzzuAC+jElYESxeJwQCmUXPBJID3gbf?= =?us-ascii?Q?OeCHtuFqETPkADTdwL43x1tPwiAhHyuAgEBFCX+ARBZ7V5HAH6BBmbhT/wSd?= =?us-ascii?Q?au+msp3R10x5bM2heMkX/ZRTs428v6C2RQhbLnsnCJ/R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pua0rg6Rrir1l+Xi/zM/vL2eBIUdXUe?= =?us-ascii?Q?3bunDmW83I20Hzid/na/08YR5DrHdfIE+eSP8bHtBrknwA6mG63fWQW+WKP0?= =?us-ascii?Q?zYa7QFe/zAC5SpWzL71VBQ1oyjO54LRO6TAlugfYdWJqBTrtt/cT7RCt6SEa?= =?us-ascii?Q?shSdKhhJUhcfEsR0Sx87lyT65ZsuAcbAUJecOhZp3YIS2VNnvifyabjJ70w5?= =?us-ascii?Q?XwcQS68BGmMEIBhGP78egT5un8hOO902Txd5SUKSEeZQeBHEkOtI6+C4huaX?= =?us-ascii?Q?r3edVY4HMyKNMFXhM70CTXiEn6W2MKYdjaOE9ayotQQgxluG4kOh/WGMpHtb?= =?us-ascii?Q?a3XUw9c2QB0zjzRAmsnGd/iAl5U7SMe3dojJa3hA?= X-MS-Exchange-CrossTenant-Network-Message-Id: d691c4d3-7db9-4131-d851-08dc118a439f X-MS-Exchange-CrossTenant-AuthSource: CY5PR11MB6392.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2024 03:14:31.9100 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: UAVsUKU4PfA8jivJnT1ys4RbzfGPOeNQBdHQDVJTk7U30cIbLbtd8oAhB+aYUxxKIzdOXOukVMNFMa/FF7zarw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR11MB7376 X-OriginatorOrg: intel.com Hi Sean, On Fri, Dec 01, 2023 at 07:56:01AM -0800, Sean Christopherson wrote: > On Fri, Dec 01, 2023, Yujie Liu wrote: > > On Thu, Nov 30, 2023 at 09:49:43AM -0800, Sean Christopherson wrote: > > > On Thu, Nov 30, 2023, Vitaly Kuznetsov wrote: > > > > kernel test robot writes: > > > > > > > > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master > > > > > head: 3b47bc037bd44f142ac09848e8d3ecccc726be99 > > > > > commit: a789aeba419647c44d7e7320de20fea037c211d0 KVM: VMX: Rename "vmx/evmcs.{ch}" to "vmx/hyperv.{ch}" > > > > > date: 1 year ago > > > > > config: x86_64-randconfig-123-20231130 (https://download.01.org/0day-ci/archive/20231130/202311302231.sinLrAig-lkp@intel.com/config) > > > > > compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07) > > > > > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231130/202311302231.sinLrAig-lkp@intel.com/reproduce) > > > > > > > > > > If you fix the issue in a separate patch/commit (i.e. not just a new version of > > > > > the same patch/commit), kindly add following tags > > > > > | Reported-by: kernel test robot > > > > > | Closes: https://lore.kernel.org/oe-kbuild-all/202311302231.sinLrAig-lkp@intel.com/ > > > > > > > > > > sparse warnings: (new ones prefixed by >>) > > > > > arch/x86/kvm/vmx/hyperv.h:79:30: sparse: sparse: cast truncates bits from constant value (a000a becomes a) > > > > > > > > This is what ROL16() macro does but the thing is: we actually want to > > > > truncate bits by doing an explicit (u16) cast. We can probably replace > > > > this with '& 0xffff': > > > > > > > > #define ROL16(val, n) ((((u16)(val) << (n)) | ((u16)(val) >> (16 - (n)))) & 0xffff) > > > > > > > > but honestly I don't see much point... > > > > > > Yeah, just ignore 'em, we get the exact same sparse complaints in vmcs12.c and > > > have had great success ignoring those too :-) > > > > Thanks for the information. We've disabled this warning in the bot to > > avoid sending reports against other files with similar code. > > I would probably recommend keeping the sparse warning enabled, IIRC it does find > legitimate bugs from time to time. > > Or are you able to disable just the ROL16() warning? If so, super cool! FYI, we've added new logic in kernel test robot to ignore this sparse warning for ROL16 macro. Best Regards, Yujie