From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 985D5CA9EA0 for ; Tue, 22 Oct 2019 15:22:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6C0A12086D for ; Tue, 22 Oct 2019 15:22:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388172AbfJVPW0 (ORCPT ); Tue, 22 Oct 2019 11:22:26 -0400 Received: from mga09.intel.com ([134.134.136.24]:23876 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388081AbfJVPW0 (ORCPT ); Tue, 22 Oct 2019 11:22:26 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Oct 2019 08:22:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,216,1569308400"; d="scan'208";a="196468247" Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.41]) by fmsmga008.fm.intel.com with ESMTP; 22 Oct 2019 08:22:24 -0700 Date: Tue, 22 Oct 2019 08:22:24 -0700 From: Sean Christopherson To: Paolo Bonzini Cc: James Hogan , Paul Mackerras , Christian Borntraeger , Janosch Frank , Radim =?utf-8?B?S3LEjW3DocWZ?= , Marc Zyngier , David Hildenbrand , Cornelia Huck , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , James Morse , Julien Thierry , Suzuki K Poulose , linux-mips@vger.kernel.org, kvm-ppc@vger.kernel.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 15/15] KVM: Dynamically size memslot array based on number of used slots Message-ID: <20191022152223.GB2343@linux.intel.com> References: <20191022003537.13013-1-sean.j.christopherson@intel.com> <20191022003537.13013-16-sean.j.christopherson@intel.com> <2609aedc-4fc9-ab92-8877-55c64cf19165@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2609aedc-4fc9-ab92-8877-55c64cf19165@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org On Tue, Oct 22, 2019 at 04:04:21PM +0200, Paolo Bonzini wrote: > On 22/10/19 02:35, Sean Christopherson wrote: > > + struct kvm_memory_slot memslots[]; > > + /* > > + * WARNING: 'memslots' is dynamically-sized. It *MUST* be at the end. > > + */ > > Isn't that obvious from the flexible array member? Probably. It's also unnecessary as the compiler (at least as of gcc 5.4) will throw an error if it's not at the end. I think I even verified this during development and still decided to leave the obnoxious warning in for some reason... include/linux/kvm_host.h:436:25: error: flexible array member not at end of struct struct kvm_memory_slot memslots[];