From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 81DF1A0032;
	Tue, 21 Jun 2022 11:31:15 +0200 (CEST)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id F222B41132;
	Tue, 21 Jun 2022 11:31:13 +0200 (CEST)
Received: from us-smtp-delivery-124.mimecast.com
 (us-smtp-delivery-124.mimecast.com [170.10.129.124])
 by mails.dpdk.org (Postfix) with ESMTP id 4846F40151
 for <dev@dpdk.org>; Tue, 21 Jun 2022 11:31:12 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
 s=mimecast20190719; t=1655803871;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=FK9YZmQqsc2/ju6z1MHW8XDclNw22DgeNyFrzpKYoS0=;
 b=hVNV7pzuBbuB22o1k04QcAbexWJsOZ2GYAatgGGtz7qpGPnlVJ0teSB3M9frmGN82El2gG
 Yecn3dx0BNb3zktMGsZuCYyyGGva6C9swesdxqYv1pSEvC9BMq8SILX1lOBWBVpFlTvCgu
 RRwgdnTiiMeCy7Mt+tWaf9ZZaUtYNHk=
Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com
 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS
 (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 us-mta-203-FAR2pWuZN9SWvivhL22Ayg-1; Tue, 21 Jun 2022 05:31:06 -0400
X-MC-Unique: FAR2pWuZN9SWvivhL22Ayg-1
Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com
 [10.11.54.10])
 (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6BD1C1C06EC9;
 Tue, 21 Jun 2022 09:31:06 +0000 (UTC)
Received: from [10.39.208.40] (unknown [10.39.208.40])
 by smtp.corp.redhat.com (Postfix) with ESMTPS id 7C55440334F;
 Tue, 21 Jun 2022 09:31:05 +0000 (UTC)
Message-ID: <01bd004b-02f1-9369-dc43-456149d0240d@redhat.com>
Date: Tue, 21 Jun 2022 11:31:04 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
 Thunderbird/91.9.0
Subject: Re: [PATCH v3] vhost/crypto: fix build with GCC 12
To: David Marchand <david.marchand@redhat.com>, dev@dpdk.org
Cc: stable@dpdk.org, Chenbo Xia <chenbo.xia@intel.com>,
 Fan Zhang <roy.fan.zhang@intel.com>
References: <20220518101657.1230416-13-david.marchand@redhat.com>
 <20220616144650.1013920-1-david.marchand@redhat.com>
From: Maxime Coquelin <maxime.coquelin@redhat.com>
In-Reply-To: <20220616144650.1013920-1-david.marchand@redhat.com>
X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10
Authentication-Results: relay.mimecast.com;
 auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com
X-Mimecast-Spam-Score: 0
X-Mimecast-Originator: redhat.com
Content-Language: en-US
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org



On 6/16/22 16:46, David Marchand wrote:
> GCC 12 raises the following warning:
> 
> In file included from ../lib/mempool/rte_mempool.h:46,
>                   from ../lib/mbuf/rte_mbuf.h:38,
>                   from ../lib/vhost/vhost_crypto.c:7:
> ../lib/vhost/vhost_crypto.c: In function ‘rte_vhost_crypto_fetch_requests’:
> ../lib/eal/x86/include/rte_memcpy.h:371:9: warning: array subscript 1 is
>       outside array bounds of ‘struct virtio_crypto_op_data_req[1]’
>       [-Warray-bounds]
>    371 | rte_mov32((uint8_t *)dst + 3 * 32, (const uint8_t *)src + 3 * 32);
>        | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ../lib/vhost/vhost_crypto.c:1178:42: note: while referencing ‘req’
>   1178 |         struct virtio_crypto_op_data_req req;
>        |                                          ^~~
> 
> Split this function and separate the per descriptor copy.
> This makes the code clearer, and the compiler happier.
> 
> Note: logs for errors have been moved to callers to avoid duplicates.
> 
> Fixes: 3c79609fda7c ("vhost/crypto: handle virtually non-contiguous buffers")
> Cc: stable@dpdk.org
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
> Changes since v2:
> - fixed 32-bits build,
> 
> Changes since v1:
> - refactored copy function,
> 
> ---
>   lib/vhost/vhost_crypto.c | 123 +++++++++++++++------------------------
>   1 file changed, 46 insertions(+), 77 deletions(-)
> 

Applied to dpdk-next-virtio/main.

Thanks,
Maxime