au-ts / sddf

A collection of interfaces, libraries and tools for writing device drivers for seL4 that allow accessing devices securely and with low overhead.
Other
17 stars 14 forks source link

Various fixes to block subsystem #223

Open erichchan999 opened 2 weeks ago

erichchan999 commented 2 weeks ago

This PR changes blk virt to use io addresses from client data regions instead of the one shared with the driver. Refer to commit message for more details.

Note: I haven't been able to test this on the hardware examples in examples/mmc

Ivan-Velickovic commented 2 weeks ago

Thanks for the detailed commit message, just for next time can you wrap the lines to 80-100 characters? It just makes it easier to read it on the command line with git log etc.

Cheng-Li1 commented 2 weeks ago

Hello, I have submitted a fix that removes a redundant check of whether cli_offset is aligned to BLK_TRANSFER_SIZE in virt.c. As the request should be considered as valid even if the cli_offset is not aligned to BLK_TRANSFER_SIZE.

erichchan999 commented 2 weeks ago

Hello, I have submitted a fix that removes a redundant check of whether cli_offset is aligned to BLK_TRANSFER_SIZE in virt.c. As the request should be considered as valid even if the cli_offset is not aligned to BLK_TRANSFER_SIZE.

Yes I thought this was true initially and made a commit to change this, but turns out some block devices do care whether paddrs are sector aligned. So will add the check back

midnightveil commented 2 weeks ago

Tested to still work with the MMC example on the imx8mm_evk.

Cheng-Li1 commented 2 weeks ago

Hello, I have submitted a fix that removes a redundant check of whether cli_offset is aligned to BLK_TRANSFER_SIZE in virt.c. As the request should be considered as valid even if the cli_offset is not aligned to BLK_TRANSFER_SIZE.

Yes I thought this was true initially and made a commit to change this, but turns out some block devices do care whether paddrs are sector aligned. So will add the check back

Right, if the addr has to be strict aligned to word or page, one copy is probably needed. I am not sure where should this copy happen though.

erichchan999 commented 2 weeks ago

Seems like dma address alignment has more complications than I thought. Will create an issue and address it in a separate PR, for ease of tracking and simplicity. #225

Edit: Page alignment. Included here.

erichchan999 commented 1 week ago

Previously removed ERR_SEEK status code, but adding it back here. It's needed because block devices can fail accessing data due to physical defect reasons. This is could be electrical/physical connection issues , or especially the case for HDDs which has a read/write head that can have mechanical failure when it spins across the platters to access data etc.

Ivan-Velickovic commented 1 week ago

Previously removed ERR_SEEK status code, but adding it back here. It's needed because block devices can fail accessing data due to physical defect reasons. This is could be electrical/physical connection issues , or especially the case for HDDs which has a read/write head that can have mechanical failure when it spins across the platters to access data etc.

IOERR would be better then I think. SEEK still seems to specific.