From patchwork Wed Nov 28 19:36:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brendan Higgins X-Patchwork-Id: 10703257 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id ED89F15A8 for ; Wed, 28 Nov 2018 19:38:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DFE4629F77 for ; Wed, 28 Nov 2018 19:38:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D3F3D2B182; Wed, 28 Nov 2018 19:38:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, USER_IN_DEF_DKIM_WL autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8722C29F77 for ; Wed, 28 Nov 2018 19:38:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729514AbeK2GlI (ORCPT ); Thu, 29 Nov 2018 01:41:08 -0500 Received: from mail-qt1-f202.google.com ([209.85.160.202]:52351 "EHLO mail-qt1-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729529AbeK2GlI (ORCPT ); Thu, 29 Nov 2018 01:41:08 -0500 Received: by mail-qt1-f202.google.com with SMTP id w15so25045110qtk.19 for ; Wed, 28 Nov 2018 11:38:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=ZXeVKB3z4xYEMo//ei2CNGIhvC0pSeK1m9ZjHQ2diMw=; b=Rb9/h0zVwkkHN++1m58koJGyJMM2Qj3zSthOhQpGBZZ/uJowc3xBQITml1f4/xyZJa B3DhIiwi2xrFoi7Lg1DCPrR7jql0Y5iiGW96UAdIv/l7a72tOaIu/2RUTYsVhdx+iX4R oQTLd2T63dQ5oa12uvSnjG9zKS1z6OdomrilynAIPtjXmcHqnpGxebSh6XpLGu/l3GAs ylLroOjj6q8fZ3fFnQzEjEyoaI8rLhh6rTtvDOqiMTzpL9bPKHMnD6jP9jkDdxo3USg+ v3DuICgLArR4aAaeTCE1kY5NXdiff1auhDnsM8/YzuuEHTJRs7rDohz5swcips2xZ6Ov CFTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=ZXeVKB3z4xYEMo//ei2CNGIhvC0pSeK1m9ZjHQ2diMw=; b=DEHsQAzeSWvYcGMWCvy9Lrta3QBxMJvJfxqYkHr4ycDVTD2HA2kiP6GelNmpyS/4Ux hYkdkgv2FD8qgGYox/gmgSxnk36EqF6VFK6mtqv6WF7eprgEm21qbQb8c4wTxbERA3Vq ONisd3KOBwbT06Z6R4Ml0U3Vi9KssjEYbJQc3THnRp2qXjep4F2dOAksgcF9SuR5k1Bj YXFeUaB+11b+oD7J/ASL2zoSRZ5VespRqRPdK+Ttt62nVR2+aDAApDw/hDbfwnyjrmBI PDwIDtyjMes3IoVA5Ggfxd0VAASRAroLMBHvjiKs4L4kru4cCrYFQ8oLmECIRyiAVPeQ oQ8w== X-Gm-Message-State: AA+aEWa1NXVLHwB1yzfw0nznEz3nmod+FNxeybiOfG+ryTfzUAJ7zZgE 4e9+gRLMJJUXaBtsd4QmgNjoi17gA2fhU93hczUJjQ== X-Google-Smtp-Source: AFSGD/WNRv4uLe4qzapo7byn71/CSO8pn+dusHGBhoYU/dteolVxh/z9q17isRjU/4o3tgV/+62KxUnN0F0B3WRn+xp75A== X-Received: by 2002:a37:4916:: with SMTP id w22mr4361663qka.6.1543433903147; Wed, 28 Nov 2018 11:38:23 -0800 (PST) Date: Wed, 28 Nov 2018 11:36:33 -0800 In-Reply-To: <20181128193636.254378-1-brendanhiggins@google.com> Message-Id: <20181128193636.254378-17-brendanhiggins@google.com> Mime-Version: 1.0 References: <20181128193636.254378-1-brendanhiggins@google.com> X-Mailer: git-send-email 2.20.0.rc0.387.gc7a69e6b6c-goog Subject: [RFC v3 16/19] arch: um: make UML unflatten device tree when testing From: Brendan Higgins To: gregkh@linuxfoundation.org, keescook@google.com, mcgrof@kernel.org, shuah@kernel.org Cc: joel@jms.id.au, mpe@ellerman.id.au, joe@perches.com, brakmo@fb.com, rostedt@goodmis.org, Tim.Bird@sony.com, khilman@baylibre.com, julia.lawall@lip6.fr, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-kernel@vger.kernel.org, jdike@addtoit.com, richard@nod.at, linux-um@lists.infradead.org, daniel@ffwll.ch, dri-devel@lists.freedesktop.org, robh@kernel.org, dan.j.williams@intel.com, linux-nvdimm@lists.01.org, kieran.bingham@ideasonboard.com, frowand.list@gmail.com, knut.omang@oracle.com, Brendan Higgins Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Make UML unflatten any present device trees when running KUnit tests. Signed-off-by: Brendan Higgins --- arch/um/kernel/um_arch.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c index a818ccef30ca2..bd58ae3bf4148 100644 --- a/arch/um/kernel/um_arch.c +++ b/arch/um/kernel/um_arch.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -347,6 +348,9 @@ void __init setup_arch(char **cmdline_p) read_initrd(); paging_init(); +#if IS_ENABLED(CONFIG_OF_UNITTEST) + unflatten_device_tree(); +#endif strlcpy(boot_command_line, command_line, COMMAND_LINE_SIZE); *cmdline_p = command_line; setup_hostinfo(host_info, sizeof host_info);