From patchwork Tue Aug 6 12:51:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 817039 Delivered-To: patch@linaro.org Received: by 2002:adf:e00d:0:b0:367:895a:4699 with SMTP id s13csp1782734wrh; Tue, 6 Aug 2024 05:53:40 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXVxVBNGPzhUT3OVXDLMqJP+J+ZIHtXNGLnfk1VC2knJd6/3YnbwLbz84pAMocL3rNbExJ8JwggCaHww3lfwqAH X-Google-Smtp-Source: AGHT+IEA2J5JVVCz4YOqFjACZ6wL+wlT3ROaQcmksVwnew6TN5RVf4qY4PD3jd+1doC9bFRRZMQx X-Received: by 2002:a05:622a:1a8e:b0:444:d42a:c522 with SMTP id d75a77b69052e-4518450575cmr275721991cf.4.1722948820208; Tue, 06 Aug 2024 05:53:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1722948802; cv=none; d=google.com; s=arc-20160816; b=VCSpGwVbjZrWN/m3nT+Av3QPl2AYfRVaNr+Kodd1xfwmpmR+21yKkQJT1Knl4GfPD4 hIkwf7lQT1yaK/Mp3xIeUymW4JvJvUmqObRf3vJnPtnbIZmhQkvrrnBsci09QLu1VvGK 7h3jh8wyBdjy/NJk5QHTDtrqhRtvOappFF2IzQHUKE2Z96DLL91Dbcl9+2/keb4X//O2 du9Ad0DDfyDZX/jHUyZMcl8db7KVbeEja8lmmipMD3xe+F9SFAzHKv8YJ2BPmIRAEht1 gU/AMtbqhN0QwIfvm0yI6b81wVPGFYCFMRAftePchEx1u3FUucMsIv0jXwVfrW8WpLEi i0uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ZTxS6tVkh4S2hExOyR5WNEzapIPqKrrXzfqzZq+lw00=; fh=rxGWTSOrq9MmYE4+hMcV/u38d68oc92wX5eFok0A+84=; b=HT518Yz0dXFh/e6u0cJFtkkeyb7Crdz2d4OtSVi26GflOaLgGSss4ZohZK6zD90xFn GRU4Jz50lTfYeHJVTLdiAa87JOkx/t4JFlulzxU0Z4tzeEqzu9S1WjWgN0JlIP1qCTs+ VGVN0p2QZdFIIfQQ5cSC+iGahIJBwwdFtT52CMwWjUmW4UQvmeGauyQNw6RY7GV25ukW lMXEtCHzYzVpoAenn1yYpjhmYRJe22VOxSg6nxcNN4yVGwevAIS9wU6W4rojVO4fbWhb uKLOuSmnGhsWgfVQDj2DcAllvgfW1WW91KBjlfTJhJ+NGSN5LgWr0gfPxyB+LSa5D24V i4GQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JlzTNEyx; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-4518a79ceb4si133619571cf.638.2024.08.06.05.53.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 06 Aug 2024 05:53:22 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JlzTNEyx; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbJgG-00076D-JW; Tue, 06 Aug 2024 08:52:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sbJgE-0006zM-SD for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:52:46 -0400 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sbJgD-0008T4-58 for qemu-devel@nongnu.org; Tue, 06 Aug 2024 08:52:46 -0400 Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-52efbb55d24so1039430e87.1 for ; Tue, 06 Aug 2024 05:52:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1722948763; x=1723553563; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZTxS6tVkh4S2hExOyR5WNEzapIPqKrrXzfqzZq+lw00=; b=JlzTNEyxf6eGLFfVQaDV/WIm+06jTFdjVgNVy4jQcT7AdA1ucBTdKzu2/gGWT63mHF qoWL5I7fjx7J3QKuYiQigtqsGmxryqt3jhIqZVliyT7LXQIt5avdnq2lHmL7EwPmhkDX MLPDoCUFIDg93BEJAHSh+HcPOLOxhHPOyqOOEvkfFYbFKOXhQ9zO8WK/Bqy8i08wovhu PZmtyIZviogvRmqFYq1edIodfXRx+sdYro9ilS40PA7p8wOAnn6fjtVC74dEEr0xTgxK 3hvjqjfH/G915qP9VKk+0ENGfQJxEQ5JzvbLzthMYhqZQMb7yQP+TaMwTU8u5gi2npav oRig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722948763; x=1723553563; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZTxS6tVkh4S2hExOyR5WNEzapIPqKrrXzfqzZq+lw00=; b=QvHKoST3lZdvrFIVm3XGl1z3UC2LwlqnwgI58keSBiUHPij2wFDxZzlKt3lOY0HKGc 6n5fCN11zb/8ELrmZxdmrjbZlVhPvaHAFx6zQ+kKMEbx0BSjg/SJkLv0tFv4hRhjZA5v dqKhyp8NcJ1Y1RrK/Eaum36CV83Jmsr90OlZdnBQWX5os5rPpKNvfggdWjRIr6Z64Vp/ dXSGTKaReO+PE98qoSVuUjvhwq53Gn+IcVjU1F3jp5Zmz673CLHuVHnICN+POHO7Gnou ZxIFIWcSqmcJbmAVVSiN1G3ALNeU77LdI9p+VXvgFTj32hZQEvL8VY3yYOwagTzQ6SaR mAEQ== X-Gm-Message-State: AOJu0YztEzsEmj43jHnpx1Qesbu1QKCfKftYyxCJdjeuZQKz9NScRGjt 81dM9suXXd+3r8TQTCJKV8eOACC1JF/mivdMcF/mjI/yhCEK6uQ05eBIMwyFSJOE6KevhMcsGtw 5 X-Received: by 2002:a05:6512:4020:b0:52c:deb9:904b with SMTP id 2adb3069b0e04-530bb3b46fcmr13250092e87.38.1722948763035; Tue, 06 Aug 2024 05:52:43 -0700 (PDT) Received: from m1x-phil.lan (cor91-h02-176-184-30-206.dsl.sta.abo.bbox.fr. [176.184.30.206]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7dc9e83ec1sm545106766b.182.2024.08.06.05.52.41 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 06 Aug 2024 05:52:42 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Bibo Mao , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Song Gao , Richard Henderson , Jiaxun Yang Subject: [PULL 07/28] hw/intc/loongson_ipi: Pass LoongsonIPICommonState to send_ipi_data() Date: Tue, 6 Aug 2024 14:51:35 +0200 Message-ID: <20240806125157.91185-8-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240806125157.91185-1-philmd@linaro.org> References: <20240806125157.91185-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::131; envelope-from=philmd@linaro.org; helo=mail-lf1-x131.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Bibo Mao In order to get LoongsonIPICommonClass in send_ipi_data() in the next commit, propagate LoongsonIPICommonState. Signed-off-by: Bibo Mao [PMD: Extracted from bigger commit, added commit description] Co-Developed-by: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Bibo Mao Tested-by: Bibo Mao Acked-by: Song Gao Reviewed-by: Richard Henderson Reviewed-by: Jiaxun Yang Tested-by: Jiaxun Yang Message-Id: <20240805180622.21001-8-philmd@linaro.org> --- hw/intc/loongson_ipi.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/hw/intc/loongson_ipi.c b/hw/intc/loongson_ipi.c index 347bc26729..8bf16f26d4 100644 --- a/hw/intc/loongson_ipi.c +++ b/hw/intc/loongson_ipi.c @@ -88,8 +88,8 @@ static AddressSpace *get_cpu_iocsr_as(CPUState *cpu) return NULL; } -static MemTxResult send_ipi_data(CPUState *cpu, uint64_t val, hwaddr addr, - MemTxAttrs attrs) +static MemTxResult send_ipi_data(LoongsonIPICommonState *ipi, CPUState *cpu, + uint64_t val, hwaddr addr, MemTxAttrs attrs) { int i, mask = 0, data = 0; AddressSpace *iocsr_as = get_cpu_iocsr_as(cpu); @@ -119,7 +119,8 @@ static MemTxResult send_ipi_data(CPUState *cpu, uint64_t val, hwaddr addr, return MEMTX_OK; } -static MemTxResult mail_send(uint64_t val, MemTxAttrs attrs) +static MemTxResult mail_send(LoongsonIPICommonState *ipi, + uint64_t val, MemTxAttrs attrs) { uint32_t cpuid; hwaddr addr; @@ -134,10 +135,11 @@ static MemTxResult mail_send(uint64_t val, MemTxAttrs attrs) /* override requester_id */ addr = SMP_IPI_MAILBOX + CORE_BUF_20 + (val & 0x1c); attrs.requester_id = cs->cpu_index; - return send_ipi_data(cs, val, addr, attrs); + return send_ipi_data(ipi, cs, val, addr, attrs); } -static MemTxResult any_send(uint64_t val, MemTxAttrs attrs) +static MemTxResult any_send(LoongsonIPICommonState *ipi, + uint64_t val, MemTxAttrs attrs) { uint32_t cpuid; hwaddr addr; @@ -152,7 +154,7 @@ static MemTxResult any_send(uint64_t val, MemTxAttrs attrs) /* override requester_id */ addr = val & 0xffff; attrs.requester_id = cs->cpu_index; - return send_ipi_data(cs, val, addr, attrs); + return send_ipi_data(ipi, cs, val, addr, attrs); } static MemTxResult loongson_ipi_core_writel(void *opaque, hwaddr addr, @@ -249,15 +251,16 @@ static const MemoryRegionOps loongson_ipi_iocsr_ops = { static MemTxResult loongson_ipi_writeq(void *opaque, hwaddr addr, uint64_t val, unsigned size, MemTxAttrs attrs) { + LoongsonIPICommonState *ipi = opaque; MemTxResult ret = MEMTX_OK; addr &= 0xfff; switch (addr) { case MAIL_SEND_OFFSET: - ret = mail_send(val, attrs); + ret = mail_send(ipi, val, attrs); break; case ANY_SEND_OFFSET: - ret = any_send(val, attrs); + ret = any_send(ipi, val, attrs); break; default: break;