From patchwork Wed Aug 28 14:47:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 19585 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f200.google.com (mail-qc0-f200.google.com [209.85.216.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E5DA425E58 for ; Wed, 28 Aug 2013 14:48:42 +0000 (UTC) Received: by mail-qc0-f200.google.com with SMTP id b11sf3101224qcw.7 for ; Wed, 28 Aug 2013 07:48:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=yjp+2lIVzq8+7Pzk2Z0ZxTJSzrwGnh45WmHQAv0rW7w=; b=YnBqCfA6PuYCHvqBaxUZbCe3EaZZqZzZUR+MTD/qrhExr1nNeT0tjbs0Fk88jsEbKs oL+y0Yvn2dJxhXz/9pG2X1sady2G9IgAOPRbUjCyVzjqp8iSBVW4oYHlCogjaUhXojrs rmLR1TlZTdw9BoQiougco3ElD9omK/XReuk1TNMttEEzV6faldOWgOOVeaMDtWP7H5iS i84EoGHc478jZJgjZTk2/sxkXgulAikWfGwJJNtP6KM/czkA5zLokpUleQ6KVLUUsSwG dzjv161IKWGeKwwguqnTD0GMkkxX/Wc+7tgi92NhycA/rtHFYVJVXnotDXqL6o/3r8pN CIEA== X-Received: by 10.236.140.130 with SMTP id e2mr9631888yhj.10.1377701322777; Wed, 28 Aug 2013 07:48:42 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.74.35 with SMTP id q3ls145629qev.50.gmail; Wed, 28 Aug 2013 07:48:42 -0700 (PDT) X-Received: by 10.221.55.4 with SMTP id vw4mr310682vcb.37.1377701322678; Wed, 28 Aug 2013 07:48:42 -0700 (PDT) Received: from mail-vb0-f53.google.com (mail-vb0-f53.google.com [209.85.212.53]) by mx.google.com with ESMTPS id x3si6597539vcn.114.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 28 Aug 2013 07:48:42 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.53 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.53; Received: by mail-vb0-f53.google.com with SMTP id i3so4274218vbh.12 for ; Wed, 28 Aug 2013 07:48:42 -0700 (PDT) X-Gm-Message-State: ALoCoQnQ6xiVpMTngNhXNJuTPEa+VEClTkVz4MydIGvsDGfWNXhRbVY3hikRZqiGeLGzIEjKnSaW X-Received: by 10.220.112.132 with SMTP id w4mr821611vcp.28.1377701322597; Wed, 28 Aug 2013 07:48:42 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp359969vcz; Wed, 28 Aug 2013 07:48:41 -0700 (PDT) X-Received: by 10.194.20.170 with SMTP id o10mr20385844wje.4.1377701321478; Wed, 28 Aug 2013 07:48:41 -0700 (PDT) Received: from mail-wg0-f53.google.com (mail-wg0-f53.google.com [74.125.82.53]) by mx.google.com with ESMTPS id kd4si9547001wjc.30.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 28 Aug 2013 07:48:41 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.53 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=74.125.82.53; Received: by mail-wg0-f53.google.com with SMTP id n12so170907wgh.32 for ; Wed, 28 Aug 2013 07:48:41 -0700 (PDT) X-Received: by 10.194.80.39 with SMTP id o7mr8865405wjx.39.1377701320856; Wed, 28 Aug 2013 07:48:40 -0700 (PDT) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id a8sm5590498wie.6.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 28 Aug 2013 07:48:39 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Cc: stefano.stabellini@eu.citrix.com, ian.campbell@citrix.com, patches@linaro.org, andre.przywara@linaro.org, Julien Grall Subject: [PATCH V1 23/29] xen/arm: Add new platform specific callback device_is_blacklist Date: Wed, 28 Aug 2013 15:47:37 +0100 Message-Id: <1377701263-3319-24-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1377701263-3319-1-git-send-email-julien.grall@linaro.org> References: <1377701263-3319-1-git-send-email-julien.grall@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.53 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Each platform code will list the device that must not pass-through to a guest. Theses devices are used for: power management, timer,... When theses devices are given to DOM0, it can controls the hardware and then break the whole platform. This callback is enough until we will start to care about power performance. For this purpose, we may need to extend this interface to implement per-device MMIO filtering to allow dom0 to continue to control devices which it owns which happen to share e.g. a clock controller with Xen. Signed-off-by: Julien Grall Acked-by: Ian Campbell --- Changes in v2: - Update commit message --- xen/arch/arm/domain_build.c | 2 +- xen/arch/arm/platform.c | 10 ++++++++++ xen/include/asm-arm/platform.h | 7 +++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 3afe48f..1ac261e 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -663,7 +663,7 @@ static int handle_node(struct domain *d, struct kernel_info *kinfo, DPRINT("handle %s\n", path); /* Skip theses nodes and the sub-nodes */ - if ( dt_match_node(skip_matches, np ) ) + if ( dt_match_node(skip_matches, np ) || platform_device_is_blacklist(np) ) { DPRINT(" Skip it!\n"); return 0; diff --git a/xen/arch/arm/platform.c b/xen/arch/arm/platform.c index afda302..cae0580 100644 --- a/xen/arch/arm/platform.c +++ b/xen/arch/arm/platform.c @@ -127,6 +127,16 @@ bool_t platform_has_quirk(uint32_t quirk) return !!(quirks & quirk); } +bool_t platform_device_is_blacklist(const struct dt_device_node *node) +{ + const struct dt_device_match *blacklist = NULL; + + if ( platform && platform->blacklist_dev ) + blacklist = platform->blacklist_dev; + + return dt_match_node(blacklist, node); +} + /* * Local variables: * mode: C diff --git a/xen/include/asm-arm/platform.h b/xen/include/asm-arm/platform.h index f460e9c..4b511ed 100644 --- a/xen/include/asm-arm/platform.h +++ b/xen/include/asm-arm/platform.h @@ -4,6 +4,7 @@ #include #include #include +#include /* Describe specific operation for a board */ struct platform_desc { @@ -26,6 +27,11 @@ struct platform_desc { * board with different quirk on each */ uint32_t (*quirks)(void); + /* + * Platform blacklist devices + * List of devices which must not pass-through to a guest + */ + const struct dt_device_match *blacklist_dev; }; /* @@ -40,6 +46,7 @@ int __init platform_specific_mapping(struct domain *d); void platform_reset(void); void platform_poweroff(void); bool_t platform_has_quirk(uint32_t quirk); +bool_t platform_device_is_blacklist(const struct dt_device_node *node); #define PLATFORM_START(_name, _namestr) \ static const struct platform_desc __plat_desc_##_name __used \