From nobody Tue Nov 26 22:11:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1704633834; cv=none; d=zohomail.com; s=zohoarc; b=Fw6iaIjgA85zgl0dIH/0/icWXyYWotwagn6QogwaJVLxunCMxwJNqcJi4TTIzVl2QmJOZ27KYiVBJecPdLWZcSbwEN2n2JnkUh3MpkHDh9AI/Xd0Rrwwtiry1r9lS/pU/+rja9pktEg7lkuAIUY5dQIeSNkeLqH0AADrKHU8EsA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704633834; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=psT1a9CxzgIGnmr278B9XHGn5uRpCbXgdNT3QbIw2Wc=; b=joJZhYj6pqbrNFbbGGz2SldQOJHO6kS2eUyZXix21mF17XFQntokeISXKYcgc8vghwVzgghWgGndzogffOsB+kueyh3uS/lojP5ovZTX81RbW0tkJj+6hzOV9G3R0oWfqavGhR84IrQ0g2GbgsLwDSBfAAkqgibjEcMhSIqyYrA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704633834260439.67070121946256; Sun, 7 Jan 2024 05:23:54 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rMT7B-0006I4-1j; Sun, 07 Jan 2024 08:22:57 -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 1rMT78-0006G1-4c for qemu-devel@nongnu.org; Sun, 07 Jan 2024 08:22:54 -0500 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rMT75-0003K9-DJ for qemu-devel@nongnu.org; Sun, 07 Jan 2024 08:22:53 -0500 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id 2FD8CB8091E; Sun, 7 Jan 2024 13:22:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 10D70C433C7; Sun, 7 Jan 2024 13:22:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704633769; bh=RfMF/F1MWgRkg/cJ7tX1IjaxKfhLcUlRTaP90CvwDNc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W8UmuSiwKELoIdoTeFkAh8fMwC2cwNF3yLHkOZrfBCZlbf5tyK6Z5a/zH9TEFwoHv Wv7k6cp5Zg3sPX1QgCdkYiDXOPVAHSjBSfDNCkQNfJ2yRONSP6bAmssUAN9wrh1fit ZwYtMHb+lktbqid3TqdJGa/5ri471Ub64tX8F/8622VJ2z0lkt2ZmpfdbnAkgBcYl0 +ePABZveh6rfH86BjSdbvA3wwORIvaCGHabqdI7HFmv2BdmZWewVoTnyybJdKDjzld 0UQbBj+jwSNanv3GVonWY9azG2PaES080ar9FkqGIwsWk2/ZBiTsDGU060RSf0udcC ZlvhQI7Q1aAgg== From: deller@kernel.org To: qemu-devel@nongnu.org Cc: Richard Henderson , Michael Tokarev , Bruno Haible , "Nelson H . F . Beebe" , Helge Deller Subject: [PATCH v2 4/9] target/hppa: Fix PDC address translation on PA2.0 with PSW.W=0 Date: Sun, 7 Jan 2024 14:22:32 +0100 Message-ID: <20240107132237.50553-5-deller@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240107132237.50553-1-deller@kernel.org> References: <20240107132237.50553-1-deller@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=2604:1380:4601:e00::1; envelope-from=deller@kernel.org; helo=ams.source.kernel.org X-Spam_score_int: -64 X-Spam_score: -6.5 X-Spam_bar: ------ X-Spam_report: (-6.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.098, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @kernel.org) X-ZM-MESSAGEID: 1704633835316100001 Content-Type: text/plain; charset="utf-8" From: Helge Deller Fix the address translation for PDC space on PA2.0 if PSW.W=3D0. Basically, for any address in the 32-bit PDC range from 0xf0000000 to 0xf1000000 keep the lower 32-bits and just set the upper 32-bits to 0xfffffff0. This mapping fixes the emulated power button in PDC space for 32- and 64-bit machines and is how the physical C3700 machine seems to map PDC. Signed-off-by: Helge Deller --- target/hppa/mem_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/hppa/mem_helper.c b/target/hppa/mem_helper.c index 08abd1a9f9..011b192406 100644 --- a/target/hppa/mem_helper.c +++ b/target/hppa/mem_helper.c @@ -56,7 +56,7 @@ hwaddr hppa_abs_to_phys_pa2_w0(vaddr addr) addr =3D (int32_t)addr; } else { /* PDC address space */ - addr &=3D MAKE_64BIT_MASK(0, 24); + addr =3D (uint32_t)addr; addr |=3D -1ull << (TARGET_PHYS_ADDR_SPACE_BITS - 4); } return addr; --=20 2.43.0