Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3401331rdg; Tue, 17 Oct 2023 13:37:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEagCv2N93r7pDCKGn5qoBshoi/HyJ7HzkTWiGPvCnNFE3jXiQU2ogX3XGndmLLT1bHtTvH X-Received: by 2002:a05:6a20:3d02:b0:12e:caac:f263 with SMTP id y2-20020a056a203d0200b0012ecaacf263mr4759328pzi.20.1697575043903; Tue, 17 Oct 2023 13:37:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697575043; cv=none; d=google.com; s=arc-20160816; b=M5OHwhqVMhX0oi9syUXf/GBt2lO43ebK3VZ0rPI2dMTXa3QNj6eyz8NshdcR8doOag xVko7vhnRZI2kJbPg1oO6UEywvCc0phs/4uzwpDgb+X+tm6VLsYwm7dM0QB7S9rjf9Zp mcqNbv38I2WPyMNurYcfC2A+r+DOAuKkhEr8a9bmL0SbrW1//xjCAhHJcvaxdZ6SaIVB ygGG58GwlQYRtJOewErWZ/M3K4SeRGcx6jib6SVqN3nV/KQQcHAftvsn18lA5GGdCUKQ 3ju4YMoDNUTzPJtzKhZ3f52GIx8wdPGdZmrEY/DaosaRVOr+ExhS12Yso1CCMzJ72+Gc SKaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=kEi3uhi3KiLNGGbfd5SfB9lorUi36o1eVTSn7Ih7Sqw=; fh=//q8/Z/SlAHBZoS2UdeQrkwiCfeubhQ6PGz9zi+RF1s=; b=bBF8sOE9ZeaMHuG0PBWWarzFk/b7WZHNUtUrPwZifiKBrKdaE3lghJ4rq7PN8w5phg Idq3zCPPLSM1wRZqSQp7r0BJsUqUHLGfgMt30/8Bj/nSzG+k+JouKaadeq/1S1MD8qdR Qr2n4kwC8ETuxBu8/g0c1MrUhEp3DJXCzPbMkRE7n8bs7t6qgzsaNzFi2Xx5Eaz+meW2 ZCQCaWLw8F2xQFxa//yjzI5hjzqCArRdwre7EYssIzs/86OIrK5M4MXAKuW88j4RDeOi zv7SNTR7RptozpDbdYnQEdSXjYYqeIwqHMvHpFrvVhTj5C49lYxU0GSAc7ppMOTcnmqo PWzQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id 129-20020a630087000000b00565f0e9cfbbsi556710pga.382.2023.10.17.13.37.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 13:37:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 5FF15801B81D; Tue, 17 Oct 2023 13:37:21 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344254AbjJQUhL (ORCPT + 99 others); Tue, 17 Oct 2023 16:37:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231149AbjJQUhK (ORCPT ); Tue, 17 Oct 2023 16:37:10 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D29F92; Tue, 17 Oct 2023 13:37:08 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 74902C433C7; Tue, 17 Oct 2023 20:37:07 +0000 (UTC) Date: Tue, 17 Oct 2023 16:38:44 -0400 From: Steven Rostedt To: Beau Belgrave Cc: shuah@kernel.org, mhiramat@kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-trace-kernel@vger.kernel.org, Shuah Khan Subject: Re: [PATCH v3] selftests/user_events: Fix abi_test for BE archs Message-ID: <20231017163844.55d828bf@gandalf.local.home> In-Reply-To: <20231005215712.17942-1-beaub@linux.microsoft.com> References: <20231005215712.17942-1-beaub@linux.microsoft.com> X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Tue, 17 Oct 2023 13:37:21 -0700 (PDT) On Thu, 5 Oct 2023 21:57:12 +0000 Beau Belgrave wrote: > The abi_test currently uses a long sized test value for enablement > checks. On LE this works fine, however, on BE this results in inaccurate > assert checks due to a bit being used and assuming it's value is the > same on both LE and BE. > > Use int type for 32-bit values and long type for 64-bit values to ensure > appropriate behavior on both LE and BE. > > Fixes: 60b1af8de8c1 ("tracing/user_events: Add ABI self-test") > Signed-off-by: Beau Belgrave > --- > V3 Changes: > Fix missing cast in clone_check(). > > V2 Changes: > Rebase to linux-kselftest/fixes. Shuah, Can you take this patch? Acked-by: Steven Rostedt (Google) -- Steve > > tools/testing/selftests/user_events/abi_test.c | 16 +++++++++------- > 1 file changed, 9 insertions(+), 7 deletions(-) > > diff --git a/tools/testing/selftests/user_events/abi_test.c b/tools/testing/selftests/user_events/abi_test.c > index 8202f1327c39..f5575ef2007c 100644 > --- a/tools/testing/selftests/user_events/abi_test.c > +++ b/tools/testing/selftests/user_events/abi_test.c > @@ -47,7 +47,7 @@ static int change_event(bool enable) > return ret; > } > > -static int reg_enable(long *enable, int size, int bit) > +static int reg_enable(void *enable, int size, int bit) > { > struct user_reg reg = {0}; > int fd = open(data_file, O_RDWR); > @@ -69,7 +69,7 @@ static int reg_enable(long *enable, int size, int bit) > return ret; > } > > -static int reg_disable(long *enable, int bit) > +static int reg_disable(void *enable, int bit) > { > struct user_unreg reg = {0}; > int fd = open(data_file, O_RDWR); > @@ -90,7 +90,8 @@ static int reg_disable(long *enable, int bit) > } > > FIXTURE(user) { > - long check; > + int check; > + long check_long; > bool umount; > }; > > @@ -99,6 +100,7 @@ FIXTURE_SETUP(user) { > > change_event(false); > self->check = 0; > + self->check_long = 0; > } > > FIXTURE_TEARDOWN(user) { > @@ -136,9 +138,9 @@ TEST_F(user, bit_sizes) { > > #if BITS_PER_LONG == 8 > /* Allow 0-64 bits for 64-bit */ > - ASSERT_EQ(0, reg_enable(&self->check, sizeof(long), 63)); > - ASSERT_NE(0, reg_enable(&self->check, sizeof(long), 64)); > - ASSERT_EQ(0, reg_disable(&self->check, 63)); > + ASSERT_EQ(0, reg_enable(&self->check_long, sizeof(long), 63)); > + ASSERT_NE(0, reg_enable(&self->check_long, sizeof(long), 64)); > + ASSERT_EQ(0, reg_disable(&self->check_long, 63)); > #endif > > /* Disallowed sizes (everything beside 4 and 8) */ > @@ -200,7 +202,7 @@ static int clone_check(void *check) > for (i = 0; i < 10; ++i) { > usleep(100000); > > - if (*(long *)check) > + if (*(int *)check) > return 0; > } > > > base-commit: 6f874fa021dfc7bf37f4f37da3a5aaa41fe9c39c