From nobody Fri Mar 29 06:24:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1560319222; cv=none; d=zoho.com; s=zohoarc; b=Cmx/Lb+ZX1DdoA2j6Ki9128kb3R93Rr/74suF3D9GdLg3o44M8gOrJulZ4sJcn7R0WxIZq9f2oWPkv9+upcq39D0baCMoIUZXSPX1BgTIDxrn5lQp7nt0uJAtlXqGZnASh/N3/s63g1nhk9vTn+AYN13C6bY9pTIsbDoMiMoOkE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560319222; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=PKtQ66Im19CdRx5g7RhnHC8sgNg3fT70fVdQgUgDYWE=; b=lYi85O463b0CTG0mOWpBKPuyI6VBnbkyz7rbIDDoz6A+g7BXVhEnVxj9BSm82E/nPTJnb+9KM2uEPF6zwJffpCCTX6BktgXOjSPZ99mgqcGWuuiy4yUxAxoihGSyrqiFQ1FLu04qJVNBce/sSDXP/GYbk/kvLjk1j8nniWp2p8Y= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1560319222043589.0409569171607; Tue, 11 Jun 2019 23:00:22 -0700 (PDT) Received: from localhost ([::1]:56870 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hawIw-0006Da-Sc for importer@patchew.org; Wed, 12 Jun 2019 02:00:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58584) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1haw8p-0004a1-4S for qemu-devel@nongnu.org; Wed, 12 Jun 2019 01:49:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1haw8n-000758-Fh for qemu-devel@nongnu.org; Wed, 12 Jun 2019 01:49:46 -0400 Received: from bilbo.ozlabs.org ([2401:3900:2:1::2]:46167 helo=ozlabs.org) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1haw8m-00073Q-WF; Wed, 12 Jun 2019 01:49:45 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 45NwtR60Tqz9sPH; Wed, 12 Jun 2019 15:49:35 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1560318575; bh=tyUDdI4e4bCE/oy8otsoOZLgCZX2M2lVZQFcb3wbaG0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LP8aVkvAJvLUWrSFlNtQ6ksimJNKkRnHwnOBTYOUSh3HpxkKXO2KHxnYgYgRYXalY vehJGdI60JE8d6Q8PHz0Et6ZZWKMYugZatlMi0JyiIbDnVJxH1J63VWcTbivwvU0nz 5NZ+1hOvViOc45KyAzbxR0bLzS4bIUgjtjtfROVk= From: David Gibson To: peter.maydell@linaro.org Date: Wed, 12 Jun 2019 15:49:29 +1000 Message-Id: <20190612054929.21136-14-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190612054929.21136-1-david@gibson.dropbear.id.au> References: <20190612054929.21136-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 13/13] ppc/xive: Make XIVE generate the proper interrupt types X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lvivier@redhat.com, aik@ozlabs.ru, qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Benjamin Herrenschmidt It should be generic Hypervisor Virtualization interrupts for HV directed rings and traditional External Interrupts for the OS directed ring. Don't generate anything for the user ring as it isn't actually supported. Signed-off-by: Benjamin Herrenschmidt Signed-off-by: C=C3=A9dric Le Goater Reviewed-by: David Gibson Message-Id: <20190606174409.12502-1-clg@kaod.org> Signed-off-by: David Gibson --- hw/intc/xive.c | 22 +++++++++++++++++++--- include/hw/ppc/xive.h | 3 ++- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/hw/intc/xive.c b/hw/intc/xive.c index 0c74e47aa4..b2b92a92c8 100644 --- a/hw/intc/xive.c +++ b/hw/intc/xive.c @@ -61,13 +61,28 @@ static uint8_t exception_mask(uint8_t ring) } } =20 +static qemu_irq xive_tctx_output(XiveTCTX *tctx, uint8_t ring) +{ + switch (ring) { + case TM_QW0_USER: + return 0; /* Not supported */ + case TM_QW1_OS: + return tctx->os_output; + case TM_QW2_HV_POOL: + case TM_QW3_HV_PHYS: + return tctx->hv_output; + default: + return 0; + } +} + static uint64_t xive_tctx_accept(XiveTCTX *tctx, uint8_t ring) { uint8_t *regs =3D &tctx->regs[ring]; uint8_t nsr =3D regs[TM_NSR]; uint8_t mask =3D exception_mask(ring); =20 - qemu_irq_lower(tctx->output); + qemu_irq_lower(xive_tctx_output(tctx, ring)); =20 if (regs[TM_NSR] & mask) { uint8_t cppr =3D regs[TM_PIPR]; @@ -100,7 +115,7 @@ static void xive_tctx_notify(XiveTCTX *tctx, uint8_t ri= ng) default: g_assert_not_reached(); } - qemu_irq_raise(tctx->output); + qemu_irq_raise(xive_tctx_output(tctx, ring)); } } =20 @@ -556,7 +571,8 @@ static void xive_tctx_realize(DeviceState *dev, Error *= *errp) env =3D &cpu->env; switch (PPC_INPUT(env)) { case PPC_FLAGS_INPUT_POWER9: - tctx->output =3D env->irq_inputs[POWER9_INPUT_INT]; + tctx->hv_output =3D env->irq_inputs[POWER9_INPUT_HINT]; + tctx->os_output =3D env->irq_inputs[POWER9_INPUT_INT]; break; =20 default: diff --git a/include/hw/ppc/xive.h b/include/hw/ppc/xive.h index d872f96d1a..a6ee7e831d 100644 --- a/include/hw/ppc/xive.h +++ b/include/hw/ppc/xive.h @@ -317,7 +317,8 @@ typedef struct XiveTCTX { DeviceState parent_obj; =20 CPUState *cs; - qemu_irq output; + qemu_irq hv_output; + qemu_irq os_output; =20 uint8_t regs[XIVE_TM_RING_COUNT * XIVE_TM_RING_SIZE]; } XiveTCTX; --=20 2.21.0