From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030386AbdKQXP3 (ORCPT ); Fri, 17 Nov 2017 18:15:29 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:53088 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966920AbdKQXPU (ORCPT ); Fri, 17 Nov 2017 18:15:20 -0500 Date: Sat, 18 Nov 2017 00:14:21 +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 09/10] x86: jailhouse: Wire up IOAPIC for legacy UART ports 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 Thu, 16 Nov 2017, Jan Kiszka wrote: > > static void __init jailhouse_init_platform(void) > { > + struct ioapic_domain_cfg ioapic_cfg = { > + .type = IOAPIC_DOMAIN_STRICT, > + .ops = &mp_ioapic_irqdomain_ops, > + }; > + struct mpc_intsrc mp_irq = { > + .type = MP_INTSRC, > + .irqtype = mp_INT, > + }; > u64 pa_data = boot_params.hdr.setup_data; > struct jailhouse_setup_data *data; > unsigned int cpu; > @@ -189,6 +198,17 @@ static void __init jailhouse_init_platform(void) > boot_cpu_apic_version); > smp_found_config = 1; > > + if (data->standard_ioapic) { > + mp_register_ioapic(0, 0xfec00000, gsi_top, &ioapic_cfg); > + > + /* Register 1:1 mapping for legacy UART IRQs 3 and 4 */ > + mp_irq.srcbusirq = mp_irq.dstirq = 3; > + mp_save_irq(&mp_irq); > + > + mp_irq.srcbusirq = mp_irq.dstirq = 4; > + mp_save_irq(&mp_irq); Again, that can run later. And please split out initialization for particular features into separate functions. Otherwise the parse function will become a kitchen sink of all sorts. Thanks, tglx