Received: by 10.223.164.202 with SMTP id h10csp1296267wrb; Mon, 27 Nov 2017 00:14:56 -0800 (PST) X-Google-Smtp-Source: AGs4zMYJXSOGueF/3POY9p8EqZ7rPmatyhU75mCoSHLDE+aF4sESrvBikFLMBybtzoO1sR/Nau3J X-Received: by 10.98.216.193 with SMTP id e184mr35003670pfg.98.1511770496323; Mon, 27 Nov 2017 00:14:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511770496; cv=none; d=google.com; s=arc-20160816; b=fCasQ/rqHYsqdnPnEquPT465PiJLqJ9l0boIqFjghCX3prqQd59fxh0Ph7dQRSoHNk YwJQZJFl2GDjT/WIuDNQNu/6Qusi7Z0TetVSomv4O3A/dgfAd669Y59F7r+Xrwa6sZ73 0yUlEVuC4fdgAP7Y9w47RaSf24nN8TCrE7ukW2MK8JUpHMareA7PtkcwwqLkGkOQQ1OL UGxEUiGurk2BS+9/tu4p50vI5S4+Ys8GCXCTAqG1csSyEc2vfl/RtRbDDPLvGzJE1Q6F 9p60z2gyDXq5RhTXaQsX6Xeqa47qSjK4R7h1ifdy/VekOo8SJXHDvyEka4ikvEmAq7Ru fmdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=Ngw62JHct9KXt1IteObFZ+9PXBslkywCLgfGOEmjNAM=; b=O/XRdwsVWzoz+dYay04Re5A6C/Ku4QeZW1fltxDUt0/IinXj3yefy7Xcd7UiHjtUYF GNzblptYriY/Zt9dM3+ijg5KsnO5ZQZOLNSxf1r1lsE9rBstq6uSgfIP8452/OkgTRf5 eXNHM8P5Y4U/Phmj1lDfnsGl+dkEv7EIhBYT6XvArzURgLYXO47qxo9Mfj1AKxHb6dBm azAFLFysKX7ds99c+nZxkcsHapocI4uoCYwAG8z6N3FqhDgj3c8rlo0qew0/Zt1Vv7Mx y0Gk8bjf0bG1QzaRfYA9mTDblSd0VakU0iRHHyPLOmJk0yu2NAQZ10Xb4eCCp9RCt8a3 uJ3A== 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 l18si4461833pfi.159.2017.11.27.00.14.44; Mon, 27 Nov 2017 00:14:56 -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 S1752018AbdK0INh (ORCPT + 78 others); Mon, 27 Nov 2017 03:13:37 -0500 Received: from thoth.sbs.de ([192.35.17.2]:36505 "EHLO thoth.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751395AbdK0IMI (ORCPT ); Mon, 27 Nov 2017 03:12:08 -0500 Received: from mail3.siemens.de (mail3.siemens.de [139.25.208.14]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id vAR8Bui2015404 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 27 Nov 2017 09:11:56 +0100 Received: from md1f2u6c.ww002.siemens.net ([167.87.32.153]) by mail3.siemens.de (8.15.2/8.15.2) with ESMTP id vAR8BtES021016; Mon, 27 Nov 2017 09:11:56 +0100 From: Jan Kiszka To: Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" Cc: x86@kernel.org, Linux Kernel Mailing List , jailhouse-dev@googlegroups.com Subject: [PATCH v2 00/12] x86: Add support for running as secondary Jailhouse guest Date: Mon, 27 Nov 2017 09:11:42 +0100 Message-Id: X-Mailer: git-send-email 2.12.3 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series paves the way to run Linux in so-called non-root cells (guest partitions) of the Jailhouse hypervisor. Jailhouse [1] was started 4 years ago as an open-source (GPL) leight- weight hypervisor that statically partitions SMP systems. It's unique in that it uses one Linux instance, the root cell, as boot loader and management console. Jailhouse targets use cases for hard real-time and safety-critical systems that KVM cannot cater due to its inherent complexity. Jaihouse can run bare-metal, free and closed-source RTOSes as secondary guests and, with this series, also x86 Linux instances. While ARM and ARM64 non-root Linux guests are feasible without extra patches, thanks to the high configurability via device trees, x86 requires special platform support, mostly to step away from non-existing resources in a non-root Jailhouse cell. These differences are: - no legacy devices such as PIC, PIT, RTC/CMOS, i8042 - no HPET - no ACPI, no other BIOS services; platform information is provided from hypervisor config - APIC and IOAPIC (if any) are available at fixed MMIO addresses and the APIC is limited to flat physical mode - no complete PCI topology - no restart supported - use precalibrated TSC and APIC timer frequencies This series ensures that Linux can boot in a non-root cell, including SMP cells, has working timekeeping and can use the platform UARTs and PCI devices as assigned to it. In follow-up series, we will propose optimizations and enhancements for the PCI support, a simplistic debug console, and some improvement for Linux guests on ARM. What is not yet in upstream-ready state is a driver for inter-cell communication. The current implementation of virtual peer-to-peer network [2] uses an enhanced version of the QEMU ivshmem shared memory device. However we still need to finish the evaluation of virtio / vhost-pci options prior to settling over the final interface. This patch series is also available at git://git.kiszka.org/linux.git e8d19494b96b Changes in v2: - removed calibration in favor of static values now passed from boot loader - refactored hypervisor platform setup according to feedback, specifically - proper switch to x2APIC ops - APIC and IOAPIC registration from x86_init.mpparse.get_smp_config - PCI setup from x86_init.pci.arch_init - disabled i8042 devices - control of warm reset setup via platform feature flag - proper walk of setup data linked list - decoupled CONFIG_JAILHOUSE from CONFIG_PARAVIRT - fixed IOAPIC routing setup for UARTs (trigger and polarity set) - symbolic irqflag values in MP config tables Jan [1] http://jailhouse-project.org [2] http://git.kiszka.org/?p=linux.git;a=shortlog;h=refs/heads/queues/jailhouse Jan Kiszka (12): x86/apic: Install an empty physflat_init_apic_ldr x86: Control warm reset setup via legacy feature flag x86: Introduce and use MP IRQ trigger and polarity defines x86/jailhouse: Add infrastructure for running in non-root cell x86/jailhouse: Enable APIC and SMP support x86/jailhouse: Enable PMTIMER x86/jailhouse: Set up timekeeping x86/jailhouse: Avoid access of unsupported platform resources x86/jailhouse: Silence ACPI warning x86/jailhouse: Halt instead of failing to restart x86/jailhouse: Wire up IOAPIC for legacy UART ports x86/jailhouse: Initialize PCI support arch/x86/Kconfig | 9 ++ arch/x86/include/asm/hypervisor.h | 1 + arch/x86/include/asm/jailhouse_para.h | 27 +++++ arch/x86/include/asm/mpspec_def.h | 14 ++- arch/x86/include/asm/x86_init.h | 1 + arch/x86/include/uapi/asm/bootparam.h | 22 ++++ arch/x86/kernel/Makefile | 2 + arch/x86/kernel/apic/apic_flat_64.c | 16 ++- arch/x86/kernel/apic/io_apic.c | 20 ++-- arch/x86/kernel/apic/x2apic_uv_x.c | 1 + arch/x86/kernel/cpu/hypervisor.c | 4 + arch/x86/kernel/jailhouse.c | 205 ++++++++++++++++++++++++++++++++++ arch/x86/kernel/mpparse.c | 23 ++-- arch/x86/kernel/platform-quirks.c | 1 + arch/x86/kernel/smpboot.c | 4 +- arch/x86/platform/intel-mid/sfi.c | 5 +- drivers/acpi/Kconfig | 32 +++--- 17 files changed, 341 insertions(+), 46 deletions(-) create mode 100644 arch/x86/include/asm/jailhouse_para.h create mode 100644 arch/x86/kernel/jailhouse.c -- 2.12.3 From 1585212606042281198@xxx Mon Nov 27 09:55:48 +0000 2017 X-GM-THRID: 1585212606042281198 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread