Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3550892pxj; Mon, 24 May 2021 09:10:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwaqI3hr3KfL+/wI6gE/Hw5VYS85ze4bDOT+ryKm0GwOSlc6nPC76HKqoK5bSjnET6xps6m X-Received: by 2002:a05:6638:270b:: with SMTP id m11mr24772264jav.59.1621872649530; Mon, 24 May 2021 09:10:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621872649; cv=none; d=google.com; s=arc-20160816; b=Hj16M64kM80BanaPQ1UpeB27iGrCZLbjeQ1gJvzwxMpWd4Sz2ZeDGurZuVZZsm0sP2 pbLLYVAz/E74i9YyXt8lTIItRLk6YuFh3w7KMV1lywQIQkEX8B419/I7bmGzmUiyBYm+ RxnwG6RUqo0DO3xTMnbPSZsAQBd/kZpS0mltOnFCkR23ajDfbdNIVFg/qgoERhWhohxC 87aiNOmXBae7zjUGMMjRjb2f12nsVxFYf+5CnUzD1qy8OhgV1eTb+xLuOqpaCMA+gIOA h1uYfhQHV5bN/bmt8VnuUbYCMix3SqmMr3eQfz4+UrPElfhGJpGvAvJIksCm57bJaT/2 S6iQ== 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=dWk9Eh3uzITW+kyN9fz6lzKxBsqJM+/GV3vg19kQHiE=; b=rOn8We9JQg63HiAD37OqHM2kD/ZtxkNIHhkRRFMNd2jj6dYMxWmiHQflrfz/gUpW+3 En2K7st9dcJhqgqhKguw/2PsWrJKsO9uLN3YF+ZHPgL/vl87Yqlo4IkGQbUstjs2S/vh s+qd7Jj2XUWcqjCt7lP45jPwdYLxcecOscNkF0923Y00kK0WnAakGHCPGZeh9286CXVl m67jXCPnc6IkjWEW2xEYJ+Jpv1KgISogryqzW+Y77bLckuxt1/o/bq3C+mcHiheG0854 F7PEOuy4vFvJjh0tBKWFn24lzJWyYIvbkuojaRUezOCyGRG5mvNG6CxDvsWBk0doZl8C qIYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xeLDyw+5; 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 v8si15741132ilu.72.2021.05.24.09.10.36; Mon, 24 May 2021 09:10:49 -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=xeLDyw+5; 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 S233602AbhEXQKw (ORCPT + 99 others); Mon, 24 May 2021 12:10:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:46882 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235997AbhEXQCd (ORCPT ); Mon, 24 May 2021 12:02:33 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 25C4561376; Mon, 24 May 2021 15:50:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621871439; bh=Z87IyYhw8VNqCVTMOSBY3ZV/P8EfPVu5Q8WRoURoiCc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xeLDyw+50gaSeWdUskKabkWJnJ9BBcr24X34BhiUmr+6zlHKGlbtVnPmK3jBFFRkc TNZbPj9vRS2RZCouFWNpZgn83pPt0tnXFW56WUrXjb6bMGqPQ5FFLoMe5CTXJyf1LF zYhdfLP/dlOyMZy3zuylIr6bZIlYAKHGVcBcn48o= 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 4.19 49/49] x86/Xen: swap NX determination and GDT setup on BSP Date: Mon, 24 May 2021 17:26:00 +0200 Message-Id: <20210524152325.958181984@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524152324.382084875@linuxfoundation.org> References: <20210524152324.382084875@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 @@ -1246,16 +1246,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);