Received: by 10.223.185.116 with SMTP id b49csp5831169wrg; Tue, 27 Feb 2018 22:36:38 -0800 (PST) X-Google-Smtp-Source: AH8x226Q7u0UV65QU6x3Ddu24/7EVAzCgHLzhjB/CELl48VTyaQVWyPnMZjCruAzXqwZwuqutmHt X-Received: by 10.101.101.138 with SMTP id u10mr13028335pgv.299.1519799798236; Tue, 27 Feb 2018 22:36:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519799798; cv=none; d=google.com; s=arc-20160816; b=R1cOFOgPbk85B5VJV7TaAQjfgnaq80sKcCOG6/Le2OoSxn85PyzV+WZlvbzIqQFSJs OPNK2WFJZYViM3M+e8XUP9MfIeUIe6oi9K9Frsy6q1oXt11jNr2eVT7bvkgolT7uUolW DayuBymrGDII5mMGX5AFXifcOHvDsRFWNXPw+ixFLBlpAcIF5q4RXFi4kUXcvhWFt82G iUzBWkCqMB9+rOaDb0crBGgJDvBYuDZL9JJz6X1e2Y8Wtq6oThJpgAhlbtUHh4XMyTGW KRCScVIxnKRbHkhPG7DvxTo/KrXYpH3BJM7V+QXSViotfaQDqyiyCA1VpXy5iOMFLikr fzRw== 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=e2yXQHYHFrtQQJuCOCXMY6GU7gbIbbLdHMD+UHREL9E=; b=cnsWgGsifYd1EoTkMKccMQ/P7NZJNK5s5oJN8MoRE89Uzp9/NaEqae/5PsQmo1PHo5 Rw4VKHqBKxz4z3+HnTjMO+pz0GGrBVy67rdTXWtbQNoHnE3XehrxPj/JIuot5p5kAM/W EPmHWkimjIglF+/Ym6YbwEn5lG2oqxr8HiMhG6cYnOatGcME3IwBmX+k0FXr/Nf4TxLX h71ECFJOxPdBbF9HPE2kOPhZOJJpYO5VariwCL3M/nMdw7yXjr96pyzwkgSnUdU1iRIS lazD3JLp6YLkFsc9BTbg/c9L9rXi2T5mdyJdnk0dL6LT8cFsDr2nUuY3/nsJdSliEGbM 5TNQ== 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 f1-v6si759093pld.744.2018.02.27.22.36.23; Tue, 27 Feb 2018 22:36:38 -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 S1752087AbeB1GfV (ORCPT + 99 others); Wed, 28 Feb 2018 01:35:21 -0500 Received: from david.siemens.de ([192.35.17.14]:46006 "EHLO david.siemens.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751758AbeB1GfS (ORCPT ); Wed, 28 Feb 2018 01:35:18 -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 w1S6YtYC013917 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 28 Feb 2018 07:34:56 +0100 Received: from md1f2u6c.ww002.siemens.net ([167.87.77.211]) by mail3.siemens.de (8.15.2/8.15.2) with ESMTP id w1S6Yqu3013249; Wed, 28 Feb 2018 07:34:55 +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, Rob Herring , Mark Rutland Subject: [PATCH v2 1/6] jailhouse: Provide detection for non-x86 systems Date: Wed, 28 Feb 2018 07:34:46 +0100 Message-Id: <558f5cbae432ae029e2d8ee9b0ef44d837318625.1519799691.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 Signed-off-by: Jan Kiszka --- 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