[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] nvdimm: allow read/write zero-size namespace la
From: |
Li Qiang |
Subject: |
Re: [Qemu-devel] [PATCH] nvdimm: allow read/write zero-size namespace label |
Date: |
Sat, 14 Jan 2017 19:22:28 +0800 |
Hello Guangrong,
2017-01-13 17:00 GMT+08:00 Xiao Guangrong <address@hidden>:
>
>
> On 01/13/2017 11:02 AM, Li Qiang wrote:
>
>> From: Li Qiang <address@hidden>
>>
>> The spec doesn't say the namespace label can't be zero
>> when read/write it. As this is no harmful, just allow
>> it.
>>
>>
> WHY?
>
> The spec said that the label should be at least 128K.
>
Yes, the label size has a limit, but in NVDIMM_DSM_Interface_Example.pdf
section 4.5.1
When the guest get namespace label data, the 'Length' is not limited, if it
is 0, it will trigger
this assert.
static void nvdimm_validate_rw_label_data(NVDIMMDevice *nvdimm, uint64_t
size,
uint64_t offset)
{
assert((nvdimm->label_size >= size + offset) && (offset + size >
offset));
}
Though I don't know what the exact behavior of this action in real
hardware. I just think it should not
trigger assert and exit when the guest get 0-size label data.
Anyway, this is just a suggestion, If my understand is wrong, just ignore
this.
Thanks.