From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vitaly Kuznetsov Subject: Re: [PATCH v2 1/4] x86/hyper-v: move synic/stimer control structures definitions to hyperv-tlfs.h Date: Thu, 29 Nov 2018 12:36:18 +0100 Message-ID: <87bm68i099.fsf@vitty.brq.redhat.com> References: <20181126154732.23025-1-vkuznets@redhat.com> <20181126154732.23025-2-vkuznets@redhat.com> <20181126200413.GA7852@rkaganb.sw.ru> <87wooyk6na.fsf@vitty.brq.redhat.com> <20181127184835.GA5147@rkaganip.lan> <8A215F49-BB8F-4E93-AC62-EC33B4734F24@gmail.com> <87a7ltjxnz.fsf@vitty.brq.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , "Michael Kelley \(EOSG\)" , "kvm\@vger.kernel.org" , Radim =?utf-8?B?S3LEjW0=?= =?utf-8?B?w6HFmQ==?= , "linux-kernel\@vger.kernel.org" , "x86\@kernel.org" , Roman Kagan To: Nadav Amit , Thomas Gleixner , Paolo Bonzini Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org Nadav Amit writes: >> On Nov 28, 2018, at 5:07 AM, Thomas Gleixner wrote: >> >> On Wed, 28 Nov 2018, Vitaly Kuznetsov wrote: >> >>> Nadav Amit writes: >>> >>>> On a different note: how come all of the hyper-v structs are not marked >>>> with the “packed" attribute? >>> >>> "packed" should not be needed with proper padding; I vaguely remember >>> someone (from x86@?) arguing _against_ "packed". >> >> Packed needs to be used, when describing fixed format data structures in >> hardware or other ABIs, so the compiler cannot put alignment holes into >> them. >> >> Using packed for generic data structures might result in suboptimal layouts >> and prevents layout randomization. > > Right, I forgot about the structs randomization. So at least for it, the > attribute should be needed. > Not sure when randomization.s used but Hyper-V drivers will of course be utterly broken with it. > To prevent conflicts, I think that this series should also add the > attribute in a first patch, which would be tagged for stable. As the patchset doesn't add new definitions and as Paolo already queued it I'd go with a follow-up patch adding "packed" to all hyperv-tlfs.h structures. The question is how to avoid conflicts when Linus will be merging this. We can do: - Topic branch in kvm - Send the patch to x86, make topic branch and reabse kvm - Send the patch to kvm - ... ? Paolo/Thomas, what would be your preference? -- Vitaly