From patchwork Tue Sep 7 17:09:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksandr Tyshchenko X-Patchwork-Id: 12479171 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 BA691C433FE for ; Tue, 7 Sep 2021 17:10:11 +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 83FF360187 for ; Tue, 7 Sep 2021 17:10:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 83FF360187 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.181246.328316 (Exim 4.92) (envelope-from ) id 1mNebb-0002iA-Uk; Tue, 07 Sep 2021 17:09:55 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 181246.328316; Tue, 07 Sep 2021 17:09:55 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mNebb-0002i3-RN; Tue, 07 Sep 2021 17:09:55 +0000 Received: by outflank-mailman (input) for mailman id 181246; Tue, 07 Sep 2021 17:09:55 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mNebb-0002hx-9x for xen-devel@lists.xenproject.org; Tue, 07 Sep 2021 17:09:55 +0000 Received: from mail-lf1-x12d.google.com (unknown [2a00:1450:4864:20::12d]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id c53e1a52-308e-47af-b219-550dd6532ed3; Tue, 07 Sep 2021 17:09:54 +0000 (UTC) Received: by mail-lf1-x12d.google.com with SMTP id m28so20870217lfj.6 for ; Tue, 07 Sep 2021 10:09:53 -0700 (PDT) Received: from otyshchenko.router ([212.22.223.21]) by smtp.gmail.com with ESMTPSA id t20sm1059533lfk.157.2021.09.07.10.09.51 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Sep 2021 10:09:52 -0700 (PDT) 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: c53e1a52-308e-47af-b219-550dd6532ed3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id; bh=Eb3nTuViuxkM2u25OPGYlL8g/e8tL46q5jZZVa4g28I=; b=KP6THAg3j2h3laFCwGL5cczIeTLwtChwkQPOmjuYWuwXVJm4iCDbMNWljxQJsS51V9 U3QfumpMjey7dx9fzCA33igvERXlRiqcS5hQOMLSdRW1inlq9p+2Jdroz4Ysv1y5uw/d IgE4zEBsFvGfq4iDslJ/TuWV1T72ct9WtyozmWBWwyxwO7XLhULP92KcQa0ZvFs8/G4y R8w3VoT3fmYcQYXhiL4Pab9DpIxC8Ie5CnTuPBVViXdWfklFFZ3JTp9AjifpBphL33YA bwG+qQs+po0ALxhyPPzAYPU9apCnC0AI2bBO+oNmNMsyDXu1FG7KbY50ERp5NdOKkYzX PuOw== 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; bh=Eb3nTuViuxkM2u25OPGYlL8g/e8tL46q5jZZVa4g28I=; b=rCbKOLEQfKWv88OJ5NCLMptP3XtGvZmm+Q4VrWI2eWNsVmX+xE60PFXXaegJkMKV2l 6fQCDqeAa0esEXcdfihoGAiZU8a/o8wFcJdGvkGWESIeCa+ytHKH9daER6KRnVWwSg/v +GS6KfUqaQto6W2XNA7I68iTNamfOuyDgkJ92OI0vgsBFg0mxfbz8HnlBtABBfXkfs1G PQz7i2NAKbFJ3f0w7Mstcg+0tLYHIbXtp2B3Sd1ch8tcPZQfBwktHr9XlcYwOtzY5WEP oSlzUjqd0Y7Pi+bEDPcu1Xzw3y8h535vY91RehsUgcvUcZFoqRcyv9guKlBuig+GxBkS ik2Q== X-Gm-Message-State: AOAM531X23uxe2uClcDe7vWmU0+xElO2HGQe7g6wYy173CivB8EilEPz 71SwsOQPOPCiEfrja29rhXjQRBL7Ewg= X-Google-Smtp-Source: ABdhPJzrrQuBHf/px86brxNUtIXtsL3f4TvChuTwFU0eFe8bl8AjmS+1W0LXx6/jcCJ7EOw5P8BGsA== X-Received: by 2002:ac2:551a:: with SMTP id j26mr13864021lfk.354.1631034592707; Tue, 07 Sep 2021 10:09:52 -0700 (PDT) From: Oleksandr Tyshchenko To: xen-devel@lists.xenproject.org Cc: Oleksandr Tyshchenko , Ian Jackson , Wei Liu , Anthony PERARD , Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall , Stefano Stabellini , Juergen Gross , Volodymyr Babchuk , =?utf-8?q?Roger_Pau_Monn?= =?utf-8?q?=C3=A9?= Subject: [RFC PATCH 0/3] Add handling of extended regions (safe ranges) on Arm (Was "xen/memory: Introduce a hypercall to provide unallocated space") Date: Tue, 7 Sep 2021 20:09:35 +0300 Message-Id: <1631034578-12598-1-git-send-email-olekstysh@gmail.com> X-Mailer: git-send-email 2.7.4 From: Oleksandr Tyshchenko You can find an initial discussion at [1]. The extended region (safe range) is a region of guest physical address space which is unused and could be safely used to create grant/foreign mappings instead of wasting real RAM pages from the domain memory for establishing these mappings. The extended regions are chosen at the domain creation time and advertised to it via "reg" property under hypervisor node in the guest device-tree. The extended regions are calculated differently for direct mapped Dom0 (with and without IOMMU) and non-direct mapped DomUs. Please note the following limitations: - The extended region feature is only supported for 64-bit domain. - The ACPI case is not covered. Also please note that we haven't figured out yet how to properly extend the Xen hypervisor device-tree bindings on Arm (either via new compatible or via new property). I decided to go with new property for now, but this can be changed. This uncertainty is the main reason why this series is marked as RFC. Patch series is also available at [2]. The corresponding Linux changes is not in a good shape now (require some cleanup and refactoring), I will publish them once put them in order (I hope, it will be in a few days). [1] https://lore.kernel.org/xen-devel/1627489110-25633-1-git-send-email-olekstysh@gmail.com/ [2] https://github.com/otyshchenko1/xen/commits/map_opt_ml2 Oleksandr Tyshchenko (3): xen: Introduce "gpaddr_bits" field to XEN_SYSCTL_physinfo xen/arm: Add handling of extended regions for Dom0 toolstack/arm: Add handling of extended regions for DomU tools/include/libxl.h | 7 ++ tools/libs/light/libxl.c | 2 + tools/libs/light/libxl_arm.c | 92 +++++++++++++++- tools/libs/light/libxl_types.idl | 2 + xen/arch/arm/domain_build.c | 233 ++++++++++++++++++++++++++++++++++++++- xen/arch/arm/sysctl.c | 2 + xen/arch/x86/sysctl.c | 2 + xen/include/public/sysctl.h | 3 +- 8 files changed, 338 insertions(+), 5 deletions(-)