From patchwork Wed Dec 18 18:21:05 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: 851755 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1078266wrq; Wed, 18 Dec 2024 10:22:53 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUW+fWbnRVHRQWAenMKLdzpojq7FgF+9EZeDwA+SS+4AowIk2E4nLlFaMh1KPqR1GONYQPlZg==@linaro.org X-Google-Smtp-Source: AGHT+IHIZd+9RNbxpXbp+coGfEkHE9bh7pN/nyWtAbYmBQhkxVZkg/CcOhr1tFC9n0em8AHhjngX X-Received: by 2002:a05:620a:4491:b0:7b6:7030:511a with SMTP id af79cd13be357-7b9aa9148ccmr60908385a.37.1734546173155; Wed, 18 Dec 2024 10:22:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734546173; cv=none; d=google.com; s=arc-20240605; b=TXd9P6aky5A3/vuBz83n1SdKDOgaW52gK1hl3Ky+FVbpFUXHLOrwv3jhmhpDhfXgKe mepoYm2DrEI6rGv/qHU5f5RwBEC3NSm2XgjFiHdHW5b/qIQ3C9rmssAO9hSOiOeiDAFE RywVXRbJ7QO37yDzrqkdsHB8DSbYG8zykI/agVCrL5ek9k6mypbz5jP3Opr49yXDeA+7 uqikMlOa1tfYKG4Fc7fsv/NbAx2kskVSM9lT1s7yrdbZvQCI90d/KC2fa35g4uB5F5Ms XG7fkFOgmI8EtqMgk8zh7x5BKB/jOm0x6qMqFvx92Gqeg8f7FaSns17T+dwAjF09sdwe 0QZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=vRCJLMdgZW3KLUCMhAufUiGlbDH+xCju65D/z9uiuwI=; fh=aDK3AYW/tYhipRsN4fimbcHK1l9GCjVTlWyiAdYPq8A=; b=W0Sarx61F6Qm3xDd/jDA+030rZRxlf2jXu2EjG979JEbIOABtovh/mEefMp4ppPK7c 6RPcxb4bS66nWHEK2BxKvRDaQNjj6z1+1v+pu76KWm0MS7r48KEw+K0hTPE7dFa54Z+U +WYseRRyjyOXCz0RQ5uKtDkvrwt5rgwIzzhUaOrzi2Sc0ZOgfb5nbdS8UGNIGeZ+csdZ Dd0P/065FE6hNVDe0vGAA3v1xoD1IrOagSYtzIRHKbxpH7prIe0S09BcJrXMVUJfVbve k8MnwGrX4sm/+AWVM6j61pJwYeZ3+p9vbZztmOQI13/xHp/MbLXsyoXVVt+OnbyEeKCL jKDA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Aq4QcoGq; 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 af79cd13be357-7b7048f251csi1447003985a.633.2024.12.18.10.22.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Dec 2024 10:22:53 -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=Aq4QcoGq; 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 1tNygB-0000WO-KB; Wed, 18 Dec 2024 13:21:51 -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 1tNyg1-0000Nt-7H for qemu-devel@nongnu.org; Wed, 18 Dec 2024 13:21:41 -0500 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tNyfz-0001o2-Nz for qemu-devel@nongnu.org; Wed, 18 Dec 2024 13:21:40 -0500 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-385ef8b64b3so1965f8f.0 for ; Wed, 18 Dec 2024 10:21:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734546098; x=1735150898; 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=vRCJLMdgZW3KLUCMhAufUiGlbDH+xCju65D/z9uiuwI=; b=Aq4QcoGqVi4GYDg4+PgknSGWQ/RJNaAQbRlrPB64WeGiT//h9EqIZlJdiT9cbldJXN WEUQK1IwDIWjh6aqkqEw/clTTVJumZ2ZULIJLz5nKJvzrgnECKMUbVQNggeTXpi1L3h/ ir8vqQl4hmDSLghm4hz0bGvqVk4HtPLNdyJANEbHP7ZexYJGzHGgiyQysJGwtqhQXaJl +jQGhJRa93xkqYaotxk46K913na6S1Zwe1QXUGsIDHKhyYGJp86F15z1e/c8piD/DXBt XywNEf/1pugEgt1wJ/WQ2Uq2zrRj48sX+gGmFccFomm7CNJLU4wzXxX6l1GztoSq0Hyu ZqKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734546098; x=1735150898; 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=vRCJLMdgZW3KLUCMhAufUiGlbDH+xCju65D/z9uiuwI=; b=cRbKm3lzZvuIOE/s9AwddBKip1Mb0kb+ZNAMk4hh/1GGBqAZ+9JW8hqezQPyfWXAQn qeHLgGOj+Y+Eu1Iwp5+31Feu8h7SCRmeG42SIdOHhYKpCEVdN9Ey7fFPKyOjy9VX0219 bqRdvpwE13Jspo5WmqFffJVnIePI20ern8GdOHGHXmDDA9ohsGnw4Ol6ZEgIsDykzU5a EGUE2IS7QVmGPDjc9fhD24lWAGl6M32KeA+ys14OsHCyWRbM8W4csAvJjk7vKTclDSNX 5sagMym2xYJL+InWQkQ/fuxWtWfKy/yUTK1oNH6unmmYtHelGokTGbRhMG/ILAdl8fSU JwZw== X-Gm-Message-State: AOJu0Yy5mE/0OiMgUh+d9qjeiEtRdwvhdx0/OL+/vstFXX1qvfagrU0A 92R/H+40XGZr2Xe3VNxcWuANCzKQY3rY52WP+tiq9KLRB4I24QhA0K0u5WzLNXhe70wShtH0DbG e X-Gm-Gg: ASbGncvagP4YaAHq498+2NM8+w4p60M4FzOFIkhaOYNGE83vYs+ekHnhhISLThW93GH CRsxLMDXOvIGTxbzMGOq/tQU3NyFbRBNOC8Lf1ETQH+7KtXQQdIXAgaXZupKtrTvkjhiO8h0YZ3 r5ljf2KBNpw6M/1IJnCOLES72KaPDEeoRjUhT67gpgp9CcLUBr59hQbyvhFQvILHGovt+BBGxEP QtLqhd0K7wRBtd4GuJSbtKcrgdmA32jCgU4e9h6JPGAEV2bKQjONzSUCypkpLXobqZzZvFntpP4 uCfA X-Received: by 2002:a5d:6d02:0:b0:382:3efc:c6d8 with SMTP id ffacd0b85a97d-388e4d2dfedmr3282820f8f.12.1734546097835; Wed, 18 Dec 2024 10:21:37 -0800 (PST) Received: from localhost.localdomain ([78.196.4.158]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c801a628sm14968029f8f.47.2024.12.18.10.21.36 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 18 Dec 2024 10:21:37 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Harsh Prateek Bora , Nicholas Piggin , Daniel Henrique Barboza , "Edgar E. Iglesias" , =?utf-8?q?Daniel_P=2E_Berra?= =?utf-8?q?ng=C3=A9?= , BALATON Zoltan , qemu-ppc@nongnu.org, =?utf-8?q?Marc-An?= =?utf-8?q?dr=C3=A9_Lureau?= , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Maydell Subject: [PATCH v3 6/7] hw/ppc/spapr: Convert DIRTY_HPTE() macro as hpte_set_dirty() method Date: Wed, 18 Dec 2024 19:21:05 +0100 Message-ID: <20241218182106.78800-7-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241218182106.78800-1-philmd@linaro.org> References: <20241218182106.78800-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=philmd@linaro.org; helo=mail-wr1-x435.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 Convert DIRTY_HPTE() macro as hpte_set_dirty() method. Since sPAPR is in big endian configuration at reset, use the big endian LD/ST API to access the HPTEs. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Nicholas Piggin --- hw/ppc/spapr.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 4e1fe832c29..dedf6fb2916 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -1422,7 +1422,11 @@ static void hpte_set_clean(SpaprMachineState *s, unsigned index) ldq_be_p(hpte_get(s, index)) & ~HPTE64_V_HPTE_DIRTY); } -#define DIRTY_HPTE(_hpte) ((*(uint64_t *)(_hpte)) |= tswap64(HPTE64_V_HPTE_DIRTY)) +static void hpte_set_dirty(SpaprMachineState *s, unsigned index) +{ + stq_be_p(hpte_get(s, index), + ldq_be_p(hpte_get(s, index)) | HPTE64_V_HPTE_DIRTY); +} /* * Get the fd to access the kernel htab, re-opening it if necessary @@ -1633,7 +1637,7 @@ int spapr_reallocate_hpt(SpaprMachineState *spapr, int shift, Error **errp) spapr->htab_shift = shift; for (i = 0; i < size / HASH_PTE_SIZE_64; i++) { - DIRTY_HPTE(hpte_get(spapr->htab, i)); + hpte_set_dirty(spapr->htab, i); } } /* We're setting up a hash table, so that means we're not radix */