Skip to contentSkip to conversation

hw/mem/nvdimm: fix error message for 'unarmed' flag

PATCH RESEND Superseded Julia Suvorova 5 participants 6 messages Oct 18, 2022 – Oct 20, 2022

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 hw/mem/nvdimm: fix error message for 'unarmed' flag

In the ACPI specification [1], the 'unarmed' bit is set when a device cannot accept a persistent write. This means that when a memdev is read-only, the 'unarmed' flag must be turned on. The logic is correct, just changing the error message.

[1] ACPI NFIT NVDIMM Region Mapping Structure "NVDIMM State Flags" Bit 3

---
 hw/mem/nvdimm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/mem/nvdimm.c +1 -1
index 7c7d777781..bfb76818c1 100644
@@ -149,7 +149,7 @@ static void nvdimm_prepare_memory_region(NVDIMMDevice *nvdimm, Error **errp)
     if (!nvdimm->unarmed && memory_region_is_rom(mr)) {
         HostMemoryBackend *hostmem = dimm->hostmem;
 
-        error_setg(errp, "'unarmed' property must be off since memdev %s "
+        error_setg(errp, "'unarmed' property must be on since memdev %s "
                    "is read-only",
                    object_get_canonical_path_component(OBJECT(hostmem)));
         return;
Signature · 1 line
2.37.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Julia Suvorova

In the ACPI specification [1], the 'unarmed' bit is set when a device cannot accept a persistent write. This means that when a memdev is read-only, the 'unarmed' flag must be turned on. The logic is correct, just changing the error message.

[1] ACPI NFIT NVDIMM Region Mapping Structure "NVDIMM State Flags" Bit 3

Fixes dbd730e859 ("nvdimm: check -object memory-backend-file, readonly=on option")

The documentation in 'docs/nvdimm.txt' is correct :)

Quoted 11 lines
---
  hw/mem/nvdimm.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
hw/mem/nvdimm.c +0 -0
index 7c7d777781..bfb76818c1 100644

hw/mem/nvdimm.c static void nvdimm_prepare_memory_region(NVDIMMDevice *nvdimm, Error **errp) · line 152

Quoted 5 lines
hw/mem/nvdimm.c +1 -1
@@ -149,7 +149,7 @@ static void nvdimm_prepare_memory_region(NVDIMMDevice *nvdimm, Error **errp)
      if (!nvdimm->unarmed && memory_region_is_rom(mr)) {
          HostMemoryBackend *hostmem = dimm->hostmem;
 
-        error_setg(errp, "'unarmed' property must be off since memdev %s "
+        error_setg(errp, "'unarmed' property must be on since memdev %s "

If you ever respin please quote 'on' for readability.

hw/mem/nvdimm.c static void nvdimm_prepare_memory_region(NVDIMMDevice *nvdimm, Error **errp) · line 155

Quoted 3 lines
hw/mem/nvdimm.c +0 -0
                     "is read-only",
                     object_get_canonical_path_component(OBJECT(hostmem)));
          return;
#2 lore raw
Quoted 20 lines · Philippe Mathieu-Daudé
Quoted 7 lines · Julia Suvorova

In the ACPI specification [1], the 'unarmed' bit is set when a device cannot accept a persistent write. This means that when a memdev is read-only, the 'unarmed' flag must be turned on. The logic is correct, just changing the error message.

[1] ACPI NFIT NVDIMM Region Mapping Structure "NVDIMM State Flags" Bit 3

Fixes dbd730e859 ("nvdimm: check -object memory-backend-file, readonly=on

option")

The documentation in 'docs/nvdimm.txt' is correct :)

Quoted 6 lines
---
  hw/mem/nvdimm.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 11 lines

hw/mem/nvdimm.c static void nvdimm_prepare_memory_region(NVDIMMDevice *nvdimm, Error **errp) · line 151

Quoted 9 lines
hw/mem/nvdimm.c +1 -1
index 7c7d777781..bfb76818c1 100644
@@ -149,7 +149,7 @@ static void nvdimm_prepare_memory_region(NVDIMMDevice *nvdimm, Error **errp)
      if (!nvdimm->unarmed && memory_region_is_rom(mr)) {
          HostMemoryBackend *hostmem = dimm->hostmem;
-        error_setg(errp, "'unarmed' property must be off since memdev %s "
+        error_setg(errp, "'unarmed' property must be on since memdev %s "

If you ever respin please quote 'on' for readability.

Yes make sense. Julia could you change this pls?

Quoted 5 lines

hw/mem/nvdimm.c static void nvdimm_prepare_memory_region(NVDIMMDevice *nvdimm, Error **errp) · line 155

Quoted 3 lines
hw/mem/nvdimm.c +0 -0
                     "is read-only",
                     object_get_canonical_path_component(OBJECT(hostmem)));
          return;
#3 lore raw
Quoted 34 lines · Michael S. Tsirkin
Quoted 20 lines · Philippe Mathieu-Daudé
Quoted 7 lines · Julia Suvorova

In the ACPI specification [1], the 'unarmed' bit is set when a device cannot accept a persistent write. This means that when a memdev is read-only, the 'unarmed' flag must be turned on. The logic is correct, just changing the error message.

[1] ACPI NFIT NVDIMM Region Mapping Structure "NVDIMM State Flags" Bit 3

Fixes dbd730e859 ("nvdimm: check -object memory-backend-file, readonly=on

option")

The documentation in 'docs/nvdimm.txt' is correct :)

Quoted 6 lines
---
   hw/mem/nvdimm.c | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 11 lines

hw/mem/nvdimm.c static void nvdimm_prepare_memory_region(NVDIMMDevice *nvdimm, Error **errp) · line 151

Quoted 9 lines
hw/mem/nvdimm.c +1 -1
index 7c7d777781..bfb76818c1 100644
@@ -149,7 +149,7 @@ static void nvdimm_prepare_memory_region(NVDIMMDevice *nvdimm, Error **errp)
       if (!nvdimm->unarmed && memory_region_is_rom(mr)) {
           HostMemoryBackend *hostmem = dimm->hostmem;
-        error_setg(errp, "'unarmed' property must be off since memdev %s "
+        error_setg(errp, "'unarmed' property must be on since memdev %s "

If you ever respin please quote 'on' for readability.

Quoted 1 line

Yes make sense. Julia could you change this pls?

I can pick this up once resent. I'll most probably send a merge request by the end of next week.

Signature · 3 lines
Thanks,

David / dhildenb
#4 lore raw
In reply to Michael S. Tsirkin
Quoted 35 lines · Michael S. Tsirkin
Quoted 20 lines · Philippe Mathieu-Daudé
Quoted 7 lines · Julia Suvorova

In the ACPI specification [1], the 'unarmed' bit is set when a device cannot accept a persistent write. This means that when a memdev is read-only, the 'unarmed' flag must be turned on. The logic is correct, just changing the error message.

[1] ACPI NFIT NVDIMM Region Mapping Structure "NVDIMM State Flags" Bit 3

Fixes dbd730e859 ("nvdimm: check -object memory-backend-file, readonly=on

option")

The documentation in 'docs/nvdimm.txt' is correct :)

Quoted 6 lines
---
  hw/mem/nvdimm.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 11 lines

hw/mem/nvdimm.c static void nvdimm_prepare_memory_region(NVDIMMDevice *nvdimm, Error **errp) · line 151

Quoted 9 lines
hw/mem/nvdimm.c +1 -1
index 7c7d777781..bfb76818c1 100644
@@ -149,7 +149,7 @@ static void nvdimm_prepare_memory_region(NVDIMMDevice *nvdimm, Error **errp)
      if (!nvdimm->unarmed && memory_region_is_rom(mr)) {
          HostMemoryBackend *hostmem = dimm->hostmem;
-        error_setg(errp, "'unarmed' property must be off since memdev %s "
+        error_setg(errp, "'unarmed' property must be on since memdev %s "

If you ever respin please quote 'on' for readability.

Quoted 1 line

Yes make sense. Julia could you change this pls?

Sure, will do.

Quoted 6 lines
Quoted 5 lines

hw/mem/nvdimm.c static void nvdimm_prepare_memory_region(NVDIMMDevice *nvdimm, Error **errp) · line 155

Quoted 3 lines
hw/mem/nvdimm.c +0 -0
                     "is read-only",
                     object_get_canonical_path_component(OBJECT(hostmem)));
          return;
Reviewed-by on v1 1/1
#5 lore raw
In reply to Julia Suvorova
Quoted 18 lines

In the ACPI specification [1], the 'unarmed' bit is set when a device cannot accept a persistent write. This means that when a memdev is read-only, the 'unarmed' flag must be turned on. The logic is correct, just changing the error message.

[1] ACPI NFIT NVDIMM Region Mapping Structure "NVDIMM State Flags" Bit 3

---
 hw/mem/nvdimm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/mem/nvdimm.c +0 -0
index 7c7d777781..bfb76818c1 100644

hw/mem/nvdimm.c static void nvdimm_prepare_memory_region(NVDIMMDevice *nvdimm, Error **errp) · line 155

Quoted 8 lines
hw/mem/nvdimm.c +1 -1
@@ -149,7 +149,7 @@ static void nvdimm_prepare_memory_region(NVDIMMDevice *nvdimm, Error **errp)
     if (!nvdimm->unarmed && memory_region_is_rom(mr)) {
         HostMemoryBackend *hostmem = dimm->hostmem;
 
-        error_setg(errp, "'unarmed' property must be off since memdev %s "
+        error_setg(errp, "'unarmed' property must be on since memdev %s "
                    "is read-only",
                    object_get_canonical_path_component(OBJECT(hostmem)));
         return;

With the suggested minor change.