From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1423090AbdKQW7z (ORCPT ); Fri, 17 Nov 2017 17:59:55 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:53065 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966853AbdKQW7s (ORCPT ); Fri, 17 Nov 2017 17:59:48 -0500 Date: Fri, 17 Nov 2017 23:59:42 +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 06/10] x86: jailhouse: Avoid access of unsupported platform resources In-Reply-To: Message-ID: References: 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 Fri, 17 Nov 2017, Thomas Gleixner wrote: > On Thu, 16 Nov 2017, Jan Kiszka wrote: > > > From: Jan Kiszka > > > > We don't have CMOS access, thus we can't set the warm-reset vectors in > > s/We/A jailhouse cell/ or s/We/A jailhouse guest/ > > > 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. > > > +static void jailhouse_get_wallclock(struct timespec *now) > > +{ > > + memset(now, 0, sizeof(*now)); > > +} > > > @@ -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"); > > Adding more here might justify a function pointer in x86_platform_ops. Not > sure though, but we have an increasing amount of xen()/kvm()/whatever > conditionals popping up all over the place. And now you add jailhouse() > ones :) Actually we don't want a function pointer as we would need two. A simple flag would be sufficient. Thanks, tglx