Received: by 10.223.176.46 with SMTP id f43csp2524570wra; Sun, 21 Jan 2018 22:14:21 -0800 (PST) X-Google-Smtp-Source: AH8x22414KNmYU2rvuaReP60S81HHVLu+zwGmNUQhJkgc0q8uVPEzURlHlucqFW/5NzaYmy2Vnil X-Received: by 10.99.111.11 with SMTP id k11mr6302909pgc.414.1516601661548; Sun, 21 Jan 2018 22:14:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516601661; cv=none; d=google.com; s=arc-20160816; b=JJIbHvN8YHOVcs6yIiJtrOMVdGOmBwHZ0/W47VFAp4O1nOYqcrSqGfEhHok9sGaSAg ZtGUqPCfiSBO4GT1yUznNrKYvLga7c9dWYpvr8uJUVJDDYzotTf73WvXUW6gn4HH85iG yZN3xB0n24FxpzU+XfhQHSq3Bg9nlf6q3q2cjN9nbu/ICgfsuOZdT9+w0C269yAkaDI7 2kouNEg5/xkLAVFmmRaqxsuyISEe2f002a+VrwKgcwQXtZTxZ4Ni1nziLot2HCAImDaB v1yUFZ6Yxn2zerfWXPUEWib6OvT+Qj4TZMS+kaJTsAFT/Xcsc+DgCgNeEm1eFx1v9yi0 loRg== 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=jCjXsYDm65GucPm60GbWdXybc1D11YvN9eJ0lnjEG9TEyRX9vUicMM+acr8YLD7vLL 2YzCuoVuJ15PYExYIu+FAUkcwHEVEKTuOKjpa/aLNKqk3ZwLkqdczrvQoY5gLTteYy1n KQlXP/1tHKulCJ+azCWzdEtlpT4csl+cRZ9gagRRC3IuYUDwtmVGgNetqFOTbWFPpKY2 E1Z8G3AoEE7XEMesyN1ps8dsUF1F65euMuY4CB0Bp3ezd0obLq6H+PRR9oDtPhduzxYI wIQP5WIW4JN8SY+Db2RiGOJGTJtqDbyPe19MddTSzFzSOY6YFBbMr32/IlMEan/UZoA+ KBGQ== 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 b21si14990907pfn.195.2018.01.21.22.14.07; Sun, 21 Jan 2018 22:14:21 -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 S1751154AbeAVGNO (ORCPT + 99 others); Mon, 22 Jan 2018 01:13:14 -0500 Received: from david.siemens.de ([192.35.17.14]:38093 "EHLO david.siemens.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751048AbeAVGNL (ORCPT ); Mon, 22 Jan 2018 01:13:11 -0500 Received: from mail1.siemens.de (mail1.siemens.de [139.23.33.14]) by david.siemens.de (8.15.2/8.15.2) with ESMTPS id w0M6CtpJ016956 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 22 Jan 2018 07:12:55 +0100 Received: from md1f2u6c.ww002.siemens.net ([167.87.15.170]) by mail1.siemens.de (8.15.2/8.15.2) with ESMTP id w0M6Cq6i008276; Mon, 22 Jan 2018 07:12: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 1/6] jailhouse: Provide detection for non-x86 systems Date: Mon, 22 Jan 2018 07:12:45 +0100 Message-Id: <5541843651e0232ac90f347f638e486d2ddda237.1516601570.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