Received: by 2002:a05:6a10:87d6:0:0:0:0 with SMTP id g22csp222989pxr; Sun, 10 Apr 2022 12:41:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydsP+N3alu9xIRCca4tBitSeKG3LP1Kydw3diQyM6j0jHUZC/15VcbCASpKXE5iyTsy969 X-Received: by 2002:a17:902:cccf:b0:156:31a:736e with SMTP id z15-20020a170902cccf00b00156031a736emr29101777ple.76.1649619670685; Sun, 10 Apr 2022 12:41:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649619670; cv=none; d=google.com; s=arc-20160816; b=wUlInvRSaNCauNDgCoE7S9aObx9yzZbUv1sXdYEpBzyovqGy7A6vfHdLeAm9Uh92QJ eu0khYS5hz4m8KQYrUO4Xf5QMUnFmG/b5GS87UXQelWd4mL9ehh42FlCHAcvkcXqBST2 WYneGw4Y95Myu9wiVHMfHJIPi8nSQ2kzdSUHUpsD6mgaemxApXw34EaklURJ7e2Jx76f WgAa8W6Fa9g2YnmY0LvcIdmrkAmmtjAmw+jqM88Smyn6lATa+86rQVAmqpc3wjxk7jwJ ROCqgI2KlOjGaQlvwvxsuVZZYAt0iKloejjk6HLSiTRTUlNyGqfKMAqRcizkMlEkkhIy 1Slw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:references :cc:to:from:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=vS2s2qRevra2XEsFF3mSNB6jYFDG6iqb3Cu6xK44T5w=; b=XVhBHM/OJqzIFJvwItWpaKjh5WOAbqMutsic7So1CSI0mY6vYiEZu3QC2Mgy1/hahb aKNTaXtOuv1Bbtr9B4pOCzb0hKirAiB2UNSy0E60DL2Z4Pm1zqYUrRYfAlwXmoM6W3dL n3uWmdafgjAdiKOd+aUT4CvbxrA8MIoMjSqPbQEvd3efiJ7isEvpe0xW+KV0UyeGcvcI QPfdSdEHq4qXh75hqdYVM53PF4fy/cRvKuPtrxJ6EqE6zCzIe3RSthFf7ue9gaZOWo1V W7Wnc7wbLFOHy+eKimFCaaiqlyVSEfKCT3oGwZ2eECYD39+0Uy+s8akT45me5Y975ssQ iBzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@landley-net.20210112.gappssmtp.com header.s=20210112 header.b=Li9YdVUV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g2-20020a056a001a0200b004fb04dde469si7136812pfv.23.2022.04.10.12.40.57; Sun, 10 Apr 2022 12:41:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@landley-net.20210112.gappssmtp.com header.s=20210112 header.b=Li9YdVUV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234632AbiDJIGi (ORCPT + 99 others); Sun, 10 Apr 2022 04:06:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234580AbiDJIGe (ORCPT ); Sun, 10 Apr 2022 04:06:34 -0400 Received: from mail-ot1-x330.google.com (mail-ot1-x330.google.com [IPv6:2607:f8b0:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E375C606E2 for ; Sun, 10 Apr 2022 01:04:24 -0700 (PDT) Received: by mail-ot1-x330.google.com with SMTP id n19-20020a9d7113000000b005cd9cff76c3so9228086otj.1 for ; Sun, 10 Apr 2022 01:04:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=landley-net.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language :from:to:cc:references:in-reply-to:content-transfer-encoding; bh=vS2s2qRevra2XEsFF3mSNB6jYFDG6iqb3Cu6xK44T5w=; b=Li9YdVUVqp0sNmfxs6nv4NNpyPzm8bGG/the7OIBqSo1JGcFhZWoNFg9lf2ROaUmFi 3mz05iZGfTWperb7Ok/G4OK9Ta/MhLswL1/6cA9xfrjAiXQwyzL8uB0o2QLaHor3WpFW 7QBD++pHwAqwowvS0S36bjTfpsEQM4FXy0orqj/kkVHDBp8MnKKBxu+LVw5CqSpMycIW Xmgn6R7fNGbYF7Z/l4lwQrOU/pHlj5sdVZkdHwOiYzW2BYYPymXAnCOqVUOE6H5zWas4 pqA1iJ1wvsJUMu+4HhWhypqAG9jkVLeTyoJGlmI2j6WnXayocEjqm1bpyX7E3prjbrAW Z+sA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:from:to:cc:references:in-reply-to :content-transfer-encoding; bh=vS2s2qRevra2XEsFF3mSNB6jYFDG6iqb3Cu6xK44T5w=; b=nYcAgJP67APliYL+K8PhZG8e0oh6An5LxHLmodL8v0cwRwxedtMl8ObJ4zwwUFm0Oc 69eK9LT5LY9AgYEsUKLSxAShNTx+XViY23wIT41bZd1d4+sw2v3K8R+7AzUUHhtIx0au HY7tahPWlDqzpyeQw2HdjTnhhEjJYBSNZzYY3OlcJCUVF8E9BEtr7ZHCN9S7SxwykNlQ MSL7I9I053NDzwy8B5KxolI8rV6on4rsT8bG7x/UWe3VNGQ67bJfEX706qVL78Nu10Fy yUe6MH1pyPSlFHhrQYHAJW83SB9zjmKoHOBXlqTTaILT+6wl1xnGYg1zg2uBr7xN7etA ai7A== X-Gm-Message-State: AOAM532ALhKokjzcOShyWbqVThb0mkJ7JQG6fbQZGsT1Xkqxxlol1F9U Yd68YXzghu/WI4DDO4cyHT6q+A== X-Received: by 2002:a05:6830:82a:b0:5b2:36d5:1603 with SMTP id t10-20020a056830082a00b005b236d51603mr9400402ots.240.1649577864303; Sun, 10 Apr 2022 01:04:24 -0700 (PDT) Received: from [192.168.224.179] ([172.58.198.202]) by smtp.gmail.com with ESMTPSA id lh22-20020a0568700b1600b000e2ba035051sm762425oab.58.2022.04.10.01.04.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 10 Apr 2022 01:04:23 -0700 (PDT) Message-ID: <130c8036-208c-2f6b-999c-31b2e507ecb5@landley.net> Date: Sun, 10 Apr 2022 03:08:28 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.2 Subject: Re: [RFC PULL] remove arch/h8300 Content-Language: en-US From: Rob Landley To: Greg Ungerer , Finn Thain Cc: Daniel Palmer , Arnd Bergmann , Christoph Hellwig , Linus Torvalds , Yoshinori Sato , Linux Kernel Mailing List , linux-arch , "moderated list:H8/300 ARCHITECTURE" , "open list:TENSILICA XTENSA PORT (xtensa)" , Max Filippov , Linux-sh list , linux-m68k , Damien Le Moal , linux-riscv References: <6a38e8b8-7ccc-afba-6826-cb6e4f92af83@linux-m68k.org> <5b7687d4-8ba5-ad79-8a74-33fc2496a3db@linux-m68k.org> <8f9be869-7244-d92a-4683-f9c53da97755@landley.net> <3d5cf48c-94f1-2948-1683-4a2a87f4c697@linux-m68k.org> <147dc6cc-1fbb-558f-8e6d-29d4327d54b4@linux-m68k.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/10/22 02:26, Rob Landley wrote: >> FWIW this will do it: >> >> qemu-system-m68k -nographic -machine mcf5208evb -kernel vmlinux >> >> That will boot an m5208evb_defconfig generated vmlinux. >> But you will need a user space to get a full boot to login/shell. > > No FDPIC support. :( First stab at switching on CONFIG_BINFMT_FDPIC in the coldfire config and adding enough stuff to shut up the compiler. Maybe it'll let me load a PIE binary? Dunno yet, but it compiled a vmlinux that booted to the same panic as the previous one because I haven't fed it an initramfs yet... I also had to disable CONFIG_ELF_CORE or else the link died with: m68k-linux-musl-ld: fs/binfmt_elf_fdpic.o: in function `elf_dump_thread_status': binfmt_elf_fdpic.c:(.text+0x18): undefined reference to `task_user_regset_view' make: *** [Makefile:1155: vmlinux] Error 1 But when I did THAT it compiled. :) diff --git a/arch/m68k/include/asm/elf.h b/arch/m68k/include/asm/elf.h index 3d387ceaea3f..bcb072396640 100644 --- a/arch/m68k/include/asm/elf.h +++ b/arch/m68k/include/asm/elf.h @@ -114,4 +114,6 @@ typedef struct user_m68kfp_struct elf_fpregset_t; #define ELF_PLATFORM (NULL) +#define ELF_FDPIC_CORE_EFLAGS 0 + #endif diff --git a/arch/m68k/include/asm/mmu.h b/arch/m68k/include/asm/mmu.h index 5c15aacb1370..6f6d83b731ed 100644 --- a/arch/m68k/include/asm/mmu.h +++ b/arch/m68k/include/asm/mmu.h @@ -8,6 +8,10 @@ typedef unsigned long mm_context_t; #else typedef struct { unsigned long end_brk; +#ifdef CONFIG_BINFMT_ELF_FDPIC + unsigned long exec_fdpic_loadmap; + unsigned long interp_fdpic_loadmap; +#endif } mm_context_t; #endif diff --git a/arch/m68k/include/uapi/asm/ptrace.h b/arch/m68k/include/uapi/asm/ptrace.h index 19a1b9d0d858..869601381f30 100644 --- a/arch/m68k/include/uapi/asm/ptrace.h +++ b/arch/m68k/include/uapi/asm/ptrace.h @@ -71,6 +71,10 @@ struct switch_stack { #define PTRACE_SETREGS 13 #define PTRACE_GETFPREGS 14 #define PTRACE_SETFPREGS 15 +#define PTRACE_GETFDPIC 31 + +#define PTRACE_GETFDPIC_EXEC 0 +#define PTRACE_GETFDPIC_INTERP 1 #define PTRACE_GET_THREAD_AREA 25 diff --git a/fs/Kconfig.binfmt b/fs/Kconfig.binfmt index 4d5ae61580aa..073360aa982c 100644 --- a/fs/Kconfig.binfmt +++ b/fs/Kconfig.binfmt @@ -45,7 +45,7 @@ config ARCH_USE_GNU_PROPERTY config BINFMT_ELF_FDPIC bool "Kernel support for FDPIC ELF binaries" default y if !BINFMT_ELF - depends on (ARM || (SUPERH && !MMU)) + depends on (ARM || (SUPERH && !MMU) || M68K) select ELFCORE help ELF FDPIC binaries are based on ELF, but allow the individual load Rob