Received: by 10.223.176.5 with SMTP id f5csp725794wra; Fri, 9 Feb 2018 06:17:05 -0800 (PST) X-Google-Smtp-Source: AH8x225y+g0PwOYIgtvs8e/yMgzXglW41vaa3Xk+MSDI4lAqL2t3NK7KmsqVGCKXjuPOAn9x8Fbh X-Received: by 2002:a17:902:34e:: with SMTP id 72-v6mr2789223pld.126.1518185825665; Fri, 09 Feb 2018 06:17:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518185825; cv=none; d=google.com; s=arc-20160816; b=mYdBxmEfnoN5ESwL8a7wvjB8sokP3dPpYDr0ZH4J/lzfdX7uCowLi93wzuShlVssBq +BMHShdg6OcecofERnoq5a3vRO6jgpqE6VlvA+PgD9nqUAkuNpBEyIxTSs8xfmJZQxxU T4K2Jn5qLPCTcADEPooiLKPfKbZXhqroTW7JYiA73cOajf+gzZweuY+OovwcfQkvOCJE bOaQ8jvqTKvB6vfzRlZ9pjQ4K1xg+/AvNNkZraRmPqHO4dXE32cavbCVqdDjnmk4gqk+ pYXuHepRl28buv2SKbE7TYsVrclmkFUOSIMVXnOIKHAx7Oj3SfTv45ekVT93uZnFwImC /Rbg== 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=ldry68c7hwOy/DD0jpgsZuAmETvz0YDuJKdRBuOP5Yg=; b=nxX7fu5EsuC3/kv+OjMY7xahybl2goHFmURIzNAJwMCT15oQiqgFpTt75p5BRJNZAH 4DA0ffo/zanwQqE+kgks5C652yv1VXYLAyImamgplAVU8Iif9vajjIPq/RF95AcVw2Ao Yl+gXTGrk1GR5EfurMZT7uLbTAZ5O6ofC/XAE8aWIWIUq50MGxdtPX63KfsjCuB4EFUf x54wWBWzD8BgjzOM17Ci8u1UqyMzg6gvepZGvHueYVYe28sQGoTQJmy97dpsenOTN0KD 7Hka30OezD0ZOryQ674evgmVr36M/BCXQndgBUYnp3xUtaOpL/5z71fVcBNNksPSstJd eqtg== 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 q13si1412672pgq.181.2018.02.09.06.16.51; Fri, 09 Feb 2018 06:17:05 -0800 (PST) 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 S1752375AbeBINk7 (ORCPT + 99 others); Fri, 9 Feb 2018 08:40:59 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:48314 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752261AbeBINky (ORCPT ); Fri, 9 Feb 2018 08:40:54 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id DDD381060; Fri, 9 Feb 2018 13:40:53 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Neuling , Michael Ellerman Subject: [PATCH 4.9 08/92] powerpc/pseries: Query hypervisor for RFI flush settings Date: Fri, 9 Feb 2018 14:38:37 +0100 Message-Id: <20180209133931.874865385@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180209133931.211869118@linuxfoundation.org> References: <20180209133931.211869118@linuxfoundation.org> User-Agent: quilt/0.65 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.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Michael Neuling commit 8989d56878a7735dfdb234707a2fee6faf631085 upstream. A new hypervisor call is available which tells the guest settings related to the RFI flush. Use it to query the appropriate flush instruction(s), and whether the flush is required. Signed-off-by: Michael Neuling Signed-off-by: Michael Ellerman Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/platforms/pseries/setup.c | 35 +++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) --- a/arch/powerpc/platforms/pseries/setup.c +++ b/arch/powerpc/platforms/pseries/setup.c @@ -450,6 +450,39 @@ static void __init find_and_init_phbs(vo of_pci_check_probe_only(); } +static void pseries_setup_rfi_flush(void) +{ + struct h_cpu_char_result result; + enum l1d_flush_type types; + bool enable; + long rc; + + /* Enable by default */ + enable = true; + + rc = plpar_get_cpu_characteristics(&result); + if (rc == H_SUCCESS) { + types = L1D_FLUSH_NONE; + + if (result.character & H_CPU_CHAR_L1D_FLUSH_TRIG2) + types |= L1D_FLUSH_MTTRIG; + if (result.character & H_CPU_CHAR_L1D_FLUSH_ORI30) + types |= L1D_FLUSH_ORI; + + /* Use fallback if nothing set in hcall */ + if (types == L1D_FLUSH_NONE) + types = L1D_FLUSH_FALLBACK; + + if (!(result.behaviour & H_CPU_BEHAV_L1D_FLUSH_PR)) + enable = false; + } else { + /* Default to fallback if case hcall is not available */ + types = L1D_FLUSH_FALLBACK; + } + + setup_rfi_flush(types, enable); +} + static void __init pSeries_setup_arch(void) { set_arch_panic_timeout(10, ARCH_PANIC_TIMEOUT); @@ -467,6 +500,8 @@ static void __init pSeries_setup_arch(vo fwnmi_init(); + pseries_setup_rfi_flush(); + /* By default, only probe PCI (can be overridden by rtas_pci) */ pci_add_flags(PCI_PROBE_ONLY);