Received: by 10.223.185.116 with SMTP id b49csp6199695wrg; Thu, 8 Mar 2018 03:35:25 -0800 (PST) X-Google-Smtp-Source: AG47ELsdyoGvHKKmRRBxa5VTPV+mVmidD8eRMrhdPAQWk7vAgHKvUBvKsLoIvJOZcOFd6NH96EFd X-Received: by 2002:a17:902:4827:: with SMTP id s36-v6mr23578619pld.269.1520508925861; Thu, 08 Mar 2018 03:35:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520508925; cv=none; d=google.com; s=arc-20160816; b=GI32dUt8ikpL3VUIhaDYOzsoi2uYNkuisRaZKYVxMUA7NERhVbJCVUlFzQi1ZNenCQ cn5BXiOEdLs7pwhNvAWuw6LbjL67baNid9wNCVrQf/76J06bwtZqdmASbHCFnJSxQWXZ lZKvjw9ye0bxE3cBA302BHYaoQJ5IYpe3ps7UiX2E/i0jBMlAxPRnO6Ie7UqxZNJPOir /K50DbwHS9w35N5Nzq2A5zmTI3lcwqIk6C4c9i9MqpKoq9uMDZfFfOcIjSJ5GZkX+GjA xXlAOT7EHYneZ4Mh0ynOlvzrbScr7z9XcBITXtmcSPUAcyGG6WEd6u2V3xCFNEJBnp51 EOjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=doYfBIXOpNl+z+K9K84+Zffv5lSZYUDNnG9AfJlfRtU=; b=If/0OInrDhBX7fQ+vsQRdj7tlKJ3BldcBWzQOYndg+ywWU7JcMdSpX27jnBZMXu1mV HqPTkFk5A90dyo+GVNV7S7NUuONf0/SKpE3Dp/2goVlW81r3dobEH2KLmndWhOtDpxQ6 1GOlryz3EkNXXqxGn97tWXUoTz544A+GJKek0dkdjU0B5QjOUZdCO97RYltxexbSHLsm R5rBHy+bfUY/ZcsNe9EQF63iSPPxVE84fldkV5X/ruLUqLaLZNzwINqejtn3MNnFSe9R iK801TEZiRkKbrQw2A8KmdbIcPj9I6qYPQm92vGshPh3Xy2mwHGIlxq2bMrXeSNswWVI iIKA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u186si12801072pgc.462.2018.03.08.03.35.10; Thu, 08 Mar 2018 03:35:25 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935719AbeCHLeT (ORCPT + 99 others); Thu, 8 Mar 2018 06:34:19 -0500 Received: from terminus.zytor.com ([198.137.202.136]:46293 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751434AbeCHLeR (ORCPT ); Thu, 8 Mar 2018 06:34:17 -0500 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTP id w28BXtK9029881; Thu, 8 Mar 2018 03:33:55 -0800 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w28BXsSo029878; Thu, 8 Mar 2018 03:33:54 -0800 Date: Thu, 8 Mar 2018 03:33:54 -0800 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Jan Kiszka Message-ID: Cc: linux-kernel@vger.kernel.org, andy.shevchenko@gmail.com, bhelgaas@google.com, mark.rutland@arm.com, jan.kiszka@siemens.com, hpa@zytor.com, robh+dt@kernel.org, tglx@linutronix.de, mingo@kernel.org, jgross@suse.com Reply-To: jgross@suse.com, tglx@linutronix.de, mingo@kernel.org, robh+dt@kernel.org, linux-kernel@vger.kernel.org, bhelgaas@google.com, andy.shevchenko@gmail.com, mark.rutland@arm.com, jan.kiszka@siemens.com, hpa@zytor.com In-Reply-To: References: To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/platform] jailhouse: Provide detection for non-x86 systems Git-Commit-ID: 63338a38db955cb4e0352c11b78732157c78d30b X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 63338a38db955cb4e0352c11b78732157c78d30b Gitweb: https://git.kernel.org/tip/63338a38db955cb4e0352c11b78732157c78d30b Author: Jan Kiszka AuthorDate: Wed, 7 Mar 2018 08:39:12 +0100 Committer: Thomas Gleixner CommitDate: Thu, 8 Mar 2018 12:30:37 +0100 jailhouse: Provide detection for non-x86 systems Implement jailhouse_paravirt() via device tree probing on architectures != x86. Will be used by the PCI core. Signed-off-by: Jan Kiszka Signed-off-by: Thomas Gleixner Reviewed-by: Juergen Gross Cc: jailhouse-dev@googlegroups.com Cc: Mark Rutland Cc: linux-pci@vger.kernel.org Cc: virtualization@lists.linux-foundation.org Cc: Andy Shevchenko Cc: Rob Herring Cc: Bjorn Helgaas Link: https://lkml.kernel.org/r/dae9fe0c6e63141c28ca90492fa5712b4c33ffb5.1520408357.git.jan.kiszka@siemens.com --- Documentation/devicetree/bindings/jailhouse.txt | 8 ++++++++ arch/x86/include/asm/jailhouse_para.h | 2 +- include/linux/hypervisor.h | 17 +++++++++++++++-- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/jailhouse.txt b/Documentation/devicetree/bindings/jailhouse.txt new file mode 100644 index 000000000000..2901c25ff340 --- /dev/null +++ b/Documentation/devicetree/bindings/jailhouse.txt @@ -0,0 +1,8 @@ +Jailhouse non-root cell device tree bindings +-------------------------------------------- + +When running in a non-root Jailhouse cell (partition), the device tree of this +platform shall have a top-level "hypervisor" node with the following +properties: + +- compatible = "jailhouse,cell" diff --git a/arch/x86/include/asm/jailhouse_para.h b/arch/x86/include/asm/jailhouse_para.h index 875b54376689..b885a961a150 100644 --- a/arch/x86/include/asm/jailhouse_para.h +++ b/arch/x86/include/asm/jailhouse_para.h @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: GPL2.0 */ /* - * Jailhouse paravirt_ops implementation + * Jailhouse paravirt detection * * Copyright (c) Siemens AG, 2015-2017 * diff --git a/include/linux/hypervisor.h b/include/linux/hypervisor.h index b19563f9a8eb..fc08b433c856 100644 --- a/include/linux/hypervisor.h +++ b/include/linux/hypervisor.h @@ -8,15 +8,28 @@ */ #ifdef CONFIG_X86 + +#include #include + static inline void hypervisor_pin_vcpu(int cpu) { x86_platform.hyper.pin_vcpu(cpu); } -#else + +#else /* !CONFIG_X86 */ + +#include + static inline void hypervisor_pin_vcpu(int cpu) { } -#endif + +static inline bool jailhouse_paravirt(void) +{ + return of_find_compatible_node(NULL, NULL, "jailhouse,cell"); +} + +#endif /* !CONFIG_X86 */ #endif /* __LINUX_HYPEVISOR_H */