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: <20250818103853.GEaKMCvbtnA3J197yP@fat_crate.local>
Date: Mon, 18 Aug 2025 12:38:53 +0200
From: Borislav Petkov <bp@...en8.de>
To: David Woodhouse <dwmw2@...radead.org>
Cc: Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>,
	Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
	"H. Peter Anvin" <hpa@...or.com>,
	David Woodhouse <dwmw@...zon.co.uk>,
	"Ahmed S. Darwish" <darwi@...utronix.de>,
	linux-kernel@...r.kernel.org, Konstantin Belousov <kib@....kiev.ua>,
	John Baldwin <jhb@...ebsd.org>,
	"<cperciva@...snap.com>" <cperciva@...snap.com>
Subject: Re: [PATCH v4] x86/bhyve: Detect FreeBSD Bhyve hypervisor

On Sat, Aug 16, 2025 at 11:06:32AM +0100, David Woodhouse wrote:
> +static uint32_t bhyve_features(void)
> +{
> +	if (bhyve_cpuid_max < bhyve_cpuid_base | CPUID_BHYVE_FEATURES)

Forgot those parentheses again:

arch/x86/kernel/cpu/bhyve.c: In function ‘bhyve_features’:
arch/x86/kernel/cpu/bhyve.c:42:29: warning: suggest parentheses around comparison in operand of ‘|’ [-Wparentheses]
   42 |         if (bhyve_cpuid_max < bhyve_cpuid_base | CPUID_BHYVE_FEATURES)
      |

Tztztz.

:-P

I did the below. Ok?

static uint32_t bhyve_features(void)
{
        unsigned int cpuid_leaf = bhyve_cpuid_base | CPUID_BHYVE_FEATURES;

        if (bhyve_cpuid_max < cpuid_leaf)
                return 0;

        return cpuid_eax(cpuid_leaf);
}

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ