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.5 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 0FFC3C433F5 for ; Fri, 3 Sep 2021 15:56:58 +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 B37996054E for ; Fri, 3 Sep 2021 15:56:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B37996054E 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]:57856 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMBYm-000386-Qp for qemu-devel@archiver.kernel.org; Fri, 03 Sep 2021 11:56:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57608) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMBXN-0000T1-5J for qemu-devel@nongnu.org; Fri, 03 Sep 2021 11:55:29 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:50464) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMBXK-00007G-Dd for qemu-devel@nongnu.org; Fri, 03 Sep 2021 11:55:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630684523; 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=eK7TE9SGkZ7MrXs41nGpgW1LJtxbgl0OnNUyizX5uyU=; b=dcxZnlyd+xUXaLM9j8JrGq0BGZ6d9NWWoSUrmAv0UdzxqJUI+IHm8bhYNF/j+31FRAOuQr LQZ42UQzf1ZNbY8j8/6sy4TijbxfCUU7nXcgnZ5bHxZg93GuwBq62ti/h/T/0rEWnP6hDx AK3D207y+mhPj2hJ5o4EayskxJ+JVA8= 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-413-t2G5feJQOFWCiR2gUWR9xA-1; Fri, 03 Sep 2021 11:55:22 -0400 X-MC-Unique: t2G5feJQOFWCiR2gUWR9xA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 51E496D4E0; Fri, 3 Sep 2021 15:55:21 +0000 (UTC) Received: from t480s.redhat.com (unknown [10.39.193.142]) by smtp.corp.redhat.com (Postfix) with ESMTP id 65D88838BC; Fri, 3 Sep 2021 15:55:15 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Subject: [PATCH v3 00/13] s390x: skey related fixes, cleanups, and memory device preparations Date: Fri, 3 Sep 2021 17:55:01 +0200 Message-Id: <20210903155514.44772-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.392, 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_H2=-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-12 also affect KVM. The remaining ones mostly only affect TCG. v2 -> v3: - "s390x/tcg: check for addressing exceptions for RRBE, SSKE and ISKE" -- Use trigger_pgm_exception() to trigger PGM_ADDRESSING v1 -> v2: - "s390x/tcg: fix ignoring bit 63 when setting the storage key in SSKE" -- Extended description - "s390x/tcg: convert real to absolute address for RRBE, SSKE and ISKE" -- Extended description - "s390x/tcg: check for addressing exceptions for RRBE, SSKE and ISKE" -- Fix compilation issue - "s390x/mmu_helper: no need to pass access type to mmu_translate_asce()" -- Mention commit id in description - "s390x/mmu_helper: move address validation into mmu_translate*()" -- Introduce and use MMU_S390_LRA - "hw/s390x/s390-skeys: check if an address is valid before dumping the key" -- Add missing return - "hw/s390x/s390-skeys: rename skeys_enabled to skeys_are_enabled" -- Added - "hw/s390x/s390-skeys: lazy storage key enablement under TCG" -- Adjust error cases/message in TCG get_skeys() and set_skeys() -- Use "enable_skeys" and return a bool -- Adjust function documentation 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 (13): 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 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: rename skeys_enabled to skeys_are_enabled hw/s390x/s390-skeys: lazy storage key enablement under TCG hw/s390x/s390-skeys-kvm.c | 4 +- hw/s390x/s390-skeys.c | 206 +++++++++++++++++++++----------- include/hw/s390x/storage-keys.h | 65 +++++++++- target/s390x/helper.h | 6 +- target/s390x/mmu_helper.c | 70 +++++++---- target/s390x/s390x-internal.h | 3 + target/s390x/tcg/excp_helper.c | 13 -- target/s390x/tcg/mem_helper.c | 53 +++++--- 8 files changed, 294 insertions(+), 126 deletions(-) -- 2.31.1