All of lore.kernel.org
 help / color / mirror / Atom feed
* efi_loader breakage
@ 2022-04-26 17:07 Mark Kettenis
  2022-04-27  4:48 ` AKASHI Takahiro
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Kettenis @ 2022-04-26 17:07 UTC (permalink / raw)
  To: takahiro.akashi, sjg; +Cc: xypron.glpk, u-boot

commit d97e98c887ed8fa4a339350c02f093f03cd1cf4d breaks the OpenBSD
bootloader.  Or rather, it seems that this breaks access to raw
devices through the UEFI interfaces, which is something the OpenBSD
bootloader relies on.

After this commit we end up calling dev_read() and dev_write() instead
of blk_dread() and blk_dwrite().  But dev_read() and dev_write() only
work if dev_get_blk() returns a valid struct blkdev, and that handles
only for UCLASS_PARTITION.  But when accessing raw devices we have a
UCLASS_BLK.

The easy fix would be to support UCLASS_BLK in dev_get_blk(), but that
function has an explicit comment saying:

        /*
         * We won't support UCLASS_BLK with dev_* interfaces.
         */
			  
So I'm a bit at a loss what is needed here.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: efi_loader breakage
  2022-04-26 17:07 efi_loader breakage Mark Kettenis
@ 2022-04-27  4:48 ` AKASHI Takahiro
  2022-04-27  7:26   ` AKASHI Takahiro
  0 siblings, 1 reply; 4+ messages in thread
From: AKASHI Takahiro @ 2022-04-27  4:48 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: sjg, xypron.glpk, u-boot

On Tue, Apr 26, 2022 at 07:07:13PM +0200, Mark Kettenis wrote:
> commit d97e98c887ed8fa4a339350c02f093f03cd1cf4d breaks the OpenBSD
> bootloader.  Or rather, it seems that this breaks access to raw
> devices through the UEFI interfaces, which is something the OpenBSD
> bootloader relies on.
> 
> After this commit we end up calling dev_read() and dev_write() instead
> of blk_dread() and blk_dwrite().  But dev_read() and dev_write() only
> work if dev_get_blk() returns a valid struct blkdev, and that handles
> only for UCLASS_PARTITION.  But when accessing raw devices we have a
> UCLASS_BLK.

Probably I forgot this use case.

> The easy fix would be to support UCLASS_BLK in dev_get_blk(), but that
> function has an explicit comment saying:

The best way to do is to modify efi_disk_rw_blocks().

-Takahiro Akashi

>         /*
>          * We won't support UCLASS_BLK with dev_* interfaces.
>          */
> 			  
> So I'm a bit at a loss what is needed here.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: efi_loader breakage
  2022-04-27  4:48 ` AKASHI Takahiro
@ 2022-04-27  7:26   ` AKASHI Takahiro
  2022-04-27  9:31     ` Mark Kettenis
  0 siblings, 1 reply; 4+ messages in thread
From: AKASHI Takahiro @ 2022-04-27  7:26 UTC (permalink / raw)
  To: Mark Kettenis, sjg, xypron.glpk, u-boot

On Wed, Apr 27, 2022 at 01:48:13PM +0900, AKASHI Takahiro wrote:
> On Tue, Apr 26, 2022 at 07:07:13PM +0200, Mark Kettenis wrote:
> > commit d97e98c887ed8fa4a339350c02f093f03cd1cf4d breaks the OpenBSD
> > bootloader.  Or rather, it seems that this breaks access to raw
> > devices through the UEFI interfaces, which is something the OpenBSD
> > bootloader relies on.
> > 
> > After this commit we end up calling dev_read() and dev_write() instead
> > of blk_dread() and blk_dwrite().  But dev_read() and dev_write() only
> > work if dev_get_blk() returns a valid struct blkdev, and that handles
> > only for UCLASS_PARTITION.  But when accessing raw devices we have a
> > UCLASS_BLK.
> 
> Probably I forgot this use case.
> 
> > The easy fix would be to support UCLASS_BLK in dev_get_blk(), but that
> > function has an explicit comment saying:
> 
> The best way to do is to modify efi_disk_rw_blocks().

I have already made necessary changes, but found another problem
(not relating to my patch) in device path handling.

So I will post the patch once I fix the latter issue as well.

-Takahiro Akashi


> -Takahiro Akashi
> 
> >         /*
> >          * We won't support UCLASS_BLK with dev_* interfaces.
> >          */
> > 			  
> > So I'm a bit at a loss what is needed here.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: efi_loader breakage
  2022-04-27  7:26   ` AKASHI Takahiro
@ 2022-04-27  9:31     ` Mark Kettenis
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Kettenis @ 2022-04-27  9:31 UTC (permalink / raw)
  To: AKASHI Takahiro; +Cc: takahiro.akashi, sjg, xypron.glpk, u-boot

> Date: Wed, 27 Apr 2022 16:26:25 +0900
> From: AKASHI Takahiro <takahiro.akashi@linaro.org>
> 
> On Wed, Apr 27, 2022 at 01:48:13PM +0900, AKASHI Takahiro wrote:
> > On Tue, Apr 26, 2022 at 07:07:13PM +0200, Mark Kettenis wrote:
> > > commit d97e98c887ed8fa4a339350c02f093f03cd1cf4d breaks the OpenBSD
> > > bootloader.  Or rather, it seems that this breaks access to raw
> > > devices through the UEFI interfaces, which is something the OpenBSD
> > > bootloader relies on.
> > > 
> > > After this commit we end up calling dev_read() and dev_write() instead
> > > of blk_dread() and blk_dwrite().  But dev_read() and dev_write() only
> > > work if dev_get_blk() returns a valid struct blkdev, and that handles
> > > only for UCLASS_PARTITION.  But when accessing raw devices we have a
> > > UCLASS_BLK.
> > 
> > Probably I forgot this use case.
> > 
> > > The easy fix would be to support UCLASS_BLK in dev_get_blk(), but that
> > > function has an explicit comment saying:
> > 
> > The best way to do is to modify efi_disk_rw_blocks().
> 
> I have already made necessary changes, but found another problem
> (not relating to my patch) in device path handling.
> 
> So I will post the patch once I fix the latter issue as well.

Thanks,

Looking forward to a patch to test.

Mark

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-04-27  9:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-26 17:07 efi_loader breakage Mark Kettenis
2022-04-27  4:48 ` AKASHI Takahiro
2022-04-27  7:26   ` AKASHI Takahiro
2022-04-27  9:31     ` Mark Kettenis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.