From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 23360C4332F for ; Wed, 9 Nov 2022 17:26:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230240AbiKIR0K (ORCPT ); Wed, 9 Nov 2022 12:26:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229447AbiKIR0H (ORCPT ); Wed, 9 Nov 2022 12:26:07 -0500 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17B79222B8 for ; Wed, 9 Nov 2022 09:26:02 -0800 (PST) Received: by mail-wm1-x330.google.com with SMTP id p16so11285872wmc.3 for ; Wed, 09 Nov 2022 09:26:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=ZCXeEArAtZpsAV3+eRTf/uuyrZvxHawTJioxLNt9+dY=; b=r7GxC3viikU1BMakG5VODgDk9Ij9V8KtgDgvhaAN4UHpivyY3e4nV49LEEY1sqxbmO LqfOPKqYXKHHfn7bIaMP1n+YbjvZyEGpi2gRLeDhLnhu6zXhMMNnaUVq+wqhCeIPC/Gy fJlFTR2cil1rBrbYX3MJu6fsyyFBl6IC0nfrApkOkx5tl23d2Q3URRaaEILdCISe+NAP g6qlYZIrrCm7ReiwB3g5Y7/TPguUmRf3j0jhn4wcUda1kbxgOAwJ+j1hmr/qQGbvrasW n9PIqCPu3Tqs6PyOK6uKyxZouglTgkp60ax4a7+WT07hntm100KUa677jm4dYvReXyEh Iv/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ZCXeEArAtZpsAV3+eRTf/uuyrZvxHawTJioxLNt9+dY=; b=RcojYo8LxQ3r+IsriZQklyIgcX3jaIZondw43laTkUmOWhibXLdcfipYfLWuzEORHC NBjWlyp4eq7BHOl567TIfqbUelzIN/oaTjh58tjPM8rb6SnAvmAIy4B1SEA5SPxhRYYP tUSNOSCqZQOYjwpbPn5COtScZeoWqay8TmRF51mW9j3FbGDBRGvBMjsK5WXB3kYktK7S unNsw0oElKITKOi90Vd5R3Ud1IUiXOmUZxSC7OurkUDRYBukIDMiA1IyfuFmzQe8AN2c VE/yzZEENLu+r8HBemyZbxAzjLlUmoOutgTUs7x0s1dNW6SyHYpjz+QaVUfBvmNUpOEJ 3whg== X-Gm-Message-State: ACrzQf0f0bF5jmaAUwOaSyXvjbJpike2I8+9TVfaavhpVwKpgDiVm09D ICHinIEUEM8pUJFyJLb5tOG4Vg== X-Google-Smtp-Source: AMsMyM5/nJv3lbVZCjlhCxvQw9vBCMdyhzzwwyfsJrMd9x8XBUHC9V7Ftyi3Z0ER7AqpImwLPc2RWg== X-Received: by 2002:a05:600c:3781:b0:3a6:804a:afc with SMTP id o1-20020a05600c378100b003a6804a0afcmr50635675wmr.27.1668014760612; Wed, 09 Nov 2022 09:26:00 -0800 (PST) Received: from localhost ([95.148.15.66]) by smtp.gmail.com with ESMTPSA id j20-20020a05600c489400b003cfa80443a0sm2064380wmp.35.2022.11.09.09.25.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Nov 2022 09:25:58 -0800 (PST) From: Punit Agrawal To: Alexey Dobriyan Cc: Punit Agrawal , akpm@linux-foundation.org, shuah@kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: Re: Re: [PATCH] selftests: proc: Fix proc-empty-vm build error on non x86_64 References: <20221109110621.1791999-1-punit.agrawal@bytedance.com> Date: Wed, 09 Nov 2022 17:25:56 +0000 In-Reply-To: (Alexey Dobriyan's message of "Wed, 9 Nov 2022 19:59:31 +0300") Message-ID: <87leok11ln.fsf_-_@stealth> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Alexey Dobriyan writes: > On Wed, Nov 09, 2022 at 11:06:21AM +0000, Punit Agrawal wrote: >> The proc-empty-vm test is implemented for x86_64 and fails to build >> for other architectures. Rather then emitting a compiler error it >> would be preferable to only build the test on supported architectures. > > Ehh, can you just port it to whatever arch you're using? > What's the address space on arm/arm64? On arm64, it is 0x0000ffffffffffff ((1 << 48) - 1) when using 48bit VA, but goes up when using 52-bit VA[0]. > #ifdef __amd64__ > munmap(NULL, ((size_t)1 << 47) - 4096); > #else > #error "implement 'unmap everything'" > #endif > > This program is almost arch-independent. I did try updating the #ifdef but then hit the asm block in vsyscall(). Also, the test would be still fail to build on other architectures. While support for architectures is added, it would be good to not have the compiler throw an error on unsuspecting kselftest users. >> +TEST_GEN_PROGS_x86_64 += proc-empty-vm [0] https://docs.kernel.org/arm64/memory.html