From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D1A8CC4338F for ; Thu, 5 Aug 2021 15:29:14 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8B2CD60EE8 for ; Thu, 5 Aug 2021 15:29:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8B2CD60EE8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:35560 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mBfJ3-0007w1-LG for qemu-devel@archiver.kernel.org; Thu, 05 Aug 2021 11:29:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45496) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBfI8-0005PU-JU for qemu-devel@nongnu.org; Thu, 05 Aug 2021 11:28:16 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:28022) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBfI7-00067q-5t for qemu-devel@nongnu.org; Thu, 05 Aug 2021 11:28:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628177294; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FmTffAR/VmwDXaNjvwG7lDbdAok11iKxZJF4+PNQ6G4=; b=VMlOsfcEG9g2yaAAZ2SbWdbc+q1cwgmYFsJySTEwyUW1GWjpy/WmFS9zaoej2OECl1sO7n vYzM5p3uI+acCdCD/RU4LWB/Y/yOIN9lI/5Zf9wOXsxszvPJI8IeUge5otjx4u3IuOQmwD l7DEGEVtI5bBkHEWrCT+9WFVgZm4rKI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-499--1c9rOcTPou8SdLRdWsP1Q-1; Thu, 05 Aug 2021 11:28:13 -0400 X-MC-Unique: -1c9rOcTPou8SdLRdWsP1Q-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B187A87D54A; Thu, 5 Aug 2021 15:28:11 +0000 (UTC) Received: from t480s.redhat.com (unknown [10.39.194.118]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9A9E62B45D; Thu, 5 Aug 2021 15:28:05 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Subject: [PATCH v1 00/12] s390x: skey related fixes, cleanups, and memory device preparations Date: Thu, 5 Aug 2021 17:27:52 +0200 Message-Id: <20210805152804.100333-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Received-SPF: pass client-ip=216.205.24.124; envelope-from=david@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) DKIMWL_WL_HIGH=-0.699, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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: "Jason J . Herne" , Thomas Huth , Janosch Frank , David Hildenbrand , Cornelia Huck , Richard Henderson , Halil Pasic , Christian Borntraeger , qemu-s390x@nongnu.org, Claudio Imbrenda Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This series fixes multiple TCG issues related to storage key instructions, fixes some TCG issues related to LOAD REAL ADDRESS and skeys, implements lazy skey enablement under TCG, and prepares the whole skey infrastructure for dealing with addresses beyond initial RAM (e.g., memory devices like virtio-mem). Along, some cleanups. To prepare for memory devices / memory hotplug, my goal was to get rid of as many ms->ram_size users as possible. Unfortunately, I stumbled over many other things on the way :) The remaining s390x users of ms->ram_size are: a) hw/s390x/ipl.c: loading the FW. Won't need adjustment. b) hw/s390x/s390-skeys.c: allocating the array for storage keys. Will need adjustment for memory devices. c) hw/s390x/s390-stattrib-kvm.c: will need adjustments in the future when using memory devices with CMM. d) hw/s390x/s390-virtio-ccw.c: fixing up / handling initital ram. Won't need adjustment. e) hw/s390x/sclp.c: same as d) Especially patch 9-11 also affect KVM. The remaining ones mostly only affect TCG. Cc: Richard Henderson Cc: Cornelia Huck Cc: Halil Pasic Cc: Christian Borntraeger Cc: Thomas Huth Cc: Janosch Frank Cc: Claudio Imbrenda Cc: Jason J. Herne Cc: qemu-s390x@nongnu.org David Hildenbrand (12): s390x/tcg: wrap address for RRBE s390x/tcg: fix ignoring bit 63 when setting the storage key in SSKE s390x/tcg: convert real to absolute address for RRBE, SSKE and ISKE s390x/tcg: check for addressing exceptions for for RRBE, SSKE and ISKE s390x/mmu_helper: no need to pass access type to mmu_translate_asce() s390x/mmu_helper: fixup mmu_translate() documentation s390x/mmu_helper: move address validation into mmu_translate*() s390x/mmu_helper: avoid setting the storage key if nothing changed hw/s390x/s390-skeys: use memory mapping to detect which storage keys to migrate hw/s390x/s390-skeys: use memory mapping to detect which storage keys to dump hw/s390x/s390-skeys: check if an address is valid before dumping the key hw/s390x/s390-skeys: lazy storage key enablement under TCG hw/s390x/s390-skeys.c | 183 +++++++++++++++++++++----------- include/hw/s390x/storage-keys.h | 63 +++++++++++ target/s390x/helper.h | 6 +- target/s390x/mmu_helper.c | 70 ++++++++---- target/s390x/s390x-internal.h | 1 + target/s390x/tcg/excp_helper.c | 13 --- target/s390x/tcg/mem_helper.c | 54 +++++++--- 7 files changed, 277 insertions(+), 113 deletions(-) -- 2.31.1