* multiboot_mmap_entry.zero isn't zero
@ 2016-02-13 21:20 Wink Saville
2016-02-14 7:12 ` Andrei Borzenkov
0 siblings, 1 reply; 5+ messages in thread
From: Wink Saville @ 2016-02-13 21:20 UTC (permalink / raw)
To: grub-devel
I'm processing multiboot_tag_mmap and the multiboot_mmap_entry.zero
isn't zero. As best as I can tell grub isn't initializing it. Here is
the code from grub-core/loader/i386/multiboot_mbi.c:
/* Helper for grub_fill_multiboot_mmap. */
static int
grub_fill_multiboot_mmap_iter (grub_uint64_t addr, grub_uint64_t size,
grub_memory_type_t type, void *data)
{
struct multiboot_mmap_entry **mmap_entry = data;
(*mmap_entry)->addr = addr;
(*mmap_entry)->len = size;
(*mmap_entry)->type = type;
(*mmap_entry)->size = sizeof (struct multiboot_mmap_entry) - sizeof
((*mmap_entry)->size);
(*mmap_entry)++;
return 0;
}
And similar code in grub-core/loader/multiboot_mbi2.c:
/* Helper for grub_fill_multiboot_mmap. */
static int
grub_fill_multiboot_mmap_iter (grub_uint64_t addr, grub_uint64_t size,
grub_memory_type_t type, void *data)
{
struct multiboot_mmap_entry **mmap_entry = data;
(*mmap_entry)->addr = addr;
(*mmap_entry)->len = size;
(*mmap_entry)->type = type;
(*mmap_entry)++;
return 0;
}
And I'd expect to see:
(*mmap_entry)->zero = 0;
Is there a reason its not being zeroed?
-- Wink
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: multiboot_mmap_entry.zero isn't zero
2016-02-13 21:20 multiboot_mmap_entry.zero isn't zero Wink Saville
@ 2016-02-14 7:12 ` Andrei Borzenkov
2016-02-14 11:24 ` Wink Saville
0 siblings, 1 reply; 5+ messages in thread
From: Andrei Borzenkov @ 2016-02-14 7:12 UTC (permalink / raw)
To: The development of GNU GRUB
14.02.2016 00:20, Wink Saville пишет:
> I'm processing multiboot_tag_mmap and the multiboot_mmap_entry.zero
> isn't zero. As best as I can tell grub isn't initializing it. Here is
> the code from grub-core/loader/i386/multiboot_mbi.c:
>
> /* Helper for grub_fill_multiboot_mmap. */
> static int
> grub_fill_multiboot_mmap_iter (grub_uint64_t addr, grub_uint64_t size,
> grub_memory_type_t type, void *data)
> {
> struct multiboot_mmap_entry **mmap_entry = data;
>
> (*mmap_entry)->addr = addr;
> (*mmap_entry)->len = size;
> (*mmap_entry)->type = type;
> (*mmap_entry)->size = sizeof (struct multiboot_mmap_entry) - sizeof
> ((*mmap_entry)->size);
> (*mmap_entry)++;
>
> return 0;
> }
>
> And similar code in grub-core/loader/multiboot_mbi2.c:
>
> /* Helper for grub_fill_multiboot_mmap. */
> static int
> grub_fill_multiboot_mmap_iter (grub_uint64_t addr, grub_uint64_t size,
> grub_memory_type_t type, void *data)
> {
> struct multiboot_mmap_entry **mmap_entry = data;
>
> (*mmap_entry)->addr = addr;
> (*mmap_entry)->len = size;
> (*mmap_entry)->type = type;
> (*mmap_entry)++;
>
> return 0;
> }
>
> And I'd expect to see:
>
> (*mmap_entry)->zero = 0;
>
> Is there a reason its not being zeroed?
>
Because it does not exist?
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: multiboot_mmap_entry.zero isn't zero
2016-02-14 7:12 ` Andrei Borzenkov
@ 2016-02-14 11:24 ` Wink Saville
2016-02-23 6:14 ` Andrei Borzenkov
0 siblings, 1 reply; 5+ messages in thread
From: Wink Saville @ 2016-02-14 11:24 UTC (permalink / raw)
To: The development of GNU GRUB, arvidjaar
I'm using multiboot2 and I see a zero field in grub/include/multiboot2.h:
struct multiboot_mmap_entry
{
multiboot_uint64_t addr;
multiboot_uint64_t len;
#define MULTIBOOT_MEMORY_AVAILABLE 1
#define MULTIBOOT_MEMORY_RESERVED 2
#define MULTIBOOT_MEMORY_ACPI_RECLAIMABLE 3
#define MULTIBOOT_MEMORY_NVS 4
#define MULTIBOOT_MEMORY_BADRAM 5
multiboot_uint32_t type;
multiboot_uint32_t zero;
} GRUB_PACKED;
typedef struct multiboot_mmap_entry multiboot_memory_map_t;
Although in grub/include/multiboot.h it does not exist:
struct multiboot_mmap_entry
{
multiboot_uint32_t size;
multiboot_uint64_t addr;
multiboot_uint64_t len;
#define MULTIBOOT_MEMORY_AVAILABLE 1
#define MULTIBOOT_MEMORY_RESERVED 2
#define MULTIBOOT_MEMORY_ACPI_RECLAIMABLE 3
#define MULTIBOOT_MEMORY_NVS 4
#define MULTIBOOT_MEMORY_BADRAM 5
multiboot_uint32_t type;
} GRUB_PACKED;
typedef struct multiboot_mmap_entry multiboot_memory_map_t;
On Sat, Feb 13, 2016 at 11:12 PM, Andrei Borzenkov <arvidjaar@gmail.com> wrote:
> 14.02.2016 00:20, Wink Saville пишет:
>> I'm processing multiboot_tag_mmap and the multiboot_mmap_entry.zero
>> isn't zero. As best as I can tell grub isn't initializing it. Here is
>> the code from grub-core/loader/i386/multiboot_mbi.c:
>>
>> /* Helper for grub_fill_multiboot_mmap. */
>> static int
>> grub_fill_multiboot_mmap_iter (grub_uint64_t addr, grub_uint64_t size,
>> grub_memory_type_t type, void *data)
>> {
>> struct multiboot_mmap_entry **mmap_entry = data;
>>
>> (*mmap_entry)->addr = addr;
>> (*mmap_entry)->len = size;
>> (*mmap_entry)->type = type;
>> (*mmap_entry)->size = sizeof (struct multiboot_mmap_entry) - sizeof
>> ((*mmap_entry)->size);
>> (*mmap_entry)++;
>>
>> return 0;
>> }
>>
>> And similar code in grub-core/loader/multiboot_mbi2.c:
>>
>> /* Helper for grub_fill_multiboot_mmap. */
>> static int
>> grub_fill_multiboot_mmap_iter (grub_uint64_t addr, grub_uint64_t size,
>> grub_memory_type_t type, void *data)
>> {
>> struct multiboot_mmap_entry **mmap_entry = data;
>>
>> (*mmap_entry)->addr = addr;
>> (*mmap_entry)->len = size;
>> (*mmap_entry)->type = type;
>> (*mmap_entry)++;
>>
>> return 0;
>> }
>>
>> And I'd expect to see:
>>
>> (*mmap_entry)->zero = 0;
>>
>> Is there a reason its not being zeroed?
>>
>
> Because it does not exist?
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: multiboot_mmap_entry.zero isn't zero
2016-02-14 11:24 ` Wink Saville
@ 2016-02-23 6:14 ` Andrei Borzenkov
2016-02-23 18:01 ` Wink Saville
0 siblings, 1 reply; 5+ messages in thread
From: Andrei Borzenkov @ 2016-02-23 6:14 UTC (permalink / raw)
To: Wink Saville, The development of GNU GRUB
14.02.2016 14:24, Wink Saville пишет:
> I'm using multiboot2 and I see a zero field in grub/include/multiboot2.h:
>
> struct multiboot_mmap_entry
> {
> multiboot_uint64_t addr;
> multiboot_uint64_t len;
> #define MULTIBOOT_MEMORY_AVAILABLE 1
> #define MULTIBOOT_MEMORY_RESERVED 2
> #define MULTIBOOT_MEMORY_ACPI_RECLAIMABLE 3
> #define MULTIBOOT_MEMORY_NVS 4
> #define MULTIBOOT_MEMORY_BADRAM 5
> multiboot_uint32_t type;
> multiboot_uint32_t zero;
> } GRUB_PACKED;
> typedef struct multiboot_mmap_entry multiboot_memory_map_t;
>
OK, I pushed fix (although documentation also says OS should ignore this
field :) )
>
> Although in grub/include/multiboot.h it does not exist:
>
> struct multiboot_mmap_entry
> {
> multiboot_uint32_t size;
> multiboot_uint64_t addr;
> multiboot_uint64_t len;
> #define MULTIBOOT_MEMORY_AVAILABLE 1
> #define MULTIBOOT_MEMORY_RESERVED 2
> #define MULTIBOOT_MEMORY_ACPI_RECLAIMABLE 3
> #define MULTIBOOT_MEMORY_NVS 4
> #define MULTIBOOT_MEMORY_BADRAM 5
> multiboot_uint32_t type;
> } GRUB_PACKED;
> typedef struct multiboot_mmap_entry multiboot_memory_map_t;
>
>
> On Sat, Feb 13, 2016 at 11:12 PM, Andrei Borzenkov <arvidjaar@gmail.com> wrote:
>> 14.02.2016 00:20, Wink Saville пишет:
>>> I'm processing multiboot_tag_mmap and the multiboot_mmap_entry.zero
>>> isn't zero. As best as I can tell grub isn't initializing it. Here is
>>> the code from grub-core/loader/i386/multiboot_mbi.c:
>>>
>>> /* Helper for grub_fill_multiboot_mmap. */
>>> static int
>>> grub_fill_multiboot_mmap_iter (grub_uint64_t addr, grub_uint64_t size,
>>> grub_memory_type_t type, void *data)
>>> {
>>> struct multiboot_mmap_entry **mmap_entry = data;
>>>
>>> (*mmap_entry)->addr = addr;
>>> (*mmap_entry)->len = size;
>>> (*mmap_entry)->type = type;
>>> (*mmap_entry)->size = sizeof (struct multiboot_mmap_entry) - sizeof
>>> ((*mmap_entry)->size);
>>> (*mmap_entry)++;
>>>
>>> return 0;
>>> }
>>>
>>> And similar code in grub-core/loader/multiboot_mbi2.c:
>>>
>>> /* Helper for grub_fill_multiboot_mmap. */
>>> static int
>>> grub_fill_multiboot_mmap_iter (grub_uint64_t addr, grub_uint64_t size,
>>> grub_memory_type_t type, void *data)
>>> {
>>> struct multiboot_mmap_entry **mmap_entry = data;
>>>
>>> (*mmap_entry)->addr = addr;
>>> (*mmap_entry)->len = size;
>>> (*mmap_entry)->type = type;
>>> (*mmap_entry)++;
>>>
>>> return 0;
>>> }
>>>
>>> And I'd expect to see:
>>>
>>> (*mmap_entry)->zero = 0;
>>>
>>> Is there a reason its not being zeroed?
>>>
>>
>> Because it does not exist?
>>
>>
>> _______________________________________________
>> Grub-devel mailing list
>> Grub-devel@gnu.org
>> https://lists.gnu.org/mailman/listinfo/grub-devel
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: multiboot_mmap_entry.zero isn't zero
2016-02-23 6:14 ` Andrei Borzenkov
@ 2016-02-23 18:01 ` Wink Saville
0 siblings, 0 replies; 5+ messages in thread
From: Wink Saville @ 2016-02-23 18:01 UTC (permalink / raw)
To: Andrei Borzenkov; +Cc: The development of GNU GRUB
Thanks!
On Mon, Feb 22, 2016 at 10:14 PM, Andrei Borzenkov <arvidjaar@gmail.com> wrote:
> 14.02.2016 14:24, Wink Saville пишет:
>> I'm using multiboot2 and I see a zero field in grub/include/multiboot2.h:
>>
>> struct multiboot_mmap_entry
>> {
>> multiboot_uint64_t addr;
>> multiboot_uint64_t len;
>> #define MULTIBOOT_MEMORY_AVAILABLE 1
>> #define MULTIBOOT_MEMORY_RESERVED 2
>> #define MULTIBOOT_MEMORY_ACPI_RECLAIMABLE 3
>> #define MULTIBOOT_MEMORY_NVS 4
>> #define MULTIBOOT_MEMORY_BADRAM 5
>> multiboot_uint32_t type;
>> multiboot_uint32_t zero;
>> } GRUB_PACKED;
>> typedef struct multiboot_mmap_entry multiboot_memory_map_t;
>>
>
> OK, I pushed fix (although documentation also says OS should ignore this
> field :) )
>
>>
>> Although in grub/include/multiboot.h it does not exist:
>>
>> struct multiboot_mmap_entry
>> {
>> multiboot_uint32_t size;
>> multiboot_uint64_t addr;
>> multiboot_uint64_t len;
>> #define MULTIBOOT_MEMORY_AVAILABLE 1
>> #define MULTIBOOT_MEMORY_RESERVED 2
>> #define MULTIBOOT_MEMORY_ACPI_RECLAIMABLE 3
>> #define MULTIBOOT_MEMORY_NVS 4
>> #define MULTIBOOT_MEMORY_BADRAM 5
>> multiboot_uint32_t type;
>> } GRUB_PACKED;
>> typedef struct multiboot_mmap_entry multiboot_memory_map_t;
>>
>>
>> On Sat, Feb 13, 2016 at 11:12 PM, Andrei Borzenkov <arvidjaar@gmail.com> wrote:
>>> 14.02.2016 00:20, Wink Saville пишет:
>>>> I'm processing multiboot_tag_mmap and the multiboot_mmap_entry.zero
>>>> isn't zero. As best as I can tell grub isn't initializing it. Here is
>>>> the code from grub-core/loader/i386/multiboot_mbi.c:
>>>>
>>>> /* Helper for grub_fill_multiboot_mmap. */
>>>> static int
>>>> grub_fill_multiboot_mmap_iter (grub_uint64_t addr, grub_uint64_t size,
>>>> grub_memory_type_t type, void *data)
>>>> {
>>>> struct multiboot_mmap_entry **mmap_entry = data;
>>>>
>>>> (*mmap_entry)->addr = addr;
>>>> (*mmap_entry)->len = size;
>>>> (*mmap_entry)->type = type;
>>>> (*mmap_entry)->size = sizeof (struct multiboot_mmap_entry) - sizeof
>>>> ((*mmap_entry)->size);
>>>> (*mmap_entry)++;
>>>>
>>>> return 0;
>>>> }
>>>>
>>>> And similar code in grub-core/loader/multiboot_mbi2.c:
>>>>
>>>> /* Helper for grub_fill_multiboot_mmap. */
>>>> static int
>>>> grub_fill_multiboot_mmap_iter (grub_uint64_t addr, grub_uint64_t size,
>>>> grub_memory_type_t type, void *data)
>>>> {
>>>> struct multiboot_mmap_entry **mmap_entry = data;
>>>>
>>>> (*mmap_entry)->addr = addr;
>>>> (*mmap_entry)->len = size;
>>>> (*mmap_entry)->type = type;
>>>> (*mmap_entry)++;
>>>>
>>>> return 0;
>>>> }
>>>>
>>>> And I'd expect to see:
>>>>
>>>> (*mmap_entry)->zero = 0;
>>>>
>>>> Is there a reason its not being zeroed?
>>>>
>>>
>>> Because it does not exist?
>>>
>>>
>>> _______________________________________________
>>> Grub-devel mailing list
>>> Grub-devel@gnu.org
>>> https://lists.gnu.org/mailman/listinfo/grub-devel
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-02-23 18:01 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-13 21:20 multiboot_mmap_entry.zero isn't zero Wink Saville
2016-02-14 7:12 ` Andrei Borzenkov
2016-02-14 11:24 ` Wink Saville
2016-02-23 6:14 ` Andrei Borzenkov
2016-02-23 18:01 ` Wink Saville
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.