Received: by 10.223.185.116 with SMTP id b49csp1823937wrg; Sun, 4 Mar 2018 10:48:55 -0800 (PST) X-Google-Smtp-Source: AG47ELvGFsc8DxDz+atTEVrZAc1icUHfOdQvgbW7sGLVzHroVHSMG+WbWjFCg7pu0cLEkbyAMejj X-Received: by 10.99.186.73 with SMTP id l9mr9977869pgu.83.1520189335698; Sun, 04 Mar 2018 10:48:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520189335; cv=none; d=google.com; s=arc-20160816; b=PMBzK+8qnDuRBGD89kl5SdemdGF3xGkaCvfCiAjYO8mMir/CwNKcgkI5+dA78iQTac VdeP3Gwwwieon03+S4PCM0v10jUAslOYtF1zj/UqH6EWTuAQAKGLdK6iRZboKKfUv+hn 1lBrmPBRiddxFgBdiSOoR8M0476Oszx/IWK04lxaAa6yu+rZQRszgszC1jy+X3gtzClP SDgjwfQbt74gebt0DGLRX1keMSaf9dK+yTFao3UDVwl7VbzwDAEfIJzOq2HR9JaYNpSX 2MX2eONZ1IAxl8l8KgIco6iXE2C/jUSMz2+gwvNOxKb65RBAyPGYR9Sc2mFbEQCitS/K 2h5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=iYnfQYagbWE6WcEnuKcM7gQdfFF7/dYKYxh4X3Uw9xQ=; b=zdP797VDy0E+W/QGI5zVHi2TrF3VXb63I3qZYV+149sq4YpVYSnqqoZTxuKXHeGZst vMwj2JEQ88hFVaGDDMUqpMHo+sDYyeX5ZKTzjMWwZxK343KPf2nt1MFcJSAtxwKgswm9 +WbPqra5gzYB0wxkyoDXZsYCDxEly5bxxB2xBsNNVdDl93t+B/qk6abkiXGldpsfHvBa riBaaNjEyCN2KEE2XFxFiNpDH4/Zq2jIrmn4JebLeaSgBNuWZx+pv3Fg477geyhxr26E BmSxIyr6PFQRlkle8tNgnKJMJKBmn9nH+OWH6O1ha/FF9iHT7hOwk9N/AyotGw2jjyv5 MI6w== 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 f18-v6si5062606plr.726.2018.03.04.10.48.41; Sun, 04 Mar 2018 10:48:55 -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 S1752275AbeCDScN (ORCPT + 99 others); Sun, 4 Mar 2018 13:32:13 -0500 Received: from david.siemens.de ([192.35.17.14]:44418 "EHLO david.siemens.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752083AbeCDScC (ORCPT ); Sun, 4 Mar 2018 13:32:02 -0500 Received: from mail3.siemens.de (mail3.siemens.de [139.25.208.14]) by david.siemens.de (8.15.2/8.15.2) with ESMTPS id w24IVgqY011163 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 4 Mar 2018 19:31:42 +0100 Received: from md1f2u6c.ww002.siemens.net ([167.87.43.202]) by mail3.siemens.de (8.15.2/8.15.2) with ESMTP id w24IVdj5022006; Sun, 4 Mar 2018 19:31:41 +0100 From: Jan Kiszka To: Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , Bjorn Helgaas Cc: x86@kernel.org, Linux Kernel Mailing List , jailhouse-dev@googlegroups.com, linux-pci@vger.kernel.org, virtualization@lists.linux-foundation.org, Andy Shevchenko , Rob Herring , Mark Rutland , Juergen Gross Subject: [PATCH v4 1/7] jailhouse: Provide detection for non-x86 systems Date: Sun, 4 Mar 2018 19:31:33 +0100 Message-Id: <7b24a9f00261e20e0dd12934a663ab552500bded.1520188299.git.jan.kiszka@siemens.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jan Kiszka Implement jailhouse_paravirt() via device tree probing on architectures != x86. Will be used by the PCI core. CC: Rob Herring CC: Mark Rutland CC: Juergen Gross Signed-off-by: Jan Kiszka Reviewed-by: Juergen Gross --- 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(-) create mode 100644 Documentation/devicetree/bindings/jailhouse.txt 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 */ -- 2.13.6