Skip to content

Fix the lazy CFI mode switch

Jan Kiszka qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4cfi02: Fix a debug printhw/pflash_cfi02.c+1 -10 replies
2/4Add support for execution from ROMs in IO device modecpu-common.h exec-all.h exec.c+4 -23 replies
3/4cfi: Mark flash memory executablehw/pflash_cfi01.c hw/pflash_cfi02.c+6 -50 replies
4/4cfi02: Use timer-based ROM mode switchhw/pflash_cfi02.c+32 -100 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 0/4] Fix the lazy CFI mode switch

This series addresses the major problem lazy mode switching of the pflash_cfi02 currently has: code execution from this ROM can fail.

The reason for this was a conceptual issue that was papered over by a bug in the original implementation. Both are addressed here by
- allowing code execution from marked I/O memory regions (specifically ROM devices)
- performing the lazy switch back of cfi02 from reprogramming to ROM mode via a timer

To recall why this effort is needed: Programming 7 MB of an 8 MB flash that does not support the unlock bypass command takes 5:40 minutes with this optimization and about 3 h (estimated, it became boring to wait for completion) without it.

Jan Kiszka (4):
cfi02: Fix a debug print
Add support for execution from ROMs in IO device mode
cfi: Mark flash memory executable
cfi02: Use timer-based ROM mode switch

 cpu-common.h      |    2 ++
 exec-all.h        |    2 +-
 exec.c            |    2 +-
 hw/pflash_cfi01.c |    9 +++++----
 hw/pflash_cfi02.c |   46 ++++++++++++++++++++++++++++++++++------------
 5 files changed, 43 insertions(+), 18 deletions(-)