From patchwork Thu Sep 5 03:08:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Oliver O'Halloran X-Patchwork-Id: 1158186 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46P5KK55D7z9s3Z for ; Thu, 5 Sep 2019 13:10:13 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="P98lvP1a"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46P5KK3LtBzDql0 for ; Thu, 5 Sep 2019 13:10:13 +1000 (AEST) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::541; helo=mail-pg1-x541.google.com; envelope-from=oohall@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="P98lvP1a"; dkim-atps=neutral Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46P5J11xRtzDq62 for ; Thu, 5 Sep 2019 13:09:05 +1000 (AEST) Received: by mail-pg1-x541.google.com with SMTP id d10so558202pgo.5 for ; Wed, 04 Sep 2019 20:09:05 -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 :mime-version:content-transfer-encoding; bh=VDKGm6mP8I0KUbJ2HVDv4DfSLjmYWoapHwvDbsRCCrE=; b=P98lvP1arBqD/YcxLRQMp3YO9EdX4Hq0BgEY20uDXHYYJabhfNvqXVtk9JUcq201B4 XIJuFtmQ8hb5d81SmqnOfAiwj2A1BKdZm8XoI8G4k5K6si3/iUG9bbqGeHrhdc/7ihZx x4Xpn5HA88tCrmhqG57dBArAN0Tt45WGjyBYdxfopnKGkA5oXiHupLlH02ouCwnu3Ueq lJmQOQq+D7QU2QYZFr69DpZp8vqETG42GPipm+LCmvEMq/Ya3M/koP/4CJ2Z1yVfrQbx q8PLSvKnG/ZoJoW5XGteXUUWn3mJYfrzOASWbP7S9Y3K5E3D1cst573km1Y/etNQJiHN 1Qbw== 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:mime-version:content-transfer-encoding; bh=VDKGm6mP8I0KUbJ2HVDv4DfSLjmYWoapHwvDbsRCCrE=; b=PxAx5UjBTEKk7uR6KWO29iZ9G/+jc1jbuGcew0xNQX+lgH97F+zdhTUIuXGYZ3N2x8 s1wZaN1c0xvmXK1ft49G+9RT9P90kbm4WBxL0iWxOPLGcal8iSC/Je4pS+GSOZlizKd5 ywQgcbFuizw0ECrPqK3RNLaX5UyIZEJjRlpRGT9GqGKZqPLnkv5uFi+LwWZ1Goce2oFk qy3iPz8R/ipGk/vn5JceDLjb8cWD/tYIJ1MJ9Idx3jPbgUkPU59eIFYLavY8Asy3bNC1 AJgtalOuRDtS1uVf4Qwcqrfg0+FvDvO55EaGQi4sSm+DlKXIuAktXSIo7oBcYXsaqdwz avtw== X-Gm-Message-State: APjAAAXxFJUTGBJLJv9vuVl65G6gENREOb8kVbfMW9kJT0RVPNhmBqwi 6KGNrgkyqeuMPRkN64H7ayLbasPK X-Google-Smtp-Source: APXvYqyNXblh61kV3xPrX22N5H3wvEXKaMpZHVodgAEP7FMetWE9Rj8u2VnazFc+Em0Cxx8aCsTO0g== X-Received: by 2002:a17:90a:1150:: with SMTP id d16mr1514363pje.2.1567652943041; Wed, 04 Sep 2019 20:09:03 -0700 (PDT) Received: from wafer.ozlabs.ibm.com.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id p189sm545844pfp.163.2019.09.04.20.09.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Sep 2019 20:09:02 -0700 (PDT) From: Oliver O'Halloran To: skiboot@lists.ozlabs.org Date: Thu, 5 Sep 2019 13:08:44 +1000 Message-Id: <20190905030845.15540-4-oohall@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190905030845.15540-1-oohall@gmail.com> References: <20190905030845.15540-1-oohall@gmail.com> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 4/5] hw/psi-p9: Follow the external IRQ policy X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" The P8 PSI support follows the external IRQ policy and the P9 PSI doesn't. There are no P9 platforms which define an .external_irq() in the platform structure so this should not cause any functional changes. Linux is smart enough to mask LSIs without a registered handler so directing them at the OS should be safe. Cc: Cédric Le Goater Signed-off-by: Oliver O'Halloran Reviewed-by: Cédric Le Goater --- hw/psi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/psi.c b/hw/psi.c index 6c28eb0447ad..ba05be8403d9 100644 --- a/hw/psi.c +++ b/hw/psi.c @@ -629,6 +629,10 @@ static uint64_t psi_p9_irq_attributes(struct irq_source *is __unused, if (is_lpc_serirq) return lpc_get_irq_policy(psi->chip_id, idx - P9_PSI_IRQ_LPC_SIRQ0); + if (idx == P9_PSI_IRQ_EXTERNAL) + if (psi_ext_irq_policy == EXTERNAL_IRQ_POLICY_LINUX) + return IRQ_ATTR_TARGET_LINUX | IRQ_ATTR_TYPE_LSI; + return IRQ_ATTR_TARGET_OPAL | IRQ_ATTR_TYPE_LSI; }