Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ppc: block-size method failing and failing to read disk #16

Open
crass opened this issue Jul 31, 2023 · 0 comments
Open

ppc: block-size method failing and failing to read disk #16

crass opened this issue Jul 31, 2023 · 0 comments

Comments

@crass
Copy link
Contributor

crass commented Jul 31, 2023

QEMU: QEMU emulator version 5.2.0 (Debian 1:5.2+dfsg-11+deb11u2)
OpenBIOS: PPC debug build of latest v1.1 release in releases
GRUB ISO: grub.iso.gz
CMD: qemu-system-ppc -M mac99,via=pmu -nographic -drive file=luks.disk,media=disk,format=raw,if=ide,id=luks -nographic -monitor file:/dev/null -chardev stdio,mux=on,id=serdev -serial chardev:serdev -serial chardev:serdev --drive if=ide,media=cdrom,file=grub.iso -boot d
LUKS DISK: luks.disk.gz

This is a test GRUB test to verify decrypting contents from LUKS disk. I've truncated the LUKS disk image built by the test to 1M, but the failure is the same on the untruncated image.

kern/disk.c:196:disk: Opening `ieee1275/ide0'...
disk/ieee1275/ofdisk.c:472:disk: Opening `ide0'.
call-method block-size: exception -21 
>> call-method block-size failed with error ffffffdf
disk/ieee1275/ofdisk.c:724:disk: can't get block size: 1
kern/disk.c:386:disk: ieee1275/ide0 read failed
kern/disk.c:386:disk: ieee1275/ide0 read failed
kern/disk.c:299:disk: Closing `ieee1275/ide0'.
kern/disk.c:196:disk: Opening `ieee1275/ide0'...
disk/ieee1275/ofdisk.c:472:disk: Opening `ide0'.
kern/disk.c:386:disk: ieee1275/ide0 read failed
kern/disk.c:386:disk: ieee1275/ide0 read failed
kern/disk.c:386:disk: ieee1275/ide0 read failed
kern/disk.c:386:disk: ieee1275/ide0 read failed
kern/disk.c:386:disk: ieee1275/ide0 read failed
kern/disk.c:386:disk: ieee1275/ide0 read failed

There looks to be two issues here:

  1. The block-size method is failing. I don't think this matters for the test to pass, but seems like a legitimate issue. By compiling with DEBUG_IDE, I see that the IDE openbios IDE code has a correct block size for both devices. And block-size is failing for both the CDROM and disk devices.
>> IDE - ob_ide_open: opening channel 0 unit 130654868
>> IDE DRIVE @7c9a294:
>> unit: 1
>> present: 1
>> type: 2
>> media: 5
>> model: QEMU DVD-ROM
>> nr: 1
>> cyl: 0
>> head: 0
>> sect: 0
>> bs: 2048
>> IDE - ob_ide_atapi_drive_ready: 
>> IDE - ob_ide_block_size: block size 800
>> IDE - ob_ide_max_transfer: max_transfer f800
call-method block-size: exception -21 
>> call-method block-size failed with error ffffffdf
>> IDE - ob_ide_open: opening channel 0 unit 130654788
>> IDE DRIVE @7c9a244:
>> unit: 0
>> present: 1
>> type: 1
>> media: 32
>> model: QEMU HARDDISK
>> nr: 0
>> cyl: 40
>> head: 16
>> sect: 63
>> bs: 512
>> IDE - ob_ide_block_size: block size 200
>> IDE - ob_ide_max_transfer: max_transfer 1fe00
call-method block-size: exception -21 
>> call-method block-size failed with error ffffffdf
disk/ieee1275/ofdisk.c:724:disk: can't get block size: 1
  1. The read to ide0 is failing.
>> IDE - ob_ide_open: opening channel 0 unit 130654788
>> IDE DRIVE @7c9a244:
>> unit: 0
>> present: 1
>> type: 1
>> media: 32
>> model: QEMU HARDDISK
>> nr: 0
>> cyl: 40
>> head: 16
>> sect: 63
>> bs: 512
>> IDE - ob_ide_block_size: block size 200
>> IDE - ob_ide_max_transfer: max_transfer 1fe00
>> IDE - ob_ide_read_blocks: fffffcb8 block=0 n=1
>> IDE - ob_ide_read_sectors: block=0 sectors=1
>> MAC-PARTS: macparts_probe 4c55 ?= 4552
>> IDE - ob_ide_read_blocks: 7d18fcc block=2 n=2
>> IDE - ob_ide_read_sectors: block=2 sectors=2
>> IDE - ob_ide_read_blocks: 7d19404 block=2 n=2
>> IDE - ob_ide_read_sectors: block=2 sectors=2
>> IDE - ob_ide_read_blocks: 7d1983c block=2 n=2
>> IDE - ob_ide_read_sectors: block=2 sectors=2
>> IDE - ob_ide_read_blocks: fffff428 block=64 n=4
>> IDE - ob_ide_read_sectors: block=64 sectors=4
>> Unknown filesystem type
kern/disk.c:386:disk: ieee1275/ide0 read failed
kern/disk.c:299:disk: Closing `ieee1275/ide0'.
error: [12] can't open device.

The "Unknown filesystem type" leads me to suspect that the read is failing because OpenBIOS isn't detecting a known filesystem. And I see that OpenBIOS supports reading from various filesystems. I'm not sure why this should matter as GRUB should be reading from a block device and the firmware should not care if there is a valid filesystem there or not.

@crass crass changed the title ppc: block-size method failing ppc: block-size method failing and failing to read disk Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant