Received: by 2002:a05:6358:795:b0:dc:4c66:fc3e with SMTP id n21csp2320311rwj; Sun, 30 Oct 2022 15:33:50 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6vCMVIKTK3ZLYWbgv7uhKhRAS/f8it01A0UayDjwEFuaCAxTIhTOFHRyD0tijCRbVGIn9s X-Received: by 2002:a17:902:b78b:b0:187:1623:827f with SMTP id e11-20020a170902b78b00b001871623827fmr5311961pls.165.1667169230596; Sun, 30 Oct 2022 15:33:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667169230; cv=none; d=google.com; s=arc-20160816; b=OIQpWnHSQy/lPU7lGHuYELdQbst4p+O/RpTJ4Rmn9vStQNYgSYeIa7K29bDtg1s5/b EC66QGjmVV2tQLGp5bf6iMQFjMzU0lU78t0xPZ3AP4ihl4Q8ndfR2a8iBPTm/xPZChua ZIhgrz3yjhicJFMxnras7arKI+239ZBowRrmUXvnL4JJ81Qsgr45lIDC6xeIdGD5fk+U hzYkVyePK9ceyjS6rVIx+mWQKEPltYXwutCA8ZUMJEkM/PelzOVanDdRKjj9DbXmlgAG 479U9se0gFhztV7p2pUoRMCjKE6XTsFPhA/MieAzkCg6D0IJVUuEWrs6fEArAuZt280c GISA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=XKEqlfpNtgh/AfXUPy0NjqXoLx2HHDBjFk77mupP6l4=; b=Nz5473AgtIBrMybyiZ53giBOhZOYQtrja03Y9UDOYuyOiLjyr9lb7+89XKsX/WZrJE pOe6YRdIicKQKFW4L+sYFsBw5ac38rcCcQfFMx4JaIq8dUBWIha6dH7MFxb32BoWqkDX 0GK+x1wYOW90m3t1vsqrvPq4sWuTNUmX73VAgqtedeO/euwOTfTFFetJ8Hl2BI2s7lvx O1lzJybKQbkC0oRfGZ8x8ts5S241ysiifTTkK+NeH39Wvyb7T8R2zDQCy6ZLm7OC/il5 dCfIxhDxwsFcarAqNRtJHKAcn8536zMg9WiqBxWwBfO7j+LmcmrzkLZXKd2ZWX+E9y4N YL1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=JRwSZnyv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w4-20020a656944000000b00464a9874658si6258961pgq.6.2022.10.30.15.33.18; Sun, 30 Oct 2022 15:33:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=JRwSZnyv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229608AbiJ3WGj (ORCPT + 99 others); Sun, 30 Oct 2022 18:06:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229494AbiJ3WGh (ORCPT ); Sun, 30 Oct 2022 18:06:37 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B13EC7651; Sun, 30 Oct 2022 15:06:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667167596; x=1698703596; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=IlxZQ6qxXfEbM/XmZBwTjN/fapBFZBIks0uyy63At0A=; b=JRwSZnyvLAIbEUoJkTAgG4AVaiZcWXu8ZXSuMAUSCn9/mDQoGxtH01hm GJfXwZIPyggoBH/f3prg954QFZo6q1LmdkEbjubsyu90KLafYOFkUNZS4 MtuOh/vGPJGdwsG/E6UVS1XebehW8nZwcqmR6OjxyeZ9BDfUfG+t4LyAI EsYX5OIMMzZ3ZvtOM4ryuHk7cJEgoWSj6SNEN4CuQNXlf9oI1pTgQoX2R R9uLNpcLFeh1uFCYdvv/ReF7C/BPKuwEbdALGv67K5oo7lv2kFG67OIt/ rWgNKNwhmCywZ1NPCMTDXOpFs9pRaNUxW+v7qMnKMLTrXMGTBTw+AXFku A==; X-IronPort-AV: E=McAfee;i="6500,9779,10516"; a="288496655" X-IronPort-AV: E=Sophos;i="5.95,226,1661842800"; d="scan'208";a="288496655" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Oct 2022 15:06:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10516"; a="628055229" X-IronPort-AV: E=Sophos;i="5.95,226,1661842800"; d="scan'208";a="628055229" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga007.jf.intel.com with ESMTP; 30 Oct 2022 15:06:31 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1opGRo-004phz-28; Mon, 31 Oct 2022 00:06:28 +0200 Date: Mon, 31 Oct 2022 00:06:28 +0200 From: Andy Shevchenko To: Xu Yilun Cc: matthew.gerlach@linux.intel.com, hao.wu@intel.com, russell.h.weight@intel.com, basheer.ahmed.muddebihal@intel.com, trix@redhat.com, mdf@kernel.org, linux-fpga@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, tianfei.zhang@intel.com, corbet@lwn.net, jirislaby@kernel.org, geert+renesas@glider.be, niklas.soderlund+renesas@ragnatech.se, macro@orcam.me.uk, johan@kernel.org, lukas@wunner.de, ilpo.jarvinen@linux.intel.com, marpagan@redhat.com Subject: Re: [PATCH v4 3/4] fpga: dfl: add basic support DFHv1 Message-ID: References: <20221020212610.697729-1-matthew.gerlach@linux.intel.com> <20221020212610.697729-4-matthew.gerlach@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Oct 29, 2022 at 09:08:44PM +0800, Xu Yilun wrote: > On 2022-10-20 at 14:26:09 -0700, matthew.gerlach@linux.intel.com wrote: > > struct dfl_feature_info { > > u16 fid; > > u8 revision; > > + u8 dfh_version; > > struct resource mmio_res; > > void __iomem *ioaddr; > > struct list_head node; > > unsigned int irq_base; > > unsigned int nr_irqs; > > + unsigned int param_size; > > + u64 params[]; > > }; ... > > + finfo = kzalloc(sizeof(*finfo) + dfh_psize, GFP_KERNEL); This probably may use something from overflow.h. > The u64 flexible array in the structure, but seems dfh_get_psize could > not garantee 64bit aligned size. > > What's the mandatory alignment of param data? If 64bit aligned, bit 33-34 > of PARAM_HDR should be reserved. If 32bit aligned, finfo:params should be > u32[]. Isn't it guaranteed by the C standard / architecture ABI? -- With Best Regards, Andy Shevchenko