Re: [PATCH v10 4/7] dax: introduce DAX_RECOVERY_WRITE dax access mode

2022-05-16 Thread Vivek Goyal
On Fri, May 13, 2022 at 02:55:59PM -0700, Dan Williams wrote: > From: Jane Chu > > Up till now, dax_direct_access() is used implicitly for normal > access, but for the purpose of recovery write, dax range with > poison is requested. To make the interface clear, introduce > enum dax_access_

[dm-devel] [PATCH v4 01/13] block: make blkdev_nr_zones and blk_queue_zone_no generic for npo2 zsze

2022-05-16 Thread Pankaj Raghav
Adapt blkdev_nr_zones and blk_queue_zone_no function so that it can also work for non-power-of-2 zone sizes. As the existing deployments of zoned devices had power-of-2 assumption, power-of-2 optimized calculation is kept for those devices. There are no direct hot paths modified and the changes j

[dm-devel] [PATCH v4 04/13] nvmet: Allow ZNS target to support non-power_of_2 zone sizes

2022-05-16 Thread Pankaj Raghav
A generic bdev_zone_no helper is added to calculate zone number for a given sector in a block device. This helper internally uses blk_queue_zone_no to find the zone number. Use the helper bdev_zone_no() to calculate nr of zones. This let's us make modifications to the math if needed in one place a

[dm-devel] [PATCH v4 00/13] support non power of 2 zoned devices

2022-05-16 Thread Pankaj Raghav
- Background and Motivation: The zone storage implementation in Linux, introduced since v4.10, first targetted SMR drives which have a power of 2 (po2) zone size alignment requirement. The po2 zone size was further imposed implicitly by the block layer's blk_queue_chunk_sectors(), used to prevent

[dm-devel] [PATCH v4 02/13] block: allow blk-zoned devices to have non-power-of-2 zone size

2022-05-16 Thread Pankaj Raghav
Checking if a given sector is aligned to a zone is a common operation that is performed for zoned devices. Add blk_queue_is_zone_start helper to check for this instead of opencoding it everywhere. Convert the calculations on zone size to be generic instead of relying on power_of_2 based logic in t

[dm-devel] [PATCH v4 03/13] nvme: zns: Allow ZNS drives that have non-power_of_2 zone size

2022-05-16 Thread Pankaj Raghav
Remove the condition which disallows non-power_of_2 zone size ZNS drive to be updated and use generic method to calculate number of zones instead of relying on log and shift based calculation on zone size. The power_of_2 calculation has been replaced directly with generic calculation without speci

[dm-devel] [PATCH v4 01/13] block: make blkdev_nr_zones and blk_queue_zone_no generic for npo2 zsze

2022-05-16 Thread Pankaj Raghav
Adapt blkdev_nr_zones and blk_queue_zone_no function so that it can also work for non-power-of-2 zone sizes. As the existing deployments of zoned devices had power-of-2 assumption, power-of-2 optimized calculation is kept for those devices. There are no direct hot paths modified and the changes j

[dm-devel] [PATCH v4 00/13] support non power of 2 zoned devices

2022-05-16 Thread Pankaj Raghav
- Background and Motivation: The zone storage implementation in Linux, introduced since v4.10, first targetted SMR drives which have a power of 2 (po2) zone size alignment requirement. The po2 zone size was further imposed implicitly by the block layer's blk_queue_chunk_sectors(), used to prevent

[dm-devel] [PATCH v4 05/13] btrfs: zoned: Cache superblock location in btrfs_zoned_device_info

2022-05-16 Thread Pankaj Raghav
Instead of calculating the superblock location every time, cache the superblock zone location in btrfs_zoned_device_info struct and use it to locate the zone index. The functions such as btrfs_sb_log_location_bdev() and btrfs_reset_sb_log_zones() which work directly on block_device shall continue

[dm-devel] [PATCH v4 07/13] btrfs: zoned: use generic btrfs zone helpers to support npo2 zoned devices

2022-05-16 Thread Pankaj Raghav
Add helpers to calculate alignment, round up and round down for zoned devices. These helpers encapsulates the necessary handling for power_of_2 and non-power_of_2 zone sizes. Optimized calculations are performed for zone sizes that are power_of_2 with log and shifts. btrfs_zoned_is_aligned() is ad

[dm-devel] [PATCH v4 09/13] btrfs: zoned: relax the alignment constraint for zoned devices

2022-05-16 Thread Pankaj Raghav
Checks were in place to return error when a non power-of-2 zoned devices is detected. Remove those checks as non power-of-2 zoned devices are now supported. Relax the zone size constraint to align with a sane default of 1MB. This 1M default has been chosen as the minimum alignment requirement for

[dm-devel] [PATCH v4 03/13] nvme: zns: Allow ZNS drives that have non-power_of_2 zone size

2022-05-16 Thread Pankaj Raghav
Remove the condition which disallows non-power_of_2 zone size ZNS drive to be updated and use generic method to calculate number of zones instead of relying on log and shift based calculation on zone size. The power_of_2 calculation has been replaced directly with generic calculation without speci

[dm-devel] [PATCH v4 08/13] btrfs:zoned: make sb for npo2 zone devices align with sb log offsets

2022-05-16 Thread Pankaj Raghav
Superblocks for zoned devices are fixed as 2 zones at 0, 512GB and 4TB. These are fixed at these locations so that recovery tools can reliably retrieve the superblocks even if one of the mirror gets corrupted. power of 2 zone sizes align at these offsets irrespective of their value but non power o

[dm-devel] [PATCH v4 06/13] btrfs: zoned: Make sb_zone_number function non power of 2 compatible

2022-05-16 Thread Pankaj Raghav
Make the calculation in sb_zone_number function to be generic and work for both power-of-2 and non power-of-2 zone sizes. The function signature has been modified to take block device and mirror as input as this function is only invoked from callers that have access to the block device. This enabl

[dm-devel] [PATCH v4 10/13] zonefs: allow non power of 2 zoned devices

2022-05-16 Thread Pankaj Raghav
The zone size shift variable is useful only if the zone sizes are known to be power of 2. Remove that variable and use generic helpers from block layer to calculate zone index in zonefs. Reviewed-by: Luis Chamberlain Signed-off-by: Pankaj Raghav --- fs/zonefs/super.c | 6 ++ fs/zonefs/zone

[dm-devel] [PATCH v4 13/13] dm-zoned: ensure only power of 2 zone sizes are allowed

2022-05-16 Thread Pankaj Raghav
From: Luis Chamberlain Today dm-zoned relies on the assumption that you have a zone size with a power of 2. Even though the block layer today enforces this requirement, these devices do exist and so provide a stop-gap measure to ensure these devices cannot be used by mistake Reviewed-by: Hannes

[dm-devel] [PATCH v4 04/13] nvmet: Allow ZNS target to support non-power_of_2 zone sizes

2022-05-16 Thread Pankaj Raghav
A generic bdev_zone_no helper is added to calculate zone number for a given sector in a block device. This helper internally uses blk_queue_zone_no to find the zone number. Use the helper bdev_zone_no() to calculate nr of zones. This let's us make modifications to the math if needed in one place a

[dm-devel] [PATCH v4 02/13] block: allow blk-zoned devices to have non-power-of-2 zone size

2022-05-16 Thread Pankaj Raghav
Checking if a given sector is aligned to a zone is a common operation that is performed for zoned devices. Add blk_queue_is_zone_start helper to check for this instead of opencoding it everywhere. Convert the calculations on zone size to be generic instead of relying on power_of_2 based logic in t

[dm-devel] [PATCH v4 12/13] null_blk: use zone_size_sects_shift for power of 2 zoned devices

2022-05-16 Thread Pankaj Raghav
Instead of doing is_power_of_2 and ilog2 operation for every IO, cache the zone_size_sects_shift variable and use it for power of 2 zoned devices. This variable will be set to zero for non power of 2 zoned devices. Suggested-by: Damien Le Moal Signed-off-by: Pankaj Raghav --- drivers/block/nul

[dm-devel] [PATCH v4 11/13] null_blk: allow non power of 2 zoned devices

2022-05-16 Thread Pankaj Raghav
Convert the power of 2 based calculation with zone size to be generic in null_zone_no with optimization for power of 2 based zone sizes. The nr_zones calculation in null_init_zoned_dev has been replaced with a division without special handling for power of 2 based zone sizes as this function is ca

Re: [dm-devel] [PATCH v3 2/3] LoadPin: Enable loading from trusted dm-verity devices

2022-05-16 Thread Matthias Kaehlcke
Hi Kees, thanks for the review! On Fri, May 13, 2022 at 03:36:26PM -0700, Kees Cook wrote: > > > On May 4, 2022 12:54:18 PM PDT, Matthias Kaehlcke wrote: > >Extend LoadPin to allow loading of kernel files from trusted dm-verity [1] > >devices. > > > >This change adds the concept of trusted ver

Re: [dm-devel] [PATCH v3 1/3] dm: Add verity helpers for LoadPin

2022-05-16 Thread Matthias Kaehlcke
On Fri, May 13, 2022 at 03:15:53PM -0700, Kees Cook wrote: > > > On May 4, 2022 12:54:17 PM PDT, Matthias Kaehlcke wrote: > >LoadPin limits loading of kernel modules, firmware and certain > >other files to a 'pinned' file system (typically a read-only > >rootfs). To provide more flexibility Load

Re: [dm-devel] [PATCH v4 02/13] block: allow blk-zoned devices to have non-power-of-2 zone size

2022-05-16 Thread Pankaj Raghav
Hi Damien, I copied your comments from the previous thread to avoid confusion. On 2022-05-16 16:00, Damien Le Moal wrote: > On 2022/05/16 15:39, Pankaj Raghav wrote: >> Checking if a given sector is aligned to a zone is a common >> operation that is performed for zoned devices. Add >> blk_queue_i

Re: [PATCH v9 2/7] x86/mce: relocate set{clear}_mce_nospec() functions

2022-05-16 Thread Dan Williams
On Fri, Apr 22, 2022 at 3:46 PM Jane Chu wrote: > > Relocate the twin mce functions to arch/x86/mm/pat/set_memory.c > file where they belong. > > While at it, fixup a function name in a comment. > > Reviewed-by: Christoph Hellwig > Reviewed-by: Dan Williams > Signed-off-by: Jane Chu > --- > ar

Re: [dm-devel] [PATCH v4 05/13] btrfs: zoned: Cache superblock location in btrfs_zoned_device_info

2022-05-16 Thread David Sterba
On Mon, May 16, 2022 at 06:54:08PM +0200, Pankaj Raghav wrote: > Instead of calculating the superblock location every time, cache the > superblock zone location in btrfs_zoned_device_info struct and use it to > locate the zone index. > > The functions such as btrfs_sb_log_location_bdev() and > btr

Re: [dm-devel] [PATCH v3 1/3] dm: Add verity helpers for LoadPin

2022-05-16 Thread Kees Cook
On Mon, May 16, 2022 at 11:51:54AM -0700, Matthias Kaehlcke wrote: > 'targets' are different types of DM mappings like 'linear' or 'verity'. A > device mapper table contains has one or more targets that define the mapping > of the blocks of the mapped device. > > Having spelled that out I realize

Re: [dm-devel] [PATCH v3 2/3] LoadPin: Enable loading from trusted dm-verity devices

2022-05-16 Thread Kees Cook
On Mon, May 16, 2022 at 11:17:44AM -0700, Matthias Kaehlcke wrote: > On Fri, May 13, 2022 at 03:36:26PM -0700, Kees Cook wrote: > > > > > > On May 4, 2022 12:54:18 PM PDT, Matthias Kaehlcke wrote: > > >Extend LoadPin to allow loading of kernel files from trusted dm-verity [1] > > >devices. > > >

Re: [dm-devel] [PATCH v4 11/13] null_blk: allow non power of 2 zoned devices

2022-05-16 Thread kernel test robot
Hi Pankaj, Thank you for the patch! Yet something to improve: [auto build test ERROR on next-20220516] [also build test ERROR on v5.18-rc7] [cannot apply to axboe-block/for-next kdave/for-next device-mapper-dm/for-next linus/master v5.18-rc7 v5.18-rc6 v5.18-rc5] [If your patch is applied to the

Re: [dm-devel] [PATCH v4 00/13] support non power of 2 zoned devices

2022-05-16 Thread notnand
My mail server got messed up for some reason because of the number of people in cc. I will send the whole patch series again in some time as I am traveling now. Sorry about that. On Mon, 16 May 2022, 16:20 Damien Le Moal, wrote: > On 2022/05/16 15:39, Pankaj Raghav wrote: > [...] > > - Patchset