From patchwork Wed Jun 29 11:05:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vicente Olivert Riera X-Patchwork-Id: 641990 X-Patchwork-Delegate: Vincent.Riera@imgtec.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rffxR0zrqz9ssM for ; Wed, 29 Jun 2016 21:06:19 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 13CDD957D7; Wed, 29 Jun 2016 11:06:15 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vF2ytzeoMm+M; Wed, 29 Jun 2016 11:06:12 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 7C9B3957D4; Wed, 29 Jun 2016 11:06:12 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id EBF461C16C7 for ; Wed, 29 Jun 2016 11:06:10 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id E7C1488F38 for ; Wed, 29 Jun 2016 11:06:10 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id otw_S5bKCLLH for ; Wed, 29 Jun 2016 11:06:09 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mailapp01.imgtec.com (mailapp01.imgtec.com [195.59.15.196]) by fraxinus.osuosl.org (Postfix) with ESMTP id C121B875FD for ; Wed, 29 Jun 2016 11:06:09 +0000 (UTC) Received: from HHMAIL01.hh.imgtec.org (unknown [10.100.10.19]) by Forcepoint Email with ESMTPS id 9E6F769A62955 for ; Wed, 29 Jun 2016 12:06:05 +0100 (IST) Received: from vriera-linux.le.imgtec.org (192.168.154.36) by HHMAIL01.hh.imgtec.org (10.100.10.21) with Microsoft SMTP Server (TLS) id 14.3.294.0; Wed, 29 Jun 2016 12:06:07 +0100 From: Vicente Olivert Riera To: Date: Wed, 29 Jun 2016 12:05:34 +0100 Message-ID: <1467198337-47064-1-git-send-email-Vincent.Riera@imgtec.com> X-Mailer: git-send-email 2.7.3 MIME-Version: 1.0 X-Originating-IP: [192.168.154.36] Subject: [Buildroot] [PATCH 5/8] Add qemu_mips_32r6_malta_defconfig X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Signed-off-by: Vicente Olivert Riera --- board/qemu/mips-32r6-malta/linux-4.6.config | 30 +++++++++++++++++++++ board/qemu/mips-32r6-malta/readme.txt | 7 +++++ ...oration-of-MSA-context-in-non-MSA-kernels.patch | 25 +++++++++++++++++ configs/qemu_mips_32r6_malta_defconfig | 31 ++++++++++++++++++++++ 4 files changed, 93 insertions(+) create mode 100644 board/qemu/mips-32r6-malta/linux-4.6.config create mode 100644 board/qemu/mips-32r6-malta/readme.txt create mode 100644 board/qemu/mips-32r6-malta/v2-MIPS-Prevent-restoration-of-MSA-context-in-non-MSA-kernels.patch create mode 100644 configs/qemu_mips_32r6_malta_defconfig diff --git a/board/qemu/mips-32r6-malta/linux-4.6.config b/board/qemu/mips-32r6-malta/linux-4.6.config new file mode 100644 index 0000000..d559676 --- /dev/null +++ b/board/qemu/mips-32r6-malta/linux-4.6.config @@ -0,0 +1,30 @@ +CONFIG_MIPS_MALTA=y +CONFIG_CPU_MIPS32_R6=y +CONFIG_MIPS_MT_SMP=y +CONFIG_NR_CPUS=2 +CONFIG_SYSVIPC=y +CONFIG_HIGH_RES_TIMERS=y +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +CONFIG_PCI=y +CONFIG_NET=y +CONFIG_PACKET=y +CONFIG_UNIX=y +CONFIG_INET=y +CONFIG_IDE=y +CONFIG_BLK_DEV_IDECD=y +CONFIG_IDE_GENERIC=y +CONFIG_BLK_DEV_GENERIC=y +CONFIG_BLK_DEV_PIIX=y +CONFIG_NETDEVICES=y +CONFIG_PCNET32=y +CONFIG_INPUT_EVDEV=y +CONFIG_SERIAL_8250=y +CONFIG_SERIAL_8250_CONSOLE=y +CONFIG_FB=y +CONFIG_FB_CIRRUS=y +CONFIG_USB=y +CONFIG_USB_UHCI_HCD=y +CONFIG_EXT4_FS=y +CONFIG_TMPFS=y +CONFIG_TMPFS_POSIX_ACL=y diff --git a/board/qemu/mips-32r6-malta/readme.txt b/board/qemu/mips-32r6-malta/readme.txt new file mode 100644 index 0000000..107c47d --- /dev/null +++ b/board/qemu/mips-32r6-malta/readme.txt @@ -0,0 +1,7 @@ +Run the emulation with: + +qemu-system-mips -M malta -cpu mips32r6-generic -kernel output/images/vmlinux -drive file=output/images/rootfs.ext2,format=raw -append "root=/dev/hda" -nographic + +The login prompt will appear in the terminal that started Qemu. + +Tested with QEMU 2.6.0 diff --git a/board/qemu/mips-32r6-malta/v2-MIPS-Prevent-restoration-of-MSA-context-in-non-MSA-kernels.patch b/board/qemu/mips-32r6-malta/v2-MIPS-Prevent-restoration-of-MSA-context-in-non-MSA-kernels.patch new file mode 100644 index 0000000..6741b7f --- /dev/null +++ b/board/qemu/mips-32r6-malta/v2-MIPS-Prevent-restoration-of-MSA-context-in-non-MSA-kernels.patch @@ -0,0 +1,25 @@ +diff --git a/arch/mips/kernel/signal.c b/arch/mips/kernel/signal.c +index bf792e2..fc7c1f0 100644 +--- a/arch/mips/kernel/signal.c ++++ b/arch/mips/kernel/signal.c +@@ -195,6 +195,9 @@ static int restore_msa_extcontext(void __user *buf, unsigned int size) + unsigned int csr; + int i, err; + ++ if (!config_enabled(CONFIG_CPU_HAS_MSA)) ++ return SIGSYS; ++ + if (size != sizeof(*msa)) + return -EINVAL; + +@@ -398,8 +401,8 @@ int protected_restore_fp_context(void __user *sc) + } + + fp_done: +- if (used & USED_EXTCONTEXT) +- err |= restore_extcontext(sc_to_extcontext(sc)); ++ if (!err && (used & USED_EXTCONTEXT)) ++ err = restore_extcontext(sc_to_extcontext(sc)); + + return err ?: sig; + } diff --git a/configs/qemu_mips_32r6_malta_defconfig b/configs/qemu_mips_32r6_malta_defconfig new file mode 100644 index 0000000..46d51dd --- /dev/null +++ b/configs/qemu_mips_32r6_malta_defconfig @@ -0,0 +1,31 @@ +# Architecture +BR2_mips=y +BR2_mips_32r6=y + +# System +BR2_SYSTEM_DHCP="eth0" + +# Filesystem +BR2_TARGET_ROOTFS_EXT2=y +# BR2_TARGET_ROOTFS_TAR is not set + +# Linux headers same as kernel, a 4.6 series +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_6=y + +# Kernel +BR2_LINUX_KERNEL=y +BR2_LINUX_KERNEL_CUSTOM_VERSION=y +BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.6.1" +BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y +BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/qemu/mips-32r6-malta/linux-4.6.config" +BR2_LINUX_KERNEL_VMLINUX=y +# kernel patch needed to compile with GCC 6.x +BR2_LINUX_KERNEL_PATCH="board/qemu/mips-32r6-malta/v2-MIPS-Prevent-restoration-of-MSA-context-in-non-MSA-kernels.patch" + +# Compiler +# linux >= 4.4 uses -mcompact-branches which is only available since gcc-6 +BR2_GCC_VERSION_6_X=y + +# Serial port config +BR2_TARGET_GENERIC_GETTY=y +BR2_TARGET_GENERIC_GETTY_PORT="ttyS0"