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 6BB0DA00BE for ; Thu, 16 Jun 2022 11:27:24 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6F4ED42C0F; Thu, 16 Jun 2022 11:27:23 +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 0940D4003C for ; Thu, 16 Jun 2022 11:27:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1655371640; 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: in-reply-to:in-reply-to:references:references; bh=wx7NidZqxzvyiTQoZfUa1dMm1/HV6TA04r3Wdzu7tUg=; b=g0RID2aIX8ndWX8utED6vNfi6uMPT1hfmRgUcGXkzsql69Ic6GjedeA5QFKqLZ1VarnRKN q6AO/YLjQw0i1JLYzER1lOJQAL5ANdJ2WzCoZoEK1OEk78yncT4SYJTlrT/b3S7z3J6esc bxhu0NZxNKZBV+iOZ7D73G0aP9iWSuE= Received: from mail-lf1-f72.google.com (mail-lf1-f72.google.com [209.85.167.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-377-sR1PVjiAONOG7P3Cazn0dg-1; Thu, 16 Jun 2022 05:27:17 -0400 X-MC-Unique: sR1PVjiAONOG7P3Cazn0dg-1 Received: by mail-lf1-f72.google.com with SMTP id c21-20020a056512105500b00479762353a4so517265lfb.8 for ; Thu, 16 Jun 2022 02:27:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wx7NidZqxzvyiTQoZfUa1dMm1/HV6TA04r3Wdzu7tUg=; b=GSuPjvRekFQPcELVWx6aMbK1cl1xTRox3M1Na6m6lV/64Wm0UULaKNgm1uTDnNB8Ey Tv80VyWykHS73DXpVkP0G4lDaSpQRIvSryX0CmFrFuHkEGv8sfnhVb48zMwGEOXrysc+ 9DOXIL3oGIREtLevRI4EqVgfYMO/RebqBEWh0uQqO4IT6fNzgJdw1lGZo6iIAm16Thzf 9kzL527cUaBk9pQrP1JMzwkKOtQLts3/T+8LRSNzCauGYhoTSOBTvytEryejdO7w90Y3 IUsB9FUTWdWYQgxUFNg+Va8yPkLK+uB0dLPlKZUFR4NMal6WzObU2BMiX1Xq1Lfivx1H iJWA== X-Gm-Message-State: AJIora9iRkuMiHjPm0b1ePDyhVYMB5nxzV/ttzk9T0K0YYcUwJKwdw88 pJgfI3jqt3M2rqn3jWeInUq4lvgcGWqI+AIiK8MqUXw45R2BAmdi7A9e6O3hjo+sEe/u7feTE0b e8Ty0KdwN0XtWgTmzll6+9II= X-Received: by 2002:a19:a418:0:b0:478:fda4:e755 with SMTP id q24-20020a19a418000000b00478fda4e755mr2133076lfc.560.1655371635364; Thu, 16 Jun 2022 02:27:15 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tocM4NyuP6uzKRMjNVcG1iRq+MwmKIvZE4QeWgR2tHwVkU7ImHD9dLMKZRHlVU76kOn4BPBVuQns4YcIAVZq4= X-Received: by 2002:a19:a418:0:b0:478:fda4:e755 with SMTP id q24-20020a19a418000000b00478fda4e755mr2133069lfc.560.1655371635165; Thu, 16 Jun 2022 02:27:15 -0700 (PDT) MIME-Version: 1.0 References: <20220518101657.1230416-1-david.marchand@redhat.com> <20220518101657.1230416-11-david.marchand@redhat.com> In-Reply-To: From: David Marchand Date: Thu, 16 Jun 2022 11:27:03 +0200 Message-ID: Subject: Re: [PATCH 10/12] vhost/crypto: fix build with GCC 12 To: Bruce Richardson , Fan Zhang Cc: Maxime Coquelin , Chenbo Xia , dev , Thomas Monjalon , Ferruh Yigit , dpdk stable Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" 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 Tue, Jun 14, 2022 at 11:25 AM Bruce Richardson wrote: > > > > - if (unlikely(!src || !dlen)) > > > > + if (unlikely(!src || !dlen || dlen > left)) > > > > return -1; > > > > > > > > > > If this change is omitted, does the compiler still give warnings. Looking > > > through the called code, the dlen parameter can only ever be reduced, not > > > incremented (function rte_vhost_va_from_guest_pa() in rte_vhost.h). > > > > If I promote to_copy and left variables as uint64_t, gcc is still > > unhappy, for the same reason. > > The check on dlen > left seems necessary. > > > > > Ok, just thought I'd ask anyway. I wonder if we need to check for > wrap-around in the reduction case, since we are dealing with unsigned > values. This additional check should catch that anyway if it does occur. I had a fresh look at this code and went with some splitting / simplification. This makes the code clearer, and there is no added check. I'll send a v2. -- David Marchand