Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3551503pxj; Mon, 24 May 2021 09:11:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEwKgaAz2OwiWMGbZ0yoTRd8uKuaGXxqONC+7t6iTu7iOrWzHrZizCWW06Wh7vT8RyTjsd X-Received: by 2002:a05:6602:1815:: with SMTP id t21mr16631363ioh.193.1621872688494; Mon, 24 May 2021 09:11:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621872688; cv=none; d=google.com; s=arc-20160816; b=0y36BpZeEb7nyNnISXFqalHLiVcO/bqoVrZxgPDJgKbs1YuIlhYLFXQPezyTITElbx pKQPELpi/ErgcWHP9dsKQ6AuF9Sb6W7M7k/IGl5ZzseaWHq1O9tRKD5FjWuPDHIkS4qM gW5AGjjsjoQkVlmbprhTSeHq6cR/MshCbyOo665imYU4MPKNfYPWq0fX5COtuERHe3k2 Nm+XWpARF1IMk8hVf6Ee+z7lWvDXJiWsWQMhlSm16w7d/sqIifLSU/yLhWf7LALZ0mhO a9wE1Ky4eh98g+FKpR5RlrK4DTSfvRTN7sxEevaILhNPmxMEzr6HypNUkKrbkeyGhMkB YGBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7RJLCFDYsoZg+FMuQBbtCW45D5PwPg5H38xE7LMJ1J8=; b=PCLXIbjr/17Xvf5YdHEpdLDo8fuypzp1XXk9Sv1D/90PwmQ7XFfGjxUBelokn0FIyb ++7ooDa83tCCTy/DFXb0lPqFJbLh0UjAkvaTT7QuVGQWfdIqHKq1kfebiUFkPFszJSsG 5Ln1yNwpPOL0T/tPjXj/7wus8xLfaQ3FRPonuz2oPXGmfaSviIZrwq0lAzFagsIXqcY7 7q5WOWUY88wfdgpqYk2OPYNXB1QLGoZgEkrTC+C+ZnRKLTd90O99EC1ejBuhSS8pRjts 5IBDTYlm9TpR844O04lhxi5FCRTZGTceO1QJxwsYwqpB8UQki96M4g4OrD0Ov8WyWC8u rMCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SKSCEjiY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k2si13957818ils.162.2021.05.24.09.11.15; Mon, 24 May 2021 09:11:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SKSCEjiY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234967AbhEXQKt (ORCPT + 99 others); Mon, 24 May 2021 12:10:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:46884 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235892AbhEXQCe (ORCPT ); Mon, 24 May 2021 12:02:34 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 736B26140C; Mon, 24 May 2021 15:50:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621871443; bh=OKwBig0ASc3vb2AN3l1PWnwwMPSAFQCEJt5p9LTtmgc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SKSCEjiYmx039UL6bhXKITLl8jexJhCBeF2+QdDZAwBYBtN/U3hbWtkyr/zVwmvY+ 89QNwQl4xK9K3+EIu0K+R7UkaSykWdPciSyn+ApB2QFxTOEnLPTQGZVIXB3T+nUat+ oAHF2O3yT4Eg2yjIzrJXlPInfQHBy3wDE5/uaqck= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Olaf Hering , Jan Beulich , Juergen Gross Subject: [PATCH 5.12 124/127] x86/Xen: swap NX determination and GDT setup on BSP Date: Mon, 24 May 2021 17:27:21 +0200 Message-Id: <20210524152339.064067288@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524152334.857620285@linuxfoundation.org> References: <20210524152334.857620285@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jan Beulich commit ae897fda4f507e4b239f0bdfd578b3688ca96fb4 upstream. xen_setup_gdt(), via xen_load_gdt_boot(), wants to adjust page tables. For this to work when NX is not available, x86_configure_nx() needs to be called first. [jgross] Note that this is a revert of 36104cb9012a82e73 ("x86/xen: Delay get_cpu_cap until stack canary is established"), which is possible now that we no longer support running as PV guest in 32-bit mode. Cc: # 5.9 Fixes: 36104cb9012a82e73 ("x86/xen: Delay get_cpu_cap until stack canary is established") Reported-by: Olaf Hering Signed-off-by: Jan Beulich Reviewed-by: Juergen Gross Signed-off-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/12a866b0-9e89-59f7-ebeb-a2a6cec0987a@suse.com Signed-off-by: Juergen Gross --- arch/x86/xen/enlighten_pv.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/arch/x86/xen/enlighten_pv.c +++ b/arch/x86/xen/enlighten_pv.c @@ -1276,16 +1276,16 @@ asmlinkage __visible void __init xen_sta /* Get mfn list */ xen_build_dynamic_phys_to_machine(); + /* Work out if we support NX */ + get_cpu_cap(&boot_cpu_data); + x86_configure_nx(); + /* * Set up kernel GDT and segment registers, mainly so that * -fstack-protector code can be executed. */ xen_setup_gdt(0); - /* Work out if we support NX */ - get_cpu_cap(&boot_cpu_data); - x86_configure_nx(); - /* Determine virtual and physical address sizes */ get_cpu_address_sizes(&boot_cpu_data);