[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 12/15] nvdimm acpi: support Get Namespace Label
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH 12/15] nvdimm acpi: support Get Namespace Label Size function |
Date: |
Thu, 17 Mar 2016 10:58:45 +0000 |
User-agent: |
Mutt/1.5.24 (2015-08-30) |
On Thu, Mar 17, 2016 at 04:32:58PM +0800, Xiao Guangrong wrote:
> - /* No function except function 0 is supported yet. */
> - nvdimm_dsm_no_payload(1 /* Not Supported */, dsm_mem_addr);
> + if (!nvdimm) {
> + return nvdimm_dsm_no_payload(1 /* Non-Existing Memory Device */,
"Non-existing Memory Device" is 2 according to the spec. 1 would be
"Not Supported".
Please define constants for all these magic values instead of putting
literals into the code:
enum {
NVDIMM_DSM_SUCCESS = 0,
NVDIMM_DSM_NOT_SUPPORTED = 1,
NVDIMM_DSM_NON_EXISTING_MEMORY_DEVICE = 2,
NVDIMM_DSM_INVALID_INPUT_PARAMETERS = 3,
NVDIMM_DSM_VENDOR_SPECIFIC_ERROR = 4,
};
> + dsm_mem_addr);
> + }
> +
> + /* Encode DSM function according to DSM Spec Rev1. */
> + switch (in->function) {
> + case 4 /* Get Namespace Label Size */:
> + if (nvdimm->reserve_label) {
> + nvdimm_dsm_label_size(nvdimm, dsm_mem_addr);
> + }
> + break;
What is the expected return status code if the device has no labels?
This function must write a return status code, otherwise the guest will
read the out buffer and attempt to interpret uninitialized memory.
signature.asc
Description: PGP signature
- [Qemu-devel] [PATCH 06/15] acpi: add aml_call5, (continued)
- [Qemu-devel] [PATCH 06/15] acpi: add aml_call5, Xiao Guangrong, 2016/03/17
- [Qemu-devel] [PATCH 07/15] nvdimm acpi: set HDLE properly, Xiao Guangrong, 2016/03/17
- [Qemu-devel] [PATCH 08/15] nvdimm acpi: save arg3 of _DSM method, Xiao Guangrong, 2016/03/17
- [Qemu-devel] [PATCH 10/15] nvdimm acpi: abstract the operations for root device and nvdimm devices, Xiao Guangrong, 2016/03/17
- [Qemu-devel] [PATCH 09/15] nvdimm acpi: check UUID, Xiao Guangrong, 2016/03/17
- [Qemu-devel] [PATCH 11/15] nvdimm acpi: check revision, Xiao Guangrong, 2016/03/17
- [Qemu-devel] [PATCH 13/15] nvdimm acpi: support Get Namespace Label Data function, Xiao Guangrong, 2016/03/17
- [Qemu-devel] [PATCH 12/15] nvdimm acpi: support Get Namespace Label Size function, Xiao Guangrong, 2016/03/17
- Re: [Qemu-devel] [PATCH 12/15] nvdimm acpi: support Get Namespace Label Size function,
Stefan Hajnoczi <=
- [Qemu-devel] [PATCH 14/15] nvdimm acpi: support Set Namespace Label Data function, Xiao Guangrong, 2016/03/17
- [Qemu-devel] [PATCH 15/15] docs: add NVDIMM ACPI documentation, Xiao Guangrong, 2016/03/17
- Re: [Qemu-devel] [PATCH 00/15] NVDIMM: introduce nvdimm label support, Stefan Hajnoczi, 2016/03/17
Re: [Qemu-devel] [PATCH 00/15] NVDIMM: introduce nvdimm label support, Michael S. Tsirkin, 2016/03/22