From patchwork Wed Apr 12 14:12:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 750033 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 3w35XQ231Rz9sN6 for ; Thu, 13 Apr 2017 00:14:46 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="uYPqpsnx"; 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 3w35XQ1126zDq99 for ; Thu, 13 Apr 2017 00:14:46 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="uYPqpsnx"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-pg0-x242.google.com (mail-pg0-x242.google.com [IPv6:2607:f8b0:400e:c05::242]) (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 3w35Vs5Z8PzDq7h for ; Thu, 13 Apr 2017 00:13:25 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="uYPqpsnx"; dkim-atps=neutral Received: by mail-pg0-x242.google.com with SMTP id 34so2720348pgx.3 for ; Wed, 12 Apr 2017 07:13:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :organization:mime-version:content-transfer-encoding; bh=wrZc+YyhzgmM30BlXtIaX5+TEEb/jHlSSxU7xH1BA1Y=; b=uYPqpsnxfP3xkk2pq0YYeOHqEn4XnlTX9guytytVOjlsSwPTn/9L1zWkFefhZAYl6J pOIa22SfOwK5FVsIIzR4eYDF1ta86m6PYMJLNGNmcHqgGCWsWGOPawm66xA/tnb/5psS DqClaAqn0RJu4I+sHmPVx9275XtkOc7i4mlYvk2d6kUhhN0x8PlEFTHHA89gJ7KocXoy BQFTLABHZ3hJ45oKNN4LisJ8S7h5SytTcIKb3dHfXbTUTXqG5fscaIavSVv9VLoUGgJR khO29z8ypnWxdHxoQcWIhQ02+5btoXL1OOiktPcC+YeJAnOii0qNAGtm+aYab0pipfXw wZ4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=wrZc+YyhzgmM30BlXtIaX5+TEEb/jHlSSxU7xH1BA1Y=; b=kuzGX5ROiAd5+JpJof17Jt29DC8kXmea5G4DQyZ9aRGU17leyyKot01AW1iS3PFOVY qM7yywlJIcVk+pgXFgStZ60uGkylE3jlqcQD2N3PuMZOLQtvq9ksh9SYTL/q/MI7MejM or+zNLsRjTVCHHQf7O1BMCf4+ygLWficJopoEaV2xmyyjeYyrP0JsydTm91CJpUlllgx ia8Z/KEGdmFECOuNVBtdH7XQpMRPtQ3bQiwJreEgamxvZ0B432v/MKRBw/g3BlKw3jTR qMsaJlWJaOqmCroswTQuGQb5G662LVNnqLWHl8FZ5fRT+OQXqzbJ3ERB2ZKnmfjPn8Oy 3yWA== X-Gm-Message-State: AFeK/H1HMLuBp9Zxw86gsvl40D1q9BORpNYz7qoa7N8zdLQOLDAfd4Mn3ti6jX7ZGxpCtw== X-Received: by 10.84.128.4 with SMTP id 4mr52849714pla.37.1492006404032; Wed, 12 Apr 2017 07:13:24 -0700 (PDT) Received: from roar.ozlabs.ibm.com ([203.221.48.234]) by smtp.gmail.com with ESMTPSA id r17sm36992587pfa.13.2017.04.12.07.13.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 Apr 2017 07:13:23 -0700 (PDT) Date: Thu, 13 Apr 2017 00:12:52 +1000 From: Nicholas Piggin To: Benjamin Herrenschmidt Subject: Re: [PATCH] powerpc/64s: catch external interrupts going to host in POWER9 Message-ID: <20170413001252.250018c4@roar.ozlabs.ibm.com> In-Reply-To: <1492004742.7236.58.camel@kernel.crashing.org> References: <20170412131123.17445-1-npiggin@gmail.com> <1492004742.7236.58.camel@kernel.crashing.org> Organization: IBM X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 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: linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Wed, 12 Apr 2017 23:45:42 +1000 Benjamin Herrenschmidt wrote: > On Wed, 2017-04-12 at 23:11 +1000, Nicholas Piggin wrote: > > After setting LPES0 in the host on POWER9, the host external interrupt > > handler no longer works correctly, because it's set to HV mode (HSRR) > > for POWER7/8 with LPES0 clear. We don't expect to get any EE in the host > > with XIVE, but it seems preferable to catch unexpected interrupts in case > > there are bugs or unexpected behaviour. > > > > > Signed-off-by: Nicholas Piggin > > --- > > No. Let's just get LPES back to P8 value in the host, we don't care as > we don't get those EEs on normal systems. Then make sure KVM properly > sets it the way we want when setting up the guest LPCR (which it should > be doing with my patches). > Much simpler patch... Yeah sure that sounds good. How's this then? --- arch/powerpc/kernel/exceptions-64s.S | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index 857bf7c5b946..c78165e5fb77 100644 --- a/arch/powerpc/kernel/exceptions-64s.S +++ b/arch/powerpc/kernel/exceptions-64s.S @@ -735,8 +735,20 @@ EXC_VIRT_END(hardware_interrupt, 0x4500, 0x100) TRAMP_KVM(PACA_EXGEN, 0x500) TRAMP_KVM_HV(PACA_EXGEN, 0x500) -EXC_COMMON_ASYNC(hardware_interrupt_common, 0x500, do_IRQ) +EXC_COMMON_BEGIN(hardware_interrupt_common) +BEGIN_FTR_SECTION + /* + * The POWER9 XIVE interrupt controller should be configured to send + * all interrupts to the host as HVI, even with the OPAL XICS + * emulation, so HVMODE should never see a 0x500 interrupt. However we + * catch it in case of a bug. + */ + b unknown_host_ee_common +END_FTR_SECTION_IFSET(CPU_FTR_HVMODE | CPU_FTR_ARCH_300) + STD_EXCEPTION_COMMON_ASYNC(0x500, hardware_interrupt_common, do_IRQ) + +EXC_COMMON_ASYNC(unknown_host_ee_common, 0x500, unknown_exception) EXC_REAL(alignment, 0x600, 0x100) EXC_VIRT(alignment, 0x4600, 0x100, 0x600)