>> + blkcfg.sectors = secs & ~(blk_size / pblk_size - 1);
> I'm not sure here what you mean. Usually blk_size >= pblk_size on
> non-s390 systems, so this is completely different from the previous
> code, which is effectively
I was trying to prevent the masking of the sector number.
the first version of the patch simply did
blkcfg.sectors = secs;
but this broke setups that really need that masking.
> blkcfg.sectors = secs & ~(blk_size / 512 - 1);
> I wonder if s390 gives a different meaning to logical vs. physical
> sector sizes, compared to what virtio expects (which is what SCSI says,
> basically). Physical block sizes on non-s390 systems are really just
> useful as an alignment hint, they do not affect correctness.
Maybe that really points to the problem that we are trying to solve here.
For a dasd device, there is usually a 4096 byte block size and on the host
these 4096 arereported via getss and getpbsz.
The geometry reported by the device driver is usually 15 head and 12 sectors
per track, but actually means 12 sectors of 4096 bytes size (a track ~ 48k).
What I want to achieve is that the guest view is identical to the host view
cyls, heads, secs, and all block sizes.