From nobody Wed Dec 18 23:49:22 2024 X-Original-To: virtualization@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YD9Py6Y9bz5h7qw for ; Wed, 18 Dec 2024 23:49:26 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YD9Py4tT3z462k for ; Wed, 18 Dec 2024 23:49:26 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734565766; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=e1p9pz11tQd1Po4svZ7o3GCGiHAO1B/SKH/8wyZV44Y=; b=v56hOfA5tj0N4PE6rRRkwQ2+n3H6H78MMoqFyG45e5+SKwjt3uIY1/7N6DWJbg12bAMRZf 7rpSNLB17FakF1cQ/SH1MJDrUWatoDT8/UgTW7YZDw30wUqVm9KLHuMuB5ohj6at8KLIfI YHmDdFZd6wysy1eTT7jeAjOrxvAwTx5vy9Dx2KL1eShqY3U/FbV5Bn6TFDaMAdjamugTMo GRL9vCs1F9NccdV2ZYd0M5xEA/J6TJTXuO1rn4JCeeTYW7ZA4jZrDJKmQz3BmfGWY51lyv U0AfpMV1gWonzWmlqT7lTsRYTsqK//Kw0CJ4x8KBQXhe1eFULXtxuLg1z80HCw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734565766; a=rsa-sha256; cv=none; b=dhquxFK6LZBbufKVJANlaJfb55woJMTRL3pXnxUNj625XSc9ONrak1ecGzoNhx/f/swS8i LkZNlwGDkyB5iy+vPFCGL5Y12gAAZ3pEfaljtGmxDtM9KTKDwmsB6zoG1KSZawLGbirwXl SKILPyZVBk2IfsSGrSY0nsD2hP/Yp1waUFIsleLT8WhXaPar5K+GIwhVStiPmSOpMwtK4H ReX2oErdAIfDmq9U+RiJoUgXbNeZOVZLHf4mo8WiPrRFFKcSWg+qBk5mHG9zId8bVus5Bv t6lKP7KVnoMtWCMB02m3VOvOQpx0kGcSyAVG2mcMZGwI3ETRHdR8Hl6HiOp8fQ== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YD9Py4VBCzTqy for ; Wed, 18 Dec 2024 23:49:26 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 4BINnQVa083607 for ; Wed, 18 Dec 2024 23:49:26 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 4BINnQKk083606 for virtualization@FreeBSD.org; Wed, 18 Dec 2024 23:49:26 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: virtualization@FreeBSD.org Subject: [Bug 279901] glibc-2.39-2 and above on the host segfault Date: Wed, 18 Dec 2024 23:49:22 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bhyve X-Bugzilla-Version: 14.1-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: kib@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: virtualization@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Discussion List-Archive: https://lists.freebsd.org/archives/freebsd-virtualization List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-virtualization@freebsd.org Sender: owner-freebsd-virtualization@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D279901 --- Comment #41 from Konstantin Belousov --- (In reply to Florian Weimer from comment #39) For 8000_001Dh, the %ecx =3D=3D 0 reply seems to be legal, for fully assoc = cache. This probably explains why my previous attempt did not worked, lets arbitra= ry set asssoc to 2 (%ecx =3D=3D 1). From your explanation, and what I see in c= ode, glibc should use the 'new way' then. For 8000_0006h, bhyve reflects the data reported by the host CPU. For 8000_0008h, the reported number of threads is user-controllable, AFAIR. There is a strange force-fallback to legacy reporting of ApicIdSize (%ecx 15:12) when cpu count per-package is less than 16. A useful experiment is to remo= ve it. diff --git a/sys/amd64/vmm/x86.c b/sys/amd64/vmm/x86.c index a833b61786e7..b00ae12f802d 100644 --- a/sys/amd64/vmm/x86.c +++ b/sys/amd64/vmm/x86.c @@ -150,8 +150,8 @@ x86_emulate_cpuid(struct vcpu *vcpu, uint64_t *rax, uint64_t *rbx, * pkg_id_shift and other OSes may rely on = it. */ width =3D MIN(0xF, log2(threads * cores)); - if (width < 0x4) - width =3D 0; +// if (width < 0x4) +// width =3D 0; logical_cpus =3D MIN(0xFF, threads * cores = - 1); regs[2] =3D (width << AMDID_COREID_SIZE_SHI= FT) | logical_cpus; } @@ -256,7 +256,7 @@ x86_emulate_cpuid(struct vcpu *vcpu, uint64_t *rax, uint64_t *rbx, func =3D 3; /* unified cache */ break; default: - logical_cpus =3D 0; + logical_cpus =3D sockets * threads * cores; level =3D 0; func =3D 0; break; @@ -266,7 +266,7 @@ x86_emulate_cpuid(struct vcpu *vcpu, uint64_t *rax, uint64_t *rbx, regs[0] =3D (logical_cpus << 14) | (1 << 8) | (level << 5) | func; regs[1] =3D (func > 0) ? (CACHE_LINE_SIZE - 1) : 0; - regs[2] =3D 0; + regs[2] =3D 1; /* Num of cache ways */ regs[3] =3D 0; break; --=20 You are receiving this mail because: You are the assignee for the bug.=