Received: by 10.223.164.202 with SMTP id h10csp1298916wrb; Mon, 27 Nov 2017 00:18:07 -0800 (PST) X-Google-Smtp-Source: AGs4zMYq2qA3R+wRwRMaMVOstFaY6qt7C163iQ5iy4faaNTRVt0R9q1h1C5wdb2KPRbhWouI21fG X-Received: by 10.98.166.84 with SMTP id t81mr35738168pfe.196.1511770687065; Mon, 27 Nov 2017 00:18:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511770687; cv=none; d=google.com; s=arc-20160816; b=JRyztjJioNX0TKn0vSDFcT0Q/bMvphDzKIuAqKautRGcjz5X7C2nmL9e2jl8m+eNhi plsXvr5mj7zEvFsQ3XEwexGEGhepK2QlY0xW2xxPBhSoHbvdFuxrl75UKpU635WM0ho3 wPtcDfLMI69zTBRj6mcwriV+A3OAMYrZlCCq6BMganqJdE55y6m5NDCANBjVV+X/cKq1 9j9pqoMgmOKutEGERYjxHb+wczmLXilua6qaLaKwjh1aAHPhdMrLhnLMIrrDuHpPJX6T 9MvZlopBr4zBlP24DqPbF2brEirk704oU/Gn4t4pGa5X/8/p1S4xcVjaoDRwrTvEPYGR 4lgQ== 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=skfMmn64PO6zcWxtBXRH8dntJD/h0XoJrM9E1GVlOwk=; b=uUsnXVyi2ko/N1qL/14WD0iN3smI/fYaxK4lED1WAp6qYxCGZ6hwgvV43Vv4uiImn3 sTA33mi5Ywk1T5FaOl8qgKd739Hx5TT+wOJpzzMN32HXKC+7IiVjafoyArK6lhuh44KK 6qOcbAqMBrVE13YxIe8DIlR3qNDlwwYSQlLy+eFJUQMtAEOPKqG2vApg/EQu3mhx6evS XmRfeXDn/VcUKt2dH2eDqoUgYwoN6pGmSlVgkNVIpUHA9UoaBoKRaLIWNDbsa8Iaed0J X6AjGOm1RWcnUWrreFEnrOTsMjeMk9kmUv3CaU+8OcksFAKmAB8RWgFHA6nRATvkoKCE Cd7w== 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 j4si9405390pfc.22.2017.11.27.00.17.55; Mon, 27 Nov 2017 00:18:07 -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 S1751660AbdK0IOw (ORCPT + 78 others); Mon, 27 Nov 2017 03:14:52 -0500 Received: from david.siemens.de ([192.35.17.14]:44096 "EHLO david.siemens.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751389AbdK0IMI (ORCPT ); Mon, 27 Nov 2017 03:12:08 -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 vAR8C1C4018894 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 27 Nov 2017 09:12:01 +0100 Received: from md1f2u6c.ww002.siemens.net ([167.87.32.153]) by mail3.siemens.de (8.15.2/8.15.2) with ESMTP id vAR8BtEa021016; Mon, 27 Nov 2017 09:12:00 +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 08/12] x86/jailhouse: Avoid access of unsupported platform resources Date: Mon, 27 Nov 2017 09:11:50 +0100 Message-Id: <39b68cc2c496501c9d95e6f40e5d76e3053c3908.1511770314.git.jan.kiszka@siemens.com> X-Mailer: git-send-email 2.12.3 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 Non-root cells do not have CMOS access, thus the warm reset cannot be enabled. There is no RTC, thus also no wall clock. Furthermore, there are no ISA IRQs and no PIC. Also disable probing of i8042 devices that are typically blocked for non-root cells. In theory, access could also be granted to a non-root cell, provided the root cell is not using the devices. But there is no concrete scenario in sight, and disabling probing over Jailhouse allows to build generic kernels that keep CONFIG_SERIO enabled for use in normal systems. Signed-off-by: Jan Kiszka --- arch/x86/kernel/jailhouse.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/arch/x86/kernel/jailhouse.c b/arch/x86/kernel/jailhouse.c index effec7d2b480..f5f459bb7aac 100644 --- a/arch/x86/kernel/jailhouse.c +++ b/arch/x86/kernel/jailhouse.c @@ -15,6 +15,7 @@ #include #include #include +#include #include static __initdata struct jailhouse_setup_data setup_data; @@ -34,6 +35,11 @@ static uint32_t __init jailhouse_detect(void) return jailhouse_cpuid_base(); } +static void jailhouse_get_wallclock(struct timespec *now) +{ + memset(now, 0, sizeof(*now)); +} + static void __init jailhouse_timer_init(void) { lapic_timer_frequency = setup_data.apic_khz * (1000 / HZ); @@ -79,11 +85,18 @@ static void __init jailhouse_init_platform(void) struct setup_data header; void *mapping; + x86_init.irqs.pre_vector_init = x86_init_noop; x86_init.timers.timer_init = jailhouse_timer_init; x86_init.mpparse.get_smp_config = jailhouse_get_smp_config; x86_platform.calibrate_cpu = jailhouse_get_tsc; x86_platform.calibrate_tsc = jailhouse_get_tsc; + x86_platform.get_wallclock = jailhouse_get_wallclock; + x86_platform.legacy.rtc = 0; + x86_platform.legacy.warm_reset = 0; + x86_platform.legacy.i8042 = X86_LEGACY_I8042_PLATFORM_ABSENT; + + legacy_pic = &null_legacy_pic; while (pa_data) { mapping = early_memremap(pa_data, sizeof(header)); -- 2.12.3 From 1585250532859582488@xxx Mon Nov 27 19:58:38 +0000 2017 X-GM-THRID: 1585250532859582488 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread