Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1484159rwb; Tue, 27 Sep 2022 13:55:49 -0700 (PDT) X-Google-Smtp-Source: AMsMyM69EDbFqW0tholPEXsbjQG9JgGOCt1zQ8yeJvrDhIjn99W/mH/RrQmJZwrcVeDpi0zbQuuf X-Received: by 2002:a05:6402:90e:b0:443:ec4b:2b03 with SMTP id g14-20020a056402090e00b00443ec4b2b03mr29128953edz.71.1664312149519; Tue, 27 Sep 2022 13:55:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664312149; cv=none; d=google.com; s=arc-20160816; b=QttyE/08q3YMhlHE6dcLlnb/59Ej0ce/SwOC+UWsblPgbj3Hcj2mOeedFbFwyb+aGn QxiMYATrq8QLFkQHdq1fgSxdiX8XE9eUdivoq2T0rGzQFnEYMjD+CVB4AYgnKQEZc7Bb nbNLKMwHHCJvi7cXLefeBvNDlQ7WwV9E2x80tzP2IXcIJP28hpt9ZGrK6JH4oFY5pKED MPhtSTS/6lDry3vTE1P8hLSgWoaYjF+O/E7p/iwPod34YzBcL1DeoncA2RsTq7JM83Su lo/UNuJ67h0rhkXMmR5lKjBLvnvRqqZixr4RPaFpmRhzXl6Z/fz52oFZHabjRh+oQAeT FYng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=nyIWb4q49IeRBcTdaBjFbYmydjE1/zTC63oz1D9JAPw=; b=oL8tqlNqQ9WFhaEMRw524DDtRPswqNzX3TO6EY5TzzU0yGjf3tA8aD2qZq+7bwyjZ1 a0mH10ZSyXPyzKxxuoPwk1stTc6s4xgZatcp4RrrmL1W/VoeIqqAd9gRu/drK1+FK9fB eG1fYO9p7okzZnYnwF9sCevJloAwh3E6347QWoAKqAUgEvAq08WFXws5g4fhoNDvqwWy FADGK9hlYklqwB5afttyDhLRV+M68sbtm2uHXOKDWw4glqJn176Yjq4nBvMwc0uiu6tL mL8MesBxrpobwRbYl5F5Q1YQKlUqMQuLKlz+wQxoVrsqCTsPOA6plkVWuUhqN8bzquZJ GJ0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=D9gQBmNQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b13-20020a50cccd000000b0044f0a023da0si2112684edj.118.2022.09.27.13.55.22; Tue, 27 Sep 2022 13:55:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=D9gQBmNQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233105AbiI0Ugf (ORCPT + 99 others); Tue, 27 Sep 2022 16:36:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233193AbiI0UgR (ORCPT ); Tue, 27 Sep 2022 16:36:17 -0400 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 428D85808A for ; Tue, 27 Sep 2022 13:36:11 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id jm5so10076423plb.13 for ; Tue, 27 Sep 2022 13:36:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=nyIWb4q49IeRBcTdaBjFbYmydjE1/zTC63oz1D9JAPw=; b=D9gQBmNQxGxcJOTmKOJ6kVMZFCat4w9oz+/TgZOTgP6RLidu+QNs96yw4wo1nU9LIZ MwgougQ2dAsE432LNtdp5lTY9XjiD3QB9TsieStF5Z47LwLvjJzCGuHkABhr4fmKRMFa +1RATpr78eb95vQbWQFgjhqPh5bgKqaUdfOEI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=nyIWb4q49IeRBcTdaBjFbYmydjE1/zTC63oz1D9JAPw=; b=cPUJzTuCx6bdd4l16VUnbBchg7TQBbe1OI/X+7/YbpLspuZw1gVGdXwyJ7/LVG+jhg 6lBsFxKjNlAOkkPpvZV4XjHsKWvuLLW2ejARXqykdv9wGy+k36tl8P/rw9StFCTe3q3z vh3g4KZh1N4oZdWaeSgGNiSMLPwYty/kOAw7APBYXk51BznjHAnPJYeK9B+fqaojsV2d VuquMMkwFWFaR14FwueNabtIiILzpcMHSovloeZ0hWN6mCkN9Xk6A9KvSuhxLLn4wxtN 5WByyJVPI62f3GkEXCKJ0o2CP71h8mLy+jpYIJxQx5mKjiCyFevcOY+j3tMar5QhHlut BNVA== X-Gm-Message-State: ACrzQf2Yav8OamLhN+WNzP2ey1D1eoqZ8lgzGnxXLs6Jc/0ElqdiPcF9 rnY+ocfUt57U8lMr7vJ62S1jtU2PjIZTWQ== X-Received: by 2002:a17:90a:e513:b0:200:2275:2d27 with SMTP id t19-20020a17090ae51300b0020022752d27mr6483019pjy.162.1664310970338; Tue, 27 Sep 2022 13:36:10 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id f9-20020a170902f38900b001783f964fe3sm1941280ple.113.2022.09.27.13.36.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Sep 2022 13:36:09 -0700 (PDT) Date: Tue, 27 Sep 2022 13:36:08 -0700 From: Kees Cook To: Nick Desaulniers Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H . Peter Anvin" , Peter Zijlstra , linux-kernel@vger.kernel.org, Linus Torvalds , llvm@lists.linux.dev, Andy Lutomirski Subject: Re: [PATCH v2] x86, mem: move memmove to out of line assembler Message-ID: <202209271333.10AE3E1D@keescook> References: <20220927172839.3708280-1-ndesaulniers@google.com> <202209271143.7B7D15D@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 27, 2022 at 01:01:35PM -0700, Nick Desaulniers wrote: > > Found it (need to use %di instead of %dx). With this changed, the kunit > > test passes again: > > > > That was stupid of me, I updated the scratch register operand in the > instruction 2 before the one at issue and forgot to update the operand > for the register in question, breaking the swap. No worries! It meant I got to do a very careful review of the port. :) > Off thread, can you show me how to run the kunit tests, please? It's literally just what I put in the original email. KUnit is super easy to use. In the root of the kernel source tree, just run: ./tools/testing/kunit/kunit.py run --arch=i386 memcpy Without --arch, it'll default to um. -- Kees Cook