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 1FCFEA0505; Thu, 7 Apr 2022 17:40:18 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C48D94068B; Thu, 7 Apr 2022 17:40:17 +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 BEB8640689 for ; Thu, 7 Apr 2022 17:40:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649346016; 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=dbdmsdHpedEzfkRofOzcrfDbpEpJf8UuWtyyp60a99Y=; b=XfZdkqWOu1OII5PeeGXdOSNYivLRjSFcMYHRVyZYSADCPOqGZs2DKr4FceAW/6Bz0lFvXs lvtmlZsRJGJj31fROwvCsSGtHhoqhREOTRtJl1gu4mXK0xLxx6sv16oqkSV4ME4XFXZyxI VTJwXP254UVL5Ie/4CiagaahLR21H9w= Received: from mail-lf1-f70.google.com (mail-lf1-f70.google.com [209.85.167.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-278-nDfwReDdNrur4LoXsYVnbA-1; Thu, 07 Apr 2022 11:40:15 -0400 X-MC-Unique: nDfwReDdNrur4LoXsYVnbA-1 Received: by mail-lf1-f70.google.com with SMTP id f39-20020a0565123b2700b0044f567f870dso1961453lfv.13 for ; Thu, 07 Apr 2022 08:40:14 -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=dbdmsdHpedEzfkRofOzcrfDbpEpJf8UuWtyyp60a99Y=; b=ExMMO6h9MliLGJBs+qIPtyMJyazOHTmyCbs5VnDdToQF8QB6j3uNPiP96uUz1GlOCK mh0TWiFIu868grqhQnyVX+JM6G/9SXt68vYd6VDGlJTkyIsfsV+bwmTvjlG1ag5q2B30 Hr7NRfM3nOJdj51RkSo1t/AfWLyVvrcrqoWqs/rdG3nV+s65GWlQlW4yCW422jLiqaBB gk4XXz3L/xn/MUsf6mCQx6lx9NnvaCVcSowIWsloxZEx20WDCP/uQ9TfsD37c+MUDclH QqKxrUuPzTrj5/BykMsyOR8UN6gwF6uR5zbo5U4zzU1sJaO5Xag0tBbdafgqkTYAhsFs 97Pw== X-Gm-Message-State: AOAM531RvuAB089vx2HVO4n3dq8k+FkdwOyn3up6qRe9a8IrqNS51dWK w4Ek1wjKxP7IdbZH5TONxYYKKfFfyC4NdTdpWcqqlr7BvaZm0GHy9UDEioWOp1DZLuuv909Fbnu aXPpZxW4Fi9tTjaT/SUw= X-Received: by 2002:a05:651c:1781:b0:247:daa7:4358 with SMTP id bn1-20020a05651c178100b00247daa74358mr8869311ljb.477.1649346013548; Thu, 07 Apr 2022 08:40:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxN7l4/3mCYErouw4Jv22MsVZ60hCXJAUFtwe7yhr/uHSFTvC8Pw/KUxSjq7/NEgT1B0bXH1TBwZkmpdpvnYOw= X-Received: by 2002:a05:651c:1781:b0:247:daa7:4358 with SMTP id bn1-20020a05651c178100b00247daa74358mr8869299ljb.477.1649346013372; Thu, 07 Apr 2022 08:40:13 -0700 (PDT) MIME-Version: 1.0 References: <20220115194102.444140-1-lucp.at.work@gmail.com> <20220225163804.506142-1-lucp.at.work@gmail.com> In-Reply-To: From: David Marchand Date: Thu, 7 Apr 2022 17:40:02 +0200 Message-ID: Subject: Re: [PATCH v7] eal: fix rte_memcpy strict aliasing/alignment bugs To: "Ananyev, Konstantin" , Luc Pelletier Cc: "Richardson, Bruce" , "dev@dpdk.org" , "Li, Xiaoyun" , "stable@dpdk.org" , Aaron Conole , Owen Hilyard 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 Thu, Apr 7, 2022 at 5:32 PM David Marchand wrote: > > On Thu, Apr 7, 2022 at 5:24 PM David Marchand wrote: > > > > On Thu, Mar 10, 2022 at 3:55 PM Ananyev, Konstantin > > wrote: > > > > Calls to rte_memcpy for 1 < n < 16 could result in unaligned > > > > loads/stores, which is undefined behaviour according to the C > > > > standard, and strict aliasing violations. > > > > > > > > The code was changed to use a packed structure that allows aliasing > > > > (using the __may_alias__ attribute) to perform the load/store > > > > operations. This results in code that has the same performance as the > > > > original code and that is also C standards-compliant. > > > > > > > > Fixes: d35cc1fe6a7a ("eal/x86: revert select optimized memcpy at run-time") > > Actually, looking again at the history, it fixes: > Fixes: f5472703c0bd ("eal: optimize aligned memcpy on x86") Nop, that's probably even older, could you double check? I'll hold on pushing this fix. -- David Marchand