From patchwork Wed Jul 1 16:29:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nastya Vicodin X-Patchwork-Id: 1321290 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=C7nPsTD3; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49yFtt4V5kz9sPF for ; Thu, 2 Jul 2020 21:17:42 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 36288821EF; Thu, 2 Jul 2020 13:13:51 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="C7nPsTD3"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CE08481991; Wed, 1 Jul 2020 18:30:43 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-lf1-x143.google.com (mail-lf1-x143.google.com [IPv6:2a00:1450:4864:20::143]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 4BCC98006D for ; Wed, 1 Jul 2020 18:30:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=vicooodin@gmail.com Received: by mail-lf1-x143.google.com with SMTP id k17so1270222lfg.3 for ; Wed, 01 Jul 2020 09:30:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=+lgphjjPXRbRF3I9hUd56aYYPMc0GA3T+ISDwiExdc8=; b=C7nPsTD3sUDPzYOIDAw0bvFCCYOZdpaS6p9flV0pozyjAHju5irRZlREsRLV9wyh8q nc/c8NtsBOiAM2KHWvjcdaDjJGAF5jXA25mIc7BXktdNpfWnEdnGfrctkmLu0NLJxFxp VBn2tnY0NkC5irEo2IlhID8UfJCsfjrbSr+Ib85x4XUA8jYmgE3VLl33wOAgMZB0W2Bz zPxGmGnJ5rnUHqyrkBDGvbMxWFp2QdQDVI/40QPI7SOlTw3wjKp6v9AdIKG5+5V9oU0p W3DWwo9DPJhWSmP+iuaNMPkSSz/x1xfBjl1mtxVTwG8ZUMpdrcbfuptf+9coPu4i6bsd W1YA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=+lgphjjPXRbRF3I9hUd56aYYPMc0GA3T+ISDwiExdc8=; b=XNsHSnUF4Xt00Si1j+YIph12S405DkQ6qV0/grEQ6imPRCFsS4cdjWN/sUuiuFZx5h dViWhj1CeE4VBrrKKyEMZj7FD8YGBzCF4xoRt2Zl3uw5U3vVJ5odlFVoIsOY3P+hJF4r BZQO5IbKY9zu845CQlUWOp7ggHBhamrE1ojX0V5xSqt6tlC7aW9fu3xH8ZGVV9ehtXuo Tkxd6xsS/tmYMOouCv0U4LCvEU+LVbTyrOEZq2E8P0zB2iyTOhRLYsFIbdHOoiKV30WS ny9qBk4GyzLRWqrVoYLPz8sAwnHaF4StiVjBf7/+h9mWKnczgjoAxjJO9m0QKck++heL 76Hg== X-Gm-Message-State: AOAM533odX4k0r+W/A7Lwm3WCU3Pue/kK5LLNzPoAhws6GIgXVpMzEw+ VPbeKmb9fIftwYnhH+x+zb2XhEp2avwWew== X-Google-Smtp-Source: ABdhPJwW31UA9HzQctraE8lt0gy/Pc/bb22In2jKdfzX1ZRD6vVTg3NkkmGi4Prb/3reXCp1a3e/2w== X-Received: by 2002:a19:4a96:: with SMTP id x144mr15416415lfa.213.1593621040099; Wed, 01 Jul 2020 09:30:40 -0700 (PDT) Received: from localhost.localdomain (host-176-36-213-80.la.net.ua. [176.36.213.80]) by smtp.gmail.com with ESMTPSA id v20sm1943322lfr.74.2020.07.01.09.30.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jul 2020 09:30:39 -0700 (PDT) From: Anastasiia Lukianenko To: u-boot@lists.denx.de, sjg@chromium.org, ye.li@nxp.com, bmeng.cn@gmail.com, xypron.glpk@gmx.de Cc: julien@xen.org, sstabellini@kernel.org, peng.fan@nxp.com, roman@zededa.com, volodymyr_babchuk@epam.com, Oleksandr Andrushchenko , Anastasiia Lukianenko Subject: [PATCH 17/17] board: xen: De-initialize before jumping to Linux Date: Wed, 1 Jul 2020 19:29:59 +0300 Message-Id: <20200701162959.9814-18-vicooodin@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200701162959.9814-1-vicooodin@gmail.com> References: <20200701162959.9814-1-vicooodin@gmail.com> X-Mailman-Approved-At: Thu, 02 Jul 2020 13:12:53 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean From: Oleksandr Andrushchenko Free resources used by Xen board before jumping to Linux kernel. Signed-off-by: Oleksandr Andrushchenko Signed-off-by: Anastasiia Lukianenko Reviewed-by: Simon Glass --- board/xen/xenguest_arm64/xenguest_arm64.c | 6 ++++++ drivers/xen/hypervisor.c | 8 ++++++++ include/xen.h | 1 + 3 files changed, 15 insertions(+) diff --git a/board/xen/xenguest_arm64/xenguest_arm64.c b/board/xen/xenguest_arm64/xenguest_arm64.c index b4e1650f99..76a18bea8b 100644 --- a/board/xen/xenguest_arm64/xenguest_arm64.c +++ b/board/xen/xenguest_arm64/xenguest_arm64.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -195,3 +196,8 @@ int print_cpuinfo(void) return 0; } +void board_cleanup_before_linux(void) +{ + xen_fini(); +} + diff --git a/drivers/xen/hypervisor.c b/drivers/xen/hypervisor.c index f3c2504d72..8d7d320839 100644 --- a/drivers/xen/hypervisor.c +++ b/drivers/xen/hypervisor.c @@ -279,3 +279,11 @@ void xen_init(void) init_gnttab(); } +void xen_fini(void) +{ + debug("%s\n", __func__); + + fini_gnttab(); + fini_xenbus(); + fini_events(); +} diff --git a/include/xen.h b/include/xen.h index 1d6f74cc92..327d7e132b 100644 --- a/include/xen.h +++ b/include/xen.h @@ -7,5 +7,6 @@ #define __XEN_H__ void xen_init(void); +void xen_fini(void); #endif /* __XEN_H__ */