[RFC PATCH v6 0/2] Add file-backed and write-once features to OTP

Green Wan posted 2 patches 3 years, 7 months ago
Test docker-quick@centos7 failed
Test docker-mingw@fedora passed
Test checkpatch passed
Test FreeBSD passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200928101146.12786-1-green.wan@sifive.com
There is a newer version of this series
hw/misc/sifive_u_otp.c         | 81 +++++++++++++++++++++++++++++++++-
include/hw/misc/sifive_u_otp.h |  5 +++
2 files changed, 85 insertions(+), 1 deletion(-)
[RFC PATCH v6 0/2] Add file-backed and write-once features to OTP
Posted by Green Wan 3 years, 7 months ago
Changelogs:
v5 to v6:
 - Rebase to latest. (sifive_u_otp.* are moved to hw/misc)
 - Put the example command to commit message.
 - Refine errp handle when check backend drive.
 - Remove unnecessary debug message.

v4 to v5:
 - Change the patch order
 - Add write operation to update pdin to fuse[] bit by bit 
 - Fix wrong protection for offset 0x0~0x38
 - Add SIFIVE_U_OTP_PWE_EN definition
 - Refine access macro for fuse[] and fuse_wo[]

Summary of Patches 
 - First patch is to add write opertion to update pdin data to fuse[] bit
   by bit. Add 'write-once' feature to block second write to same bit of
   the OTP memory.

 - Second patch is to add file-backed implementation to allow users to use
   '-drive' to assign an OTP raw image file. OTP image file must be bigger
   than 16K.

       For example, '-drive if=none,format=raw,file=otp.img'

Testing
 - Tested on sifive_u for both qemu and u-boot.

Green Wan (2):
  hw/misc/sifive_u_otp: Add write function and write-once protection
  hw/misc/sifive_u_otp: Add backend drive support

 hw/misc/sifive_u_otp.c         | 81 +++++++++++++++++++++++++++++++++-
 include/hw/misc/sifive_u_otp.h |  5 +++
 2 files changed, 85 insertions(+), 1 deletion(-)

-- 
2.17.1


Re: [RFC PATCH v6 0/2] Add file-backed and write-once features to OTP
Posted by no-reply@patchew.org 3 years, 7 months ago
Patchew URL: https://patchew.org/QEMU/20200928101146.12786-1-green.wan@sifive.com/



Hi,

This series failed the docker-quick@centos7 build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#!/bin/bash
make docker-image-centos7 V=1 NETWORK=1
time make docker-test-quick@centos7 SHOW_ENV=1 J=14 NETWORK=1
=== TEST SCRIPT END ===

C linker for the host machine: cc ld.bfd 2.27-43
Host machine cpu family: x86_64
Host machine cpu: x86_64
../src/meson.build:10: WARNING: Module unstable-keyval has no backwards or forwards compatibility and might not exist in future releases.
Program sh found: YES
Program python3 found: YES (/usr/bin/python3)
Configuring ninjatool using configuration
---
Using expected file 'tests/data/acpi/virt/DSDT.memhp'
socket_accept failed: Resource temporarily unavailable
**
ERROR:../src/tests/qtest/libqtest.c:301:qtest_init_without_qmp_handshake: assertion failed: (s->fd >= 0 && s->qmp_fd >= 0)
../src/tests/qtest/libqtest.c:166: kill_qemu() tried to terminate QEMU process but encountered exit status 1 (expected 0)
ERROR qtest-x86_64: bios-tables-test - Bail out! ERROR:../src/tests/qtest/libqtest.c:301:qtest_init_without_qmp_handshake: assertion failed: (s->fd >= 0 && s->qmp_fd >= 0)
  TEST    iotest-qcow2: 024
make: *** [run-test-138] Error 1
make: *** Waiting for unfinished jobs....
  TEST    iotest-qcow2: 025
  TEST    iotest-qcow2: 027
---
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--rm', '--label', 'com.qemu.instance.uuid=1a4351fb3f90489ebfca763b45f3d5e1', '-u', '1001', '--security-opt', 'seccomp=unconfined', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=1', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-ku3zq5yz/src/docker-src.2020-09-28-07.25.33.19332:/var/tmp/qemu:z,ro', 'qemu/centos7', '/var/tmp/qemu/run', 'test-quick']' returned non-zero exit status 2.
filter=--filter=label=com.qemu.instance.uuid=1a4351fb3f90489ebfca763b45f3d5e1
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-ku3zq5yz/src'
make: *** [docker-run-test-quick@centos7] Error 2

real    17m35.301s
user    0m15.921s


The full log is available at
http://patchew.org/logs/20200928101146.12786-1-green.wan@sifive.com/testing.docker-quick@centos7/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
Re: [RFC PATCH v6 0/2] Add file-backed and write-once features to OTP
Posted by Bin Meng 3 years, 6 months ago
Hi Green,

On Mon, Sep 28, 2020 at 6:11 PM Green Wan <green.wan@sifive.com> wrote:
>
> Changelogs:
> v5 to v6:
>  - Rebase to latest. (sifive_u_otp.* are moved to hw/misc)
>  - Put the example command to commit message.
>  - Refine errp handle when check backend drive.
>  - Remove unnecessary debug message.
>

I will try to test this soon with a modified U-Boot.

Regards,
Bin