From patchwork Thu Mar 30 23:30:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elliott Mitchell X-Patchwork-Id: 1774260 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=1N8QJzUC; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (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 4Q69VG0vGpz23vH for ; Thu, 27 Apr 2023 06:30:30 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:To:Subject:Date:From: References:In-Reply-To:Message-Id:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=vh7roPiS9mL210NkoJITa3GXkBmaWH708ao5UzTQfMs=; b=1N8QJzUCx5jORR JdejiSJczWbuSSqB+TRWIdiIGt4F6oEjhGmHFTWlxCLpOFHKzV8uihlHCEhHupsxMskiuq9KE5far NxqKowT0b7L2YzHo3aQQwrcFIcleTdbCfb8ezLQCj4UkSF9p8uk0P25/rdqQZORbYzvsqbxkJqu2t VvUBVAAiMlEvQFSl9n9c18Ug/4YVelQT6DtzytUvBoPs8ti3dK7Dgzgzc95gQdoy2gZL6zw4+AeGr dcAx07LoHndnISFU6rsF1C1HWwecxjrBwMfPTUSmGudrPvJDhQcg4kyY5NY0qcy+Kc9ZtWY0fJVvR NWn3VgtSuo5uOogsVWtg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1prllJ-004nsm-2x; Wed, 26 Apr 2023 20:29:13 +0000 Received: from mailhost.m5p.com ([74.104.188.4]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1prllG-004nrK-2n for openwrt-devel@lists.openwrt.org; Wed, 26 Apr 2023 20:29:12 +0000 Received: from m5p.com (mailhost.m5p.com [IPv6:2001:470:1f07:15ff:0:0:0:f7]) by mailhost.m5p.com (8.16.1/8.15.2) with ESMTPS id 33QKT302030142 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO) for ; Wed, 26 Apr 2023 16:29:09 -0400 (EDT) (envelope-from ehem@m5p.com) Received: (from ehem@localhost) by m5p.com (8.16.1/8.15.2/Submit) id 33QKT3aH030141; Wed, 26 Apr 2023 13:29:03 -0700 (PDT) (envelope-from ehem) Message-Id: In-Reply-To: References: From: Elliott Mitchell Date: Thu, 30 Mar 2023 16:30:49 -0700 Subject: [PATCH 6/9] kernel/x86: enable x32 support for amd64 To: openwrt-devel@lists.openwrt.org X-Spam-Status: No, score=2.5 required=10.0 tests=DATE_IN_PAST_96_XX, KHOP_HELO_FCRDNS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mattapan.m5p.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230426_132911_055975_65BEF1CD X-CRM114-Status: UNSURE ( 9.57 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Full amd64 support isn't really appropriate for most situations OpenWRT is deployed. Whereas x86-x32 seems extremely appropriate for these situations. As such enable x86-x32 support. CONFIG_ARCH_MMAP_RND_COMPAT_BITS is required to follow along, otherwise the kernel build breaks. Content analysis details: (2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 2.1 DATE_IN_PAST_96_XX Date: is 96 hours or more before Received: date -0.0 SPF_HELO_PASS SPF: HELO matches SPF record X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Full amd64 support isn't really appropriate for most situations OpenWRT is deployed. Whereas x86-x32 seems extremely appropriate for these situations. As such enable x86-x32 support. CONFIG_ARCH_MMAP_RND_COMPAT_BITS is required to follow along, otherwise the kernel build breaks. Signed-off-by: Elliott Mitchell --- I suggest OpenWRT should be placing quite a bit of effort towards x86-x32. x86-x32 seems a rather superior generic target for OpenWRT. Only issue is it could be valuable to have at least minimal amd64 userland support alongside the x86-x32 version. --- target/linux/x86/64/config-5.10 | 1 - target/linux/x86/64/config-5.15 | 1 - target/linux/x86/config-5.10 | 2 ++ target/linux/x86/config-5.15 | 2 ++ 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/target/linux/x86/64/config-5.10 b/target/linux/x86/64/config-5.10 index 1515f90932..de93495fb1 100644 --- a/target/linux/x86/64/config-5.10 +++ b/target/linux/x86/64/config-5.10 @@ -470,7 +470,6 @@ CONFIG_X86_PM_TIMER=y # CONFIG_X86_POWERNOW_K8 is not set # CONFIG_X86_VSYSCALL_EMULATION is not set CONFIG_X86_X2APIC=y -# CONFIG_X86_X32 is not set CONFIG_XEN=y CONFIG_XENFS=y CONFIG_XEN_512GB=y diff --git a/target/linux/x86/64/config-5.15 b/target/linux/x86/64/config-5.15 index a20891ea55..39e5064e53 100644 --- a/target/linux/x86/64/config-5.15 +++ b/target/linux/x86/64/config-5.15 @@ -493,7 +493,6 @@ CONFIG_X86_PM_TIMER=y # CONFIG_X86_POWERNOW_K8 is not set # CONFIG_X86_VSYSCALL_EMULATION is not set CONFIG_X86_X2APIC=y -# CONFIG_X86_X32 is not set CONFIG_XEN=y CONFIG_XENFS=y CONFIG_XEN_512GB=y diff --git a/target/linux/x86/config-5.10 b/target/linux/x86/config-5.10 index afb7adc63a..8be829d549 100644 --- a/target/linux/x86/config-5.10 +++ b/target/linux/x86/config-5.10 @@ -12,6 +12,7 @@ CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARCH_MAY_HAVE_PC_FDC=y CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y +CONFIG_ARCH_MMAP_RND_COMPAT_BITS=8 CONFIG_ARCH_RANDOM=y CONFIG_ARCH_SELECT_MEMORY_MODEL=y CONFIG_ARCH_SPARSEMEM_ENABLE=y @@ -423,6 +424,7 @@ CONFIG_X86_UP_IOAPIC=y CONFIG_X86_USE_PPRO_CHECKSUM=y CONFIG_X86_VERBOSE_BOOTUP=y CONFIG_X86_VMX_FEATURE_NAMES=y +CONFIG_X86_X32=y CONFIG_XZ_DEC_BCJ=y CONFIG_XZ_DEC_X86=y CONFIG_ZLIB_INFLATE=y diff --git a/target/linux/x86/config-5.15 b/target/linux/x86/config-5.15 index b59e809127..afe66b27b1 100644 --- a/target/linux/x86/config-5.15 +++ b/target/linux/x86/config-5.15 @@ -13,6 +13,7 @@ CONFIG_ARCH_MAY_HAVE_PC_FDC=y CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y +CONFIG_ARCH_MMAP_RND_COMPAT_BITS=8 CONFIG_ARCH_NR_GPIO=512 CONFIG_ARCH_RANDOM=y CONFIG_ARCH_SELECT_MEMORY_MODEL=y @@ -428,6 +429,7 @@ CONFIG_X86_UP_IOAPIC=y CONFIG_X86_USE_PPRO_CHECKSUM=y CONFIG_X86_VERBOSE_BOOTUP=y CONFIG_X86_VMX_FEATURE_NAMES=y +CONFIG_X86_X32=y CONFIG_XZ_DEC_BCJ=y CONFIG_XZ_DEC_X86=y CONFIG_ZLIB_INFLATE=y