From patchwork Tue Apr 18 19:12:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 751938 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3w6vxt52L7z9s2x for ; Wed, 19 Apr 2017 05:16:34 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Rf164Gwt"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3w6vxt3nQczDq9H for ; Wed, 19 Apr 2017 05:16:34 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Rf164Gwt"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-pg0-x241.google.com (mail-pg0-x241.google.com [IPv6:2607:f8b0:400e:c05::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3w6vsN40rHzDq5b for ; Wed, 19 Apr 2017 05:12:40 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Rf164Gwt"; dkim-atps=neutral Received: by mail-pg0-x241.google.com with SMTP id o123so347256pga.1 for ; Tue, 18 Apr 2017 12:12:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Gi+Sgb0UzP55tUrwUEtdNPkvfX/GeCrE2MVwX8Ue/Gw=; b=Rf164GwtouHwjAgT51ipgDxvMLAmY6RJM7xh1LbGq0n78KvGvP9RZiTM7lbKl6U3VZ 7KZOvl7bv2UyWjIXu2YhbJsL2TptA2UPGv5jP8crQfrsfu7FqGAYZEirVIqHRZ5br7+2 rndm6HBeTwD/dqc5N9X6+C/aqw3K0JEbM7wIhXRpdkrAf3Fh2wwrLaEyUbVPP8fFpelG jogykiGuaKB+FZkS9rokt6noHJNT+41E3ZOBwhX7Rbj3mwFvphQa8CmM5UyV3sWU3AQ+ M0WZjsm0kN4vYFLI4SfWovQwt7kxyhB5Ja7ZWlxwyMh2auZBf/aGiZ6fpZAOOxkJCNHu K5Lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Gi+Sgb0UzP55tUrwUEtdNPkvfX/GeCrE2MVwX8Ue/Gw=; b=RIo4sckBmfRqKJIoklICrRPa1iofH0iCqDpSpGsu+OCDEha/xlTNXmCzvDwNqdsnsY 8UgMu78X64qNxZIwaXFDkzVAxBvvlGrLvgZvDC/LprcP1c5rOCf0JDRY0UX0CCkKamqP pWKUlFZ4uNi5KvyaO0WyCnpC4tknigEA0G+Vlvqxi2liQuA0C84xOfSeaI82vAl7zXeQ 9kkFei5vQz7oN4fty27y/LbgWVgLdCgCscKLX4m5mub9BgeqPspfPlrxdKMa1MuTlOEg mcZMHDyMaVOUkN23DNIyJYuXwZJqrX8HT/jMIUn7ioxLlO5h7ebHo8vcAmnk2Ikj08Mz Iwfw== X-Gm-Message-State: AN3rC/7f26cFTsctXwwGVoN3vq9IYBDiUvEL2FeK7eAmKvPAUjZcSDTe xG7XO+SFuSK9n2nr X-Received: by 10.84.230.135 with SMTP id e7mr25716447plk.20.1492542758648; Tue, 18 Apr 2017 12:12:38 -0700 (PDT) Received: from roar.local0.net (14-202-189-126.tpgi.com.au. [14.202.189.126]) by smtp.gmail.com with ESMTPSA id 66sm66773pfg.14.2017.04.18.12.12.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Apr 2017 12:12:37 -0700 (PDT) From: Nicholas Piggin To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH 1/4] powerpc/64s: Revert setting LPCR LPES0 on POWER9 Date: Wed, 19 Apr 2017 05:12:16 +1000 Message-Id: <20170418191220.3166-2-npiggin@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170418191220.3166-1-npiggin@gmail.com> References: <20170418191220.3166-1-npiggin@gmail.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nicholas Piggin Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" The XIVE enablement patches set LPES0 on POWER9 host. This bit sets external interrupts to guest delivery mode that uses SRR[01]. The host's EE interrupt handler expects HSRR[01] (for earlier CPUs). which is fine because XIVE is configured not to deliver EE to the host (HVI is used instead) so this should never be executed. However a bug in interrupt controller code or odd configuration of mambo/systemsim could result in the host getting EE. Keeping EE delivery mode matching the host handler prevents strange crashes due to using the wrong exception registers. When running in guest mode and getting EE, the guest LPCR will be loaded by KVM which contains the LPES0 bit. Fixes: 08a1e650cc ("powerpc: Fixup LPCR:PECE and HEIC setting on POWER9") Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/cpu_setup_power.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/cpu_setup_power.S b/arch/powerpc/kernel/cpu_setup_power.S index 7013ae3d1675..1fce4ddd2e6c 100644 --- a/arch/powerpc/kernel/cpu_setup_power.S +++ b/arch/powerpc/kernel/cpu_setup_power.S @@ -107,7 +107,7 @@ _GLOBAL(__setup_cpu_power9) or r3, r3, r4 LOAD_REG_IMMEDIATE(r4, LPCR_UPRT | LPCR_HR) andc r3, r3, r4 - li r4,(LPCR_LPES0 >> LPCR_LPES_SH) + li r4,0 /* LPES = 0 */ bl __init_LPCR bl __init_HFSCR bl __init_tlb_power9 @@ -131,7 +131,7 @@ _GLOBAL(__restore_cpu_power9) or r3, r3, r4 LOAD_REG_IMMEDIATE(r4, LPCR_UPRT | LPCR_HR) andc r3, r3, r4 - li r4,(LPCR_LPES0 >> LPCR_LPES_SH) + li r4,0 /* LPES = 0 */ bl __init_LPCR bl __init_HFSCR bl __init_tlb_power9