* [PATCH v2] ppc/pnv: Add a HIOMAP erase command
@ 2020-08-20 16:46 Cédric Le Goater
2020-08-20 17:10 ` no-reply
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Cédric Le Goater @ 2020-08-20 16:46 UTC (permalink / raw)
To: David Gibson
Cc: Corey Minyard, Andrew Jeffery, qemu-devel, Klaus Heinrich Kiwi,
qemu-ppc, Cédric Le Goater, Joel Stanley
The OPAL test suite runs a read-erase-write test on the PNOR :
https://github.com/open-power/op-test/blob/master/testcases/OpTestPNOR.py
which revealed that the IPMI HIOMAP handlers didn't support
HIOMAP_C_ERASE. Implement the sector erase command by writing 0xFF in
the PNOR memory region.
Cc: Corey Minyard <cminyard@mvista.com>
Reported-by: Klaus Heinrich Kiwi <klaus@linux.vnet.ibm.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
Changes in v2:
- Introduced IPMI_CC_UNSPECIFIED as suggested by Corey.
include/hw/ipmi/ipmi.h | 1 +
hw/ppc/pnv_bmc.c | 29 ++++++++++++++++++++++++++++-
2 files changed, 29 insertions(+), 1 deletion(-)
diff --git a/include/hw/ipmi/ipmi.h b/include/hw/ipmi/ipmi.h
index 8a99d958bbc3..c1efdaa4cb42 100644
--- a/include/hw/ipmi/ipmi.h
+++ b/include/hw/ipmi/ipmi.h
@@ -53,6 +53,7 @@ enum ipmi_op {
#define IPMI_CC_INVALID_DATA_FIELD 0xcc
#define IPMI_CC_BMC_INIT_IN_PROGRESS 0xd2
#define IPMI_CC_COMMAND_NOT_SUPPORTED 0xd5
+#define IPMI_CC_UNSPECIFIED 0xff
#define IPMI_NETFN_APP 0x06
#define IPMI_NETFN_OEM 0x3a
diff --git a/hw/ppc/pnv_bmc.c b/hw/ppc/pnv_bmc.c
index 2e1a03daa45a..67ebb16c4d5f 100644
--- a/hw/ppc/pnv_bmc.c
+++ b/hw/ppc/pnv_bmc.c
@@ -140,6 +140,27 @@ static uint16_t bytes_to_blocks(uint32_t bytes)
return bytes >> BLOCK_SHIFT;
}
+static uint32_t blocks_to_bytes(uint16_t blocks)
+{
+ return blocks << BLOCK_SHIFT;
+}
+
+static int hiomap_erase(PnvPnor *pnor, uint32_t offset, uint32_t size)
+{
+ MemTxResult result;
+ int i;
+
+ for (i = 0; i < size / 4; i++) {
+ result = memory_region_dispatch_write(&pnor->mmio, offset + i * 4,
+ 0xFFFFFFFF, MO_32,
+ MEMTXATTRS_UNSPECIFIED);
+ if (result != MEMTX_OK) {
+ return -1;
+ }
+ }
+ return 0;
+}
+
static void hiomap_cmd(IPMIBmcSim *ibs, uint8_t *cmd, unsigned int cmd_len,
RspBuffer *rsp)
{
@@ -155,10 +176,16 @@ static void hiomap_cmd(IPMIBmcSim *ibs, uint8_t *cmd, unsigned int cmd_len,
switch (cmd[2]) {
case HIOMAP_C_MARK_DIRTY:
case HIOMAP_C_FLUSH:
- case HIOMAP_C_ERASE:
case HIOMAP_C_ACK:
break;
+ case HIOMAP_C_ERASE:
+ if (hiomap_erase(pnor, blocks_to_bytes(cmd[5] << 8 | cmd[4]),
+ blocks_to_bytes(cmd[7] << 8 | cmd[6]))) {
+ rsp_buffer_set_error(rsp, IPMI_CC_UNSPECIFIED);
+ }
+ break;
+
case HIOMAP_C_GET_INFO:
rsp_buffer_push(rsp, 2); /* Version 2 */
rsp_buffer_push(rsp, BLOCK_SHIFT); /* block size */
--
2.25.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] ppc/pnv: Add a HIOMAP erase command
2020-08-20 16:46 [PATCH v2] ppc/pnv: Add a HIOMAP erase command Cédric Le Goater
@ 2020-08-20 17:10 ` no-reply
2020-08-20 19:18 ` Corey Minyard
2020-08-20 22:54 ` David Gibson
2 siblings, 0 replies; 4+ messages in thread
From: no-reply @ 2020-08-20 17:10 UTC (permalink / raw)
To: clg; +Cc: cminyard, andrew, qemu-devel, joel, klaus, qemu-ppc, clg, david
Patchew URL: https://patchew.org/QEMU/20200820164638.2515681-1-clg@kaod.org/
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 ===
TEST check-unit: tests/test-char
Unexpected error in object_property_try_add() at /tmp/qemu-test/src/qom/object.c:1181:
attempt to add duplicate property 'serial-id' to object (type 'container')
ERROR test-char - too few tests run (expected 38, got 9)
make: *** [check-unit] Error 1
make: *** Waiting for unfinished jobs....
TEST iotest-qcow2: 022
qemu-system-aarch64: -accel kvm: invalid accelerator kvm
---
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=9b915b0b5b124c569a040fe67b2df63e', '-u', '1003', '--security-opt', 'seccomp=unconfined', '--rm', '-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/patchew2/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-ophh_x_b/src/docker-src.2020-08-20-12.54.46.21615:/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=9b915b0b5b124c569a040fe67b2df63e
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-ophh_x_b/src'
make: *** [docker-run-test-quick@centos7] Error 2
real 15m49.441s
user 0m9.265s
The full log is available at
http://patchew.org/logs/20200820164638.2515681-1-clg@kaod.org/testing.docker-quick@centos7/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] ppc/pnv: Add a HIOMAP erase command
2020-08-20 16:46 [PATCH v2] ppc/pnv: Add a HIOMAP erase command Cédric Le Goater
2020-08-20 17:10 ` no-reply
@ 2020-08-20 19:18 ` Corey Minyard
2020-08-20 22:54 ` David Gibson
2 siblings, 0 replies; 4+ messages in thread
From: Corey Minyard @ 2020-08-20 19:18 UTC (permalink / raw)
To: Cédric Le Goater
Cc: Corey Minyard, Andrew Jeffery, qemu-devel, Klaus Heinrich Kiwi,
qemu-ppc, Joel Stanley, David Gibson
On Thu, Aug 20, 2020 at 06:46:38PM +0200, Cédric Le Goater wrote:
> The OPAL test suite runs a read-erase-write test on the PNOR :
>
> https://github.com/open-power/op-test/blob/master/testcases/OpTestPNOR.py
>
> which revealed that the IPMI HIOMAP handlers didn't support
> HIOMAP_C_ERASE. Implement the sector erase command by writing 0xFF in
> the PNOR memory region.
>
> Cc: Corey Minyard <cminyard@mvista.com>
> Reported-by: Klaus Heinrich Kiwi <klaus@linux.vnet.ibm.com>
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
Thanks a bunch.
Acked-by: Corey Minyard <cminyard@mvista.com>
> ---
>
> Changes in v2:
>
> - Introduced IPMI_CC_UNSPECIFIED as suggested by Corey.
>
> include/hw/ipmi/ipmi.h | 1 +
> hw/ppc/pnv_bmc.c | 29 ++++++++++++++++++++++++++++-
> 2 files changed, 29 insertions(+), 1 deletion(-)
>
> diff --git a/include/hw/ipmi/ipmi.h b/include/hw/ipmi/ipmi.h
> index 8a99d958bbc3..c1efdaa4cb42 100644
> --- a/include/hw/ipmi/ipmi.h
> +++ b/include/hw/ipmi/ipmi.h
> @@ -53,6 +53,7 @@ enum ipmi_op {
> #define IPMI_CC_INVALID_DATA_FIELD 0xcc
> #define IPMI_CC_BMC_INIT_IN_PROGRESS 0xd2
> #define IPMI_CC_COMMAND_NOT_SUPPORTED 0xd5
> +#define IPMI_CC_UNSPECIFIED 0xff
>
> #define IPMI_NETFN_APP 0x06
> #define IPMI_NETFN_OEM 0x3a
> diff --git a/hw/ppc/pnv_bmc.c b/hw/ppc/pnv_bmc.c
> index 2e1a03daa45a..67ebb16c4d5f 100644
> --- a/hw/ppc/pnv_bmc.c
> +++ b/hw/ppc/pnv_bmc.c
> @@ -140,6 +140,27 @@ static uint16_t bytes_to_blocks(uint32_t bytes)
> return bytes >> BLOCK_SHIFT;
> }
>
> +static uint32_t blocks_to_bytes(uint16_t blocks)
> +{
> + return blocks << BLOCK_SHIFT;
> +}
> +
> +static int hiomap_erase(PnvPnor *pnor, uint32_t offset, uint32_t size)
> +{
> + MemTxResult result;
> + int i;
> +
> + for (i = 0; i < size / 4; i++) {
> + result = memory_region_dispatch_write(&pnor->mmio, offset + i * 4,
> + 0xFFFFFFFF, MO_32,
> + MEMTXATTRS_UNSPECIFIED);
> + if (result != MEMTX_OK) {
> + return -1;
> + }
> + }
> + return 0;
> +}
> +
> static void hiomap_cmd(IPMIBmcSim *ibs, uint8_t *cmd, unsigned int cmd_len,
> RspBuffer *rsp)
> {
> @@ -155,10 +176,16 @@ static void hiomap_cmd(IPMIBmcSim *ibs, uint8_t *cmd, unsigned int cmd_len,
> switch (cmd[2]) {
> case HIOMAP_C_MARK_DIRTY:
> case HIOMAP_C_FLUSH:
> - case HIOMAP_C_ERASE:
> case HIOMAP_C_ACK:
> break;
>
> + case HIOMAP_C_ERASE:
> + if (hiomap_erase(pnor, blocks_to_bytes(cmd[5] << 8 | cmd[4]),
> + blocks_to_bytes(cmd[7] << 8 | cmd[6]))) {
> + rsp_buffer_set_error(rsp, IPMI_CC_UNSPECIFIED);
> + }
> + break;
> +
> case HIOMAP_C_GET_INFO:
> rsp_buffer_push(rsp, 2); /* Version 2 */
> rsp_buffer_push(rsp, BLOCK_SHIFT); /* block size */
> --
> 2.25.4
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] ppc/pnv: Add a HIOMAP erase command
2020-08-20 16:46 [PATCH v2] ppc/pnv: Add a HIOMAP erase command Cédric Le Goater
2020-08-20 17:10 ` no-reply
2020-08-20 19:18 ` Corey Minyard
@ 2020-08-20 22:54 ` David Gibson
2 siblings, 0 replies; 4+ messages in thread
From: David Gibson @ 2020-08-20 22:54 UTC (permalink / raw)
To: Cédric Le Goater
Cc: Corey Minyard, Andrew Jeffery, qemu-devel, Klaus Heinrich Kiwi,
qemu-ppc, Joel Stanley
[-- Attachment #1: Type: text/plain, Size: 3315 bytes --]
On Thu, Aug 20, 2020 at 06:46:38PM +0200, Cédric Le Goater wrote:
> The OPAL test suite runs a read-erase-write test on the PNOR :
>
> https://github.com/open-power/op-test/blob/master/testcases/OpTestPNOR.py
>
> which revealed that the IPMI HIOMAP handlers didn't support
> HIOMAP_C_ERASE. Implement the sector erase command by writing 0xFF in
> the PNOR memory region.
>
> Cc: Corey Minyard <cminyard@mvista.com>
> Reported-by: Klaus Heinrich Kiwi <klaus@linux.vnet.ibm.com>
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> ---
>
> Changes in v2:
>
> - Introduced IPMI_CC_UNSPECIFIED as suggested by Corey.
Applied to ppc-for-5.2 (replacing v1).
>
> include/hw/ipmi/ipmi.h | 1 +
> hw/ppc/pnv_bmc.c | 29 ++++++++++++++++++++++++++++-
> 2 files changed, 29 insertions(+), 1 deletion(-)
>
> diff --git a/include/hw/ipmi/ipmi.h b/include/hw/ipmi/ipmi.h
> index 8a99d958bbc3..c1efdaa4cb42 100644
> --- a/include/hw/ipmi/ipmi.h
> +++ b/include/hw/ipmi/ipmi.h
> @@ -53,6 +53,7 @@ enum ipmi_op {
> #define IPMI_CC_INVALID_DATA_FIELD 0xcc
> #define IPMI_CC_BMC_INIT_IN_PROGRESS 0xd2
> #define IPMI_CC_COMMAND_NOT_SUPPORTED 0xd5
> +#define IPMI_CC_UNSPECIFIED 0xff
>
> #define IPMI_NETFN_APP 0x06
> #define IPMI_NETFN_OEM 0x3a
> diff --git a/hw/ppc/pnv_bmc.c b/hw/ppc/pnv_bmc.c
> index 2e1a03daa45a..67ebb16c4d5f 100644
> --- a/hw/ppc/pnv_bmc.c
> +++ b/hw/ppc/pnv_bmc.c
> @@ -140,6 +140,27 @@ static uint16_t bytes_to_blocks(uint32_t bytes)
> return bytes >> BLOCK_SHIFT;
> }
>
> +static uint32_t blocks_to_bytes(uint16_t blocks)
> +{
> + return blocks << BLOCK_SHIFT;
> +}
> +
> +static int hiomap_erase(PnvPnor *pnor, uint32_t offset, uint32_t size)
> +{
> + MemTxResult result;
> + int i;
> +
> + for (i = 0; i < size / 4; i++) {
> + result = memory_region_dispatch_write(&pnor->mmio, offset + i * 4,
> + 0xFFFFFFFF, MO_32,
> + MEMTXATTRS_UNSPECIFIED);
> + if (result != MEMTX_OK) {
> + return -1;
> + }
> + }
> + return 0;
> +}
> +
> static void hiomap_cmd(IPMIBmcSim *ibs, uint8_t *cmd, unsigned int cmd_len,
> RspBuffer *rsp)
> {
> @@ -155,10 +176,16 @@ static void hiomap_cmd(IPMIBmcSim *ibs, uint8_t *cmd, unsigned int cmd_len,
> switch (cmd[2]) {
> case HIOMAP_C_MARK_DIRTY:
> case HIOMAP_C_FLUSH:
> - case HIOMAP_C_ERASE:
> case HIOMAP_C_ACK:
> break;
>
> + case HIOMAP_C_ERASE:
> + if (hiomap_erase(pnor, blocks_to_bytes(cmd[5] << 8 | cmd[4]),
> + blocks_to_bytes(cmd[7] << 8 | cmd[6]))) {
> + rsp_buffer_set_error(rsp, IPMI_CC_UNSPECIFIED);
> + }
> + break;
> +
> case HIOMAP_C_GET_INFO:
> rsp_buffer_push(rsp, 2); /* Version 2 */
> rsp_buffer_push(rsp, BLOCK_SHIFT); /* block size */
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-08-21 0:06 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-20 16:46 [PATCH v2] ppc/pnv: Add a HIOMAP erase command Cédric Le Goater
2020-08-20 17:10 ` no-reply
2020-08-20 19:18 ` Corey Minyard
2020-08-20 22:54 ` David Gibson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.