From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422868AbdKQVzD (ORCPT ); Fri, 17 Nov 2017 16:55:03 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:52921 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422848AbdKQVyv (ORCPT ); Fri, 17 Nov 2017 16:54:51 -0500 Date: Fri, 17 Nov 2017 22:54:45 +0100 (CET) From: Thomas Gleixner To: Jan Kiszka cc: Ingo Molnar , "H . Peter Anvin" , x86@kernel.org, Linux Kernel Mailing List , jailhouse-dev@googlegroups.com Subject: Re: [PATCH 02/10] x86: jailhouse: Add infrastructure for running in non-root cell In-Reply-To: <160b45b696173511465a471a08143bcd9f09dd6e.1510817211.git.jan.kiszka@siemens.com> Message-ID: References: <160b45b696173511465a471a08143bcd9f09dd6e.1510817211.git.jan.kiszka@siemens.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 16 Nov 2017, Jan Kiszka wrote: > +config JAILHOUSE_GUEST > + bool "Jailhouse non-root cell support" > + depends on PARAVIRT && X86_64 > + ---help--- > + This option allows to run Linux as guest in a Jailhouse non-root > + cell. You can leave this option disabled if you only want to start > + Jailhouse and run Linux afterwards in the root cell. > + > + You likely also want to disable CONFIG_SUSPEND and CONFIG_SERIO to > + avoid access to I/O resources that are usually not assigned to the > + non-root cell. That should be prevented programatically. > +#include > +#include > +#include > +#include > + > +#define SETUP_JAILHOUSE 0x53484c4a /* "JLHS" */ > + > +#define SETUP_REQUIRED_VERSION 1 > + > +/* > + * The boot loader is passing platform information via this Jailhouse-specific > + * setup data structure. > + */ > +struct jailhouse_setup_data { > + struct setup_data header; > + u16 version; > + u16 compatible_version; > + u16 pm_timer_address; > + u16 num_cpus; > + u64 pci_mmconfig_base; > + u8 standard_ioapic; > + u8 cpu_ids[255]; Shouldn't this structure and SETUP_JAILHOUSE be defined in a header file which can be exported to boot loaders? Aside of that please write the struct in tabular fashion: struct jailhouse_setup_data { struct setup_data header; u16 version; .... > +}; > + > +bool jailhouse_paravirt(void) > +{ > + return jailhouse_cpuid_base() != 0; > +} > + > +const struct hypervisor_x86 x86_hyper_jailhouse __refconst = { > + .name = "Jailhouse", > + .detect = jailhouse_detect, > + .init = { > + .init_platform = jailhouse_init_platform, See above. Thanks, tglx