Implemented SOMEBITS/MOSTBITS emubd powerloss behavior
These emulate powerloss behavior where only some of the bits being progged are actually progged if there is a powerloss. This behavior was the original motivation for our ecksums/fcrcs, so it's good to have this tested. As a simplification, these only test the extremes: - LFS_EMUBD_POWERLOSS_SOMEBITS => one bit progged - LFS_EMUBD_POWERLOSS_MOSTBITS => all-but-one bit progged Also they flips bits instead of preserving exact partial prog behavior, but this is allowed (progs can have any intermediate value), has the same effect as partial progs, and should encourage failed progs. This required a number of tweaks in emubd: moved powerloss before prog, moved mutate after powerloss, etc, but these shouldn't affect other powerloss behaviors. Handling powerloss after prog was only to avoid power_cycles=1 being useless, it's not strictly required. Good news is testing so far suggests our ecksum design is sound.
This commit is contained in:
@@ -19,6 +19,8 @@ after = [
|
||||
[cases.test_powerloss_dir_many]
|
||||
defines.POWERLOSS_BEHAVIOR = [
|
||||
'LFS_EMUBD_POWERLOSS_NOOP',
|
||||
'LFS_EMUBD_POWERLOSS_SOMEBITS',
|
||||
'LFS_EMUBD_POWERLOSS_MOSTBITS',
|
||||
'LFS_EMUBD_POWERLOSS_OOO',
|
||||
]
|
||||
defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512]
|
||||
@@ -111,6 +113,8 @@ code = '''
|
||||
[cases.test_powerloss_file_many]
|
||||
defines.POWERLOSS_BEHAVIOR = [
|
||||
'LFS_EMUBD_POWERLOSS_NOOP',
|
||||
'LFS_EMUBD_POWERLOSS_SOMEBITS',
|
||||
'LFS_EMUBD_POWERLOSS_MOSTBITS',
|
||||
'LFS_EMUBD_POWERLOSS_OOO',
|
||||
]
|
||||
# inlining has a tendency to hide sync issues, so try without
|
||||
@@ -205,6 +209,8 @@ code = '''
|
||||
[cases.test_powerloss_file_pl_fuzz]
|
||||
defines.POWERLOSS_BEHAVIOR = [
|
||||
'LFS_EMUBD_POWERLOSS_NOOP',
|
||||
'LFS_EMUBD_POWERLOSS_SOMEBITS',
|
||||
'LFS_EMUBD_POWERLOSS_MOSTBITS',
|
||||
'LFS_EMUBD_POWERLOSS_OOO',
|
||||
]
|
||||
# inlining has a tendency to hide sync issues, so try without
|
||||
@@ -429,6 +435,8 @@ code = '''
|
||||
[cases.test_powerloss_filedir_pl_fuzz]
|
||||
defines.POWERLOSS_BEHAVIOR = [
|
||||
'LFS_EMUBD_POWERLOSS_NOOP',
|
||||
'LFS_EMUBD_POWERLOSS_SOMEBITS',
|
||||
'LFS_EMUBD_POWERLOSS_MOSTBITS',
|
||||
'LFS_EMUBD_POWERLOSS_OOO',
|
||||
]
|
||||
# inlining has a tendency to hide sync issues, so try without
|
||||
|
||||
@@ -16865,6 +16865,7 @@ code = '''
|
||||
|
||||
// create a null tag hole
|
||||
rbyd = init_rbyd;
|
||||
lfsr_bd_erase(&lfs, rbyd.blocks[0]) => 0;
|
||||
lfsr_rbyd_commit(&lfs, &rbyd, -1, LFSR_ATTRS(
|
||||
LFSR_ATTR(
|
||||
LFSR_TAG_UATTR(0), 0,
|
||||
@@ -16913,6 +16914,7 @@ code = '''
|
||||
|
||||
// create a null tag hole
|
||||
rbyd = init_rbyd;
|
||||
lfsr_bd_erase(&lfs, rbyd.blocks[0]) => 0;
|
||||
lfsr_rbyd_commit(&lfs, &rbyd, -1, LFSR_ATTRS(
|
||||
LFSR_ATTR(
|
||||
LFSR_TAG_UATTR(0), 0,
|
||||
@@ -16971,6 +16973,7 @@ code = '''
|
||||
|
||||
// create a null tag hole
|
||||
rbyd = init_rbyd;
|
||||
lfsr_bd_erase(&lfs, rbyd.blocks[0]) => 0;
|
||||
lfsr_rbyd_commit(&lfs, &rbyd, -1, LFSR_ATTRS(
|
||||
LFSR_ATTR(
|
||||
LFSR_TAG_UATTR(0), 0,
|
||||
@@ -17028,6 +17031,7 @@ code = '''
|
||||
|
||||
// create a null tag hole
|
||||
rbyd = init_rbyd;
|
||||
lfsr_bd_erase(&lfs, rbyd.blocks[0]) => 0;
|
||||
lfsr_rbyd_commit(&lfs, &rbyd, -1, LFSR_ATTRS(
|
||||
LFSR_ATTR(
|
||||
LFSR_TAG_UATTR(0), 0,
|
||||
@@ -17095,6 +17099,7 @@ code = '''
|
||||
|
||||
// create a null tag hole
|
||||
rbyd = init_rbyd;
|
||||
lfsr_bd_erase(&lfs, rbyd.blocks[0]) => 0;
|
||||
lfsr_rbyd_commit(&lfs, &rbyd, -1, LFSR_ATTRS(
|
||||
LFSR_ATTR(
|
||||
LFSR_TAG_UATTR(0), 0,
|
||||
|
||||
Reference in New Issue
Block a user