lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <401ef436-5f78-6dd7-0157-5b580c6b7f87@linux.microsoft.com>
Date:   Tue, 17 Jan 2023 15:41:18 +0530
From:   Jinank Jain <jinankjain@...ux.microsoft.com>
To:     Tom Rix <trix@...hat.com>, kys@...rosoft.com,
        haiyangz@...rosoft.com, wei.liu@...nel.org, decui@...rosoft.com,
        tglx@...utronix.de, mingo@...hat.com, bp@...en8.de,
        dave.hansen@...ux.intel.com, hpa@...or.com, mikelley@...rosoft.com,
        nunodasneves@...ux.microsoft.com
Cc:     x86@...nel.org, linux-hyperv@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] x86/hyperv: conditionally build hv_get_nested_reg()

Reviewed-by: Jinank Jain <jinankjain@...ux.microsoft.com>

On 1/14/2023 7:26 AM, Tom Rix wrote:
> cppcheck reports
> [arch/x86/kernel/cpu/mshyperv.c:44]: (style) The function 'hv_get_nested_reg' is never used.
>
> hv_get_nested_reg() is built unconditially but is only used conditionally in
> hv_get_register() and hv_set_register() by CONFIG_HYPERV.
>
> Move the conditional #if to also include hv_get_nested_reg()
>
> Fixes: 89acd9b2ff8e ("Drivers: hv: Setup synic registers in case of nested root partition")
> Signed-off-by: Tom Rix <trix@...hat.com>
> ---
>   arch/x86/kernel/cpu/mshyperv.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c
> index b8bb13daacf7..9ca202970569 100644
> --- a/arch/x86/kernel/cpu/mshyperv.c
> +++ b/arch/x86/kernel/cpu/mshyperv.c
> @@ -41,6 +41,7 @@ bool hv_root_partition;
>   bool hv_nested;
>   struct ms_hyperv_info ms_hyperv;
>   
> +#if IS_ENABLED(CONFIG_HYPERV)
>   static inline unsigned int hv_get_nested_reg(unsigned int reg)
>   {
>   	switch (reg) {
> @@ -61,7 +62,6 @@ static inline unsigned int hv_get_nested_reg(unsigned int reg)
>   	}
>   }
>   
> -#if IS_ENABLED(CONFIG_HYPERV)
>   u64 hv_get_non_nested_register(unsigned int reg)
>   {
>   	u64 value;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ