Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp93773pxu; Tue, 24 Nov 2020 20:07:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJyhz/o8KofhT8nlnOy6h6SKGWLiljlnuyt0oWFE954XzyC7d4yuwxNPL6NFvRxaZI00XaEX X-Received: by 2002:a17:906:3187:: with SMTP id 7mr1496469ejy.225.1606277244768; Tue, 24 Nov 2020 20:07:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606277244; cv=none; d=google.com; s=arc-20160816; b=UcSbOA6E2M1Lw0RfVQ4GeP/yhOSMBy8dWv6Dyyyl38NV2LWiETW17MoezKnhwTikQF Ww4TD9T04V/fanDNSILFzNB/XesmoxHIzWZziddJK6oBRkKhYYeGZSLM/Ss2HrdSVSBk c69Ybl9WVdhu5pxoACF+mSMkhPL5MAVMy7riOO0onQ10DvRAz+PMZAyXj3+Bdhs42Wln D2E3yo0AGYcH9FEDcIT4AQ4Q8UPwiLwPnWkhwTTmpNu5mDC+hE7WV4VEKAv6Fdn9VrXl Ta0YX/3ZXh56uSXy4xuFWS9/wXMkm1gKW5XWtffjPD2E7mYqjBbT0ioYxKi1l9wXK4// 2D1g== 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 :message-id:date:subject:cc:to:from; bh=8HaMHGvoWtHt5yTj5tBtTznpj5EdP7oiSRwI121TiM4=; b=Y3JyTxNDHWjjg3AolKwop1k4hAiRGk079zskNIqh03O8TDPCDYsK/0bqI7c+6oHttX tAhsEYWrgbz+CznOe+VXsJDoF+aOrBCUWaf840mwvh1Ktugd+DI2ZsxGd2E5xnY5m2KY Q+IatbcxSFco7jB2Zn80Q5FMbS6ApsmPg2PD2gf6sxZDclgp1npX8F1h81Zq8vBMZK3C cbzIRNbTsPndTeFzWeAvW+jZhC4TEYDpGXUJUdmBNxgkGao23nFY/DcF2Ib9BPDTSXzC iEXc/fCwM763+rNPZoKF2JLnKnXbxej3ewum7aAn2J0zZfb1jdG6DqYLS8t5N30tQSUe yJag== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n12si580433eje.452.2020.11.24.20.06.59; Tue, 24 Nov 2020 20:07:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726762AbgKYEFG (ORCPT + 99 others); Tue, 24 Nov 2020 23:05:06 -0500 Received: from mail.loongson.cn ([114.242.206.163]:41756 "EHLO loongson.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726039AbgKYEFF (ORCPT ); Tue, 24 Nov 2020 23:05:05 -0500 Received: from bogon.localdomain (unknown [113.200.148.30]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9AxitHq171fW1wWAA--.43984S2; Wed, 25 Nov 2020 12:04:58 +0800 (CST) From: Xingxing Su To: Mathieu Desnoyers , Peter Zijlstra , "Paul E. McKenney" , Boqun Feng , Shuah Khan Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH] rseq/selftests: Fix MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ build error under other arch. Date: Wed, 25 Nov 2020 12:04:57 +0800 Message-Id: <1606277097-5853-1-git-send-email-suxingxing@loongson.cn> X-Mailer: git-send-email 2.1.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf9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KfnxnU UI43ZEXa7IUY8wIDUUUUU== X-CM-SenderInfo: pvx0x0xj0l0wo6or00hjvr0hdfq/1tbiAQALC13QvMrfWgABs+ Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Except arch x86, the function rseq_offset_deref_addv is not defined. The function test_membarrier_manager_thread call rseq_offset_deref_addv produces a build error. The RSEQ_ARCH_HAS_OFFSET_DEREF_ADD should contain all the code for the MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ. If the other Arch implements this feature, defined RSEQ_ARCH_HAS_OFFSET_DEREF_ADD in the header file to ensure that this feature is available. Following build errors: param_test.c: In function ‘test_membarrier_worker_thread’: param_test.c:1164:10: warning: implicit declaration of function ‘rseq_offset_deref_addv’ ret = rseq_offset_deref_addv(&args->percpu_list_ptr, ^~~~~~~~~~~~~~~~~~~~~~ /tmp/ccMj9yHJ.o: In function `test_membarrier_worker_thread': param_test.c:1164: undefined reference to `rseq_offset_deref_addv' param_test.c:1164: undefined reference to `rseq_offset_deref_addv' collect2: error: ld returned 1 exit status make: *** [/selftests/rseq/param_test_benchmark] Error 1 Signed-off-by: Xingxing Su --- tools/testing/selftests/rseq/param_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/rseq/param_test.c b/tools/testing/selftests/rseq/param_test.c index 3845890..699ad5f 100644 --- a/tools/testing/selftests/rseq/param_test.c +++ b/tools/testing/selftests/rseq/param_test.c @@ -1133,6 +1133,8 @@ static int set_signal_handler(void) return ret; } +/* Test MEMBARRIER_CMD_PRIVATE_RESTART_RSEQ_ON_CPU membarrier command. */ +#ifdef RSEQ_ARCH_HAS_OFFSET_DEREF_ADDV struct test_membarrier_thread_args { int stop; intptr_t percpu_list_ptr; @@ -1286,8 +1288,6 @@ void *test_membarrier_manager_thread(void *arg) return NULL; } -/* Test MEMBARRIER_CMD_PRIVATE_RESTART_RSEQ_ON_CPU membarrier command. */ -#ifdef RSEQ_ARCH_HAS_OFFSET_DEREF_ADDV void test_membarrier(void) { const int num_threads = opt_threads; -- 1.8.3.1