Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3332020pxf; Mon, 22 Mar 2021 04:06:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwwj3pqZj2guveSYUzsR/oqbElvww6Xjp8Z38PWFGFRHM7DqlrXFdBWT6aCU3cFVkfJ7GP/ X-Received: by 2002:a05:6402:c11:: with SMTP id co17mr25669652edb.246.1616411185156; Mon, 22 Mar 2021 04:06:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616411185; cv=none; d=google.com; s=arc-20160816; b=0ODKt50x2ju/8IuO8KRoXxaczLP9wRBnIeuEh+yLbtrmHnNQeVSMvauXckHtPvm2xS 2Dc5ZkKyX2eWJIJFfskakxHELgeHtJud3RXmm9SmoZod69dSzxX0DXL1NJ3ZCcjn8Dir XzTR6mowVpLAeJV3ZjpKUddOHdmqqJQ73n9TeBoSZFj6na6130KJVcclM83lPyqPZcz1 bw+VCKcUMR16gQhwT8iWii9pHUvGaZYNbLgj6nNfZlnKVTme15hgFxTMR4nMgkjajOh/ tlEoJwr+mPjeX7O4Z5SEd0bmMkttCx/634H179EP2M6AwmuojKIyFd4c7rCb6aors6JD 3wbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=PWWnDHWb0f6VWpKB3JAHyffSxPdrHA0WVJJCPyw/usc=; b=Ay/fa4igiwG2lsd/bpBt2oI/QvEr4+WhM3RwCdecjF8dfeXcQwVMnNnJtlgGrTUNIl yUs7fO8g0pTiCY6pzfFxoGp8YRk3k6E2xEYzsoYSpAFlfcClN9Zg6U8qXTtD5vtK9uuX al3Gv3mpIdZFBJi/ArrbUGvgjQq5i90azeDIQjZ1bEJNhm34HQ2DEYlc31D8mPqiSh7n BflGzM9ChVVonx8tT2567pKpZyzlaj80a9FiZXfxZ2aBwMyI3aIiG8MZK+UUTlVh1xN3 dwS/M6T1UP0K3FUe3+V5KkOtvXfTwrddGzxiUTDkhtNw4ZtJem0r3udvnQWTKuqHxC+5 Bv8g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r9si11131732edy.4.2021.03.22.04.06.01; Mon, 22 Mar 2021 04:06:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230080AbhCVLFB (ORCPT + 99 others); Mon, 22 Mar 2021 07:05:01 -0400 Received: from mail-wr1-f41.google.com ([209.85.221.41]:40623 "EHLO mail-wr1-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230156AbhCVLEk (ORCPT ); Mon, 22 Mar 2021 07:04:40 -0400 Received: by mail-wr1-f41.google.com with SMTP id v11so16180455wro.7; Mon, 22 Mar 2021 04:04:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=PWWnDHWb0f6VWpKB3JAHyffSxPdrHA0WVJJCPyw/usc=; b=QS2i0VBc4msizGZn7kO+qmqW9uznZiSbxTvFXR+hQgYUksI7r8WIOqOXsthwm0mx4m qWEsTdOZWsliU28pBheKpSr5bVyCcWhmWOIcyeel+ac+2LXeyQuaBLFVm1f7Ku1/5VNx fQQZJ09n8pC/D2J1PKgEdtO2R8U1h3GULwa7OWM/S/JIuJ/YhMQguyoU9CDnzCZODW9M pbRkqkIvsmXIDpaI+JkrJ6MjwzOe9xSrZRyWuyP8VKm6gLp4zRIeLG3wlyR+lTCHmN7Z D+YIjRhN8Zg6uMowv9s2Vd4FRt8Q5K631ITelNrf6U8DxUVaWuHMHWOitic0fftuP7tp r7Yg== X-Gm-Message-State: AOAM533CO2nDLsleGyalQOzaRuepH/DI56bd1bRROA+16DZvD7G/d1pW KmLlL9WG8vr/U/Heeo86zp0= X-Received: by 2002:a5d:6412:: with SMTP id z18mr17733482wru.214.1616411078811; Mon, 22 Mar 2021 04:04:38 -0700 (PDT) Received: from liuwe-devbox-debian-v2 ([51.145.34.42]) by smtp.gmail.com with ESMTPSA id s83sm16562582wms.16.2021.03.22.04.04.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Mar 2021 04:04:38 -0700 (PDT) Date: Mon, 22 Mar 2021 11:04:37 +0000 From: Wei Liu To: Xu Yihang Cc: kys@microsoft.com, haiyangz@microsoft.com, sthemmin@microsoft.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, x86@kernel.org, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, johnny.chenyi@huawei.com, heying24@huawei.com, Wei Liu Subject: Re: [PATCH -next] x86: Fix unused variable 'msr_val' warning Message-ID: <20210322110437.ei3vfove4xqky3h5@liuwe-devbox-debian-v2> References: <20210322031713.23853-1-xuyihang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210322031713.23853-1-xuyihang@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 22, 2021 at 11:17:13AM +0800, Xu Yihang wrote: > Fixes the following W=1 kernel build warning(s): > arch/x86/hyperv/hv_spinlock.c:28:16: warning: variable ‘msr_val’ set but not used [-Wunused-but-set-variable] > unsigned long msr_val; > > As Hypervisor Top-Level Functional Specification states in chapter 7.5 Virtual Processor Idle Sleep State, "A partition which possesses the AccessGuestIdleMsr privilege (refer to section 4.2.2) may trigger entry into the virtual processor idle sleep state through a read to the hypervisor-defined MSR HV_X64_MSR_GUEST_IDLE". That means only a read is necessary, msr_val is not uesed, so __maybe_unused should be added. > > Reference: > https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/reference/tlfs > > Reported-by: Hulk Robot > Signed-off-by: Xu Yihang I modified the commit message a bit and queued this up for hyperv-next. Thanks. Wei.