From nobody Mon Mar 11 21:23:28 2024 X-Original-To: dev-commits-src-all@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 4TtqWh3bM9z5Dl1t; Mon, 11 Mar 2024 21:23:28 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TtqWh1ZTRz415q; Mon, 11 Mar 2024 21:23:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1710192208; 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; bh=8qo+09UDvcFEM7X4znxj6BUQUpBKBLYceMu03DJI12A=; b=vUZVGMPIioa9X4/Mw5ui8vN/UArt32uvKEcTBhhweH86K//2Lm55s4oIGV3/d+YNwLgQ8i RgAikF7KFCagTzimANXBS2K2N2PqUzwqE16t2MVJ0jYaPWk+aHfRMdjPonfGbXMPFdxdBQ V1ZQOJM5aGUNIgo/fC0QQovaPNivs6jQNNd3HkwlRlatG1tt+bNLCYJKvZ6oEyqRJGBny7 lhEmOyjK2vJhxQ+yqbAbymGnNFjg8TYIKbCjrzCm1ql9TfadYL4RTaL6xoyAcQu7NdFGRg OvZQ2ayvRrsuGuP4RXEBTv6IbAacqq9YjEzgcW60tTtQ6iAkjfDp+kQhSFi1hw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1710192208; a=rsa-sha256; cv=none; b=iZbxWJrNjTJ7vjZWmc3CkouqREzm1V61z2MArkn8u/IvHOWPjYbj2/miXd1JKAygNMrMrY 4OiwgJP9g2lwIl+PtNimHSLpbERetDrT9RXNnGmZqtHj3Pk39JrZVZ2CJgelzIgYoQpQLa 6VQq/2Gj/sq0NF8JJau2OU4DTpodW3G1PfelJGZ87QMeS0JKR5DVh+ggrG4i+sPJeHLemn jSmhhk+GmqRaoMl8BESzbwYtpnTlHsQKlyKvKB9w2GTe3zzOsHR4iNI4ALBFirpmwWozi/ en0KQ/3T3D3SAm07yQFs9t1EGlNMCAONPLGW9uqfc7wTgidX+IGcIt5Zv2Tsyg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1710192208; 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; bh=8qo+09UDvcFEM7X4znxj6BUQUpBKBLYceMu03DJI12A=; b=daVZd1wTVK6IzB6sbAG+h6fEMfMpqzCoNBzZslO3rb64dY0jM46RBQpc09egRzGw2T+Fvv upVwU+yKTQFx6K9Bd3UKBNRUdWOACx3cn3Okh8YtJHgEeBikmq25GqoodzwYnoV0U4Lx8x JBGWfrtcf+dq5HJtSb3lby56+cwXmtR9RVvzLUlPtXf/1DINce9jkSoo2oOfsllxQ5elrP REQ1rGQdYnP/af9OUlDB4Vi3ZzDsmuuKOBYOdw2orDTbVl6TYbgnfqPIO6JwkafvzAXSEc WdyjereQ83iqCRZ0Zy9TcS9G9C9H9k1S+7GHlSAaa3EjM+I0TWFmqeL2i5NdeQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 4TtqWh1BKLzmLR; Mon, 11 Mar 2024 21:23:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 42BLNSMS025671; Mon, 11 Mar 2024 21:23:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42BLNSrH025668; Mon, 11 Mar 2024 21:23:28 GMT (envelope-from git) Date: Mon, 11 Mar 2024 21:23:28 GMT Message-Id: <202403112123.42BLNSrH025668@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: d75524b3fe21 - main - kboot: Use is_linux_error to check mmap return error List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d75524b3fe21752b233f66ae8e9d6450d507f75c Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=d75524b3fe21752b233f66ae8e9d6450d507f75c commit d75524b3fe21752b233f66ae8e9d6450d507f75c Author: Warner Losh AuthorDate: 2024-03-11 20:15:39 +0000 Commit: Warner Losh CommitDate: 2024-03-11 21:21:52 +0000 kboot: Use is_linux_error to check mmap return error Rather than checking against the (incorrect) -511, use the is_linux_error() function to check to see if host_mmap failed. Sponsored by: Netflix --- stand/kboot/kboot/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stand/kboot/kboot/main.c b/stand/kboot/kboot/main.c index c397e573fc75..e57446baa47d 100644 --- a/stand/kboot/kboot/main.c +++ b/stand/kboot/kboot/main.c @@ -232,7 +232,7 @@ caddr_t ptov(uintptr_t pa) * the raw system call we have to do that ourselves. */ va = host_mmap(0, PAGE, HOST_PROT_READ, HOST_MAP_SHARED, smbios_fd, pa2); - if ((intptr_t)va < 0 && (intptr_t)va >= -511) + if (is_linux_error((long)va)) panic("smbios mmap offset %#jx failed", (uintmax_t)pa2); m = &map[nmap++]; m->pa = pa2;