From nobody Thu Apr 7 14:59:53 2022 X-Original-To: dev-commits-src-main@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 2C1331A88196; Thu, 7 Apr 2022 14:59:54 +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 4KZ4L20pBlz3D2t; Thu, 7 Apr 2022 14:59:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649343594; 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=2MQDgcOUiAOX96ze4JfvbXwgXGMAh/2imljHerEI8Hs=; b=jaq5cv06vQhoyErHPmOOUk5BJFIYXincGenhrLHWr0Pm/zLGIirD0UbI1UN0z130cpeggL SZh/Wk8vYE3Gxmo0DaqUDakfUv4SPaa+jKt743iXwP+/1rFVWGFtP581TU/Bv9owTDzMwQ j8QoLCNGcc9dKYPMXxESIhpwfaYvhA7cGFiJdhuyqI14CCXWR1IyMbtpyJlyCkJNO5C3T8 GFyNJLC2Vpa0dw0aGh8ghPRbhewT4Baxi3LKH/d+1I5gk1n5/GUUOd7BlOvZ1oK+3HyzUm f+8t/HJcFxk0A2b8rsD3iFj0F7srX8HwqMuZeqqkGWnsw9ROAkxIQeI8EbMHcA== 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 EBC6312681; Thu, 7 Apr 2022 14:59:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 237Exro6040068; Thu, 7 Apr 2022 14:59:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 237ExraP040067; Thu, 7 Apr 2022 14:59:53 GMT (envelope-from git) Date: Thu, 7 Apr 2022 14:59:53 GMT Message-Id: <202204071459.237ExraP040067@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: df696a2fb640 - main - Have the coredump_phnum test ask for the page size List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: df696a2fb640aee06b38ff487985209f97b944aa Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649343594; 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=2MQDgcOUiAOX96ze4JfvbXwgXGMAh/2imljHerEI8Hs=; b=abi1MYpxBn+M0a2OmdCklI+yng4mD81w0VprLsAIN01zvoXyjww6qP+GFZyQ/Jv+zQmfYq oTwiZ7/fUFv3LvAkcrlsVEPdBNz3eq4lGMPdxQjwzy33pwer1wz8yojmmU/Ba6nJMLtUsR Pl4sVrx7N4Kk8dWQr+Vj0s13PKEhcpYI2YSnvfWyIA7li6xkocP1ZyCHcTJXLGufsKC5jq tlOWIrFuj03ly2dAsxrkmI55moEX1qwGx8Rwd7JtSG7Thwpa3iMA3sqtBwr9KJh7Q6B9qF 7y0bEe9FO/jsqroOOnlPx1sBEPHybthBBy1Vk78RG1anwBMH/YFHl+NcRRZ6yA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1649343594; a=rsa-sha256; cv=none; b=Wzl82JMEZpowaIffiYtCaortSnLpxAO9hmv0sv1cSSH5jtjVogfECkUWiuk/NJ5Y9HT82x LutHodcGFD0uqAHXQsjviI0LvoXU/i2Xxfq0d97dLOvgRqAi9+P6V8cXMTaVKrjPtm1EO1 JLW7jdl0SOeAWIawk4paYh/TEGWTbXg9nl8/T+161DkRp7BbpT4q1Vhr2nVmrP/IAUrm+n qMOCAGBIbNy04ADVF5RTr9oYsNxhv6LezkYY3735CrOJY7mg0byHljii9jHCF5w5oULcxM aMs4EEbhToWruLDiQr+rewGvKUrGFbQkpZk33BMI5pG1r3HSm3fFe9z3gcumeQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=df696a2fb640aee06b38ff487985209f97b944aa commit df696a2fb640aee06b38ff487985209f97b944aa Author: Andrew Turner AuthorDate: 2022-04-07 14:59:32 +0000 Commit: Andrew Turner CommitDate: 2022-04-07 14:59:32 +0000 Have the coredump_phnum test ask for the page size The page size may be dynamically selected on boot. Have the coredump_phnum test helper ask the kernel for the correct value. Sponsored by: The FreeBSD Foundation --- tests/sys/kern/coredump_phnum_helper.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/sys/kern/coredump_phnum_helper.c b/tests/sys/kern/coredump_phnum_helper.c index 0dff59b918d9..1cdd4a4a09ec 100644 --- a/tests/sys/kern/coredump_phnum_helper.c +++ b/tests/sys/kern/coredump_phnum_helper.c @@ -33,6 +33,7 @@ #include #include #include +#include /* * This program is intended to create a bunch of segment mappings, then dump @@ -42,10 +43,11 @@ int main(int argc __unused, char **argv __unused) { void *v; - size_t i, pages; + size_t i, pages, page_size; + page_size = getpagesize(); pages = UINT16_MAX + 1000; - v = mmap(NULL, pages * PAGE_SIZE, PROT_READ | PROT_WRITE, + v = mmap(NULL, pages * page_size, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0); if (v == NULL) err(1, "mmap"); @@ -54,7 +56,7 @@ main(int argc __unused, char **argv __unused) * Alternate protections to interleave RW and R PT_LOAD * segments. */ - if (mprotect((char *)v + i * PAGE_SIZE, PAGE_SIZE, + if (mprotect((char *)v + i * page_size, page_size, PROT_READ) != 0) err(1, "mprotect"); }