From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B39E1A0032 for ; Tue, 21 Jun 2022 11:31:09 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AA9F040151; Tue, 21 Jun 2022 11:31:09 +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 8AA0540151 for ; Tue, 21 Jun 2022 11:31:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1655803868; 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=M/S1l59B7EAtCxtDD8kDeoJ3pvoBEgqonx/N85atagpO/C0JR0Xz0ihsXBhvKZ0SvICNjR piYc3/A67M3lhKOgfBj0iVRRpNRKeQgVx5yWXn/z6/s4xFeAShUdnUffxoww6Q+LMS/r/a 02C2Alm8TCBCT33gCisE6fU8sI7IeiY= 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 , dev@dpdk.org Cc: stable@dpdk.org, Chenbo Xia , Fan Zhang References: <20220518101657.1230416-13-david.marchand@redhat.com> <20220616144650.1013920-1-david.marchand@redhat.com> From: Maxime Coquelin 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: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-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 > --- > 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