From nobody Sun Feb 8 22:07:11 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1630684642736254.49877287132813; Fri, 3 Sep 2021 08:57:22 -0700 (PDT) Received: from localhost ([::1]:58240 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMBZB-0003OU-B2 for importer@patchew.org; Fri, 03 Sep 2021 11:57:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57688) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMBXP-0000UB-AM for qemu-devel@nongnu.org; Fri, 03 Sep 2021 11:55:32 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:51786) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMBXL-0000AN-Ec for qemu-devel@nongnu.org; Fri, 03 Sep 2021 11:55:31 -0400 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-517-n5MmcQS3OUSSjJCutmeDog-1; Fri, 03 Sep 2021 11:55:25 -0400 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 5541180198A; Fri, 3 Sep 2021 15:55:24 +0000 (UTC) Received: from t480s.redhat.com (unknown [10.39.193.142]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9F70560861; Fri, 3 Sep 2021 15:55:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630684526; 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: in-reply-to:in-reply-to:references:references; bh=+mS3O4POYnN7uAyASYwN1m7JdQo0LFcFpwPNpjhd3cs=; b=W5woOOzIeEF7eX2PPUcXohE1Cbf/eOaYMU3029iWA814n4Is9wEiHON/lGx1EyMSB7NSl4 nRefCTD9VXV25mJ/2mvpik1sLqYsha2tKCABrHY8hl4i63Qqm7LP8gjQhdVS91Ti797pfh l9GYuaGlsZf1qtPuOk82WxSykSTEdGQ= X-MC-Unique: n5MmcQS3OUSSjJCutmeDog-1 From: David Hildenbrand To: qemu-devel@nongnu.org Subject: [PATCH v3 01/13] s390x/tcg: wrap address for RRBE Date: Fri, 3 Sep 2021 17:55:02 +0200 Message-Id: <20210903155514.44772-2-david@redhat.com> In-Reply-To: <20210903155514.44772-1-david@redhat.com> References: <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: 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=216.205.24.124; envelope-from=david@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) 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=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: "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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1630684644354100002 Content-Type: text/plain; charset="utf-8" Let's wrap the address just like for SSKE and ISKE. Reviewed-by: Thomas Huth Signed-off-by: David Hildenbrand --- target/s390x/tcg/mem_helper.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/target/s390x/tcg/mem_helper.c b/target/s390x/tcg/mem_helper.c index 21a4de4067..e0befd0f03 100644 --- a/target/s390x/tcg/mem_helper.c +++ b/target/s390x/tcg/mem_helper.c @@ -2223,11 +2223,12 @@ void HELPER(sske)(CPUS390XState *env, uint64_t r1, = uint64_t r2) uint32_t HELPER(rrbe)(CPUS390XState *env, uint64_t r2) { MachineState *ms =3D MACHINE(qdev_get_machine()); + uint64_t addr =3D wrap_address(env, r2); static S390SKeysState *ss; static S390SKeysClass *skeyclass; uint8_t re, key; =20 - if (r2 > ms->ram_size) { + if (addr > ms->ram_size) { return 0; } =20 @@ -2236,14 +2237,14 @@ uint32_t HELPER(rrbe)(CPUS390XState *env, uint64_t = r2) skeyclass =3D S390_SKEYS_GET_CLASS(ss); } =20 - if (skeyclass->get_skeys(ss, r2 / TARGET_PAGE_SIZE, 1, &key)) { + if (skeyclass->get_skeys(ss, addr / TARGET_PAGE_SIZE, 1, &key)) { return 0; } =20 re =3D key & (SK_R | SK_C); key &=3D ~SK_R; =20 - if (skeyclass->set_skeys(ss, r2 / TARGET_PAGE_SIZE, 1, &key)) { + if (skeyclass->set_skeys(ss, addr / TARGET_PAGE_SIZE, 1, &key)) { return 0; } /* --=20 2.31.1