kerneldump: remove physical argument from d_dumper

The physical address argument is essentially ignored by every dumper
method. In addition, the dump routines don't actually pass a real
address; every call to dump_append() passes a value of zero for
physical.

Reviewed by:	markj
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D35173
This commit is contained in:
Mitchell Horne 2022-05-13 10:39:29 -03:00
parent 0f50da2e09
commit 489ba22236
27 changed files with 51 additions and 70 deletions

View file

@ -1099,7 +1099,7 @@ adastrategy(struct bio *bp)
}
static int
adadump(void *arg, void *virtual, vm_offset_t physical, off_t offset, size_t length)
adadump(void *arg, void *virtual, off_t offset, size_t length)
{
struct cam_periph *periph;
struct ada_softc *softc;
@ -3562,7 +3562,7 @@ adaflush(void)
/* If we panicked with the lock held, do not recurse. */
if (!cam_periph_owned(periph) &&
(softc->flags & ADA_FLAG_OPEN)) {
adadump(softc->disk, NULL, 0, 0, 0);
adadump(softc->disk, NULL, 0, 0);
}
continue;
}

View file

@ -2006,8 +2006,7 @@ sddaerror(union ccb *ccb, u_int32_t cam_flags, u_int32_t sense_flags)
}
static int
sddadump(void *arg, void *virtual, vm_offset_t physical, off_t offset,
size_t length)
sddadump(void *arg, void *virtual, off_t offset, size_t length)
{
struct ccb_mmcio mmcio;
struct disk *dp;

View file

@ -499,7 +499,7 @@ ndastrategy(struct bio *bp)
}
static int
ndadump(void *arg, void *virtual, vm_offset_t physical, off_t offset, size_t length)
ndadump(void *arg, void *virtual, off_t offset, size_t length)
{
struct cam_periph *periph;
struct nda_softc *softc;
@ -1329,7 +1329,7 @@ ndaflush(void)
*/
if (!cam_periph_owned(periph) &&
(softc->flags & NDA_FLAG_OPEN)) {
ndadump(softc->disk, NULL, 0, 0, 0);
ndadump(softc->disk, NULL, 0, 0);
}
continue;
}

View file

@ -1915,7 +1915,7 @@ dastrategy(struct bio *bp)
}
static int
dadump(void *arg, void *virtual, vm_offset_t physical, off_t offset, size_t length)
dadump(void *arg, void *virtual, off_t offset, size_t length)
{
struct cam_periph *periph;
struct da_softc *softc;
@ -6274,7 +6274,7 @@ dashutdown(void * arg, int howto)
/* If we paniced with the lock held, do not recurse. */
if (!cam_periph_owned(periph) &&
(softc->flags & DA_FLAG_OPEN)) {
dadump(softc->disk, NULL, 0, 0, 0);
dadump(softc->disk, NULL, 0, 0);
}
continue;
}

View file

@ -232,7 +232,7 @@ aac_dump_map_sg64(void *arg, bus_dma_segment_t *segs, int nsegs, int error)
* Send out one command at a time with up to maxio of data.
*/
static int
aac_disk_dump(void *arg, void *virtual, vm_offset_t physical, off_t offset, size_t length)
aac_disk_dump(void *arg, void *virtual, off_t offset, size_t length)
{
struct aac_disk *ad;
struct aac_softc *sc;
@ -311,8 +311,8 @@ aac_disk_dump(void *arg, void *virtual, vm_offset_t physical, off_t offset, size
if (aac_sync_fib(sc, command, 0, fib, size)) {
device_printf(sc->aac_dev,
"Error dumping block 0x%jx\n",
(uintmax_t)physical);
"Error dumping block to 0x%jx\n",
(uintmax_t)offset);
return (EIO);
}

View file

@ -125,7 +125,7 @@ idad_strategy(struct bio *bp)
}
static int
idad_dump(void *arg, void *virtual, vm_offset_t physical, off_t offset, size_t length)
idad_dump(void *arg, void *virtual, off_t offset, size_t length)
{
struct idad_softc *drv;

View file

@ -39,8 +39,7 @@ static int ipsd_probe(device_t dev);
static int ipsd_attach(device_t dev);
static int ipsd_detach(device_t dev);
static int ipsd_dump(void *arg, void *virtual, vm_offset_t physical,
off_t offset, size_t length);
static int ipsd_dump(void *arg, void *virtual, off_t offset, size_t length);
static void ipsd_dump_map_sg(void *arg, bus_dma_segment_t *segs, int nsegs,
int error);
static void ipsd_dump_block_complete(ips_command_t *command);
@ -185,8 +184,7 @@ static int ipsd_detach(device_t dev)
}
static int
ipsd_dump(void *arg, void *virtual, vm_offset_t physical, off_t offset,
size_t length)
ipsd_dump(void *arg, void *virtual, off_t offset, size_t length)
{
ipsdisk_softc_t *dsc;
ips_softc_t *sc;

View file

@ -315,7 +315,7 @@ mfi_disk_complete(struct bio *bio)
}
static int
mfi_disk_dump(void *arg, void *virt, vm_offset_t phys, off_t offset, size_t len)
mfi_disk_dump(void *arg, void *virt, off_t offset, size_t len)
{
struct mfi_disk *sc;
struct mfi_softc *parent_sc;

View file

@ -264,8 +264,7 @@ mfi_syspd_strategy(struct bio *bio)
}
static int
mfi_syspd_dump(void *arg, void *virt, vm_offset_t phys, off_t offset,
size_t len)
mfi_syspd_dump(void *arg, void *virt, off_t offset, size_t len)
{
struct mfi_system_pd *sc;
struct mfi_softc *parent_sc;

View file

@ -173,8 +173,7 @@ static int mmcsd_shutdown(device_t dev);
/* disk routines */
static int mmcsd_close(struct disk *dp);
static int mmcsd_dump(void *arg, void *virtual, vm_offset_t physical,
off_t offset, size_t length);
static int mmcsd_dump(void *arg, void *virtual, off_t offset, size_t length);
static int mmcsd_getattr(struct bio *);
static int mmcsd_ioctl_disk(struct disk *disk, u_long cmd, void *data,
int fflag, struct thread *td);
@ -1378,8 +1377,7 @@ mmcsd_delete(struct mmcsd_part *part, struct bio *bp)
}
static int
mmcsd_dump(void *arg, void *virtual, vm_offset_t physical, off_t offset,
size_t length)
mmcsd_dump(void *arg, void *virtual, off_t offset, size_t length)
{
struct bio bp;
daddr_t block, end;

View file

@ -291,7 +291,7 @@ nvd_ioctl(struct disk *dp, u_long cmd, void *data, int fflag,
}
static int
nvd_dump(void *arg, void *virt, vm_offset_t phys, off_t offset, size_t len)
nvd_dump(void *arg, void *virt, off_t offset, size_t len)
{
struct disk *dp = arg;
struct nvd_disk *ndisk = dp->d_drv1;

View file

@ -134,7 +134,7 @@ static int vtblk_open(struct disk *);
static int vtblk_close(struct disk *);
static int vtblk_ioctl(struct disk *, u_long, void *, int,
struct thread *);
static int vtblk_dump(void *, void *, vm_offset_t, off_t, size_t);
static int vtblk_dump(void *, void *, off_t, size_t);
static void vtblk_strategy(struct bio *);
static int vtblk_negotiate_features(struct vtblk_softc *);
@ -531,8 +531,7 @@ vtblk_ioctl(struct disk *dp, u_long cmd, void *addr, int flag,
}
static int
vtblk_dump(void *arg, void *virtual, vm_offset_t physical, off_t offset,
size_t length)
vtblk_dump(void *arg, void *virtual, off_t offset, size_t length)
{
struct disk *dp;
struct vtblk_softc *sc;

View file

@ -593,8 +593,7 @@ xbd_dump_complete(struct xbd_command *cm)
}
static int
xbd_dump(void *arg, void *virtual, vm_offset_t physical, off_t offset,
size_t length)
xbd_dump(void *arg, void *virtual, off_t offset, size_t length)
{
struct disk *dp = arg;
struct xbd_softc *sc = dp->d_drv1;

View file

@ -130,8 +130,7 @@ g_nop_resize(struct g_consumer *cp)
}
static int
g_nop_dumper(void *priv, void *virtual, vm_offset_t physical, off_t offset,
size_t length)
g_nop_dumper(void *priv, void *virtual, off_t offset, size_t length)
{
return (0);

View file

@ -1033,8 +1033,7 @@ g_raid_tr_kerneldump_common(struct g_raid_tr_object *tr,
}
static int
g_raid_dump(void *arg,
void *virtual, vm_offset_t physical, off_t offset, size_t length)
g_raid_dump(void *arg, void *virtual, off_t offset, size_t length)
{
struct g_raid_volume *vol;
int error;
@ -1043,8 +1042,7 @@ g_raid_dump(void *arg,
G_RAID_DEBUG1(3, vol->v_softc, "Dumping at off %llu len %llu.",
(long long unsigned)offset, (long long unsigned)length);
error = G_RAID_TR_KERNELDUMP(vol->v_tr,
virtual, physical, offset, length);
error = G_RAID_TR_KERNELDUMP(vol->v_tr, virtual, offset, length);
return (error);
}
@ -1397,7 +1395,7 @@ g_raid_subdisk_iostart(struct g_raid_subdisk *sd, struct bio *bp)
G_RAID_LOGREQ(3, bp, "Sending dumping request.");
if (bp->bio_cmd == BIO_WRITE) {
bp->bio_error = g_raid_subdisk_kerneldump(sd,
bp->bio_data, 0, bp->bio_offset, bp->bio_length);
bp->bio_data, bp->bio_offset, bp->bio_length);
} else
bp->bio_error = EOPNOTSUPP;
g_raid_disk_done(bp);
@ -1410,8 +1408,8 @@ g_raid_subdisk_iostart(struct g_raid_subdisk *sd, struct bio *bp)
}
int
g_raid_subdisk_kerneldump(struct g_raid_subdisk *sd,
void *virtual, vm_offset_t physical, off_t offset, size_t length)
g_raid_subdisk_kerneldump(struct g_raid_subdisk *sd, void *virtual,
off_t offset, size_t length)
{
if (sd->sd_disk == NULL)
@ -1419,7 +1417,7 @@ g_raid_subdisk_kerneldump(struct g_raid_subdisk *sd,
if (sd->sd_disk->d_kd.di.dumper == NULL)
return (EOPNOTSUPP);
return (dump_write(&sd->sd_disk->d_kd.di,
virtual, physical,
virtual, 0,
sd->sd_disk->d_kd.di.mediaoffset + sd->sd_offset + offset,
length));
}

View file

@ -406,8 +406,8 @@ int g_raid_destroy_disk(struct g_raid_disk *disk);
void g_raid_iodone(struct bio *bp, int error);
void g_raid_subdisk_iostart(struct g_raid_subdisk *sd, struct bio *bp);
int g_raid_subdisk_kerneldump(struct g_raid_subdisk *sd,
void *virtual, vm_offset_t physical, off_t offset, size_t length);
int g_raid_subdisk_kerneldump(struct g_raid_subdisk *sd, void *virtual,
off_t offset, size_t length);
struct g_consumer *g_raid_open_consumer(struct g_raid_softc *sc,
const char *name);

View file

@ -95,7 +95,6 @@ METHOD void iodone {
METHOD int kerneldump {
struct g_raid_tr_object *tr;
void *virtual;
vm_offset_t physical;
off_t offset;
size_t length;
} DEFAULT g_raid_tr_kerneldump_common;

View file

@ -286,8 +286,8 @@ g_raid_tr_iostart_concat(struct g_raid_tr_object *tr, struct bio *bp)
}
static int
g_raid_tr_kerneldump_concat(struct g_raid_tr_object *tr,
void *virtual, vm_offset_t physical, off_t boffset, size_t blength)
g_raid_tr_kerneldump_concat(struct g_raid_tr_object *tr, void *virtual,
off_t boffset, size_t blength)
{
struct g_raid_volume *vol;
struct g_raid_subdisk *sd;
@ -314,7 +314,7 @@ g_raid_tr_kerneldump_concat(struct g_raid_tr_object *tr,
sd = &vol->v_subdisks[no];
length = MIN(sd->sd_size - offset, remain);
error = g_raid_subdisk_kerneldump(&vol->v_subdisks[no],
addr, 0, offset, length);
addr, offset, length);
if (error != 0)
return (error);
remain -= length;

View file

@ -269,7 +269,7 @@ g_raid_tr_iostart_raid0(struct g_raid_tr_object *tr, struct bio *bp)
static int
g_raid_tr_kerneldump_raid0(struct g_raid_tr_object *tr,
void *virtual, vm_offset_t physical, off_t boffset, size_t blength)
void *virtual, off_t boffset, size_t blength)
{
struct g_raid_volume *vol;
char *addr;
@ -296,8 +296,8 @@ g_raid_tr_kerneldump_raid0(struct g_raid_tr_object *tr,
do {
length = MIN(strip_size - start, remain);
error = g_raid_subdisk_kerneldump(&vol->v_subdisks[no],
addr, 0, offset + start, length);
error = g_raid_subdisk_kerneldump(&vol->v_subdisks[no], addr,
offset + start, length);
if (error != 0)
return (error);
if (++no >= vol->v_disks_count) {

View file

@ -899,8 +899,8 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_object *tr,
}
static int
g_raid_tr_kerneldump_raid1(struct g_raid_tr_object *tr,
void *virtual, vm_offset_t physical, off_t offset, size_t length)
g_raid_tr_kerneldump_raid1(struct g_raid_tr_object *tr, void *virtual,
off_t offset, size_t length)
{
struct g_raid_volume *vol;
struct g_raid_subdisk *sd;
@ -935,8 +935,7 @@ g_raid_tr_kerneldump_raid1(struct g_raid_tr_object *tr,
default:
continue;
}
error = g_raid_subdisk_kerneldump(sd,
virtual, physical, offset, length);
error = g_raid_subdisk_kerneldump(sd, virtual, offset, length);
if (error == 0)
ok++;
}

View file

@ -1144,8 +1144,8 @@ g_raid_tr_iodone_raid1e(struct g_raid_tr_object *tr,
}
static int
g_raid_tr_kerneldump_raid1e(struct g_raid_tr_object *tr,
void *virtual, vm_offset_t physical, off_t boffset, size_t blength)
g_raid_tr_kerneldump_raid1e(struct g_raid_tr_object *tr, void *virtual,
off_t boffset, size_t blength)
{
struct g_raid_volume *vol;
struct g_raid_subdisk *sd;
@ -1177,8 +1177,8 @@ g_raid_tr_kerneldump_raid1e(struct g_raid_tr_object *tr,
default:
goto nextdisk;
}
error = g_raid_subdisk_kerneldump(sd,
addr, 0, offset + start, length);
error = g_raid_subdisk_kerneldump(sd, addr,
offset + start, length);
if (error != 0)
return (error);
nextdisk:

View file

@ -385,8 +385,8 @@ g_raid_tr_iodone_raid5(struct g_raid_tr_object *tr,
}
static int
g_raid_tr_kerneldump_raid5(struct g_raid_tr_object *tr,
void *virtual, vm_offset_t physical, off_t offset, size_t length)
g_raid_tr_kerneldump_raid5(struct g_raid_tr_object *tr, void *virtual,
off_t offset, size_t length)
{
return (ENODEV);

View file

@ -88,7 +88,7 @@ static bool g_union_getmap(struct bio *bp, struct g_union_softc *sc,
off_t *len2read);
static void g_union_done(struct bio *bp);
static void g_union_kerneldump(struct bio *bp, struct g_union_softc *sc);
static int g_union_dumper(void *, void *, vm_offset_t, off_t, size_t);
static int g_union_dumper(void *, void *, off_t, size_t);
static int g_union_destroy(struct gctl_req *req, struct g_geom *gp, bool force);
/*
@ -1222,8 +1222,7 @@ g_union_kerneldump(struct bio *bp, struct g_union_softc *sc)
* Handler for g_union_kerneldump().
*/
static int
g_union_dumper(void *priv, void *virtual, vm_offset_t physical, off_t offset,
size_t length)
g_union_dumper(void *priv, void *virtual, off_t offset, size_t length)
{
return (0);

View file

@ -1754,7 +1754,7 @@ dump_write(struct dumperinfo *di, void *virtual, vm_offset_t physical,
error = dump_check_bounds(di, offset, length);
if (error != 0)
return (error);
return (di->dumper(di->priv, virtual, physical, offset, length));
return (di->dumper(di->priv, virtual, offset, length));
}
/*

View file

@ -150,7 +150,6 @@ vnode_dumper_start(struct dumperinfo *di, void *key, uint32_t keysize)
* Parameters:
* arg Opaque private pointer to vnode
* virtual Virtual address (where to read the data from)
* physical Physical memory address (unused)
* offset Offset from start of core file
* length Data length
*
@ -159,8 +158,7 @@ vnode_dumper_start(struct dumperinfo *di, void *key, uint32_t keysize)
* errno on error
*/
int
vnode_dump(void *arg, void *virtual, vm_offset_t physical __unused,
off_t offset, size_t length)
vnode_dump(void *arg, void *virtual, off_t offset, size_t length)
{
struct vnode *vp;
int error = 0;

View file

@ -89,7 +89,7 @@ static void netdump_cleanup(void);
static int netdump_configure(struct diocskerneldump_arg *,
struct thread *);
static int netdump_dumper(void *priv __unused, void *virtual,
vm_offset_t physical __unused, off_t offset, size_t length);
off_t offset, size_t length);
static bool netdump_enabled(void);
static int netdump_enabled_sysctl(SYSCTL_HANDLER_ARGS);
static int netdump_ioctl(struct cdev *dev __unused, u_long cmd,
@ -227,7 +227,6 @@ netdump_flush_buf(void)
* Parameters:
* priv Unused. Optional private pointer.
* virtual Virtual address (where to read the data from)
* physical Unused. Physical memory address.
* offset Offset from start of core file
* length Data length
*
@ -236,8 +235,7 @@ netdump_flush_buf(void)
* errno on error
*/
static int
netdump_dumper(void *priv __unused, void *virtual,
vm_offset_t physical __unused, off_t offset, size_t length)
netdump_dumper(void *priv __unused, void *virtual, off_t offset, size_t length)
{
int error;

View file

@ -130,7 +130,6 @@ typedef void d_purge_t(struct cdev *dev);
typedef int dumper_t(
void *_priv, /* Private to the driver. */
void *_virtual, /* Virtual (mapped) address. */
vm_offset_t _physical, /* Physical address of virtual. */
off_t _offset, /* Byte-offset to write at. */
size_t _length); /* Number of bytes to dump. */
typedef int dumper_start_t(struct dumperinfo *di, void *key, uint32_t keysize);