Received: by 10.223.164.202 with SMTP id h10csp1615391wrb; Thu, 16 Nov 2017 01:03:24 -0800 (PST) X-Google-Smtp-Source: AGs4zMYwXPHFM5b9lgOSj08Lizs2UTNadxmkYC/2YXXQOpFYi4zUpoadxyCMpyahSPU057P48pLi X-Received: by 10.99.127.88 with SMTP id p24mr1013404pgn.98.1510823004468; Thu, 16 Nov 2017 01:03:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510823004; cv=none; d=google.com; s=arc-20160816; b=GtAabAIs4XTUTd52m2C4zTjlgbucHRdrYJXPQ/glHRek9rkY2q+/EqcDHXkMgWjWn+ k+W84bA/dkCVXVKOr9nbxWjJPTGmV9QJXUucLNw4/CQ4ySMwbfdjz1XHz++z8SjeNoo2 DCRbKPLf2n1YOkKBHpX+IG2BRb3hEj7uiFRRDoXPDgNJG4f6VZF3NsBToVa/WgVJJSkp J8rZN3Phl5nOMaBWZmf4X4R26+AWPs9qYiwVI18hs0KEh3xofBJ/R+cNADzryQJO7qZa uBchRh52Aloq2QbRALik0k16Ex+YTICQAbg/jhPKi66415zoCbXEy8EstCubo03iIwsL 9HSg== 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=09trusNwtMAb6fVzm6vNDqCrOU+ZzvoREyRuDoPafFo=; b=eVCzJvdXG8LfnEeofaU7HE6qjNVbYRpkRpFYcQaNwx6eFk0ZlT3Djeo11nI9R7Kb+r fQATP0ExL0xnxsy4Fzh04yZo8fte9rxrbqsxjy8rQjlZVugnp52dggZJLwXEnUcjpPur 9VgXGUHCtyaeie2pgqvj+Mb0ChNurFR2CuUeswV+nJqN2o6EBxkvI0k5UfuZAuHup/rt uAPCwGIut/q1U4//Iud6KZ5qaSmE5XKMNBF8qG400Fc13mRyG5G+vFe5cdUhAleoh2RM 2q7BRWUlMNA0G5Q2+XrIw+3RXhubS50PknNP6oXdTqjOtCCdzr+kBveoMNj/Z6WVD/F4 D2+Q== 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 c10si166305pgn.248.2017.11.16.01.03.12; Thu, 16 Nov 2017 01:03:24 -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 S1759110AbdKPHgL (ORCPT + 91 others); Thu, 16 Nov 2017 02:36:11 -0500 Received: from thoth.sbs.de ([192.35.17.2]:36706 "EHLO thoth.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759017AbdKPHgC (ORCPT ); Thu, 16 Nov 2017 02:36:02 -0500 Received: from mail1.siemens.de (mail1.siemens.de [139.23.33.14]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id vAG7QtjW000978 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 16 Nov 2017 08:26:55 +0100 Received: from md1f2u6c.ww002.siemens.net ([167.87.32.158]) by mail1.siemens.de (8.15.2/8.15.2) with ESMTP id vAG7QrlV029336; Thu, 16 Nov 2017 08:26:55 +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 06/10] x86: jailhouse: Avoid access of unsupported platform resources Date: Thu, 16 Nov 2017 08:26:48 +0100 Message-Id: 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 We don't have CMOS access, thus we can't set the warm-reset vectors in do_boot_cpu. There is no RTC, thus also no wall clock. Furthermore, there are no ISA IRQs and no PIC. So fill the platform callbacks accordingly. Signed-off-by: Jan Kiszka --- arch/x86/kernel/jailhouse.c | 10 ++++++++++ arch/x86/kernel/smpboot.c | 7 +++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/jailhouse.c b/arch/x86/kernel/jailhouse.c index 8e5b2f0c8a34..cfe8ae0c33a2 100644 --- a/arch/x86/kernel/jailhouse.c +++ b/arch/x86/kernel/jailhouse.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #define SETUP_JAILHOUSE 0x53484c4a /* "JLHS" */ @@ -50,6 +51,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)); +} + #define MAX_RETRIES 5 #define SMI_TRESHOLD 50000 @@ -139,7 +145,11 @@ static void __init jailhouse_init_platform(void) unsigned int cpu; x86_init.timers.timer_init = jailhouse_timer_init; + x86_init.irqs.pre_vector_init = x86_init_noop; + legacy_pic = &null_legacy_pic; + x86_platform.legacy.rtc = 0; + x86_platform.get_wallclock = jailhouse_get_wallclock; x86_platform.calibrate_cpu = jailhouse_calibrate_cpu; x86_platform.calibrate_tsc = jailhouse_calibrate_tsc; diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 5f59e6bee123..81339dbafeba 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -78,6 +78,7 @@ #include #include #include +#include /* Number of siblings per CPU package */ int smp_num_siblings = 1; @@ -1006,7 +1007,8 @@ static int do_boot_cpu(int apicid, int cpu, struct task_struct *idle, * the targeted processor. */ - if (get_uv_system_type() != UV_NON_UNIQUE_APIC) { + if (get_uv_system_type() != UV_NON_UNIQUE_APIC && + !jailhouse_paravirt()) { pr_debug("Setting warm reset code and vector.\n"); @@ -1078,7 +1080,8 @@ static int do_boot_cpu(int apicid, int cpu, struct task_struct *idle, /* mark "stuck" area as not stuck */ *trampoline_status = 0; - if (get_uv_system_type() != UV_NON_UNIQUE_APIC) { + if (get_uv_system_type() != UV_NON_UNIQUE_APIC && + !jailhouse_paravirt()) { /* * Cleanup possible dangling ends... */ -- 2.12.3 From 1584408331781905432@xxx Sat Nov 18 12:52:12 +0000 2017 X-GM-THRID: 1584408331781905432 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread