Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3015727imm; Sun, 1 Jul 2018 10:20:46 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJB4uXedKTOuECDRYGa5novjbpSqotsTtzirw+V+tP45Xo4OBy4x1SWPotCNsBuUgrpkJGi X-Received: by 2002:a65:64d3:: with SMTP id t19-v6mr19065850pgv.148.1530465646815; Sun, 01 Jul 2018 10:20:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530465646; cv=none; d=google.com; s=arc-20160816; b=G0vXEVZ7weQVb0SF/58DrNovaI30M7UI3uip56sb1OlPsZ6NLOijXDq8e5ELUiWBaw kcXaY6jvjGoSv5uSlGFllRleEEiPcRLKDha652SUBP5NBnFohYD0xspam02wXNmACDXx jz7B9ej8OxZrBbOHCJCk6B6/VfzKsYvqw/spNbT5RsUSSGM7yA30As3si4QWuqqXDrHH AkGDJXekrZnVoDQ/nyXO12AbG3IqLwaLk8E7JGtR99NiNahd1q+2R4MH8woI6R/EYoWk RunNJ71GP4ZsZ8CQVURa2vAHrUUypSXhdHIhQGG+3EXn1TUs0ZFOwzLkBZD1aouO+YVN 27Bw== 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=admYrjlQrl060dUZME/QXwGGCHgqKPh9cfeNV9itZpA=; b=Jh/HI2iF2x+kA2Ot1pR0yfms6Olu7cpRUDq2EZOHbwCj68bGuH2glxkVCuiCxA6KnZ rbWoCy6Y0uBu7whQXwbRYeBmFME82Qza/vkCWRMorVyJXlI4RuM36fGG/ZANGrUnEDhY W7kfJa1Tg1IsBCWLuUE188TQ4FDQ3m0PPm/DvXjh6bV80FazD+N+9RDcalISxd6TkhtY vEkAd0QJbJDb74MX3tBt0bhtT3QGyaq1EerHZqU/e7bhjIqvInPqH8DMVDbKDkIHgI6C B3/12UX5fkH8pOWOAk436ld/+ag5NY0s4jQo+2WPQ1cnXZElg5gsXfzo62RtXcHcpqwU aLMw== 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 u10-v6si12186241pgc.261.2018.07.01.10.20.32; Sun, 01 Jul 2018 10:20:46 -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 S1031693AbeGAQjI (ORCPT + 99 others); Sun, 1 Jul 2018 12:39:08 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:36830 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031375AbeGAQjE (ORCPT ); Sun, 1 Jul 2018 12:39:04 -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 23BD5A73; Sun, 1 Jul 2018 16:39:03 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, stable@kernel.org, Pridhiviraj Paidipeddi , Nicholas Piggin , Michael Ellerman Subject: [PATCH 4.17 056/220] powerpc/64s/radix: Fix radix_kvm_prefetch_workaround paca access of not possible CPU Date: Sun, 1 Jul 2018 18:21:20 +0200 Message-Id: <20180701160910.678158697@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180701160908.272447118@linuxfoundation.org> References: <20180701160908.272447118@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: Nicholas Piggin commit 758380b8155f69b4e2f77f27562f8a7a466749d6 upstream. If possible CPUs are limited (e.g., by kexec), then the kvm prefetch workaround function can access the paca pointer for a !possible CPU. Fixes: d2e60075a3d44 ("powerpc/64: Use array of paca pointers and allocate pacas individually") Cc: stable@kernel.org Reported-by: Pridhiviraj Paidipeddi Tested-by: Pridhiviraj Paidipeddi Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/mm/tlb-radix.c | 2 ++ 1 file changed, 2 insertions(+) --- a/arch/powerpc/mm/tlb-radix.c +++ b/arch/powerpc/mm/tlb-radix.c @@ -733,6 +733,8 @@ extern void radix_kvm_prefetch_workaroun for (; sib <= cpu_last_thread_sibling(cpu) && !flush; sib++) { if (sib == cpu) continue; + if (!cpu_possible(sib)) + continue; if (paca_ptrs[sib]->kvm_hstate.kvm_vcpu) flush = true; }