Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4237875imm; Sat, 21 Jul 2018 13:42:19 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe9Ryd3Qq4qawlmZLfpO9JfKPEX0Mn4CE6hnUQicF0M8qK41DB+ALhSvU57kGstYLgxNBPF X-Received: by 2002:a62:5486:: with SMTP id i128-v6mr7114345pfb.166.1532205739162; Sat, 21 Jul 2018 13:42:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532205739; cv=none; d=google.com; s=arc-20160816; b=0z6qwaB/pREL217rjIzgxlBSyURRGniWD2W5SBT7cSDDvV6LROv2XzbtPB0QgldJ7Z ikfEqMZ3B+hz+b2O34640r82Lz/JmVEoK6AEwlh38YB63D1UBBEwsVfXaSJffGRk9P96 K2BApU53fWt0ulQ2klQtX/BpRT+DbBPCbvEvVUKtKsixYHzSbOPno8dq89iS4ZQJDIdA ktkBJ0hlmiKwWprRHiez/h1SdczwW3/DIcJMunxow2cgV03BpV0IR7bMGCC0FSXYkT3C arYUdVkgH36AtOfSzg0WiWP/+pGgQtrfQoEvaHP7Kd89NzXXC4gLL4p1RITfdHGSKuxc jPiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=+eTJo7qWEBRtXUZwvFl2lEV8dKSwETVAxfYQdSQoYR4=; b=wQ7nCShG7LKw7hqRz8Ny0VNg0Lx1gIkL4xATb2wY4dinFvhOz6DkMs1TE92Eh9IbZk 8knev1B5SEd8LNqUHfIXiAQtMA0hrkpiBiEepNwyBAWmO9rgOg5df0+L8VdurGENriSc sYw7K/euKUrR2C2DxSPePb4Q9FuehgaIIHE929dHphch4sJc0U1BWmGChSL3tjCIIwJY XCd4eUFGumYypNeTkHrp3tftP1Vst2P80LLiRT1h+5r4SWg+JtbtCt1g1tXrOCcan+7Z ss3A0hxOP6KO3xlFdNoeNQ3IHrLf/2uI4h41bT1phmRzru+fVMnL0PiKhNzZSI+Gcgng jN6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@runbox.com header.s=rbselector1 header.b=JHcxbUqw; 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 m76-v6si4729945pfg.323.2018.07.21.13.42.02; Sat, 21 Jul 2018 13:42: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; dkim=pass header.i=@runbox.com header.s=rbselector1 header.b=JHcxbUqw; 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 S1728302AbeGUVfM (ORCPT + 99 others); Sat, 21 Jul 2018 17:35:12 -0400 Received: from aibo.runbox.com ([91.220.196.211]:32770 "EHLO aibo.runbox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728110AbeGUVfL (ORCPT ); Sat, 21 Jul 2018 17:35:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=runbox.com; s=rbselector1; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=+eTJo7qWEBRtXUZwvFl2lEV8dKSwETVAxfYQdSQoYR4=; b=JHcxbUqwODQUws0Xk2atGy4zO ZtGdCEpb4/bW1yK5seLEJTHFZzRvKZPlXqMIpMehUQP/+nW8NLwZ7p1ri+GssaxLWe3pkB1aLOJX5 WftHdn6KV+FK9FSShxMxp1fJb7LQ8fdAE9bAGc+GO4Gju24jfKy4Ir4Mr6DulS6tJWY8VHR5Vy6l2 QNoGs22SKWtNrcRkMfu/sUGMtCm+3zV5UoDMS/H3ltnIppw0JGdL2+YILZfr3Zf8mUapwfEjOtZDS wVwZ9Bwcx3HgeJBoXqUksOzneKWf4JRE0EeTthtLeejWczw4WCXGKZvPC2PG+AxU+fAY+r8A9iYt1 NpxB+pV5A==; Received: from [10.9.9.210] (helo=mailfront10.runbox.com) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1fgxtG-0002Tu-MP; Sat, 21 Jul 2018 21:50:06 +0200 Received: by mailfront10.runbox.com with esmtpsa (uid:769847 ) (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.82) id 1fgxt2-0007pF-RS; Sat, 21 Jul 2018 21:49:53 +0200 From: "M. Vefa Bicakci" To: linux-kernel@vger.kernel.org Cc: "M . Vefa Bicakci" , "Kirill A. Shutemov" , Andy Lutomirski , Ingo Molnar , "H. Peter Anvin" , Thomas Gleixner , Boris Ostrovsky , Juergen Gross , xen-devel@lists.xenproject.org, x86@kernel.org, stable@vger.kernel.org Subject: [PATCH 2/2] xen/pv: Call get_cpu_address_sizes to set x86_virt/phys_bits Date: Sat, 21 Jul 2018 15:49:09 -0400 Message-Id: <20180721194909.23903-2-m.v.b@runbox.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180721194909.23903-1-m.v.b@runbox.com> References: <20180721194909.23903-1-m.v.b@runbox.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit d94a155c59c9 ("x86/cpu: Prevent cpuinfo_x86::x86_phys_bits adjustment corruption") has moved the query and calculation of the "x86_virt_bits" and "x86_phys_bits" fields of the "cpuinfo_x86" struct from the "get_cpu_cap" function to a new function named "get_cpu_address_sizes". One of the call sites related to Xen PV VMs was unfortunately missed in the aforementioned commit, and this prevents successful boot-up of kernel versions 4.17 and up in Xen PV VMs. Signed-off-by: M. Vefa Bicakci Cc: "Kirill A. Shutemov" Cc: Andy Lutomirski Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: Thomas Gleixner Cc: Boris Ostrovsky Cc: Juergen Gross Cc: xen-devel@lists.xenproject.org Cc: x86@kernel.org Cc: stable@vger.kernel.org # for v4.17 and up Fixes: d94a155c59c9 ("x86/cpu: Prevent cpuinfo_x86::x86_phys_bits adjustment corruption") --- arch/x86/kernel/cpu/common.c | 2 +- arch/x86/kernel/cpu/cpu.h | 1 + arch/x86/xen/enlighten_pv.c | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index eb4cb3efd20e..2322d0c4bfd2 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -911,7 +911,7 @@ void get_cpu_cap(struct cpuinfo_x86 *c) apply_forced_caps(c); } -static void get_cpu_address_sizes(struct cpuinfo_x86 *c) +void get_cpu_address_sizes(struct cpuinfo_x86 *c) { u32 eax, ebx, ecx, edx; diff --git a/arch/x86/kernel/cpu/cpu.h b/arch/x86/kernel/cpu/cpu.h index 38216f678fc3..12a5f0cec0b2 100644 --- a/arch/x86/kernel/cpu/cpu.h +++ b/arch/x86/kernel/cpu/cpu.h @@ -46,6 +46,7 @@ extern const struct cpu_dev *const __x86_cpu_dev_start[], *const __x86_cpu_dev_end[]; extern void get_cpu_cap(struct cpuinfo_x86 *c); +extern void get_cpu_address_sizes(struct cpuinfo_x86 *c); extern void cpu_detect_cache_sizes(struct cpuinfo_x86 *c); extern void init_scattered_cpuid_features(struct cpuinfo_x86 *c); extern u32 get_scattered_cpuid_leaf(unsigned int level, diff --git a/arch/x86/xen/enlighten_pv.c b/arch/x86/xen/enlighten_pv.c index 439a94bf89ad..87afb000142a 100644 --- a/arch/x86/xen/enlighten_pv.c +++ b/arch/x86/xen/enlighten_pv.c @@ -1257,6 +1257,7 @@ asmlinkage __visible void __init xen_start_kernel(void) /* Work out if we support NX */ get_cpu_cap(&boot_cpu_data); + get_cpu_address_sizes(&boot_cpu_data); x86_configure_nx(); /* Let's presume PV guests always boot on vCPU with id 0. */ -- 2.17.1