From patchwork Tue Oct 18 15:25:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Palethorpe X-Patchwork-Id: 1691591 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=suse.com header.i=@suse.com header.a=rsa-sha256 header.s=susede1 header.b=c/pU7Vsq; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MsHkL69Xxz23jx for ; Wed, 19 Oct 2022 02:25:45 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 6D2A63CB0B7 for ; Tue, 18 Oct 2022 17:25:37 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-4.smtp.seeweb.it (in-4.smtp.seeweb.it [217.194.8.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id 3CA543CB077 for ; Tue, 18 Oct 2022 17:25:35 +0200 (CEST) Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by in-4.smtp.seeweb.it (Postfix) with ESMTPS id 5A29A10009FF for ; Tue, 18 Oct 2022 17:25:33 +0200 (CEST) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 4191122BE8; Tue, 18 Oct 2022 15:25:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1666106733; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=OuLu5jpeC9yTJy31FzXQMTDvZUnYh3abmMXodHdCBh8=; b=c/pU7VsqkyEaXt3WuqW3kF8WBQWVXvhUJ1Ty1Gg77WQkmbUpqDpkvGQA/g3JOA5unjvyfN NxvA/Wgatu1KirCMyVsTyqdW2zIUhvfPYggT/X4I2ILmg0YR3CxJULhOUVPxNEKdoAtkYI n8OSEBu2pmbocwAivMlv2S8/nsTYn7g= Received: from g78.suse.cz (unknown [10.100.228.202]) by relay2.suse.de (Postfix) with ESMTP id 846532C141; Tue, 18 Oct 2022 15:25:32 +0000 (UTC) To: ltp@lists.linux.it Date: Tue, 18 Oct 2022 16:25:26 +0100 Message-Id: <20221018152527.4636-1-rpalethorpe@suse.com> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.102.4 at in-4.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on in-4.smtp.seeweb.it Subject: [LTP] [PATCH 1/2] ptrace07: Fix compilation when not on x86 X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Richard Palethorpe via ltp From: Richard Palethorpe Reply-To: Richard Palethorpe Cc: Richard Palethorpe Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" Strictly cpuid.h should not be included on non-x86, but this means each test author has to remember not to include it. Instead we can set a blank macro to allow compilation. Signed-off-by: Richard Palethorpe --- This time I created a PR to check if compilation succeeds: https://github.com/linux-test-project/ltp/pull/984 include/lapi/cpuid.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/lapi/cpuid.h b/include/lapi/cpuid.h index cd0567f92..20e977093 100644 --- a/include/lapi/cpuid.h +++ b/include/lapi/cpuid.h @@ -16,11 +16,15 @@ * have __cpuid_count(). */ #ifndef __cpuid_count +# if defined(__i386__) || defined(__x86_64__) #define __cpuid_count(level, count, a, b, c, d) ({ \ __asm__ __volatile__ ("cpuid\n\t" \ : "=a" (a), "=b" (b), "=c" (c), "=d" (d) \ : "0" (level), "2" (count)); \ }) +# else +#define __cpuid_count(level, count, a, b, c, d) +# endif #endif #endif /* LAPI_CPUID_H__ */ From patchwork Tue Oct 18 15:25:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Palethorpe X-Patchwork-Id: 1691592 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=213.254.12.146; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=suse.com header.i=@suse.com header.a=rsa-sha256 header.s=susede1 header.b=durQwOmq; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MsHkV1nbMz23jx for ; Wed, 19 Oct 2022 02:25:54 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id E29ED3CB0DB for ; Tue, 18 Oct 2022 17:25:48 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-4.smtp.seeweb.it (in-4.smtp.seeweb.it [217.194.8.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id C4B853CB077 for ; Tue, 18 Oct 2022 17:25:35 +0200 (CEST) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by in-4.smtp.seeweb.it (Postfix) with ESMTPS id 79C50100064B for ; Tue, 18 Oct 2022 17:25:35 +0200 (CEST) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id D9F8F1F890; Tue, 18 Oct 2022 15:25:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1666106734; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=m0KMHBNk+Ovx2Ri9hSjXTf4CyMUWf0aTKpa+Rc0PD2I=; b=durQwOmqd/DgnbZNAZnxIeeX6LM++Ygd/3MLIfUxjFM1sJxNOA/w5vvyPRsYbmzIfcr87e zCMofRuQJFcvaYdUaZMRjFeMRdRQmwHc4F3dLkvj0Du9gDWXnlvwR+f23JIdNaDYSQkY7O UflCqDM2T3371wu861w1A4Hjn+iPNFE= Received: from g78.suse.cz (unknown [10.100.228.202]) by relay2.suse.de (Postfix) with ESMTP id DC0FD2C141; Tue, 18 Oct 2022 15:25:33 +0000 (UTC) To: ltp@lists.linux.it Date: Tue, 18 Oct 2022 16:25:27 +0100 Message-Id: <20221018152527.4636-2-rpalethorpe@suse.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20221018152527.4636-1-rpalethorpe@suse.com> References: <20221018152527.4636-1-rpalethorpe@suse.com> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.102.4 at in-4.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on in-4.smtp.seeweb.it Subject: [LTP] [PATCH 2/2] ptrace07: Fix compilation by avoiding aligned_alloc X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Richard Palethorpe via ltp From: Richard Palethorpe Reply-To: Richard Palethorpe Cc: Richard Palethorpe Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" Use memalign instead because we live in the past. Signed-off-by: Richard Palethorpe Cc: Pengfei Xu --- testcases/kernel/syscalls/ptrace/ptrace07.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testcases/kernel/syscalls/ptrace/ptrace07.c b/testcases/kernel/syscalls/ptrace/ptrace07.c index 6bd2b1062..a60c2a49e 100644 --- a/testcases/kernel/syscalls/ptrace/ptrace07.c +++ b/testcases/kernel/syscalls/ptrace/ptrace07.c @@ -35,6 +35,7 @@ #include "config.h" #include "ptrace.h" #include "tst_test.h" +#include "tst_safe_macros.h" #include "lapi/cpuid.h" #ifndef PTRACE_GETREGSET @@ -95,7 +96,7 @@ static void do_test(void) * of the XSAVE/XRSTOR save area) required by enabled features in XCR0. */ __cpuid_count(CPUID_LEAF_XSTATE, ecx, eax, ebx, ecx, edx); - xstate = aligned_alloc(64, ebx); + xstate = SAFE_MEMALIGN(64, ebx); struct iovec iov = { .iov_base = xstate, .iov_len = ebx }; int status; bool okay;