Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2040057imm; Mon, 16 Jul 2018 00:41:19 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdDAY5xBfYsEbzf90Clo3zdOvKpNuWELv9LIfIZbkTfW64L81bWwFdlxMaQxokM8YDNplyf X-Received: by 2002:a62:b917:: with SMTP id z23-v6mr11727615pfe.131.1531726879278; Mon, 16 Jul 2018 00:41:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531726879; cv=none; d=google.com; s=arc-20160816; b=ght2lIrxDUProWoE4nUcy3xMOkb438wnFVhl04fQnLgllMvdahtVySRPoY3othXn7c tIgtCXa6ywEe4zIYalJ89o9sMkigKZK4KxSV52c1rdOG3IcGDiT/xorE9z5kPyEgN8/D 8bMD3YbItWeARh9E8cK8Bkp96BSt8b1LakzK5vxQlvRyOmRH9MH31+c+0o/CUYZwrSeE AviZjHeJpqEGqQOeQtJCOq7NaM3gZBqjX6av08AMX/7A3nLJpKaLNRANySIT2nBA0SI0 DqlJaJn3bj6g7j+Fy3WvWImpNIK/rpE/DcCV6UOPVgHYFmKtq4U3jUaLynnx4XRjPjsp TS7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=wyIpi3RwURL00zk+dLm9aQGf/Jtw8hmRMbYGd2sqN00=; b=USxnOJeTCVEXq2JJty+6isPiz7Q09PcKW//B9MK9xmGvmpU+sFGATI+mpW13xxaeCN uPHxdWFpV3y95EQdRb6GXxN/Pdj9ak1PGfHSO5ehAjwt9JPCP68nCjDBAA/yVPymY8yD lQnrOxRR/4N9F3GxSCJO9/Aihtaf8HPiHN/W3CpiQR4FTf4KNZgHcMeFEOjh06zjnJ3I dlKxoRIejKbJ9QC03edXgYGSMcgQmlxYSESJ1sDGSAtArt62KTaYu4bmRY32/bGEl5or xQlRg5BSkHo0ECEvQ0t2YdN+Gefm98f0AwSzG3HKwNsDXZEzmPBEsdnJoWoqbAyM+afQ 5ByQ== 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 v9-v6si28578095pfg.123.2018.07.16.00.41.04; Mon, 16 Jul 2018 00:41:19 -0700 (PDT) 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 S2387901AbeGPIFQ (ORCPT + 99 others); Mon, 16 Jul 2018 04:05:16 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:47086 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726898AbeGPIFQ (ORCPT ); Mon, 16 Jul 2018 04:05:16 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 87546C03; Mon, 16 Jul 2018 07:39:14 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Juergen Gross , Boris Ostrovsky Subject: [PATCH 4.17 50/67] xen: setup pv irq ops vector earlier Date: Mon, 16 Jul 2018 09:35:19 +0200 Message-Id: <20180716073451.270607519@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180716073443.294323458@linuxfoundation.org> References: <20180716073443.294323458@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.17-stable review patch. If anyone has any objections, please let me know. ------------------ From: Juergen Gross commit 0ce0bba4e5e0eb9b753bb821785de5d23c494392 upstream. Setting pv_irq_ops for Xen PV domains should be done as early as possible in order to support e.g. very early printk() usage. The same applies to xen_vcpu_info_reset(0), as it is needed for the pv irq ops. Move the call of xen_setup_machphys_mapping() after initializing the pv functions as it contains a WARN_ON(), too. Remove the no longer necessary conditional in xen_init_irq_ops() from PVH V1 times to make clear this is a PV only function. Cc: # 4.14 Signed-off-by: Juergen Gross Reviewed-by: Boris Ostrovsky Signed-off-by: Juergen Gross Signed-off-by: Greg Kroah-Hartman --- arch/x86/xen/enlighten_pv.c | 24 +++++++++++------------- arch/x86/xen/irq.c | 4 +--- 2 files changed, 12 insertions(+), 16 deletions(-) --- a/arch/x86/xen/enlighten_pv.c +++ b/arch/x86/xen/enlighten_pv.c @@ -1206,12 +1206,20 @@ asmlinkage __visible void __init xen_sta xen_setup_features(); - xen_setup_machphys_mapping(); - /* Install Xen paravirt ops */ pv_info = xen_info; pv_init_ops.patch = paravirt_patch_default; pv_cpu_ops = xen_cpu_ops; + xen_init_irq_ops(); + + /* + * Setup xen_vcpu early because it is needed for + * local_irq_disable(), irqs_disabled(), e.g. in printk(). + * + * Don't do the full vcpu_info placement stuff until we have + * the cpu_possible_mask and a non-dummy shared_info. + */ + xen_vcpu_info_reset(0); x86_platform.get_nmi_reason = xen_get_nmi_reason; @@ -1224,6 +1232,7 @@ asmlinkage __visible void __init xen_sta * Set up some pagetable state before starting to set any ptes. */ + xen_setup_machphys_mapping(); xen_init_mmu_ops(); /* Prevent unwanted bits from being set in PTEs. */ @@ -1249,20 +1258,9 @@ asmlinkage __visible void __init xen_sta get_cpu_cap(&boot_cpu_data); x86_configure_nx(); - xen_init_irq_ops(); - /* Let's presume PV guests always boot on vCPU with id 0. */ per_cpu(xen_vcpu_id, 0) = 0; - /* - * Setup xen_vcpu early because idt_setup_early_handler needs it for - * local_irq_disable(), irqs_disabled(). - * - * Don't do the full vcpu_info placement stuff until we have - * the cpu_possible_mask and a non-dummy shared_info. - */ - xen_vcpu_info_reset(0); - idt_setup_early_handler(); xen_init_capabilities(); --- a/arch/x86/xen/irq.c +++ b/arch/x86/xen/irq.c @@ -128,8 +128,6 @@ static const struct pv_irq_ops xen_irq_o void __init xen_init_irq_ops(void) { - /* For PVH we use default pv_irq_ops settings. */ - if (!xen_feature(XENFEAT_hvm_callback_vector)) - pv_irq_ops = xen_irq_ops; + pv_irq_ops = xen_irq_ops; x86_init.irqs.intr_init = xen_init_IRQ; }