From patchwork Thu Oct 24 08:17:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 11208479 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 22A6D112C for ; Thu, 24 Oct 2019 08:20:14 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ED21C2166E for ; Thu, 24 Oct 2019 08:20:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.b="GvW40Ooy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ED21C2166E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:34846 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNYLs-0007NV-Ja for patchwork-qemu-devel@patchwork.kernel.org; Thu, 24 Oct 2019 04:20:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36464) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNYKQ-0004as-9F for qemu-devel@nongnu.org; Thu, 24 Oct 2019 04:18:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNYKO-0004y8-Sh for qemu-devel@nongnu.org; Thu, 24 Oct 2019 04:18:41 -0400 Received: from bilbo.ozlabs.org ([203.11.71.1]:53349 helo=ozlabs.org) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iNYKN-0004rx-Pn; Thu, 24 Oct 2019 04:18:40 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 46zKrX4wNPz9sQv; Thu, 24 Oct 2019 19:18:36 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1571905116; bh=DjdvcuO8WddDt5+4oGTr2StA6WKWigfux/PYV+2l3b4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GvW40OoylaXcri4/IYc5e3lqH0ma/HNvz+LkTeYYx0icTC3L9XTIKMOASYiEE+unL gjrCcVfKMCxyGpJC+nFW0SAgiDnC3lE6bCRTOyOxOIO++EeStVrIkfO3Bse62Sondy 32a6oP1nqmCHDLA/Q8en+GLiMRDyiFDoL2znodj4= From: David Gibson To: peter.maydell@linaro.org Subject: [PULL 05/28] ppc/pnv: Use address_space_stq_be() when triggering an interrupt from PSI Date: Thu, 24 Oct 2019 19:17:50 +1100 Message-Id: <20191024081813.2115-6-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191024081813.2115-1-david@gibson.dropbear.id.au> References: <20191024081813.2115-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 203.11.71.1 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, qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Cédric Le Goater Include the XIVE_TRIGGER_PQ bit in the trigger data which is how hardware signals to the IC that the PQ bits of the interrupt source have been checked. Signed-off-by: Cédric Le Goater Message-Id: <20191007084102.29776-3-clg@kaod.org> Signed-off-by: David Gibson --- hw/ppc/pnv_psi.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/hw/ppc/pnv_psi.c b/hw/ppc/pnv_psi.c index a997f16bb4..68d0dfacfe 100644 --- a/hw/ppc/pnv_psi.c +++ b/hw/ppc/pnv_psi.c @@ -660,10 +660,19 @@ static void pnv_psi_notify(XiveNotifier *xf, uint32_t srcno) uint32_t offset = (psi->regs[PSIHB_REG(PSIHB9_IVT_OFFSET)] >> PSIHB9_IVT_OFF_SHIFT); - uint64_t lisn = cpu_to_be64(offset + srcno); + uint64_t data = XIVE_TRIGGER_PQ | offset | srcno; + MemTxResult result; - if (valid) { - cpu_physical_memory_write(notify_addr, &lisn, sizeof(lisn)); + if (!valid) { + return; + } + + address_space_stq_be(&address_space_memory, notify_addr, data, + MEMTXATTRS_UNSPECIFIED, &result); + if (result != MEMTX_OK) { + qemu_log_mask(LOG_GUEST_ERROR, "%s: trigger failed @%" + HWADDR_PRIx "\n", __func__, notif_port); + return; } }