From patchwork Tue Dec 13 12:35:50 2022 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: 633505 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp3049270pvb; Tue, 13 Dec 2022 04:37:05 -0800 (PST) X-Google-Smtp-Source: AA0mqf4Q8uMBb7A7BBc88l/EFDdf+4VvdfBHUDPV3q3MrnUzX8BzfABvUveA300JJLh0U339lr0I X-Received: by 2002:a0c:e585:0:b0:4df:5465:b289 with SMTP id t5-20020a0ce585000000b004df5465b289mr10625962qvm.21.1670935024895; Tue, 13 Dec 2022 04:37:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670935024; cv=none; d=google.com; s=arc-20160816; b=x48KLA0owWE+A2o4z1DQwV4b1iB+jBsABjqNLL1BMO50dV5SyOl72/QrFQVigibjDQ LwRZZ5BlDN9TNKvr3yzEKbZ+/W1fbN1Ko4s5v0XFuf6rD8wklSKsbKAiVFdYx7dP0UOO 1n4bDqHlO0g7BBMKTL8uJvWtLqT7QGO+3JWmgozpkHA1KcmWE8bKeJ/pKyXVkmD20QXy NwtTlgB3o9Fj2N9yLZoFJxOs5g7TBwCcw3xz1K9j+CL2B/uZ1tsW5JiZCUMoWdpaUouI 38kBqHTBm3G+VATvcoSEL/ms+kdvQryVVuYNhovuZp2RQnnorw5m1Vve5DDDSGUH/0LV g/iA== 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=EIWqF960/rg6gqFejdnkrSGn2PEdfww2KszocKY9NPM=; b=DqADNxTarneeNMeh7QRJAA+OROY+yuliY0xNYNyCSLcMP/zWOzwOlKEaNLtNAJZsEM TjPajMHsSpiVZ/pjXuBQOUkznDXwYYFEZhLStKAPufMsMLHk1KubY0A8yu/XsBxOD4Gf 0zkjxMRfTD38MpSmmTBqfH9FGxUUKrlPoZ9YXKqVXYKpgmvyg0hzGl9kIEUCK+EpoaBl NxnBTndChlfOP+fCLviIz9KeVuCtbeDeM5Ht4FLCoOdIZlpEQjNNPPQCExYHJ1qstvii 1Iz1Sz7pUeWuUrlJ4qT35Zd70Y6vmnQYKZdl3xaH5zqtciWUkDSkukuM37hGEcGkGuqc kcCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=h+gcwRar; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6-20020a0562140d6600b004c692dc7df1si6823155qvs.309.2022.12.13.04.37.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Dec 2022 04:37:04 -0800 (PST) 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=h+gcwRar; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p54WC-0001MZ-5o; Tue, 13 Dec 2022 07:36:20 -0500 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 1p54WA-0001KC-0a for qemu-devel@nongnu.org; Tue, 13 Dec 2022 07:36:18 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p54W8-00063Q-9A for qemu-devel@nongnu.org; Tue, 13 Dec 2022 07:36:17 -0500 Received: by mail-wm1-x32a.google.com with SMTP id m19so8172241wms.5 for ; Tue, 13 Dec 2022 04:36:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=EIWqF960/rg6gqFejdnkrSGn2PEdfww2KszocKY9NPM=; b=h+gcwRarxYHjDQt6eSyU6mMb0ymg/ujMpr/wyp/9NOXKwuVevsa2yuezcU38aA6uR6 EgIrEBN6stZqv94xqIx1RCw3f2THn/jyeyfS3pp8+5l4OVRciFQf4RGrOJcsrgOZrb+W /UgIenJ71XQQYqRl07SuUEGXJFw3kRU5W4AP6MNJlgUVyH+IQBn8P/gBnYW/8PyXFjjT 7qrpQPkacbCf7KNPFamMzHqj6FSCnjenY/SZwxTNqpgykDjL3eS5PQBeFY2AATyiFpcm UA4WpWOcvjMpG62XkYMzgJriRHmuK97wk4cyMPnuYWKn2rrBYZ8fHqx1FNQ77WpX9igD myZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=EIWqF960/rg6gqFejdnkrSGn2PEdfww2KszocKY9NPM=; b=PZ5Hl3Vswiwid4bq0AHv8RhQpROu4NRS5ej21kmqbxZ5SNDWUz6r8LnB/2TuI1kj9O h0iMTrCXWeilbDnQYd8V/tDhLVY7j9xGIsD0fN6w3ejuz94Ldg/0OSzuA6CtKL/6EHwg rTerU3pCkH+akhM+9HzvdPRcY2kmKx3Nlc4gDI1j5KuhTuBNxhMq7j+Zy4ACHT+4IxXt e6gMAc+pF++TUOufBZ7J+5c2zD/oNrI/p+3vfp5tBlBvivlNvmvtDuicqIuKn1YLRvef tVXy6lhHPvHRBEwKAV1dEi5VWVCUGj5YqCfEc2oayODc1TdcHbuDvMzBUXAHcPV8AtOy V00g== X-Gm-Message-State: ANoB5pnvyroEJmWHLKBnmwk4N1dQWf06cmHBOgDoSFjW+jp7BUi6mKu6 vXvg4yMk/KmCCSPd2aVSvPiJuAX0NmPlqUQHyr4= X-Received: by 2002:a05:600c:1c06:b0:3cf:71f9:3b4c with SMTP id j6-20020a05600c1c0600b003cf71f93b4cmr14756046wms.23.1670934975281; Tue, 13 Dec 2022 04:36:15 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id j17-20020a05600c1c1100b003cfd42821dasm14467122wms.3.2022.12.13.04.36.14 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 13 Dec 2022 04:36:14 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-ppc@nongnu.org, David Gibson , kvm@vger.kernel.org, Alexey Kardashevskiy , Daniel Henrique Barboza , =?utf-8?q?C=C3=A9dric_Le_G?= =?utf-8?q?oater?= , Greg Kurz , Paolo Bonzini , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-8.0 4/4] hw/ppc/spapr_ovec: Avoid target_ulong spapr_ovec_parse_vector() Date: Tue, 13 Dec 2022 13:35:50 +0100 Message-Id: <20221213123550.39302-5-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221213123550.39302-1-philmd@linaro.org> References: <20221213123550.39302-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.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 spapr_ovec.c is a device, but it uses target_ulong which is target specific. The hwaddr type (declared in "exec/hwaddr.h") better fits hardware addresses. Change spapr_ovec_parse_vector() to take a hwaddr argument, allowing the removal of "cpu.h" in a device header. Signed-off-by: Philippe Mathieu-Daudé --- hw/ppc/spapr_ovec.c | 3 ++- include/hw/ppc/spapr_ovec.h | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/ppc/spapr_ovec.c b/hw/ppc/spapr_ovec.c index b2567caa5c..a18a751b57 100644 --- a/hw/ppc/spapr_ovec.c +++ b/hw/ppc/spapr_ovec.c @@ -19,6 +19,7 @@ #include "qemu/error-report.h" #include "trace.h" #include +#include "cpu.h" #define OV_MAXBYTES 256 /* not including length byte */ #define OV_MAXBITS (OV_MAXBYTES * BITS_PER_BYTE) @@ -176,7 +177,7 @@ static target_ulong vector_addr(target_ulong table_addr, int vector) return table_addr; } -SpaprOptionVector *spapr_ovec_parse_vector(target_ulong table_addr, int vector) +SpaprOptionVector *spapr_ovec_parse_vector(hwaddr table_addr, int vector) { SpaprOptionVector *ov; target_ulong addr; diff --git a/include/hw/ppc/spapr_ovec.h b/include/hw/ppc/spapr_ovec.h index c3e8b98e7e..d756b916e4 100644 --- a/include/hw/ppc/spapr_ovec.h +++ b/include/hw/ppc/spapr_ovec.h @@ -37,7 +37,7 @@ #ifndef SPAPR_OVEC_H #define SPAPR_OVEC_H -#include "cpu.h" +#include "exec/hwaddr.h" typedef struct SpaprOptionVector SpaprOptionVector; @@ -73,7 +73,7 @@ void spapr_ovec_set(SpaprOptionVector *ov, long bitnr); void spapr_ovec_clear(SpaprOptionVector *ov, long bitnr); bool spapr_ovec_test(SpaprOptionVector *ov, long bitnr); bool spapr_ovec_empty(SpaprOptionVector *ov); -SpaprOptionVector *spapr_ovec_parse_vector(target_ulong table_addr, int vector); +SpaprOptionVector *spapr_ovec_parse_vector(hwaddr table_addr, int vector); int spapr_dt_ovec(void *fdt, int fdt_offset, SpaprOptionVector *ov, const char *name);