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 E2033A00BE; Thu, 16 Jun 2022 11:27:21 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CFC594281E; Thu, 16 Jun 2022 11:27:21 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 315484003C 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=1655371638; 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=OJTrnp5dQbQmYm5LyHmUxGP40H3OfaE5Bh4k8seWEMyX+wZKnVP6/wuq3yaCjvGLdxrHqH f7klqguHFKCgrOjVb/BpyOZiJImJobnxp4DoHwDUMduXS/sD8p7pNeXe3uj5vWAvw1HRku gTiybJYhoHdlOh5yXreXqLy3NaGOLmA= Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-614-Eme3RugDOFCEXLyay_ndqA-1; Thu, 16 Jun 2022 05:27:17 -0400 X-MC-Unique: Eme3RugDOFCEXLyay_ndqA-1 Received: by mail-lf1-f71.google.com with SMTP id y27-20020a056512045b00b00479570fbce4so502807lfk.15 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=qLdx4JLeEe4k+sz4Il1O00n1oe2Yu6AWWsRMM0A4Sxv3krcOU6iZ6DhLV1Cq7qKTvA 9Csob96b2I1e4Ryz2MVMOLdt62kpymZUUlMWTGHHo6oerHYiPP3K/ub3vZRLDOAgEfXm fTFFv3L1BH1dMJh6n7fjoDdqfZhBRTiqsXfKbEi8wBnqnUEK53rELtjIlfgaaNWmV5oq tZQfWf2ufphJyk51wGLfOSuvsvIFJ6lBp6iPpFZOdQ2zZoPCpl0013NA+yRRcH3hu+62 E3/61cXcbdMYPNRjHfAhUjvyR321VgpcMUhs/HameSeVXXgSlUiWM86ONhAltSCFuZ2W iqtQ== X-Gm-Message-State: AJIora9bM2NbnilfQHrhw78SwD6dY8JoHBtzZIIrmmOBBzEH1Ns2t62f F97XahYv4paTJYxD/Tb1qrHwpDdSOWk9/tQOZOvQh3yEdiTxG9ZTKrhXXzL2R0tGUSEdzsLBf43 iFuppQll4lAhq6wx7lSg= X-Received: by 2002:a19:a418:0:b0:478:fda4:e755 with SMTP id q24-20020a19a418000000b00478fda4e755mr2133082lfc.560.1655371635455; 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: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-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