Skip to content

Commit

Permalink
remove temp changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tombl committed Dec 30, 2024
1 parent 3f0d1f3 commit a86fdfd
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 27 deletions.
10 changes: 5 additions & 5 deletions arch/wasm/kernel/binfmt_wasm.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ static struct linux_binfmt wasm_format = {

static int load_wasm_binary(struct linux_binprm *bprm)
{
if (strncmp(bprm->buf, "\0asm", 4)) {
return -ENOEXEC;
}
if (strncmp(bprm->buf, "\0asm", 4)) {
return -ENOEXEC;
}

set_binfmt(&wasm_format);
finalize_exec(bprm);

// TODO: read file, instantiate module, call with args
// TODO: read file, instantiate module, call with args

BUG();
BUG();

return 0;
}
Expand Down
12 changes: 2 additions & 10 deletions block/bdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,6 @@ static int blkdev_get_part(struct block_device *part, fmode_t mode)

out_blkdev_put:
blkdev_put_whole(bdev_whole(part), mode);
pr_info("%s() = %d\n", __func__, ret);
return ret;
}

Expand Down Expand Up @@ -750,8 +749,6 @@ struct block_device *blkdev_get_no_open(dev_t dev)
"block device autoloading is deprecated and will be removed.\n");
}

pr_info("inode: %p %i\n", inode, dev);

if (!inode)
return NULL;

Expand Down Expand Up @@ -804,9 +801,8 @@ struct block_device *blkdev_get_by_dev(dev_t dev, fmode_t mode, void *holder)
return ERR_PTR(ret);

bdev = blkdev_get_no_open(dev);
if (!bdev){
pr_info("%s: no bdev\n", __func__);
return ERR_PTR(-ENXIO);}
if (!bdev)
return ERR_PTR(-ENXIO);
disk = bdev->bd_disk;

if (mode & FMODE_EXCL) {
Expand Down Expand Up @@ -859,7 +855,6 @@ struct block_device *blkdev_get_by_dev(dev_t dev, fmode_t mode, void *holder)
disk_unblock_events(disk);
put_blkdev:
blkdev_put_no_open(bdev);
pr_info("%s() = %d", __func__, ret);
return ERR_PTR(ret);
}
EXPORT_SYMBOL(blkdev_get_by_dev);
Expand Down Expand Up @@ -892,8 +887,6 @@ struct block_device *blkdev_get_by_path(const char *path, fmode_t mode,
if (error)
return ERR_PTR(error);

pr_info("%s: %s -> %d\n", __func__, path, dev);

bdev = blkdev_get_by_dev(dev, mode, holder);
if (!IS_ERR(bdev) && (mode & FMODE_WRITE) && bdev_read_only(bdev)) {
blkdev_put(bdev, mode);
Expand Down Expand Up @@ -1000,7 +993,6 @@ int lookup_bdev(const char *pathname, dev_t *dev)
if (!may_open_dev(&path))
goto out_path_put;

pr_info("rdev: %p %d %x\n", inode, inode->i_rdev, inode->i_mode);
*dev = inode->i_rdev;
error = 0;
out_path_put:
Expand Down
7 changes: 2 additions & 5 deletions block/partitions/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,6 @@ int bdev_add_partition(struct gendisk *disk, int partno, sector_t start,

mutex_lock(&disk->open_mutex);
if (!disk_live(disk)) {
pr_warn("bdev not live\n");
ret = -ENXIO;
goto out;
}
Expand Down Expand Up @@ -581,7 +580,6 @@ static bool blk_add_partition(struct gendisk *disk,

part = add_partition(disk, p, from, size, state->parts[p].flags,
&state->parts[p].info);
pr_info("add_partition() = %p\n", part);
if (IS_ERR(part)) {
if (PTR_ERR(part) != -ENXIO) {
printk(KERN_ERR " %s: p%d could not be added: %pe\n",
Expand Down Expand Up @@ -667,9 +665,8 @@ int bdev_disk_changed(struct gendisk *disk, bool invalidate)

lockdep_assert_held(&disk->open_mutex);

if (!disk_live(disk)){
pr_warn("bdev not live\n");
return -ENXIO;}
if (!disk_live(disk))
return -ENXIO;

rescan:
if (disk->open_partitions)
Expand Down
1 change: 0 additions & 1 deletion drivers/base/dd.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: GPL-2.0
#define DEBUG
/*
* drivers/base/dd.c - The core device/driver interactions.
*
Expand Down
5 changes: 1 addition & 4 deletions drivers/virtio/virtio_ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
*
* Copyright 2007 Rusty Russell IBM Corporation
*/
#define DEBUG
#define pr_fmt(fmt) "vring: " fmt

#include <linux/virtio.h>
#include <linux/virtio_ring.h>
#include <linux/virtio_config.h>
Expand Down Expand Up @@ -1387,7 +1384,7 @@ static inline int virtqueue_add_packed(struct virtqueue *_vq,
err = virtqueue_add_indirect_packed(vq, sgs, total_sg, out_sgs,
in_sgs, data, gfp);
if (err != -ENOMEM) {
// END_USE(vq);
END_USE(vq);
return err;
}

Expand Down
2 changes: 0 additions & 2 deletions init/do_mounts.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,9 +372,7 @@ static int __init do_mount_root(const char *name, const char *fs,
strncpy(data_page, data, PAGE_SIZE);
}

pr_info("mounting root\n");
ret = init_mount(name, "/root", fs, flags, data_page);
pr_info("init_mount: %d\n", ret);
if (ret)
goto out;

Expand Down
6 changes: 6 additions & 0 deletions usr/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ compress-$(CONFIG_INITRAMFS_COMPRESSION_LZO) := lzo
compress-$(CONFIG_INITRAMFS_COMPRESSION_LZ4) := lz4
compress-$(CONFIG_INITRAMFS_COMPRESSION_ZSTD) := zstd

ifndef CONFIG_WASM
obj-$(CONFIG_BLK_DEV_INITRD) := initramfs_data.o

$(obj)/initramfs_data.o: $(obj)/initramfs_inc_data
endif

ramfs-input := $(CONFIG_INITRAMFS_SOURCE)
cpio-data :=

Expand Down
36 changes: 36 additions & 0 deletions usr/initramfs_data.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/* SPDX-License-Identifier: GPL-2.0 */
/*
initramfs_data includes the compressed binary that is the
filesystem used for early user space.
Note: Older versions of "as" (prior to binutils 2.11.90.0.23
released on 2001-07-14) dit not support .incbin.
If you are forced to use older binutils than that then the
following trick can be applied to create the resulting binary:
ld -m elf_i386 --format binary --oformat elf32-i386 -r \
-T initramfs_data.scr initramfs_data.cpio.gz -o initramfs_data.o
ld -m elf_i386 -r -o built-in.a initramfs_data.o
For including the .init.ramfs sections, see include/asm-generic/vmlinux.lds.
The above example is for i386 - the parameters vary from architectures.
Eventually look up LDFLAGS_BLOB in an older version of the
arch/$(ARCH)/Makefile to see the flags used before .incbin was introduced.
Using .incbin has the advantage over ld that the correct flags are set
in the ELF header, as required by certain architectures.
*/

.section .init.ramfs,"a"
__irf_start:
.incbin "usr/initramfs_inc_data"
__irf_end:
.section .init.ramfs.info,"a"
.globl __initramfs_size
__initramfs_size:
#ifdef CONFIG_64BIT
.quad __irf_end - __irf_start
#else
.long __irf_end - __irf_start
#endif

0 comments on commit a86fdfd

Please sign in to comment.