From patchwork Sun Mar 14 17:58:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 400094 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp2831740jai; Sun, 14 Mar 2021 11:00:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJwBqq373oXJqlqE2IPK3zqwuSyyPdzfh/jYfjO7blUu068WEC/hNWEo12s3OJ9zz7cVK9 X-Received: by 2002:a05:6e02:12b4:: with SMTP id f20mr9228780ilr.220.1615744845837; Sun, 14 Mar 2021 11:00:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615744845; cv=none; d=google.com; s=arc-20160816; b=o2zN62zYqlOpsr5nM7WMv1KV6wyxew13js8QMfD+5u8fZs2pV+xXm4wI+AiZ8jw7e/ BSNhd5s3KprEXo99cqVTCceY5CIY+a7/zETdPFv3gJLgScQZkyigS0aYO/eKhnWE089E fe2VUFk1e8N6WmBUICP5mvZDYWA24+ontlZoDK1WS1FgklAFmWRd/JWJsXc2+73gZBzm cSKCWAKFHCy60s3z07ryYm11FdB6UlkyXOSfxdO+oEmwhYM6wRHgYalRns/JlPewKB3M ZPHKm1qA8I4N43keJozuKQ67+GgQ2jOTybLWrwVFXY0hNyvUDmHs4nYRb8qV+PX7ku0Q l5vQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature; bh=52KfxatCEV55z76bCNlg1bkm3mzJ+j/4L7GKbVC527U=; b=0mHJmYCYYg35+DCRzQh/Se+kQaZYXfBZOIK8KjNGftIXWJf+KJYUUJSvWlBniahV2H l/Nb9KuGjc2EzPIdtZukZHKP1v1zX1pZStX//dlvhSXHFSJgmV9Nl1QKuPFMTndQa4Jk F/IMca/S9xvNw8gajN910MlPu08B+OimFTnVYmq0HIgB0aEKj82hGtjsiVcRhQGzipx6 URTocTewWLvKG6NCIYv1kQz2pNRt6rlNZGakaY0ujgxJULjRQJDQxqIEg6v4mnOSbgh8 ah2Gl5KUqiCp4FF3fSSYhVYZxeVUzW3ddY6eJPTdqQ5/R8SD2SCn5RMpABQiaSzLFvFA 5psw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="WgCqZ/PL"; 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=fail (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 a5si9767428ilv.16.2021.03.14.11.00.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 14 Mar 2021 11:00:45 -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=fail header.i=@linaro.org header.s=google header.b="WgCqZ/PL"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:36932 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lLV2j-00028z-8N for patch@linaro.org; Sun, 14 Mar 2021 14:00:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48240) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lLV1H-00028Q-17 for qemu-devel@nongnu.org; Sun, 14 Mar 2021 13:59:16 -0400 Received: from mail-qt1-x833.google.com ([2607:f8b0:4864:20::833]:43801) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lLV1C-00026v-FG for qemu-devel@nongnu.org; Sun, 14 Mar 2021 13:59:14 -0400 Received: by mail-qt1-x833.google.com with SMTP id s2so7640126qtx.10 for ; Sun, 14 Mar 2021 10:59:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=52KfxatCEV55z76bCNlg1bkm3mzJ+j/4L7GKbVC527U=; b=WgCqZ/PL29LUIlXPwlUwZj1OlGjszV2dMKWvlKwiQOzkaYsO+yZzvrkW1r2bCmYIdy FWTTnG3wrbK1+u4kSn9YIwlIM3yu/1TN0lEnrYMFS9lWEkMIMwzF8diKFgEu0qWdHWHH RTpsjd/rmXUxhxPerSX84v2MRoAp8u2AkDUa3YI0Zek+Pp70rzLvs+3J9OhATJYMexAJ TPVl1HwkFLFep4TCcTJ01EhGH5OBOgE9VlsVlergj6+nrZEMx5lk0fQMU5WBKPoyJANF Ou+vemsgWUcw2LsdqPyLjjq4MhgBuk1QON+eGx7HHlwS5grkX3i1/JfNxaXONiGH+kFV B23w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=52KfxatCEV55z76bCNlg1bkm3mzJ+j/4L7GKbVC527U=; b=i69gtKU35KF/v/1BU6mSXXFyk7mAHoC6dz95AE5WB7YpxIH0VZlDvCVCu3lsMGVx7O Nl/fpOb9zmzGnWf7y5fSycKvRnEBePttyW9hl+QUvocqjDnNOHtxwDjozr4Q21OtkBX4 AkhmY3KRYQdLVU8WwztLeg4ZL88jID/BXKQOS0+7onq1aWMpC4qTEp6uPmLu/IRsM8Eh P4FCpxNVXsy8YKXqdM5TDt1mn9gNxC/Zkx0nTJhdFyxL75PyeKyz2UdiTWMRPNzbODhB MU05CJqiyaTNKIBvwDRPZQ1EFe1q4gFD3KTPDvWHIrff8n86iPgw44Lpp5dn4VNzfvM5 fPRA== X-Gm-Message-State: AOAM5331IrNJa7dSYd2sO/1ixiPHSN/YCYvWkRP23IdIl/YxF+T6xNqk YrU+BKG9YOU35TpUQX7gWWF/XwfGK+OeNtFX X-Received: by 2002:ac8:59d6:: with SMTP id f22mr6281775qtf.83.1615744749385; Sun, 14 Mar 2021 10:59:09 -0700 (PDT) Received: from localhost.localdomain (fixed-187-189-51-144.totalplay.net. [187.189.51.144]) by smtp.gmail.com with ESMTPSA id c127sm10216240qkd.87.2021.03.14.10.59.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Mar 2021 10:59:08 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 00/16] target/ppc: Fix truncation of env->hflags Date: Sun, 14 Mar 2021 11:58:50 -0600 Message-Id: <20210314175906.1733746-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::833; envelope-from=richard.henderson@linaro.org; helo=mail-qt1-x833.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ivan@vmfacility.fr, qemu-ppc@nongnu.org, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Clean up everything that touches hflags, fixing quite a few other bugs in the process. Changes for v3: * Fixes for linux-user, signal handling and startup. -- Oops, the directory in which I did testing for v2 had a reduced set of targets. Changes for v2: * Do not put tcg internal state into migration, except to retain backward compatibility. * Do not touch anything in env in ppc_tr_init_disas_context. * Do make sure that hflags contains everything that it should. * Do verify that hflags is properly updated. r~ Richard Henderson (16): target/ppc: Move helper_regs.h functions out-of-line target/ppc: Move 601 hflags adjustment to hreg_compute_hflags target/ppc: Properly sync cpu state with new msr in cpu_load_old target/ppc: Do not call hreg_compute_mem_idx after ppc_store_msr target/ppc: Retain hflags_nmsr only for migration target/ppc: Fix comment for MSR_FE{0,1} target/ppc: Disconnect hflags from MSR target/ppc: Reduce env->hflags to uint32_t target/ppc: Put dbcr0 single-step bits into hflags target/ppc: Create helper_scv target/ppc: Put LPCR[GTSE] in hflags target/ppc: Remove MSR_SA and MSR_AP from hflags target/ppc: Remove env->immu_idx and env->dmmu_idx hw/ppc: Use hreg_store_msr for msr updates linux-user/ppc: Fix msr updates for signal handling target/ppc: Validate hflags with CONFIG_DEBUG_TCG target/ppc/cpu.h | 50 +++++- target/ppc/helper.h | 1 + target/ppc/helper_regs.h | 183 +-------------------- hw/ppc/pnv_core.c | 3 +- hw/ppc/spapr_hcall.c | 3 +- hw/ppc/spapr_rtas.c | 3 +- linux-user/ppc/cpu_loop.c | 5 +- linux-user/ppc/signal.c | 23 ++- target/ppc/excp_helper.c | 9 ++ target/ppc/helper_regs.c | 272 ++++++++++++++++++++++++++++++++ target/ppc/int_helper.c | 1 + target/ppc/machine.c | 27 ++-- target/ppc/mem_helper.c | 2 +- target/ppc/misc_helper.c | 13 +- target/ppc/mmu-hash64.c | 3 + target/ppc/translate.c | 98 ++++-------- target/ppc/translate_init.c.inc | 4 +- target/ppc/meson.build | 1 + 18 files changed, 411 insertions(+), 290 deletions(-) create mode 100644 target/ppc/helper_regs.c -- 2.25.1