From nobody Mon Jun 27 19:35:39 2022 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 BB30C86E900; Mon, 27 Jun 2022 19:35:41 +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 4LWycr5n0lz3lj0; Mon, 27 Jun 2022 19:35:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656358541; 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=X0IYN6KleJBGzswKLyUzuvO2cIe3a0R5PLyTbwi7SsI=; b=XJMgPXV16JJR1Qy36ufEWGMco7T8rpKx3v3XAej7JnhL2ui8BJOe/uAZ1vr4rm9ydSpssh tRDw4//4kuBa0treHKuRw1HGJ/9yx/+uhVLgXU0Z/met5DzlIf01TWtlTNzlzlWLufnEAv 24fLLVMRNAbFPvC0hRKwXosew8EvrHrxay1xMU7X745Nvr7HkkzNoK1bruoglh7pBhBm3m hADeiodO3mKyK5BS1QPgpOhtwjfdR7c8fPGupTOcDtIvRrnLrrrDsB3n1GEhIDFUTrS+lw QxtpcXqLV8JKl1CwrYZ68tAewThgQuR7T3FAzYfmSSgQC8XcXZZLaRkIeUg5Aw== 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 320C466FB; Mon, 27 Jun 2022 19:35:39 +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 25RJZdI2019889; Mon, 27 Jun 2022 19:35:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25RJZde7019888; Mon, 27 Jun 2022 19:35:39 GMT (envelope-from git) Date: Mon, 27 Jun 2022 19:35:39 GMT Message-Id: <202206271935.25RJZde7019888@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 5a96b88f05d1 - stable/13 - kerneldump: remove physical from dump routines 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: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5a96b88f05d1b16637dc6bd7a387f601981ff593 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656358541; 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=X0IYN6KleJBGzswKLyUzuvO2cIe3a0R5PLyTbwi7SsI=; b=Uzj4n3VMTH0gt741JwfPKSrle6sMOGLWE8dLnvvyKoorOMcdA7BqUhmAHJbGVEn1A7ijso MWrZe/KUqB0bfjhRnDdkUQfVAsR7gfsYO3u43s2Lx3ccdGIhQgfP5CJNuoTHuJPTAMthFS lCWnDn97MAKy/LE32vE4vciufyMzHc+Avuik1g4VQ1kodrMunsgzX/kiB1BjuIdSDzSB0A 1sRlrOSbS2ppHTrHdb7dfnvI+aamUYWVcjFobeob5yAnjiCc8FXesSzaieAsOaU9TaT8UQ wsmkgD1o5bNKgx5rAF34ibuFGoaexGLHhZWeM/+CCJ72n99IJ8hStq7LDorG/Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1656358541; a=rsa-sha256; cv=none; b=JAsEOAa9GYX/cs4Z95ep8virNdpfJY1CTgv7Q2fa+UJjrSIASymZibYF/95dKL/H/RY2lN Bh0Smpb073Ymb/ROcOIqAC/xB1NtCsnLX8vl9AmVuxY+K6mbZ6eT9+9Wq1bp1WU301uHOQ pc91qS3FiDdmJ73jXGZA3mlldTlf/vlhTrZuVWYXbY5JplQVIccspr2+C9eZaIEcZluBlt 2/eEF3UwJbbEHenR15E6vbfV3/b+hEXD4SMzWlEewpKn5tR5O66TYcvtwEnL+UtH+VdblZ 1kC3WlcOiZLYom9EO9kKjHWAdkz5eaKHLaXPGTy8K963F1WHWFe4KLaQ7cNHeA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=5a96b88f05d1b16637dc6bd7a387f601981ff593 commit 5a96b88f05d1b16637dc6bd7a387f601981ff593 Author: Mitchell Horne AuthorDate: 2022-05-13 13:40:05 +0000 Commit: Mitchell Horne CommitDate: 2022-06-27 19:32:06 +0000 kerneldump: remove physical from dump routines It is unused, especially now that the underlying d_dumper methods do not accept the argument. Reviewed by: markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D35174 (cherry picked from commit db71383b8836a586051b25c20992066d153c6941) --- sys/amd64/amd64/minidump_machdep.c | 4 ++-- sys/arm/arm/minidump_machdep.c | 4 ++-- sys/arm64/arm64/minidump_machdep.c | 4 ++-- sys/ddb/db_textdump.c | 4 ++-- sys/geom/raid/g_raid.c | 6 ++---- sys/i386/i386/minidump_machdep_base.c | 4 ++-- sys/kern/kern_dump.c | 8 +++---- sys/kern/kern_shutdown.c | 39 +++++++++++++++------------------- sys/powerpc/powerpc/minidump_machdep.c | 4 ++-- sys/riscv/riscv/minidump_machdep.c | 4 ++-- sys/sys/conf.h | 4 ++-- 11 files changed, 39 insertions(+), 46 deletions(-) diff --git a/sys/amd64/amd64/minidump_machdep.c b/sys/amd64/amd64/minidump_machdep.c index de8433ae5a05..3b9c39ad58da 100644 --- a/sys/amd64/amd64/minidump_machdep.c +++ b/sys/amd64/amd64/minidump_machdep.c @@ -75,7 +75,7 @@ blk_flush(struct dumperinfo *di) if (fragsz == 0) return (0); - error = dump_append(di, dump_va, 0, fragsz); + error = dump_append(di, dump_va, fragsz); fragsz = 0; return (error); } @@ -128,7 +128,7 @@ blk_write(struct dumperinfo *di, char *ptr, vm_paddr_t pa, size_t sz) } if (ptr) { - error = dump_append(di, ptr, 0, len); + error = dump_append(di, ptr, len); if (error) return (error); ptr += len; diff --git a/sys/arm/arm/minidump_machdep.c b/sys/arm/arm/minidump_machdep.c index ab3034237d17..9db111547aaa 100644 --- a/sys/arm/arm/minidump_machdep.c +++ b/sys/arm/arm/minidump_machdep.c @@ -72,7 +72,7 @@ blk_flush(struct dumperinfo *di) if (fragsz == 0) return (0); - error = dump_append(di, dump_va, 0, fragsz); + error = dump_append(di, dump_va, fragsz); fragsz = 0; return (error); } @@ -118,7 +118,7 @@ blk_write(struct dumperinfo *di, char *ptr, vm_paddr_t pa, size_t sz) wdog_kern_pat(WD_LASTVAL); #endif if (ptr) { - error = dump_append(di, ptr, 0, len); + error = dump_append(di, ptr, len); if (error) return (error); ptr += len; diff --git a/sys/arm64/arm64/minidump_machdep.c b/sys/arm64/arm64/minidump_machdep.c index ac5a7b271b85..34ad5fd7dbfe 100644 --- a/sys/arm64/arm64/minidump_machdep.c +++ b/sys/arm64/arm64/minidump_machdep.c @@ -75,7 +75,7 @@ blk_flush(struct dumperinfo *di) if (fragsz == 0) return (0); - error = dump_append(di, dump_va, 0, fragsz); + error = dump_append(di, dump_va, fragsz); fragsz = 0; return (error); } @@ -121,7 +121,7 @@ blk_write(struct dumperinfo *di, char *ptr, vm_paddr_t pa, size_t sz) wdog_kern_pat(WD_LASTVAL); if (ptr) { - error = dump_append(di, ptr, 0, len); + error = dump_append(di, ptr, len); if (error) return (error); ptr += len; diff --git a/sys/ddb/db_textdump.c b/sys/ddb/db_textdump.c index 539b51e58e1c..aad8b6965318 100644 --- a/sys/ddb/db_textdump.c +++ b/sys/ddb/db_textdump.c @@ -248,7 +248,7 @@ textdump_writeblock(struct dumperinfo *di, off_t offset, char *buffer) return (EIO); if (offset < SIZEOF_METADATA) return (ENOSPC); - textdump_error = dump_write(di, buffer, 0, offset + di->mediaoffset, + textdump_error = dump_write(di, buffer, offset + di->mediaoffset, TEXTDUMP_BLOCKSIZE); if (textdump_error) printf("textdump_writeblock: offset %jd, error %d\n", (intmax_t)offset, @@ -501,7 +501,7 @@ textdump_dumpsys(struct dumperinfo *di) * Terminate the dump, report any errors, and clear the pending flag. */ if (textdump_error == 0) - (void)dump_write(di, NULL, 0, 0, 0); + (void)dump_write(di, NULL, 0, 0); if (textdump_error == ENOSPC) printf("Textdump: Insufficient space on dump partition\n"); else if (textdump_error != 0) diff --git a/sys/geom/raid/g_raid.c b/sys/geom/raid/g_raid.c index 0fb9813fbbab..3b8f3974a495 100644 --- a/sys/geom/raid/g_raid.c +++ b/sys/geom/raid/g_raid.c @@ -1416,10 +1416,8 @@ g_raid_subdisk_kerneldump(struct g_raid_subdisk *sd, void *virtual, return (ENXIO); if (sd->sd_disk->d_kd.di.dumper == NULL) return (EOPNOTSUPP); - return (dump_write(&sd->sd_disk->d_kd.di, - virtual, 0, - sd->sd_disk->d_kd.di.mediaoffset + sd->sd_offset + offset, - length)); + return (dump_write(&sd->sd_disk->d_kd.di, virtual, + sd->sd_disk->d_kd.di.mediaoffset + sd->sd_offset + offset, length)); } static void diff --git a/sys/i386/i386/minidump_machdep_base.c b/sys/i386/i386/minidump_machdep_base.c index ce26e339d2be..5072474b9f8a 100644 --- a/sys/i386/i386/minidump_machdep_base.c +++ b/sys/i386/i386/minidump_machdep_base.c @@ -69,7 +69,7 @@ blk_flush(struct dumperinfo *di) if (fragsz == 0) return (0); - error = dump_append(di, dump_va, 0, fragsz); + error = dump_append(di, dump_va, fragsz); fragsz = 0; return (error); } @@ -112,7 +112,7 @@ blk_write(struct dumperinfo *di, char *ptr, vm_paddr_t pa, size_t sz) wdog_kern_pat(WD_LASTVAL); if (ptr) { - error = dump_append(di, ptr, 0, len); + error = dump_append(di, ptr, len); if (error) return (error); ptr += len; diff --git a/sys/kern/kern_dump.c b/sys/kern/kern_dump.c index 17ac4e418645..393c4983d08b 100644 --- a/sys/kern/kern_dump.c +++ b/sys/kern/kern_dump.c @@ -122,7 +122,7 @@ dumpsys_buf_seek(struct dumperinfo *di, size_t sz) while (sz > 0) { nbytes = MIN(sz, sizeof(buf)); - error = dump_append(di, buf, 0, nbytes); + error = dump_append(di, buf, nbytes); if (error) return (error); sz -= nbytes; @@ -146,7 +146,7 @@ dumpsys_buf_write(struct dumperinfo *di, char *ptr, size_t sz) ptr += len; sz -= len; if (fragsz == di->blocksize) { - error = dump_append(di, di->blockbuf, 0, di->blocksize); + error = dump_append(di, di->blockbuf, di->blocksize); if (error) return (error); fragsz = 0; @@ -163,7 +163,7 @@ dumpsys_buf_flush(struct dumperinfo *di) if (fragsz == 0) return (0); - error = dump_append(di, di->blockbuf, 0, di->blocksize); + error = dump_append(di, di->blockbuf, di->blocksize); fragsz = 0; return (error); } @@ -209,7 +209,7 @@ dumpsys_cb_dumpdata(struct dump_pa *mdp, int seqnr, void *arg) dumpsys_map_chunk(pa, chunk, &va); wdog_kern_pat(WD_LASTVAL); - error = dump_append(di, va, 0, sz); + error = dump_append(di, va, sz); dumpsys_unmap_chunk(pa, chunk, va); if (error) break; diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c index d6053f24a746..aaa5c5a0243f 100644 --- a/sys/kern/kern_shutdown.c +++ b/sys/kern/kern_shutdown.c @@ -1036,8 +1036,7 @@ SYSCTL_PROC(_kern_shutdown, OID_AUTO, dumpdevname, dumpdevname_sysctl_handler, "A", "Device(s) for kernel dumps"); -static int _dump_append(struct dumperinfo *di, void *virtual, - vm_offset_t physical, size_t length); +static int _dump_append(struct dumperinfo *di, void *virtual, size_t length); #ifdef EKCD static struct kerneldumpcrypto * @@ -1450,8 +1449,8 @@ dump_encrypt(struct kerneldumpcrypto *kdc, uint8_t *buf, size_t size) /* Encrypt data and call dumper. */ static int -dump_encrypted_write(struct dumperinfo *di, void *virtual, - vm_offset_t physical, off_t offset, size_t length) +dump_encrypted_write(struct dumperinfo *di, void *virtual, off_t offset, + size_t length) { static uint8_t buf[KERNELDUMP_BUFFER_SIZE]; struct kerneldumpcrypto *kdc; @@ -1467,7 +1466,7 @@ dump_encrypted_write(struct dumperinfo *di, void *virtual, if (dump_encrypt(kdc, buf, nbytes) != 0) return (EIO); - error = dump_write(di, buf, physical, offset, nbytes); + error = dump_write(di, buf, offset, nbytes); if (error != 0) return (error); @@ -1498,7 +1497,7 @@ kerneldumpcomp_write_cb(void *base, size_t length, off_t offset, void *arg) */ rlength = rounddown(length, di->blocksize); if (rlength != 0) { - error = _dump_append(di, base, 0, rlength); + error = _dump_append(di, base, rlength); if (error != 0) return (error); } @@ -1508,7 +1507,7 @@ kerneldumpcomp_write_cb(void *base, size_t length, off_t offset, void *arg) di->kdcomp->kdc_resid = resid; return (EAGAIN); } - return (_dump_append(di, base, 0, length)); + return (_dump_append(di, base, length)); } /* @@ -1557,7 +1556,7 @@ dump_write_headers(struct dumperinfo *di, struct kerneldumpheader *kdh) extent = dtoh64(kdh->dumpextent); #ifdef EKCD if (kdc != NULL) { - error = dump_write(di, kdc->kdc_dumpkey, 0, + error = dump_write(di, kdc->kdc_dumpkey, di->mediaoffset + di->mediasize - di->blocksize - extent - keysize, keysize); if (error != 0) @@ -1565,11 +1564,11 @@ dump_write_headers(struct dumperinfo *di, struct kerneldumpheader *kdh) } #endif - error = dump_write(di, buf, 0, + error = dump_write(di, buf, di->mediaoffset + di->mediasize - 2 * di->blocksize - extent - keysize, di->blocksize); if (error == 0) - error = dump_write(di, buf, 0, di->mediaoffset + di->mediasize - + error = dump_write(di, buf, di->mediaoffset + di->mediasize - di->blocksize, di->blocksize); return (error); } @@ -1658,18 +1657,16 @@ dump_start(struct dumperinfo *di, struct kerneldumpheader *kdh) } static int -_dump_append(struct dumperinfo *di, void *virtual, vm_offset_t physical, - size_t length) +_dump_append(struct dumperinfo *di, void *virtual, size_t length) { int error; #ifdef EKCD if (di->kdcrypto != NULL) - error = dump_encrypted_write(di, virtual, physical, di->dumpoff, - length); + error = dump_encrypted_write(di, virtual, di->dumpoff, length); else #endif - error = dump_write(di, virtual, physical, di->dumpoff, length); + error = dump_write(di, virtual, di->dumpoff, length); if (error == 0) di->dumpoff += length; return (error); @@ -1681,8 +1678,7 @@ _dump_append(struct dumperinfo *di, void *virtual, vm_offset_t physical, * when the compression stream's output buffer is full. */ int -dump_append(struct dumperinfo *di, void *virtual, vm_offset_t physical, - size_t length) +dump_append(struct dumperinfo *di, void *virtual, size_t length) { void *buf; @@ -1694,15 +1690,14 @@ dump_append(struct dumperinfo *di, void *virtual, vm_offset_t physical, memmove(buf, virtual, length); return (compressor_write(di->kdcomp->kdc_stream, buf, length)); } - return (_dump_append(di, virtual, physical, length)); + return (_dump_append(di, virtual, length)); } /* * Write to the dump device at the specified offset. */ int -dump_write(struct dumperinfo *di, void *virtual, vm_offset_t physical, - off_t offset, size_t length) +dump_write(struct dumperinfo *di, void *virtual, off_t offset, size_t length) { int error; @@ -1727,7 +1722,7 @@ dump_finish(struct dumperinfo *di, struct kerneldumpheader *kdh) error = compressor_flush(di->kdcomp->kdc_stream); if (error == EAGAIN) { /* We have residual data in di->blockbuf. */ - error = _dump_append(di, di->blockbuf, 0, di->blocksize); + error = _dump_append(di, di->blockbuf, di->blocksize); if (error == 0) /* Compensate for _dump_append()'s adjustment. */ di->dumpoff -= di->blocksize - di->kdcomp->kdc_resid; @@ -1751,7 +1746,7 @@ dump_finish(struct dumperinfo *di, struct kerneldumpheader *kdh) if (error != 0) return (error); - (void)dump_write(di, NULL, 0, 0, 0); + (void)dump_write(di, NULL, 0, 0); return (0); } diff --git a/sys/powerpc/powerpc/minidump_machdep.c b/sys/powerpc/powerpc/minidump_machdep.c index 396c6487823e..d713e11f2ab2 100644 --- a/sys/powerpc/powerpc/minidump_machdep.c +++ b/sys/powerpc/powerpc/minidump_machdep.c @@ -89,7 +89,7 @@ blk_flush(struct dumperinfo *di) if (fragsz == 0) return (0); - error = dump_append(di, crashdumpmap, 0, fragsz); + error = dump_append(di, crashdumpmap, fragsz); DBG(dumptotal += fragsz;) fragsz = 0; return (error); @@ -134,7 +134,7 @@ blk_write(struct dumperinfo *di, char *ptr, vm_paddr_t pa, size_t sz) dumpsys_pb_progress(len); if (ptr) { - error = dump_append(di, ptr, 0, len); + error = dump_append(di, ptr, len); if (error) return (error); DBG(dumptotal += len;) diff --git a/sys/riscv/riscv/minidump_machdep.c b/sys/riscv/riscv/minidump_machdep.c index ee6faaa6680f..9a47bb31a6f7 100644 --- a/sys/riscv/riscv/minidump_machdep.c +++ b/sys/riscv/riscv/minidump_machdep.c @@ -72,7 +72,7 @@ blk_flush(struct dumperinfo *di) if (fragsz == 0) return (0); - error = dump_append(di, dump_va, 0, fragsz); + error = dump_append(di, dump_va, fragsz); fragsz = 0; return (error); } @@ -126,7 +126,7 @@ blk_write(struct dumperinfo *di, char *ptr, vm_paddr_t pa, size_t sz) wdog_kern_pat(WD_LASTVAL); if (ptr) { - error = dump_append(di, ptr, 0, len); + error = dump_append(di, ptr, len); if (error != 0) return (error); ptr += len; diff --git a/sys/sys/conf.h b/sys/sys/conf.h index 37265c6988ce..9f60dcaf62fa 100644 --- a/sys/sys/conf.h +++ b/sys/sys/conf.h @@ -376,8 +376,8 @@ void dumper_ddb_insert(struct dumperinfo *); void dumper_ddb_remove(struct dumperinfo *); int dump_start(struct dumperinfo *di, struct kerneldumpheader *kdh); -int dump_append(struct dumperinfo *, void *, vm_offset_t, size_t); -int dump_write(struct dumperinfo *, void *, vm_offset_t, off_t, size_t); +int dump_append(struct dumperinfo *, void *, size_t); +int dump_write(struct dumperinfo *, void *, off_t, size_t); int dump_finish(struct dumperinfo *di, struct kerneldumpheader *kdh); void dump_init_header(const struct dumperinfo *di, struct kerneldumpheader *kdh, const char *magic, uint32_t archver, uint64_t dumplen);