From patchwork Fri Jun 4 06:02:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 12298743 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C46C4C47099 for ; Fri, 4 Jun 2021 06:02:38 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7B37261402 for ; Fri, 4 Jun 2021 06:02:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7B37261402 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.136687.253313 (Exim 4.92) (envelope-from ) id 1lp2uS-00029w-FU; Fri, 04 Jun 2021 06:02:20 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 136687.253313; Fri, 04 Jun 2021 06:02:20 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lp2uS-00029o-CL; Fri, 04 Jun 2021 06:02:20 +0000 Received: by outflank-mailman (input) for mailman id 136687; Fri, 04 Jun 2021 06:02:18 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lp2uQ-00029c-HA for xen-devel@lists.xenproject.org; Fri, 04 Jun 2021 06:02:18 +0000 Received: from smtp-out1.suse.de (unknown [195.135.220.28]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id ddede7e5-73e1-449e-8e80-11e019626b44; Fri, 04 Jun 2021 06:02:17 +0000 (UTC) Received: from imap.suse.de (imap-alt.suse-dmz.suse.de [192.168.254.47]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 6434221A07; Fri, 4 Jun 2021 06:02:16 +0000 (UTC) Received: from imap3-int (imap-alt.suse-dmz.suse.de [192.168.254.47]) by imap.suse.de (Postfix) with ESMTP id 2CF15118DD; Fri, 4 Jun 2021 06:02:16 +0000 (UTC) Received: from director2.suse.de ([192.168.254.72]) by imap3-int with ESMTPSA id ABwPCejBuWCyGwAALh3uQQ (envelope-from ); Fri, 04 Jun 2021 06:02:16 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: ddede7e5-73e1-449e-8e80-11e019626b44 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1622786536; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=FIMbOAmTIZD/8yxM+nY2bRVWI8IB3NGVj1EMJylNr+Y=; b=fuClDdf3Zt5CFCrW4QbLpfmMyw2zCJvImUw1OZRP/r679HrfWT50uyZM1B9aGu65o1xkFO 1zKWr+xZRGEKUXbn3VNeqLAMtywWczee2+1LaUgx3DSTj6OhosOVnSm9/mKItK/TWlr9SO d0wEBgmJe3p+flYbLG4bhvcKicDxCyI= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1622786536; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=FIMbOAmTIZD/8yxM+nY2bRVWI8IB3NGVj1EMJylNr+Y=; b=fuClDdf3Zt5CFCrW4QbLpfmMyw2zCJvImUw1OZRP/r679HrfWT50uyZM1B9aGu65o1xkFO 1zKWr+xZRGEKUXbn3VNeqLAMtywWczee2+1LaUgx3DSTj6OhosOVnSm9/mKItK/TWlr9SO d0wEBgmJe3p+flYbLG4bhvcKicDxCyI= From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: julien@xen.org, Juergen Gross , Ian Jackson , Wei Liu , Christian Lindig , David Scott Subject: [PATCH v2 0/6] tools/libs: add missing support of linear p2m_list, cleanup Date: Fri, 4 Jun 2021 08:02:08 +0200 Message-Id: <20210604060214.14924-1-jgross@suse.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 This is a resend of V2 with the Acks folded in. There are some corners left which don't support the not so very new linear p2m list of pv guests, which has been introduced in Linux kernel 3.19 and which is mandatory for non-legacy versions of Xen since kernel 4.14. This series adds support for the linear p2m list where it is missing (colo support and "xl dump-core"). In theory it should be possible to merge the p2m list mapping code from migration handling and core dump handling, but this needs quite some cleanup before this is possible. The first three patches of this series are fixing real problems, so I've put them at the start of this series, especially in order to make backports easier. The other three patches are only the first steps of cleanup. The main work done here is to concentrate all p2m mapping in libxenguest instead of having one implementation in each of libxenguest and libxenctrl. Merging the two implementations should be rather easy, but this will require to touch many lines of code, as the migration handling variant seems to be more mature, but it is using the migration stream specific structures heavily. So I'd like to have some confirmation that my way to clean this up is the right one. My idea would be to add the data needed for p2m mapping to struct domain_info_context and replace the related fields in struct xc_sr_context with a struct domain_info_context. Modifying the interface of xc_core_arch_map_p2m() to take most current parameters via struct domain_info_context would then enable migration coding to use xc_core_arch_map_p2m() for mapping the p2m. xc_core_arch_map_p2m() should look basically like the current migration p2m mapping code afterwards. Changes in V2: - added missing #include in ocaml stub Juergen Gross (6): tools/libs/guest: fix max_pfn setting in map_p2m() tools/libs/ctrl: fix xc_core_arch_map_p2m() to support linear p2m table tools/libs/ctrl: use common p2m mapping code in xc_domain_resume_any() tools/libs: move xc_resume.c to libxenguest tools/libs: move xc_core* from libxenctrl to libxenguest tools/libs/guest: make some definitions private to libxenguest tools/include/xenctrl.h | 63 --- tools/include/xenguest.h | 63 +++ tools/libs/ctrl/Makefile | 4 - tools/libs/ctrl/xc_core_x86.c | 223 ---------- tools/libs/ctrl/xc_domain.c | 2 - tools/libs/ctrl/xc_private.h | 43 +- tools/libs/guest/Makefile | 4 + .../libs/{ctrl/xc_core.c => guest/xg_core.c} | 7 +- .../libs/{ctrl/xc_core.h => guest/xg_core.h} | 15 +- .../xc_core_arm.c => guest/xg_core_arm.c} | 31 +- .../xc_core_arm.h => guest/xg_core_arm.h} | 0 tools/libs/guest/xg_core_x86.c | 399 ++++++++++++++++++ .../xc_core_x86.h => guest/xg_core_x86.h} | 0 tools/libs/guest/xg_dom_boot.c | 2 +- tools/libs/guest/xg_domain.c | 19 +- tools/libs/guest/xg_offline_page.c | 2 +- tools/libs/guest/xg_private.h | 16 +- .../{ctrl/xc_resume.c => guest/xg_resume.c} | 69 +-- tools/libs/guest/xg_sr_save_x86_pv.c | 2 +- tools/ocaml/libs/xc/xenctrl_stubs.c | 1 + 20 files changed, 545 insertions(+), 420 deletions(-) delete mode 100644 tools/libs/ctrl/xc_core_x86.c rename tools/libs/{ctrl/xc_core.c => guest/xg_core.c} (99%) rename tools/libs/{ctrl/xc_core.h => guest/xg_core.h} (92%) rename tools/libs/{ctrl/xc_core_arm.c => guest/xg_core_arm.c} (72%) rename tools/libs/{ctrl/xc_core_arm.h => guest/xg_core_arm.h} (100%) create mode 100644 tools/libs/guest/xg_core_x86.c rename tools/libs/{ctrl/xc_core_x86.h => guest/xg_core_x86.h} (100%) rename tools/libs/{ctrl/xc_resume.c => guest/xg_resume.c} (80%)