Date: Sat, 20 Apr 2024 12:01:13 +0000 From: Souradeep Chakrabarti <schakrabarti@microsoft.com> To: =?utf-8?B?RGFnLUVybGluZyBTbcO4cmdyYXY=?= <des@FreeBSD.org>, Wei Hu <weh@microsoft.com> Cc: Konstantin Belousov <kostikbel@gmail.com>, Warner Losh <imp@bsdimp.com>, "freebsd-hackers@FreeBSD.org" <freebsd-hackers@freebsd.org> Subject: RE: [EXTERNAL] Re: How to add a -W flag in local Makefile Message-ID: <TYZP153MB039748B6AEF65764034DD3F7CC0C2@TYZP153MB0397.APCP153.PROD.OUTLOOK.COM> In-Reply-To: <86cyqlbovo.fsf@ltc.des.dev> References: <TYZP153MB0399580B98D5F790C0A551C3BB0E2@TYZP153MB0399.APCP153.PROD.OUTLOOK.COM> <CANCZdfoJD1gb1SVb9xiyUAPe8mWL1SZBB%2BtJ3ZOASMWxO6nmbg@mail.gmail.com> <TYZP153MB039998D645FD84C28A9A057EBB0E2@TYZP153MB0399.APCP153.PROD.OUTLOOK.COM> <ZiFe_A6takkhcyL7@kib.kiev.ua> <TYZP153MB03991E84C684145A94EA306ABB0D2@TYZP153MB0399.APCP153.PROD.OUTLOOK.COM> <86cyqlbovo.fsf@ltc.des.dev>
index | next in thread | previous in thread | raw e-mail
>-----Original Message-----
>From: owner-freebsd-hackers@FreeBSD.org <owner-freebsd-
>hackers@FreeBSD.org> On Behalf Of Dag-Erling Smørgrav
>Sent: Friday, April 19, 2024 4:28 PM
>To: Wei Hu <weh@microsoft.com>
>Cc: Konstantin Belousov <kostikbel@gmail.com>; Warner Losh
><imp@bsdimp.com>; freebsd-hackers@FreeBSD.org
>Subject: [EXTERNAL] Re: How to add a -W flag in local Makefile
>
>Wei Hu <weh@microsoft.com> writes:
>> The same code already exists in Linux and Windows. Linux also added a
>> compiling flag to suppress similar warnings.
>
>That's not an excuse. The code makes no sense.
The way it works is as follows:
> > +struct hv_vpset {
> > + uint64_t format;
> > + uint64_t valid_bank_mask;
> > + uint64_t bank_contents[];
> > +} __packed;
> > +
> > +struct hv_tlb_flush_ex {
> > + uint64_t address_space;
> > + uint64_t flags;
> > + struct hv_vpset hv_vp_set;
> > + uint64_t gva_list[];
> > +} __packed;
Here an pointer is allocated for struct hv_tlb_flush_ex with 4K size.
Now gva_list and bank_contents are sharing same space.
But gva_list gets filled up from the particular index position, where bank_contents
is ending.
Total space used by bank_contents[0-(n-1)] + gva_list[n-end_of_the heap allocated] = 4K - (sizeof(format) + sizeof(valid_bank_mask) + sizeof(address_space) + sizeof(flags) )
During a call to hypervisor we need to send in this message format for proper deserialization and there we also specify the bank_contents index that is n-1.
Thanks
Souradeep
>
>> Anyway, the purpose of this email is to understand how to add such
>> flags in local Makefiles and make it effective for global buildkernel.
>> Adding such flags in local Makefiles already proves to be working when
>> only building under local directory.
>
>You would have to add it to every line in sys/conf/files* that references a C file
>which includes this header.
>
>DES
>--
>Dag-Erling Smørgrav - des@FreeBSD.org
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?TYZP153MB039748B6AEF65764034DD3F7CC0C2>
