From nobody Mon Nov 25 05:00:28 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1716980267; cv=none; d=zohomail.com; s=zohoarc; b=nqiL6ogE4FjLV9DF2PCmSOU3gmSleE6V54z4lmkQIKPQFhmByHt72o5m38bkGnBPzvA9XXEJJpgUbmOpQwCpSiUxaD1q/nB/ThhiU3AIdig+HuT+gXYOAC3b54POmnpqv72jSMh52mW6DrrFF53QWZal+pLpxsn02k9QETnjpRs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716980267; 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=Jxtqb3KCTt/uxYgnly+d0TkxchgWDpeC0Swp2evxboU=; b=B99/1UPH5APflMfWzo6xp/rTGxwJriD3kllai0p0bA6S/ukGDXWHyRBTnvYzRH/3iPTElZ/YuM8urhejfvWKZ0izvM4u9SETIbmxY45b7TtklmlF1xvlMiV8N6q8woy6EYD4W4kE/R6b8LSkh61GtaC1J24rXhBasRtjsgNPvz4= 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 1716980267535743.5543305194294; Wed, 29 May 2024 03:57:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCGxV-0004Vx-M1; Wed, 29 May 2024 06:55:05 -0400 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 1sCGxU-0004V2-96 for qemu-devel@nongnu.org; Wed, 29 May 2024 06:55:04 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sCGxR-0002rX-3P for qemu-devel@nongnu.org; Wed, 29 May 2024 06:55:03 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-528-WFTVp9yhP3CBz5hE_3Sixw-1; Wed, 29 May 2024 06:54:57 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8A632101A52C; Wed, 29 May 2024 10:54:57 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id B63B9105480A; Wed, 29 May 2024 10:54:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716980099; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Jxtqb3KCTt/uxYgnly+d0TkxchgWDpeC0Swp2evxboU=; b=TQEayn8DS3UMOwr7pbZLGldlB2BJZhSeoUgzlMzySr+3rc0jlpppfgOAL+F2cXeDfo1T6B AqtkgW6wkaDsu+N0x3B1vWCRK0DNzsEZ00mUqkxlr/TdTRvFExYLI46n+HEnGNsYsUpcGd HCM01ejiw4vDWIEq1ytM1461uuzKBwg= X-MC-Unique: WFTVp9yhP3CBz5hE_3Sixw-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: qemu-s390x@nongnu.org, Ilya Leoshkevich Subject: [PULL 01/22] target/s390x: Do not use unwind for per_check_exception Date: Wed, 29 May 2024 12:54:33 +0200 Message-ID: <20240529105454.1149225-2-thuth@redhat.com> In-Reply-To: <20240529105454.1149225-1-thuth@redhat.com> References: <20240529105454.1149225-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 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=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.036, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1716980269685100003 Content-Type: text/plain; charset="utf-8" From: Richard Henderson Using exception unwind via tcg_s390_program_interrupt, we discard the current value of psw.addr, which discards the result of a branch. Pass in the address of the next instruction, which may not be sequential. Pass in ilen, which we would have gotten from unwind and is passed to the exception handler. Sync cc_op before the call, which we would have gotten from unwind. Signed-off-by: Richard Henderson Reviewed-by: Ilya Leoshkevich Message-ID: <20240502054417.234340-2-richard.henderson@linaro.org> [thuth: Silence checkpatch.pl errors] Signed-off-by: Thomas Huth --- target/s390x/helper.h | 2 +- target/s390x/tcg/excp_helper.c | 2 +- target/s390x/tcg/misc_helper.c | 23 ++++++++++++++++++++--- target/s390x/tcg/translate.c | 11 ++++++----- 4 files changed, 28 insertions(+), 10 deletions(-) diff --git a/target/s390x/helper.h b/target/s390x/helper.h index cc1c20e9e3..96ab71e877 100644 --- a/target/s390x/helper.h +++ b/target/s390x/helper.h @@ -359,7 +359,7 @@ DEF_HELPER_FLAGS_4(ipte, TCG_CALL_NO_RWG, void, env, i6= 4, i64, i32) DEF_HELPER_FLAGS_1(ptlb, TCG_CALL_NO_RWG, void, env) DEF_HELPER_FLAGS_1(purge, TCG_CALL_NO_RWG, void, env) DEF_HELPER_3(lra, i64, env, i64, i64) -DEF_HELPER_1(per_check_exception, void, env) +DEF_HELPER_FLAGS_3(per_check_exception, TCG_CALL_NO_WG, void, env, i64, i3= 2) DEF_HELPER_FLAGS_3(per_branch, TCG_CALL_NO_RWG, void, env, i64, i64) DEF_HELPER_FLAGS_2(per_ifetch, TCG_CALL_NO_RWG, void, env, i64) DEF_HELPER_FLAGS_1(per_store_real, TCG_CALL_NO_RWG, void, env) diff --git a/target/s390x/tcg/excp_helper.c b/target/s390x/tcg/excp_helper.c index f1c33f7967..4c0b692c9e 100644 --- a/target/s390x/tcg/excp_helper.c +++ b/target/s390x/tcg/excp_helper.c @@ -209,7 +209,7 @@ static void do_program_interrupt(CPUS390XState *env) =20 switch (env->int_pgm_code) { case PGM_PER: - advance =3D !(env->per_perc_atmid & PER_CODE_EVENT_NULLIFICATION); + /* advance already handled */ break; case PGM_ASCE_TYPE: case PGM_REG_FIRST_TRANS: diff --git a/target/s390x/tcg/misc_helper.c b/target/s390x/tcg/misc_helper.c index 8764846ce8..7c94468392 100644 --- a/target/s390x/tcg/misc_helper.c +++ b/target/s390x/tcg/misc_helper.c @@ -20,6 +20,7 @@ =20 #include "qemu/osdep.h" #include "qemu/cutils.h" +#include "qemu/log.h" #include "cpu.h" #include "s390x-internal.h" #include "qemu/host-utils.h" @@ -590,10 +591,26 @@ void HELPER(chsc)(CPUS390XState *env, uint64_t inst) #endif =20 #ifndef CONFIG_USER_ONLY -void HELPER(per_check_exception)(CPUS390XState *env) +static G_NORETURN void per_raise_exception(CPUS390XState *env) { - if (env->per_perc_atmid) { - tcg_s390_program_interrupt(env, PGM_PER, GETPC()); + trigger_pgm_exception(env, PGM_PER); + cpu_loop_exit(env_cpu(env)); +} + +static G_NORETURN void per_raise_exception_log(CPUS390XState *env) +{ + qemu_log_mask(CPU_LOG_INT, "PER interrupt after 0x%" PRIx64 "\n", + env->per_address); + per_raise_exception(env); +} + +void HELPER(per_check_exception)(CPUS390XState *env, uint64_t next_pc, + uint32_t ilen) +{ + if (unlikely(env->per_perc_atmid)) { + env->psw.addr =3D next_pc; + env->int_pgm_ilen =3D ilen; + per_raise_exception_log(env); } } =20 diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index ebd96abe6c..4c3ff1931b 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -6424,13 +6424,14 @@ static DisasJumpType translate_one(CPUS390XState *e= nv, DisasContext *s) =20 #ifndef CONFIG_USER_ONLY if (s->base.tb->flags & FLAG_MASK_PER) { - /* An exception might be triggered, save PSW if not already done. = */ + TCGv_i64 next_pc =3D psw_addr; + if (ret =3D=3D DISAS_NEXT || ret =3D=3D DISAS_TOO_MANY) { - tcg_gen_movi_i64(psw_addr, s->pc_tmp); + next_pc =3D tcg_constant_i64(s->pc_tmp); } - - /* Call the helper to check for a possible PER exception. */ - gen_helper_per_check_exception(tcg_env); + update_cc_op(s); + gen_helper_per_check_exception(tcg_env, next_pc, + tcg_constant_i32(s->ilen)); } #endif =20 --=20 2.45.1 From nobody Mon Nov 25 05:00:28 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1716980215; cv=none; d=zohomail.com; s=zohoarc; b=aH/KiA1vWQHn8m+H+NXz2CV6i3LEQoj49UNyj1MfiBp3mNcry3VvGAZ/zEG8ig8X8i00zaSIkxPzk6Vouq7Eln1C6EreKNLWLqBsUvIiP5czgqxbGKlyPpbucADUXJ2SprZ/kcTZ0b+e3/7MS7nKXWZIV1Dq77IpS1RSggj8A9Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716980215; 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=D649wpf7fiL4benJY0EmDtgPf0hrsPfPJlzQXEO2rsk=; b=mQRVO2+73UmSZEG4ioraum2D7xcv2dIuixEpqf0O9OkP28HnSzPG8LaEf2IZP0a5eihnzNmj0LNvnsj91QMjmeKaM8VxWdKwsKWa/XrH3Zdzn5hgetHd2o3wWItwlOydhkaHDJy0ICbJUM7RFnASyK83Gp4PkY0qs0/ACHcAjuE= 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 1716980215479861.5883447850873; Wed, 29 May 2024 03:56:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCGxa-0004YZ-H6; Wed, 29 May 2024 06:55:10 -0400 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 1sCGxY-0004Xx-Sa for qemu-devel@nongnu.org; Wed, 29 May 2024 06:55:08 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sCGxU-000359-9w for qemu-devel@nongnu.org; Wed, 29 May 2024 06:55:08 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-509-JgcYcQ2bOWG9vOeN-sNcaQ-1; Wed, 29 May 2024 06:54:59 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5B4C481227E; Wed, 29 May 2024 10:54:59 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id DFC4B105480A; Wed, 29 May 2024 10:54:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716980103; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=D649wpf7fiL4benJY0EmDtgPf0hrsPfPJlzQXEO2rsk=; b=gIQM/dJbfEa/Dgywt4VP257j+jOE6SgspoYjdS3BDk56a/tqgyFdkw3gA7BCktaXqyTdrP D6unomTEzd6hv5knz1EZV94+Rkg9nkghZDVQqMuJ4AzaWsEwQvuHOu9P8s7eDBp4lRdTdb BkGgMCS3tF5W3GTecoztSJQcDKyGrKo= X-MC-Unique: JgcYcQ2bOWG9vOeN-sNcaQ-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: qemu-s390x@nongnu.org, Ilya Leoshkevich Subject: [PULL 02/22] target/s390x: Move cpu_get_tb_cpu_state out of line Date: Wed, 29 May 2024 12:54:34 +0200 Message-ID: <20240529105454.1149225-3-thuth@redhat.com> In-Reply-To: <20240529105454.1149225-1-thuth@redhat.com> References: <20240529105454.1149225-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 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=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.036, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 @redhat.com) X-ZM-MESSAGEID: 1716980217225100006 Content-Type: text/plain; charset="utf-8" From: Richard Henderson Signed-off-by: Richard Henderson Reviewed-by: Thomas Huth Reviewed-by: Ilya Leoshkevich Message-ID: <20240502054417.234340-3-richard.henderson@linaro.org> Signed-off-by: Thomas Huth --- target/s390x/cpu.h | 23 ++--------------------- target/s390x/cpu.c | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index 414680eed1..950f84f316 100644 --- a/target/s390x/cpu.h +++ b/target/s390x/cpu.h @@ -413,27 +413,8 @@ static inline int s390x_env_mmu_index(CPUS390XState *e= nv, bool ifetch) =20 #include "tcg/tcg_s390x.h" =20 -static inline void cpu_get_tb_cpu_state(CPUS390XState *env, vaddr *pc, - uint64_t *cs_base, uint32_t *flags) -{ - if (env->psw.addr & 1) { - /* - * Instructions must be at even addresses. - * This needs to be checked before address translation. - */ - env->int_pgm_ilen =3D 2; /* see s390_cpu_tlb_fill() */ - tcg_s390_program_interrupt(env, PGM_SPECIFICATION, 0); - } - *pc =3D env->psw.addr; - *cs_base =3D env->ex_value; - *flags =3D (env->psw.mask >> FLAG_MASK_PSW_SHIFT) & FLAG_MASK_PSW; - if (env->cregs[0] & CR0_AFP) { - *flags |=3D FLAG_MASK_AFP; - } - if (env->cregs[0] & CR0_VECTOR) { - *flags |=3D FLAG_MASK_VECTOR; - } -} +void cpu_get_tb_cpu_state(CPUS390XState *env, vaddr *pc, + uint64_t *cs_base, uint32_t *flags); =20 #endif /* CONFIG_TCG */ =20 diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index f7194534ae..a8428b5a1e 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -324,6 +324,28 @@ static void s390_cpu_reset_full(DeviceState *dev) #ifdef CONFIG_TCG #include "hw/core/tcg-cpu-ops.h" =20 +void cpu_get_tb_cpu_state(CPUS390XState *env, vaddr *pc, + uint64_t *cs_base, uint32_t *flags) +{ + if (env->psw.addr & 1) { + /* + * Instructions must be at even addresses. + * This needs to be checked before address translation. + */ + env->int_pgm_ilen =3D 2; /* see s390_cpu_tlb_fill() */ + tcg_s390_program_interrupt(env, PGM_SPECIFICATION, 0); + } + *pc =3D env->psw.addr; + *cs_base =3D env->ex_value; + *flags =3D (env->psw.mask >> FLAG_MASK_PSW_SHIFT) & FLAG_MASK_PSW; + if (env->cregs[0] & CR0_AFP) { + *flags |=3D FLAG_MASK_AFP; + } + if (env->cregs[0] & CR0_VECTOR) { + *flags |=3D FLAG_MASK_VECTOR; + } +} + static const TCGCPUOps s390_tcg_ops =3D { .initialize =3D s390x_translate_init, .restore_state_to_opc =3D s390x_restore_state_to_opc, --=20 2.45.1 From nobody Mon Nov 25 05:00:28 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1716980185; cv=none; d=zohomail.com; s=zohoarc; b=LjlxSaVfmyKTZBIBk38+UhcxA/REAteNfzH9ISl46zVfMGGmSRQEIyjg4vfEqV15OiY1OM0lySKSqQrUqkw02PqMN6U43QH1NuPZiAb7fgxUwUC49mLuZD3NTd+PsZp2rAksxNYgB7q3MstWzE0TXPR3z7QA6rs6fluBQBKhI28= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716980185; 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=+QYlakjJc7E2aRRntrBWn7dGsezTUaIxUX0JZczpE6g=; b=TQsY/8gyrEo8rdT/MkxWCBb6svc2tHVEm3pGOiNQPoYgXlpiIyekJBXBxPWlfqhXL83oqsCzTZJCS6RWXuzz7y3eipToaqRqQsDqOf4YRK9CO/Oiy69R6u9dd+cU3hPtPekKMbSXXSRrbGiq9Emu12Ks6eHzrbVVNqeXDTJr0fM= 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 1716980185159519.7480061041343; Wed, 29 May 2024 03:56:25 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCGxY-0004Xl-DL; Wed, 29 May 2024 06:55:08 -0400 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 1sCGxV-0004Vr-Fq for qemu-devel@nongnu.org; Wed, 29 May 2024 06:55:05 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sCGxT-00032m-RT for qemu-devel@nongnu.org; Wed, 29 May 2024 06:55:05 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-144-2j9nrVX7P0ia_g3uvlUTZA-1; Wed, 29 May 2024 06:55:01 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F09D8800CAC; Wed, 29 May 2024 10:55:00 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id CB116105480A; Wed, 29 May 2024 10:54:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716980103; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+QYlakjJc7E2aRRntrBWn7dGsezTUaIxUX0JZczpE6g=; b=K7cRMkAxXB2b/CVrxUsmJ/mTf9mpAclNvHrG/q7AVnsEhkDZTakrBRdradqBFfs1W3tt3m s4Lz14QtxWMts++CO9p8a/fZqFuy4V2rfpGkshDQMlRRX/SRSa4UfN2XH/2w3hUFR+Fbml lZ8656sdViuy35RFKL0I+46j4tNft0U= X-MC-Unique: 2j9nrVX7P0ia_g3uvlUTZA-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: qemu-s390x@nongnu.org, Ilya Leoshkevich Subject: [PULL 03/22] target/s390x: Update CR9 bits Date: Wed, 29 May 2024 12:54:35 +0200 Message-ID: <20240529105454.1149225-4-thuth@redhat.com> In-Reply-To: <20240529105454.1149225-1-thuth@redhat.com> References: <20240529105454.1149225-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 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=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.036, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1716980187065100015 Content-Type: text/plain; charset="utf-8" From: Richard Henderson Update from the PoO 14th edition. Signed-off-by: Richard Henderson Reviewed-by: Thomas Huth Reviewed-by: Ilya Leoshkevich Message-ID: <20240502054417.234340-4-richard.henderson@linaro.org> Signed-off-by: Thomas Huth --- target/s390x/cpu.h | 18 +++++++++++------- target/s390x/tcg/misc_helper.c | 2 +- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index 950f84f316..1bb723a9d3 100644 --- a/target/s390x/cpu.h +++ b/target/s390x/cpu.h @@ -419,13 +419,17 @@ void cpu_get_tb_cpu_state(CPUS390XState *env, vaddr *= pc, #endif /* CONFIG_TCG */ =20 /* PER bits from control register 9 */ -#define PER_CR9_EVENT_BRANCH 0x80000000 -#define PER_CR9_EVENT_IFETCH 0x40000000 -#define PER_CR9_EVENT_STORE 0x20000000 -#define PER_CR9_EVENT_STORE_REAL 0x08000000 -#define PER_CR9_EVENT_NULLIFICATION 0x01000000 -#define PER_CR9_CONTROL_BRANCH_ADDRESS 0x00800000 -#define PER_CR9_CONTROL_ALTERATION 0x00200000 +#define PER_CR9_EVENT_BRANCH 0x80000000 +#define PER_CR9_EVENT_IFETCH 0x40000000 +#define PER_CR9_EVENT_STORE 0x20000000 +#define PER_CR9_EVENT_STORAGE_KEY_ALTERATION 0x10000000 +#define PER_CR9_EVENT_STORE_REAL 0x08000000 +#define PER_CR9_EVENT_ZERO_ADDRESS_DETECTION 0x04000000 +#define PER_CR9_EVENT_TRANSACTION_END 0x02000000 +#define PER_CR9_EVENT_IFETCH_NULLIFICATION 0x01000000 +#define PER_CR9_CONTROL_BRANCH_ADDRESS 0x00800000 +#define PER_CR9_CONTROL_TRANSACTION_SUPRESS 0x00400000 +#define PER_CR9_CONTROL_STORAGE_ALTERATION 0x00200000 =20 /* PER bits from the PER CODE/ATMID/AI in lowcore */ #define PER_CODE_EVENT_BRANCH 0x8000 diff --git a/target/s390x/tcg/misc_helper.c b/target/s390x/tcg/misc_helper.c index 7c94468392..0482442458 100644 --- a/target/s390x/tcg/misc_helper.c +++ b/target/s390x/tcg/misc_helper.c @@ -644,7 +644,7 @@ void HELPER(per_ifetch)(CPUS390XState *env, uint64_t ad= dr) =20 /* If the instruction has to be nullified, trigger the exception immediately. */ - if (env->cregs[9] & PER_CR9_EVENT_NULLIFICATION) { + if (env->cregs[9] & PER_CR9_EVENT_IFETCH_NULLIFICATION) { CPUState *cs =3D env_cpu(env); =20 env->per_perc_atmid |=3D PER_CODE_EVENT_NULLIFICATION; --=20 2.45.1 From nobody Mon Nov 25 05:00:28 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1716980183; cv=none; d=zohomail.com; s=zohoarc; b=cyd6QA2cDmrobjHH1fAbQym9W/3jSgof1Xd2uC2qLvTLZtxYnBLOmwA/09nGQEzNCo81IAk60c2LEllDWGH/+kcth1Z3LL6jx2EjA1jQoaYv3E+y15esoMx01N3YIVWpf21+qqs8/jH0NKzMIJKHBNva/mFgTzUXa9F+TJWUUhs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716980183; 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=umqyx+sqblUVWcxcj/vmKXhAQlU/X72R57z6brOfNs4=; b=NOply/Dd5oJXfSIYLeQJ68BSUlITwEPmIIn0dsS5DuFLVwnjBDIVPSg2NB0bnKP1jcpj+ypWuWSV+HH7vKXlkt9kq0kAyRr1Cr+sTFulNqAR0DdugDe6vhZxw9f7cK8XCdkM62ki48LqY0uzEFWThE5v3mYBo0ifVLxfiyEUCP8= 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 1716980183217533.6301962521025; Wed, 29 May 2024 03:56:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCGxe-0004ah-0e; Wed, 29 May 2024 06:55:14 -0400 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 1sCGxb-0004Z7-Kx for qemu-devel@nongnu.org; Wed, 29 May 2024 06:55:11 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sCGxV-00036J-4a for qemu-devel@nongnu.org; Wed, 29 May 2024 06:55:11 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-574-MsaHgxpIOm6RFbSPOgVt6A-1; Wed, 29 May 2024 06:55:02 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 569EB185A780; Wed, 29 May 2024 10:55:02 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id 41B97105480A; Wed, 29 May 2024 10:55:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716980104; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=umqyx+sqblUVWcxcj/vmKXhAQlU/X72R57z6brOfNs4=; b=XwKlYdonD2PHr4QY66QmIvAwQUIFZ7fG7I5gIaW/XLEkB8J4s3J7r3eZrSMm61GKXSVl2g vLi3lTJgjHkNir+hK7qVxZ+StnSBLBEZti2XHpjOODfZIDS6gQwSwqIfwm4h28NZL8RAs/ iy/ZSdqfrHlqus6/b5pOGQmBm9nirxo= X-MC-Unique: MsaHgxpIOm6RFbSPOgVt6A-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: qemu-s390x@nongnu.org, Ilya Leoshkevich Subject: [PULL 04/22] target/s390x: Record separate PER bits in TB flags Date: Wed, 29 May 2024 12:54:36 +0200 Message-ID: <20240529105454.1149225-5-thuth@redhat.com> In-Reply-To: <20240529105454.1149225-1-thuth@redhat.com> References: <20240529105454.1149225-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 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=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.036, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 @redhat.com) X-ZM-MESSAGEID: 1716980185039100008 Content-Type: text/plain; charset="utf-8" From: Richard Henderson Record successful-branching, instruction-fetching, and store-using-real-address. The other PER bits are not used during translation. Having checked these at translation time, we can remove runtime tests from the helpers. Signed-off-by: Richard Henderson Reviewed-by: Ilya Leoshkevich Message-ID: <20240502054417.234340-5-richard.henderson@linaro.org> Signed-off-by: Thomas Huth --- target/s390x/cpu.h | 44 ++++++++++++++++++++++++---------- target/s390x/cpu.c | 22 +++++++++++++---- target/s390x/tcg/misc_helper.c | 21 +++++++--------- target/s390x/tcg/translate.c | 10 ++++---- 4 files changed, 62 insertions(+), 35 deletions(-) diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index 1bb723a9d3..d6b75ad0e0 100644 --- a/target/s390x/cpu.h +++ b/target/s390x/cpu.h @@ -342,19 +342,32 @@ extern const VMStateDescription vmstate_s390_cpu; =20 /* tb flags */ =20 -#define FLAG_MASK_PSW_SHIFT 31 -#define FLAG_MASK_PER (PSW_MASK_PER >> FLAG_MASK_PSW_SHIFT) -#define FLAG_MASK_DAT (PSW_MASK_DAT >> FLAG_MASK_PSW_SHIFT) -#define FLAG_MASK_PSTATE (PSW_MASK_PSTATE >> FLAG_MASK_PSW_SHIFT) -#define FLAG_MASK_ASC (PSW_MASK_ASC >> FLAG_MASK_PSW_SHIFT) -#define FLAG_MASK_64 (PSW_MASK_64 >> FLAG_MASK_PSW_SHIFT) -#define FLAG_MASK_32 (PSW_MASK_32 >> FLAG_MASK_PSW_SHIFT) -#define FLAG_MASK_PSW (FLAG_MASK_PER | FLAG_MASK_DAT | FLAG_MASK= _PSTATE \ - | FLAG_MASK_ASC | FLAG_MASK_64 | FLAG_MASK= _32) - -/* we'll use some unused PSW positions to store CR flags in tb flags */ -#define FLAG_MASK_AFP (PSW_MASK_UNUSED_2 >> FLAG_MASK_PSW_SHIFT) -#define FLAG_MASK_VECTOR (PSW_MASK_UNUSED_3 >> FLAG_MASK_PSW_SHIFT) +#define FLAG_MASK_PSW_SHIFT 31 +#define FLAG_MASK_32 0x00000001u +#define FLAG_MASK_64 0x00000002u +#define FLAG_MASK_AFP 0x00000004u +#define FLAG_MASK_VECTOR 0x00000008u +#define FLAG_MASK_ASC 0x00018000u +#define FLAG_MASK_PSTATE 0x00020000u +#define FLAG_MASK_PER_IFETCH_NULLIFY 0x01000000u +#define FLAG_MASK_DAT 0x08000000u +#define FLAG_MASK_PER_STORE_REAL 0x20000000u +#define FLAG_MASK_PER_IFETCH 0x40000000u +#define FLAG_MASK_PER_BRANCH 0x80000000u + +QEMU_BUILD_BUG_ON(FLAG_MASK_32 !=3D PSW_MASK_32 >> FLAG_MASK_PSW_SHIFT); +QEMU_BUILD_BUG_ON(FLAG_MASK_64 !=3D PSW_MASK_64 >> FLAG_MASK_PSW_SHIFT); +QEMU_BUILD_BUG_ON(FLAG_MASK_ASC !=3D PSW_MASK_ASC >> FLAG_MASK_PSW_SHIFT); +QEMU_BUILD_BUG_ON(FLAG_MASK_PSTATE !=3D PSW_MASK_PSTATE >> FLAG_MASK_PSW_S= HIFT); +QEMU_BUILD_BUG_ON(FLAG_MASK_DAT !=3D PSW_MASK_DAT >> FLAG_MASK_PSW_SHIFT); + +#define FLAG_MASK_PSW (FLAG_MASK_DAT | FLAG_MASK_PSTATE | \ + FLAG_MASK_ASC | FLAG_MASK_64 | FLAG_MASK_= 32) +#define FLAG_MASK_CR9 (FLAG_MASK_PER_BRANCH | FLAG_MASK_PER_IFET= CH) +#define FLAG_MASK_PER (FLAG_MASK_PER_BRANCH | \ + FLAG_MASK_PER_IFETCH | \ + FLAG_MASK_PER_IFETCH_NULLIFY | \ + FLAG_MASK_PER_STORE_REAL) =20 /* Control register 0 bits */ #define CR0_LOWPROT 0x0000000010000000ULL @@ -431,6 +444,11 @@ void cpu_get_tb_cpu_state(CPUS390XState *env, vaddr *p= c, #define PER_CR9_CONTROL_TRANSACTION_SUPRESS 0x00400000 #define PER_CR9_CONTROL_STORAGE_ALTERATION 0x00200000 =20 +QEMU_BUILD_BUG_ON(FLAG_MASK_PER_BRANCH !=3D PER_CR9_EVENT_BRANCH); +QEMU_BUILD_BUG_ON(FLAG_MASK_PER_IFETCH !=3D PER_CR9_EVENT_IFETCH); +QEMU_BUILD_BUG_ON(FLAG_MASK_PER_IFETCH_NULLIFY !=3D + PER_CR9_EVENT_IFETCH_NULLIFICATION); + /* PER bits from the PER CODE/ATMID/AI in lowcore */ #define PER_CODE_EVENT_BRANCH 0x8000 #define PER_CODE_EVENT_IFETCH 0x4000 diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index a8428b5a1e..2bbeaca36e 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -325,8 +325,10 @@ static void s390_cpu_reset_full(DeviceState *dev) #include "hw/core/tcg-cpu-ops.h" =20 void cpu_get_tb_cpu_state(CPUS390XState *env, vaddr *pc, - uint64_t *cs_base, uint32_t *flags) + uint64_t *cs_base, uint32_t *pflags) { + uint32_t flags; + if (env->psw.addr & 1) { /* * Instructions must be at even addresses. @@ -335,15 +337,27 @@ void cpu_get_tb_cpu_state(CPUS390XState *env, vaddr *= pc, env->int_pgm_ilen =3D 2; /* see s390_cpu_tlb_fill() */ tcg_s390_program_interrupt(env, PGM_SPECIFICATION, 0); } + *pc =3D env->psw.addr; *cs_base =3D env->ex_value; - *flags =3D (env->psw.mask >> FLAG_MASK_PSW_SHIFT) & FLAG_MASK_PSW; + + flags =3D (env->psw.mask >> FLAG_MASK_PSW_SHIFT) & FLAG_MASK_PSW; + if (env->psw.mask & PSW_MASK_PER) { + flags |=3D env->cregs[9] & (FLAG_MASK_PER_BRANCH | + FLAG_MASK_PER_IFETCH | + FLAG_MASK_PER_IFETCH_NULLIFY); + if ((env->cregs[9] & PER_CR9_EVENT_STORE) && + (env->cregs[9] & PER_CR9_EVENT_STORE_REAL)) { + flags |=3D FLAG_MASK_PER_STORE_REAL; + } + } if (env->cregs[0] & CR0_AFP) { - *flags |=3D FLAG_MASK_AFP; + flags |=3D FLAG_MASK_AFP; } if (env->cregs[0] & CR0_VECTOR) { - *flags |=3D FLAG_MASK_VECTOR; + flags |=3D FLAG_MASK_VECTOR; } + *pflags =3D flags; } =20 static const TCGCPUOps s390_tcg_ops =3D { diff --git a/target/s390x/tcg/misc_helper.c b/target/s390x/tcg/misc_helper.c index 0482442458..3f94f71437 100644 --- a/target/s390x/tcg/misc_helper.c +++ b/target/s390x/tcg/misc_helper.c @@ -627,18 +627,16 @@ static inline bool get_per_in_range(CPUS390XState *en= v, uint64_t addr) =20 void HELPER(per_branch)(CPUS390XState *env, uint64_t from, uint64_t to) { - if ((env->cregs[9] & PER_CR9_EVENT_BRANCH)) { - if (!(env->cregs[9] & PER_CR9_CONTROL_BRANCH_ADDRESS) - || get_per_in_range(env, to)) { - env->per_address =3D from; - env->per_perc_atmid =3D PER_CODE_EVENT_BRANCH | get_per_atmid(= env); - } + if (!(env->cregs[9] & PER_CR9_CONTROL_BRANCH_ADDRESS) + || get_per_in_range(env, to)) { + env->per_address =3D from; + env->per_perc_atmid =3D PER_CODE_EVENT_BRANCH | get_per_atmid(env); } } =20 void HELPER(per_ifetch)(CPUS390XState *env, uint64_t addr) { - if ((env->cregs[9] & PER_CR9_EVENT_IFETCH) && get_per_in_range(env, ad= dr)) { + if (get_per_in_range(env, addr)) { env->per_address =3D addr; env->per_perc_atmid =3D PER_CODE_EVENT_IFETCH | get_per_atmid(env); =20 @@ -659,12 +657,9 @@ void HELPER(per_ifetch)(CPUS390XState *env, uint64_t a= ddr) =20 void HELPER(per_store_real)(CPUS390XState *env) { - if ((env->cregs[9] & PER_CR9_EVENT_STORE) && - (env->cregs[9] & PER_CR9_EVENT_STORE_REAL)) { - /* PSW is saved just before calling the helper. */ - env->per_address =3D env->psw.addr; - env->per_perc_atmid =3D PER_CODE_EVENT_STORE_REAL | get_per_atmid(= env); - } + /* PSW is saved just before calling the helper. */ + env->per_address =3D env->psw.addr; + env->per_perc_atmid =3D PER_CODE_EVENT_STORE_REAL | get_per_atmid(env); } #endif =20 diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index 4c3ff1931b..de98115c4d 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -346,7 +346,7 @@ static void per_branch(DisasContext *s, bool to_next) #ifndef CONFIG_USER_ONLY tcg_gen_movi_i64(gbea, s->base.pc_next); =20 - if (s->base.tb->flags & FLAG_MASK_PER) { + if (s->base.tb->flags & FLAG_MASK_PER_BRANCH) { TCGv_i64 next_pc =3D to_next ? tcg_constant_i64(s->pc_tmp) : psw_a= ddr; gen_helper_per_branch(tcg_env, gbea, next_pc); } @@ -357,7 +357,7 @@ static void per_branch_cond(DisasContext *s, TCGCond co= nd, TCGv_i64 arg1, TCGv_i64 arg2) { #ifndef CONFIG_USER_ONLY - if (s->base.tb->flags & FLAG_MASK_PER) { + if (s->base.tb->flags & FLAG_MASK_PER_BRANCH) { TCGLabel *lab =3D gen_new_label(); tcg_gen_brcond_i64(tcg_invert_cond(cond), arg1, arg2, lab); =20 @@ -656,7 +656,7 @@ static void gen_op_calc_cc(DisasContext *s) =20 static bool use_goto_tb(DisasContext *s, uint64_t dest) { - if (unlikely(s->base.tb->flags & FLAG_MASK_PER)) { + if (unlikely(s->base.tb->flags & FLAG_MASK_PER_BRANCH)) { return false; } return translator_use_goto_tb(&s->base, dest); @@ -4409,7 +4409,7 @@ static DisasJumpType op_stura(DisasContext *s, DisasO= ps *o) { tcg_gen_qemu_st_tl(o->in1, o->in2, MMU_REAL_IDX, s->insn->data); =20 - if (s->base.tb->flags & FLAG_MASK_PER) { + if (s->base.tb->flags & FLAG_MASK_PER_STORE_REAL) { update_psw_addr(s); gen_helper_per_store_real(tcg_env); } @@ -6323,7 +6323,7 @@ static DisasJumpType translate_one(CPUS390XState *env= , DisasContext *s) } =20 #ifndef CONFIG_USER_ONLY - if (s->base.tb->flags & FLAG_MASK_PER) { + if (s->base.tb->flags & FLAG_MASK_PER_IFETCH) { TCGv_i64 addr =3D tcg_constant_i64(s->base.pc_next); gen_helper_per_ifetch(tcg_env, addr); } --=20 2.45.1 From nobody Mon Nov 25 05:00:28 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1716980194; cv=none; d=zohomail.com; s=zohoarc; b=UIS70rDIDGV3SRWhZhGwJtH6445VkK20/f2EzrWKsOoCRsDqcdOF1Jp7QrVM2NOkyCwCL3zmlA+HWZdbcMV1W1rn73weBEm5kHevUW7KzeqHEI3PvzSF6OQ7Xb8LrUL2JD/u2KP87BwytUcaaP/rILZbcgm4I18NTahRrLkf+PM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716980194; 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=rJ+27ZTIPKuiVc0o8qZqa52r5nGNmKQfLzK98i0xub4=; b=g+hPghCcp8fJAKbC17e0CNGZX3EUAwsAVdEdHlrj9zyaPa++GJcVt5rSxJQBrwfLGogmpUD2O41Oesxp2txQWd075Tp1JBOArcWkuljFgJXs95BnB8OupTgVZKH9Aq0GIwe7Q5OZlORVla7ImM8k49SXZTQKtk8Hs75hUfAG5o8= 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 1716980194326990.8371567149798; Wed, 29 May 2024 03:56:34 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCGxd-0004Zx-2p; Wed, 29 May 2024 06:55:13 -0400 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 1sCGxb-0004Yn-BH for qemu-devel@nongnu.org; Wed, 29 May 2024 06:55:11 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sCGxY-00037w-QD for qemu-devel@nongnu.org; Wed, 29 May 2024 06:55:10 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-198-AAcK9wkiOtGBcoFIcmcMMw-1; Wed, 29 May 2024 06:55:04 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 32A2685A58C; Wed, 29 May 2024 10:55:04 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id AB974105480A; Wed, 29 May 2024 10:55:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716980108; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rJ+27ZTIPKuiVc0o8qZqa52r5nGNmKQfLzK98i0xub4=; b=cFpVfds3iVKw3VikrvMnDAQKTDJoTuSvKSdVcsFFSp94nvttqjE0YPd9gZCeHHBVJmpeOY 9EWEtT2SXasKjGR3qA1wRM2prbSSj+kNpV76lkH2+E5Y6q6YLMbpaI0wlBQo3A27wtl6RP dxfJZ+1cD/MK0vXGT9hw8p1UQmjLcPw= X-MC-Unique: AAcK9wkiOtGBcoFIcmcMMw-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: qemu-s390x@nongnu.org, Ilya Leoshkevich Subject: [PULL 05/22] target/s390x: Disable conditional branch-to-next for PER Date: Wed, 29 May 2024 12:54:37 +0200 Message-ID: <20240529105454.1149225-6-thuth@redhat.com> In-Reply-To: <20240529105454.1149225-1-thuth@redhat.com> References: <20240529105454.1149225-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 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=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.036, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1716980195093100003 Content-Type: text/plain; charset="utf-8" From: Richard Henderson For PER, we require a conditional call to helper_per_branch for the conditional branch. Fold the remaining optimization into a call to helper_goto_direct, which will take care of the remaining gbea adjustment. Reviewed-by: Ilya Leoshkevich Signed-off-by: Richard Henderson Message-ID: <20240502054417.234340-6-richard.henderson@linaro.org> Signed-off-by: Thomas Huth --- target/s390x/tcg/translate.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index de98115c4d..07620948ae 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -1131,13 +1131,13 @@ static DisasJumpType help_branch(DisasContext *s, D= isasCompare *c, goto egress; } if (is_imm) { - if (dest =3D=3D s->pc_tmp) { - /* Branch to next. */ - per_branch(s, true); - ret =3D DISAS_NEXT; - goto egress; - } - if (c->cond =3D=3D TCG_COND_ALWAYS) { + /* + * Do not optimize a conditional branch if PER enabled, because we + * still need a conditional call to helper_per_branch. + */ + if (c->cond =3D=3D TCG_COND_ALWAYS + || (dest =3D=3D s->pc_tmp && + !(s->base.tb->flags & FLAG_MASK_PER_BRANCH))) { ret =3D help_goto_direct(s, dest); goto egress; } --=20 2.45.1 From nobody Mon Nov 25 05:00:28 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1716980234; cv=none; d=zohomail.com; s=zohoarc; b=Fu3OoX0jB+mf0Gv/91dtxwU5FEo8ajyHWutnxqrMZQZEI2nuF0kerb8psajB8PABP0dNy5XBb7+xC+bL2k/cXD/lB8kFq7RwwosqGcYcK0R4kFl4xPeMiC+IVOQFvFLkWu/fukUFo4Xjd2H8hUXcJjeS9NnPphyZDJImGpmx54s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716980234; h=Content-Type: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=3GyYRSkELlfnbhEfugR7UfUM9SFCQGfkQTU4bDJyXro=; b=HDcfb5+iiV7ZAUHlV4Vkk1dRS57ZiqUpaRk25QUostij6ocxeSAZQV70gh0uvQDSRV/jCV/giomH88fQZOJbcPk5JA313EAng8qwPW8r+2upsHRbX1UejBgchy2th4dXNu+T9rn1UQqTEgLrYG7a1nsa2/AsV3kSnBedGQKsyzA= 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 1716980234531503.8170869030869; Wed, 29 May 2024 03:57:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCGxf-0004bn-Hd; Wed, 29 May 2024 06:55:15 -0400 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 1sCGxe-0004az-Dj for qemu-devel@nongnu.org; Wed, 29 May 2024 06:55:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sCGxb-00038M-UF for qemu-devel@nongnu.org; Wed, 29 May 2024 06:55:13 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-483-O06KanVNMzC8iu1JtWAb9Q-1; Wed, 29 May 2024 06:55:07 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 487D429AA386; Wed, 29 May 2024 10:55:07 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id B0263105480A; Wed, 29 May 2024 10:55:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716980109; 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=3GyYRSkELlfnbhEfugR7UfUM9SFCQGfkQTU4bDJyXro=; b=U0qvNpZp13C3Ni691ZmEE4/JkJu1tzGU6jM/CW+rW5/5//UnUMLAPN7UmokO8NkYgAiWG6 YobAgfWny06Mc6erxBrozeI/xoFshyzUhnyz3PvqubMlOzPHEiFYw+nW9r7jpCZfGxLt3S FxDIUP0qw4kdzd7anDv82SekGYPGEn0= X-MC-Unique: O06KanVNMzC8iu1JtWAb9Q-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: qemu-s390x@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Ilya Leoshkevich Subject: [PULL 06/22] target/s390x: Introduce help_goto_indirect Date: Wed, 29 May 2024 12:54:38 +0200 Message-ID: <20240529105454.1149225-7-thuth@redhat.com> In-Reply-To: <20240529105454.1149225-1-thuth@redhat.com> References: <20240529105454.1149225-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 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=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.036, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1716980235302100003 From: Richard Henderson Add a small helper to handle unconditional indirect jumps. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Ilya Leoshkevich Signed-off-by: Richard Henderson Message-ID: <20240502054417.234340-7-richard.henderson@linaro.org> Signed-off-by: Thomas Huth --- target/s390x/tcg/translate.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index 07620948ae..7ae928c3b0 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -1118,6 +1118,13 @@ static DisasJumpType help_goto_direct(DisasContext *= s, uint64_t dest) } } =20 +static DisasJumpType help_goto_indirect(DisasContext *s, TCGv_i64 dest) +{ + tcg_gen_mov_i64(psw_addr, dest); + per_branch(s, false); + return DISAS_PC_UPDATED; +} + static DisasJumpType help_branch(DisasContext *s, DisasCompare *c, bool is_imm, int imm, TCGv_i64 cdest) { @@ -1148,9 +1155,7 @@ static DisasJumpType help_branch(DisasContext *s, Dis= asCompare *c, goto egress; } if (c->cond =3D=3D TCG_COND_ALWAYS) { - tcg_gen_mov_i64(psw_addr, cdest); - per_branch(s, false); - ret =3D DISAS_PC_UPDATED; + ret =3D help_goto_indirect(s, cdest); goto egress; } } @@ -1463,9 +1468,7 @@ static DisasJumpType op_bas(DisasContext *s, DisasOps= *o) { pc_to_link_info(o->out, s, s->pc_tmp); if (o->in2) { - tcg_gen_mov_i64(psw_addr, o->in2); - per_branch(s, false); - return DISAS_PC_UPDATED; + return help_goto_indirect(s, o->in2); } else { return DISAS_NEXT; } @@ -1495,9 +1498,7 @@ static DisasJumpType op_bal(DisasContext *s, DisasOps= *o) { save_link_info(s, o); if (o->in2) { - tcg_gen_mov_i64(psw_addr, o->in2); - per_branch(s, false); - return DISAS_PC_UPDATED; + return help_goto_indirect(s, o->in2); } else { return DISAS_NEXT; } --=20 2.45.1 From nobody Mon Nov 25 05:00:28 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1716980263; cv=none; d=zohomail.com; s=zohoarc; b=hBEqDbYScLAt4xPQUj8ltVA9Tx+cNkjRYgLMsIFSl1Z1r8T7TpameHN0qusthNckNvXZ0GS46I/hHM1dL3NmVLIQnWr1V11WEZ0zxXC7hQxrg6Fbk10scDV9fxAa0jqPP3jeVaayGDAja4/I/bbSmMZK0dSfkPSz6yNTk7hz7sY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716980263; 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=0hGgy6Hp9s9MqVRuTqz+IGZjvh9B+VjQjOFSX8Q6f4I=; b=TvI3jn+23OIgqZQyhwi0CGYt6WDTbF2H9gZOq9uQlYUG465+oDFqncs4/QWuV7ivY5KnVi3UNj/KIcijFO/jqFBE5CZVvt6cPcHepKJ7I8YUYHVXbzep2hrSJRhmumzctHZEOG122cP8nZtgavvFz02U5akcdGz1a5qU0QLIkEg= 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 171698026337664.58962958715063; Wed, 29 May 2024 03:57:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCGxi-0004d1-6T; Wed, 29 May 2024 06:55:18 -0400 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 1sCGxe-0004b0-E0 for qemu-devel@nongnu.org; Wed, 29 May 2024 06:55:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sCGxc-000392-Hx for qemu-devel@nongnu.org; Wed, 29 May 2024 06:55:14 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-408-NzkeJLNHNN-UBRBq_09Urg-1; Wed, 29 May 2024 06:55:09 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4FBA4857A81; Wed, 29 May 2024 10:55:09 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id BC890105480A; Wed, 29 May 2024 10:55:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716980111; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0hGgy6Hp9s9MqVRuTqz+IGZjvh9B+VjQjOFSX8Q6f4I=; b=NtJiE1GekRxyoYU/OL+0/poRqY96Put3ue/ny7m8NK0XobfPI9uGdk/g0vG4PR49Yi7qDp 34Dgx0IGFjhNNHgxl1OGXB7Zw+oMzxWOlbaNh1scyqp0yD/xS+DemU9VOz/iCx8ExKhFVX WACu1kr5dsqbiQHRWRgpmMNk8DMwF3U= X-MC-Unique: NzkeJLNHNN-UBRBq_09Urg-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: qemu-s390x@nongnu.org, Ilya Leoshkevich Subject: [PULL 07/22] target/s390x: Simplify help_branch Date: Wed, 29 May 2024 12:54:39 +0200 Message-ID: <20240529105454.1149225-8-thuth@redhat.com> In-Reply-To: <20240529105454.1149225-1-thuth@redhat.com> References: <20240529105454.1149225-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 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=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.036, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1716980265663100003 Content-Type: text/plain; charset="utf-8" From: Richard Henderson Always use a tcg branch, instead of movcond. The movcond was not a bad idea before PER was added, but since then we have either 2 or 3 actions to perform on each leg of the branch, and multiple movcond is inefficient. Reorder the taken branch to be fallthrough of the tcg branch. Reviewed-by: Ilya Leoshkevich Signed-off-by: Richard Henderson Message-ID: <20240502054417.234340-8-richard.henderson@linaro.org> Signed-off-by: Thomas Huth --- target/s390x/tcg/translate.c | 152 ++++++++++++----------------------- 1 file changed, 50 insertions(+), 102 deletions(-) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index 7ae928c3b0..78066aaf84 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -353,25 +353,6 @@ static void per_branch(DisasContext *s, bool to_next) #endif } =20 -static void per_branch_cond(DisasContext *s, TCGCond cond, - TCGv_i64 arg1, TCGv_i64 arg2) -{ -#ifndef CONFIG_USER_ONLY - if (s->base.tb->flags & FLAG_MASK_PER_BRANCH) { - TCGLabel *lab =3D gen_new_label(); - tcg_gen_brcond_i64(tcg_invert_cond(cond), arg1, arg2, lab); - - tcg_gen_movi_i64(gbea, s->base.pc_next); - gen_helper_per_branch(tcg_env, gbea, psw_addr); - - gen_set_label(lab); - } else { - TCGv_i64 pc =3D tcg_constant_i64(s->base.pc_next); - tcg_gen_movcond_i64(cond, gbea, arg1, arg2, gbea, pc); - } -#endif -} - static void per_breaking_event(DisasContext *s) { tcg_gen_movi_i64(gbea, s->base.pc_next); @@ -1128,14 +1109,12 @@ static DisasJumpType help_goto_indirect(DisasContex= t *s, TCGv_i64 dest) static DisasJumpType help_branch(DisasContext *s, DisasCompare *c, bool is_imm, int imm, TCGv_i64 cdest) { - DisasJumpType ret; uint64_t dest =3D s->base.pc_next + (int64_t)imm * 2; - TCGLabel *lab; + TCGLabel *lab, *over; =20 /* Take care of the special cases first. */ if (c->cond =3D=3D TCG_COND_NEVER) { - ret =3D DISAS_NEXT; - goto egress; + return DISAS_NEXT; } if (is_imm) { /* @@ -1145,104 +1124,73 @@ static DisasJumpType help_branch(DisasContext *s, = DisasCompare *c, if (c->cond =3D=3D TCG_COND_ALWAYS || (dest =3D=3D s->pc_tmp && !(s->base.tb->flags & FLAG_MASK_PER_BRANCH))) { - ret =3D help_goto_direct(s, dest); - goto egress; + return help_goto_direct(s, dest); } } else { if (!cdest) { /* E.g. bcr %r0 -> no branch. */ - ret =3D DISAS_NEXT; - goto egress; + return DISAS_NEXT; } if (c->cond =3D=3D TCG_COND_ALWAYS) { - ret =3D help_goto_indirect(s, cdest); - goto egress; + return help_goto_indirect(s, cdest); } } =20 - if (use_goto_tb(s, s->pc_tmp)) { - if (is_imm && use_goto_tb(s, dest)) { - /* Both exits can use goto_tb. */ - update_cc_op(s); - - lab =3D gen_new_label(); - if (c->is_64) { - tcg_gen_brcond_i64(c->cond, c->u.s64.a, c->u.s64.b, lab); - } else { - tcg_gen_brcond_i32(c->cond, c->u.s32.a, c->u.s32.b, lab); - } - - /* Branch not taken. */ - tcg_gen_goto_tb(0); - tcg_gen_movi_i64(psw_addr, s->pc_tmp); - tcg_gen_exit_tb(s->base.tb, 0); - - /* Branch taken. */ - gen_set_label(lab); - per_breaking_event(s); - tcg_gen_goto_tb(1); - tcg_gen_movi_i64(psw_addr, dest); - tcg_gen_exit_tb(s->base.tb, 1); + update_cc_op(s); =20 - ret =3D DISAS_NORETURN; - } else { - /* Fallthru can use goto_tb, but taken branch cannot. */ - /* Store taken branch destination before the brcond. This - avoids having to allocate a new local temp to hold it. - We'll overwrite this in the not taken case anyway. */ - if (!is_imm) { - tcg_gen_mov_i64(psw_addr, cdest); - } + /* + * Ensure the taken branch is fall-through of the tcg branch. + * This keeps @cdest usage within the extended basic block, + * which avoids an otherwise unnecessary spill to the stack. + */ + lab =3D gen_new_label(); + if (s->base.tb->flags & FLAG_MASK_PER_BRANCH) { + over =3D gen_new_label(); + } else { + over =3D NULL; + } =20 - lab =3D gen_new_label(); - if (c->is_64) { - tcg_gen_brcond_i64(c->cond, c->u.s64.a, c->u.s64.b, lab); - } else { - tcg_gen_brcond_i32(c->cond, c->u.s32.a, c->u.s32.b, lab); - } + if (c->is_64) { + tcg_gen_brcond_i64(tcg_invert_cond(c->cond), + c->u.s64.a, c->u.s64.b, lab); + } else { + tcg_gen_brcond_i32(tcg_invert_cond(c->cond), + c->u.s32.a, c->u.s32.b, lab); + } =20 - /* Branch not taken. */ - update_cc_op(s); - tcg_gen_goto_tb(0); - tcg_gen_movi_i64(psw_addr, s->pc_tmp); - tcg_gen_exit_tb(s->base.tb, 0); + /* Branch taken. */ + if (is_imm) { + tcg_gen_movi_i64(psw_addr, dest); + } else { + tcg_gen_mov_i64(psw_addr, cdest); + } + per_branch(s, false); =20 - gen_set_label(lab); - if (is_imm) { - tcg_gen_movi_i64(psw_addr, dest); - } - per_breaking_event(s); - ret =3D DISAS_PC_UPDATED; - } + if (is_imm && use_goto_tb(s, dest)) { + tcg_gen_goto_tb(0); + tcg_gen_exit_tb(s->base.tb, 0); + } else if (over) { + tcg_gen_br(over); } else { - /* Fallthru cannot use goto_tb. This by itself is vanishingly rar= e. - Most commonly we're single-stepping or some other condition that - disables all use of goto_tb. Just update the PC and exit. */ + tcg_gen_lookup_and_goto_ptr(); + } =20 - TCGv_i64 next =3D tcg_constant_i64(s->pc_tmp); - if (is_imm) { - cdest =3D tcg_constant_i64(dest); - } + gen_set_label(lab); =20 - if (c->is_64) { - tcg_gen_movcond_i64(c->cond, psw_addr, c->u.s64.a, c->u.s64.b, - cdest, next); - per_branch_cond(s, c->cond, c->u.s64.a, c->u.s64.b); - } else { - TCGv_i32 t0 =3D tcg_temp_new_i32(); - TCGv_i64 t1 =3D tcg_temp_new_i64(); - TCGv_i64 z =3D tcg_constant_i64(0); - tcg_gen_setcond_i32(c->cond, t0, c->u.s32.a, c->u.s32.b); - tcg_gen_extu_i32_i64(t1, t0); - tcg_gen_movcond_i64(TCG_COND_NE, psw_addr, t1, z, cdest, next); - per_branch_cond(s, TCG_COND_NE, t1, z); - } + /* Branch not taken. */ + tcg_gen_movi_i64(psw_addr, s->pc_tmp); + if (use_goto_tb(s, s->pc_tmp)) { + tcg_gen_goto_tb(1); + tcg_gen_exit_tb(s->base.tb, 1); + } =20 - ret =3D DISAS_PC_UPDATED; + if (over) { + gen_set_label(over); + return DISAS_PC_UPDATED; } =20 - egress: - return ret; + tcg_gen_lookup_and_goto_ptr(); + return DISAS_NORETURN; } =20 /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */ --=20 2.45.1 From nobody Mon Nov 25 05:00:28 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1716980275; cv=none; d=zohomail.com; s=zohoarc; b=Pzh91QVxoaUc/fZZOVNZ5C/QRe38SK7t2wGu73BIdvHALC+bYEwwW7eKDNTGpyTEpoIY/ENJbX+5svgiIF87+QLMgIK3vIf9D2rs9PEUR2UbW16ZHyIGvwACukKirDTOImoqhyVOpRlRlxvqfJq4WfUHGy3Knw7pai3ONUjGXLQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716980275; 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=gknOSq6mBkdlS86zMGskf2jg0fArR/rEv32THgzOXP0=; b=CVGNA9jeVVxt8TJ1A6ew2h5mMtSx+au2Z4qW1QLc2rQ0nkDB6e8/ayT1XsNqU3uNjPAs6O5UGLOgD3slKEaLOGwyt1eEzhIxEZKg2Kk0H2t0RHJGiA2Ml1mz6fIadmyhGjA1NDYvWRrJIoCD35tAOV+VJ/UVFjAhFLPdFxO9B5M= 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 1716980275416514.1781194332015; Wed, 29 May 2024 03:57:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCGxl-0004fg-AU; Wed, 29 May 2024 06:55:21 -0400 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 1sCGxk-0004dR-Ax for qemu-devel@nongnu.org; Wed, 29 May 2024 06:55:20 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sCGxh-0003AG-J6 for qemu-devel@nongnu.org; Wed, 29 May 2024 06:55:19 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-456-cCy01XHmP5Kk652QzKPBcg-1; Wed, 29 May 2024 06:55:12 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 35F84101A52C; Wed, 29 May 2024 10:55:12 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id C1753105480A; Wed, 29 May 2024 10:55:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716980117; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gknOSq6mBkdlS86zMGskf2jg0fArR/rEv32THgzOXP0=; b=Tmm7hFwt17L/5aMMmOb7o4UAkjOGOeS2fpmGKB1EPSzxVKUvi/QbQMfRWVk9NJ8/+HTMIl pnsAXKvrVJisa6aNs5DWp5ezh3GuJE4C2Dd0MA6ZfbZ4MZ9SpOqp9wmC/8A0D0jD7UCFTu aa8pHUj0nd5fkP9L2+c/LS5JgLEiqYE= X-MC-Unique: cCy01XHmP5Kk652QzKPBcg-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: qemu-s390x@nongnu.org, Ilya Leoshkevich Subject: [PULL 08/22] target/s390x: Split per_breaking_event from per_branch_* Date: Wed, 29 May 2024 12:54:40 +0200 Message-ID: <20240529105454.1149225-9-thuth@redhat.com> In-Reply-To: <20240529105454.1149225-1-thuth@redhat.com> References: <20240529105454.1149225-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 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=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.036, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1716980275661100001 Content-Type: text/plain; charset="utf-8" From: Richard Henderson The breaking-event-address register is updated regardless of PER being enabled. Reviewed-by: Ilya Leoshkevich Signed-off-by: Richard Henderson Message-ID: <20240502054417.234340-9-richard.henderson@linaro.org> Signed-off-by: Thomas Huth --- target/s390x/tcg/translate.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index 78066aaf84..10d5e87bb4 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -344,8 +344,6 @@ static void update_psw_addr(DisasContext *s) static void per_branch(DisasContext *s, bool to_next) { #ifndef CONFIG_USER_ONLY - tcg_gen_movi_i64(gbea, s->base.pc_next); - if (s->base.tb->flags & FLAG_MASK_PER_BRANCH) { TCGv_i64 next_pc =3D to_next ? tcg_constant_i64(s->pc_tmp) : psw_a= ddr; gen_helper_per_branch(tcg_env, gbea, next_pc); @@ -1081,13 +1079,13 @@ struct DisasInsn { =20 static DisasJumpType help_goto_direct(DisasContext *s, uint64_t dest) { + per_breaking_event(s); if (dest =3D=3D s->pc_tmp) { per_branch(s, true); return DISAS_NEXT; } if (use_goto_tb(s, dest)) { update_cc_op(s); - per_breaking_event(s); tcg_gen_goto_tb(0); tcg_gen_movi_i64(psw_addr, dest); tcg_gen_exit_tb(s->base.tb, 0); @@ -1101,6 +1099,7 @@ static DisasJumpType help_goto_direct(DisasContext *s= , uint64_t dest) =20 static DisasJumpType help_goto_indirect(DisasContext *s, TCGv_i64 dest) { + per_breaking_event(s); tcg_gen_mov_i64(psw_addr, dest); per_branch(s, false); return DISAS_PC_UPDATED; @@ -1159,6 +1158,7 @@ static DisasJumpType help_branch(DisasContext *s, Dis= asCompare *c, } =20 /* Branch taken. */ + per_breaking_event(s); if (is_imm) { tcg_gen_movi_i64(psw_addr, dest); } else { --=20 2.45.1 From nobody Mon Nov 25 05:00:28 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1716980223; cv=none; d=zohomail.com; s=zohoarc; b=nYGmoyWhilCWHRpsezUP/qVmWoMlALV6CtnZeSH7oJjVtS2KN4TRjx2mn6dOOgTQA0FpnD5A/IQ4OMc3pFreRyRu4TktpR7wTaf/NBaA7uwsRdBio9HbZ52xQFtS2Ft34P/uxo0iptyYXdDnXkmdW1L60ceosK5QPWB8UWSepZc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716980223; 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=0AQXYEtcVI6/Y12JuGhNhZ2X3MyKxepRUo0Y0p+OHaI=; b=Pi/cBcfPjwC2i83683j3ogNoO9k5j0RbDNK8IJtekacxf0sbaaWtU3XaRrEmM5fTw87IXbJBdVctFhgiAl8EvfeAlV11Qs3vPoaM47XrDMSnC1V8GjB5EAZ44mra4u2LqcCYSDFknBss3q5tXGjHXpGS7CWni3TaE0lV02n7CZY= 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 1716980223606658.6898330124114; Wed, 29 May 2024 03:57:03 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCGxo-0004hE-Qn; Wed, 29 May 2024 06:55:24 -0400 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 1sCGxm-0004gC-OZ for qemu-devel@nongnu.org; Wed, 29 May 2024 06:55:22 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sCGxj-0003Al-Ut for qemu-devel@nongnu.org; Wed, 29 May 2024 06:55:22 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-611-clv9HW3kOwiRZVwYAIjmxQ-1; Wed, 29 May 2024 06:55:15 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7276E8008A4; Wed, 29 May 2024 10:55:15 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id 74DE4105480A; Wed, 29 May 2024 10:55:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716980119; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0AQXYEtcVI6/Y12JuGhNhZ2X3MyKxepRUo0Y0p+OHaI=; b=ECIrlKf2e87LIUQMVPd/h18olTjrOBajbJkezkl9gp/QtYKb9318vP0KI99m7bqZJHRc9j BkIPmTxBeZG1o+Jp+cZwB5i5X43sJ6zLfbEljYItG2N92p4+auAZAG+STlA6FwZlkGCtTx fOvwLZffBvpMmAqMlBJvzJ5ISHmqMP8= X-MC-Unique: clv9HW3kOwiRZVwYAIjmxQ-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: qemu-s390x@nongnu.org Subject: [PULL 09/22] target/s390x: Raise exception from helper_per_branch Date: Wed, 29 May 2024 12:54:41 +0200 Message-ID: <20240529105454.1149225-10-thuth@redhat.com> In-Reply-To: <20240529105454.1149225-1-thuth@redhat.com> References: <20240529105454.1149225-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 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=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.036, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1716980225219100005 Content-Type: text/plain; charset="utf-8" From: Richard Henderson Drop from argument, since gbea has always been updated with this address. Add ilen argument for setting int_pgm_ilen. Use update_cc_op before calling per_branch. By raising the exception here, we need not call per_check_exception later, which means we can clean up the normal non-exception branch path. Signed-off-by: Richard Henderson Message-ID: <20240502054417.234340-10-richard.henderson@linaro.org> Signed-off-by: Thomas Huth --- target/s390x/helper.h | 2 +- target/s390x/tcg/misc_helper.c | 15 +++++++---- target/s390x/tcg/translate.c | 48 ++++++++++++---------------------- 3 files changed, 27 insertions(+), 38 deletions(-) diff --git a/target/s390x/helper.h b/target/s390x/helper.h index 96ab71e877..061b379065 100644 --- a/target/s390x/helper.h +++ b/target/s390x/helper.h @@ -360,7 +360,7 @@ DEF_HELPER_FLAGS_1(ptlb, TCG_CALL_NO_RWG, void, env) DEF_HELPER_FLAGS_1(purge, TCG_CALL_NO_RWG, void, env) DEF_HELPER_3(lra, i64, env, i64, i64) DEF_HELPER_FLAGS_3(per_check_exception, TCG_CALL_NO_WG, void, env, i64, i3= 2) -DEF_HELPER_FLAGS_3(per_branch, TCG_CALL_NO_RWG, void, env, i64, i64) +DEF_HELPER_FLAGS_3(per_branch, TCG_CALL_NO_WG, void, env, i64, i32) DEF_HELPER_FLAGS_2(per_ifetch, TCG_CALL_NO_RWG, void, env, i64) DEF_HELPER_FLAGS_1(per_store_real, TCG_CALL_NO_RWG, void, env) DEF_HELPER_FLAGS_1(stfl, TCG_CALL_NO_RWG, void, env) diff --git a/target/s390x/tcg/misc_helper.c b/target/s390x/tcg/misc_helper.c index 3f94f71437..974d14703c 100644 --- a/target/s390x/tcg/misc_helper.c +++ b/target/s390x/tcg/misc_helper.c @@ -625,13 +625,18 @@ static inline bool get_per_in_range(CPUS390XState *en= v, uint64_t addr) } } =20 -void HELPER(per_branch)(CPUS390XState *env, uint64_t from, uint64_t to) +void HELPER(per_branch)(CPUS390XState *env, uint64_t dest, uint32_t ilen) { - if (!(env->cregs[9] & PER_CR9_CONTROL_BRANCH_ADDRESS) - || get_per_in_range(env, to)) { - env->per_address =3D from; - env->per_perc_atmid =3D PER_CODE_EVENT_BRANCH | get_per_atmid(env); + if ((env->cregs[9] & PER_CR9_CONTROL_BRANCH_ADDRESS) + && !get_per_in_range(env, dest)) { + return; } + + env->psw.addr =3D dest; + env->int_pgm_ilen =3D ilen; + env->per_address =3D env->gbea; + env->per_perc_atmid =3D PER_CODE_EVENT_BRANCH | get_per_atmid(env); + per_raise_exception_log(env); } =20 void HELPER(per_ifetch)(CPUS390XState *env, uint64_t addr) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index 10d5e87bb4..de029185e0 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -341,12 +341,11 @@ static void update_psw_addr(DisasContext *s) tcg_gen_movi_i64(psw_addr, s->base.pc_next); } =20 -static void per_branch(DisasContext *s, bool to_next) +static void per_branch(DisasContext *s, TCGv_i64 dest) { #ifndef CONFIG_USER_ONLY if (s->base.tb->flags & FLAG_MASK_PER_BRANCH) { - TCGv_i64 next_pc =3D to_next ? tcg_constant_i64(s->pc_tmp) : psw_a= ddr; - gen_helper_per_branch(tcg_env, gbea, next_pc); + gen_helper_per_branch(tcg_env, dest, tcg_constant_i32(s->ilen)); } #endif } @@ -635,9 +634,6 @@ static void gen_op_calc_cc(DisasContext *s) =20 static bool use_goto_tb(DisasContext *s, uint64_t dest) { - if (unlikely(s->base.tb->flags & FLAG_MASK_PER_BRANCH)) { - return false; - } return translator_use_goto_tb(&s->base, dest); } =20 @@ -1079,37 +1075,38 @@ struct DisasInsn { =20 static DisasJumpType help_goto_direct(DisasContext *s, uint64_t dest) { + update_cc_op(s); per_breaking_event(s); + per_branch(s, tcg_constant_i64(dest)); + if (dest =3D=3D s->pc_tmp) { - per_branch(s, true); return DISAS_NEXT; } if (use_goto_tb(s, dest)) { - update_cc_op(s); tcg_gen_goto_tb(0); tcg_gen_movi_i64(psw_addr, dest); tcg_gen_exit_tb(s->base.tb, 0); return DISAS_NORETURN; } else { tcg_gen_movi_i64(psw_addr, dest); - per_branch(s, false); - return DISAS_PC_UPDATED; + return DISAS_PC_CC_UPDATED; } } =20 static DisasJumpType help_goto_indirect(DisasContext *s, TCGv_i64 dest) { + update_cc_op(s); per_breaking_event(s); tcg_gen_mov_i64(psw_addr, dest); - per_branch(s, false); - return DISAS_PC_UPDATED; + per_branch(s, psw_addr); + return DISAS_PC_CC_UPDATED; } =20 static DisasJumpType help_branch(DisasContext *s, DisasCompare *c, bool is_imm, int imm, TCGv_i64 cdest) { uint64_t dest =3D s->base.pc_next + (int64_t)imm * 2; - TCGLabel *lab, *over; + TCGLabel *lab; =20 /* Take care of the special cases first. */ if (c->cond =3D=3D TCG_COND_NEVER) { @@ -1143,12 +1140,6 @@ static DisasJumpType help_branch(DisasContext *s, Di= sasCompare *c, * which avoids an otherwise unnecessary spill to the stack. */ lab =3D gen_new_label(); - if (s->base.tb->flags & FLAG_MASK_PER_BRANCH) { - over =3D gen_new_label(); - } else { - over =3D NULL; - } - if (c->is_64) { tcg_gen_brcond_i64(tcg_invert_cond(c->cond), c->u.s64.a, c->u.s64.b, lab); @@ -1164,13 +1155,11 @@ static DisasJumpType help_branch(DisasContext *s, D= isasCompare *c, } else { tcg_gen_mov_i64(psw_addr, cdest); } - per_branch(s, false); + per_branch(s, psw_addr); =20 if (is_imm && use_goto_tb(s, dest)) { tcg_gen_goto_tb(0); tcg_gen_exit_tb(s->base.tb, 0); - } else if (over) { - tcg_gen_br(over); } else { tcg_gen_lookup_and_goto_ptr(); } @@ -1182,15 +1171,9 @@ static DisasJumpType help_branch(DisasContext *s, Di= sasCompare *c, if (use_goto_tb(s, s->pc_tmp)) { tcg_gen_goto_tb(1); tcg_gen_exit_tb(s->base.tb, 1); + return DISAS_NORETURN; } - - if (over) { - gen_set_label(over); - return DISAS_PC_UPDATED; - } - - tcg_gen_lookup_and_goto_ptr(); - return DISAS_NORETURN; + return DISAS_PC_CC_UPDATED; } =20 /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */ @@ -6372,7 +6355,8 @@ static DisasJumpType translate_one(CPUS390XState *env= , DisasContext *s) } =20 #ifndef CONFIG_USER_ONLY - if (s->base.tb->flags & FLAG_MASK_PER) { + if (s->base.tb->flags & (FLAG_MASK_PER_STORE_REAL | + FLAG_MASK_PER_IFETCH)) { TCGv_i64 next_pc =3D psw_addr; =20 if (ret =3D=3D DISAS_NEXT || ret =3D=3D DISAS_TOO_MANY) { @@ -6402,7 +6386,7 @@ static void s390x_tr_init_disas_context(DisasContextB= ase *dcbase, CPUState *cs) =20 dc->cc_op =3D CC_OP_DYNAMIC; dc->ex_value =3D dc->base.tb->cs_base; - dc->exit_to_mainloop =3D (dc->base.tb->flags & FLAG_MASK_PER) || dc->e= x_value; + dc->exit_to_mainloop =3D dc->ex_value; } =20 static void s390x_tr_tb_start(DisasContextBase *db, CPUState *cs) --=20 2.45.1 From nobody Mon Nov 25 05:00:28 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1716980212; cv=none; d=zohomail.com; s=zohoarc; b=NsLd2M3EkdNpoG/pyqqZ0nN3OlJRBDSLZkCaPqaflvT9D7tJU8MoHSub3ojKDytTqenqETnx0JFWs9469teJQfrBcKtgcu/T8vy9Yb6eZQKGCHXAvSSc2G+HIWJ3KGFyKOjLgAoCyT2M6W0/NEDb1Hg1RezQsyDz6DuJqGDDUfE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716980212; 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=yc9I/Tyn702qLgVI+8AQi35YjeMvPXJqOmiU2hephSc=; b=LIixV8DSqODWpaEu/qLXlCe5Wr3LRrIdo32A3e3XomJlUqaR/veG4ZJSSD/NENtK5Ml54/xrqtnc6rKXlGw6q+CDy7Yd/6BJYV3tyCD+UmRJdsJLlHdM/nqmBTlKvbdxly2svduW1kO/owIKwMkAEmLXZdvss8VYACQD7ABXVy4= 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 1716980212269358.18449643794713; Wed, 29 May 2024 03:56:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCGxo-0004hI-Rn; Wed, 29 May 2024 06:55:24 -0400 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 1sCGxn-0004gf-KD for qemu-devel@nongnu.org; Wed, 29 May 2024 06:55:23 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sCGxl-0003B0-HR for qemu-devel@nongnu.org; Wed, 29 May 2024 06:55:23 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-569-N95wLpp6Ofifk1PBHOr8CA-1; Wed, 29 May 2024 06:55:17 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 019353806701; Wed, 29 May 2024 10:55:17 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id E85E8105480A; Wed, 29 May 2024 10:55:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716980119; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yc9I/Tyn702qLgVI+8AQi35YjeMvPXJqOmiU2hephSc=; b=SFOvDKrS/jJ6/EKk5Dh2ot5OOsTvjxstvrj5Cyi58L1QeNJAwCMSxFTSLJtvlc9AuPXLXH 4nLabgaEtfFt86+wLBgkusDM1ztbmvdSOw9nM2iR7kYcurRjohApj3L8GNRWeTb7pZ7D5N COy/DOfP7495H3OGRrYuhp1FNUVmn5I= X-MC-Unique: N95wLpp6Ofifk1PBHOr8CA-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: qemu-s390x@nongnu.org Subject: [PULL 10/22] target/s390x: Raise exception from per_store_real Date: Wed, 29 May 2024 12:54:42 +0200 Message-ID: <20240529105454.1149225-11-thuth@redhat.com> In-Reply-To: <20240529105454.1149225-1-thuth@redhat.com> References: <20240529105454.1149225-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 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=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.036, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1716980213923100003 Content-Type: text/plain; charset="utf-8" From: Richard Henderson At this point the instruction is complete and there's nothing left to do but raise the exception. With this change we need not make two helper calls for this event. Signed-off-by: Richard Henderson Message-ID: <20240502054417.234340-11-richard.henderson@linaro.org> Signed-off-by: Thomas Huth --- target/s390x/helper.h | 2 +- target/s390x/tcg/misc_helper.c | 4 +++- target/s390x/tcg/translate.c | 7 ++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/target/s390x/helper.h b/target/s390x/helper.h index 061b379065..5611155ba1 100644 --- a/target/s390x/helper.h +++ b/target/s390x/helper.h @@ -362,7 +362,7 @@ DEF_HELPER_3(lra, i64, env, i64, i64) DEF_HELPER_FLAGS_3(per_check_exception, TCG_CALL_NO_WG, void, env, i64, i3= 2) DEF_HELPER_FLAGS_3(per_branch, TCG_CALL_NO_WG, void, env, i64, i32) DEF_HELPER_FLAGS_2(per_ifetch, TCG_CALL_NO_RWG, void, env, i64) -DEF_HELPER_FLAGS_1(per_store_real, TCG_CALL_NO_RWG, void, env) +DEF_HELPER_FLAGS_2(per_store_real, TCG_CALL_NO_WG, noreturn, env, i32) DEF_HELPER_FLAGS_1(stfl, TCG_CALL_NO_RWG, void, env) =20 DEF_HELPER_2(xsch, void, env, i64) diff --git a/target/s390x/tcg/misc_helper.c b/target/s390x/tcg/misc_helper.c index 974d14703c..43cacc448f 100644 --- a/target/s390x/tcg/misc_helper.c +++ b/target/s390x/tcg/misc_helper.c @@ -660,11 +660,13 @@ void HELPER(per_ifetch)(CPUS390XState *env, uint64_t = addr) } } =20 -void HELPER(per_store_real)(CPUS390XState *env) +void HELPER(per_store_real)(CPUS390XState *env, uint32_t ilen) { /* PSW is saved just before calling the helper. */ env->per_address =3D env->psw.addr; + env->int_pgm_ilen =3D ilen; env->per_perc_atmid =3D PER_CODE_EVENT_STORE_REAL | get_per_atmid(env); + per_raise_exception_log(env); } #endif =20 diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index de029185e0..5bb15a46e0 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -4342,8 +4342,10 @@ static DisasJumpType op_stura(DisasContext *s, Disas= Ops *o) tcg_gen_qemu_st_tl(o->in1, o->in2, MMU_REAL_IDX, s->insn->data); =20 if (s->base.tb->flags & FLAG_MASK_PER_STORE_REAL) { + update_cc_op(s); update_psw_addr(s); - gen_helper_per_store_real(tcg_env); + gen_helper_per_store_real(tcg_env, tcg_constant_i32(s->ilen)); + return DISAS_NORETURN; } return DISAS_NEXT; } @@ -6355,8 +6357,7 @@ static DisasJumpType translate_one(CPUS390XState *env= , DisasContext *s) } =20 #ifndef CONFIG_USER_ONLY - if (s->base.tb->flags & (FLAG_MASK_PER_STORE_REAL | - FLAG_MASK_PER_IFETCH)) { + if (s->base.tb->flags & FLAG_MASK_PER_IFETCH) { TCGv_i64 next_pc =3D psw_addr; =20 if (ret =3D=3D DISAS_NEXT || ret =3D=3D DISAS_TOO_MANY) { --=20 2.45.1 From nobody Mon Nov 25 05:00:28 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1716980290; cv=none; d=zohomail.com; s=zohoarc; b=RG1XheKowK+wLLfkECzM+v8kVwnYz6B99d8WaX2CMse7XCHIihDHegUNABN6hDvWbRwwq8Wm6+MoyivbYRh+0cIOKYNtdMUsnxzo8RyTeGX52xrtfuf/V6xfJmQ9gjQlw92SPiX+FZiW2C+sj5s/T0X+NtYKVih/GoA9R6HPHqA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716980290; 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=fKqAyedJK102xoKRLOb8cGk2nvEouv/xEZiHXtiQENY=; b=iW442WoZ3PD9qz6WYk8cSu/r1YYGXWTUf84IaRj5oh4Ddr+2GdtG/+9wk/dBCl2timD3AA7L3nmeVwAs84H4NONRJ9ml79QHDTpU/o96NTANBXXtTwwf+A65EcAcfQk/dwsgCE8FFkd1r4+pAPQJjC0FM/0xbcWQqihM2ZIUKsA= 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 1716980290893143.49029729831125; Wed, 29 May 2024 03:58:10 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCGxs-0004jG-19; Wed, 29 May 2024 06:55:28 -0400 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 1sCGxp-0004hk-PE for qemu-devel@nongnu.org; Wed, 29 May 2024 06:55:26 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sCGxn-0003EL-VN for qemu-devel@nongnu.org; Wed, 29 May 2024 06:55:25 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-6-F3n2VNDXOBaoQeEGZmN_Nw-1; Wed, 29 May 2024 06:55:18 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A0ACF1C0512D; Wed, 29 May 2024 10:55:18 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7A66F105480A; Wed, 29 May 2024 10:55:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716980122; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fKqAyedJK102xoKRLOb8cGk2nvEouv/xEZiHXtiQENY=; b=TBqoYUldbJozW7pGG1AcDqdET2iy2xM2I8AAYcWhG8DI+ruA0BvI8b6yg3TIp43fDbccMR 8OuvT0T502wO9fKC498D6WTUTJouez6stSHOgmyAJaJ8gPmbFRQPKrRUdNAV66rwxDIC04 fkli2szs7xEZdBg9+KMr2hwy7Ws6sM0= X-MC-Unique: F3n2VNDXOBaoQeEGZmN_Nw-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: qemu-s390x@nongnu.org, David Hildenbrand Subject: [PULL 11/22] target/s390x: Fix helper_per_ifetch flags Date: Wed, 29 May 2024 12:54:43 +0200 Message-ID: <20240529105454.1149225-12-thuth@redhat.com> In-Reply-To: <20240529105454.1149225-1-thuth@redhat.com> References: <20240529105454.1149225-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 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=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.036, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 @redhat.com) X-ZM-MESSAGEID: 1716980291727100005 Content-Type: text/plain; charset="utf-8" From: Richard Henderson CPU state is read on the exception path. Fixes: 83bb161299c ("target-s390x: PER instruction-fetch nullification even= t support") Signed-off-by: Richard Henderson Reviewed-by: David Hildenbrand Message-ID: <20240502054417.234340-12-richard.henderson@linaro.org> Signed-off-by: Thomas Huth --- target/s390x/helper.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/s390x/helper.h b/target/s390x/helper.h index 5611155ba1..31bd193322 100644 --- a/target/s390x/helper.h +++ b/target/s390x/helper.h @@ -361,7 +361,7 @@ DEF_HELPER_FLAGS_1(purge, TCG_CALL_NO_RWG, void, env) DEF_HELPER_3(lra, i64, env, i64, i64) DEF_HELPER_FLAGS_3(per_check_exception, TCG_CALL_NO_WG, void, env, i64, i3= 2) DEF_HELPER_FLAGS_3(per_branch, TCG_CALL_NO_WG, void, env, i64, i32) -DEF_HELPER_FLAGS_2(per_ifetch, TCG_CALL_NO_RWG, void, env, i64) +DEF_HELPER_FLAGS_2(per_ifetch, TCG_CALL_NO_WG, void, env, i64) DEF_HELPER_FLAGS_2(per_store_real, TCG_CALL_NO_WG, noreturn, env, i32) DEF_HELPER_FLAGS_1(stfl, TCG_CALL_NO_RWG, void, env) =20 --=20 2.45.1 From nobody Mon Nov 25 05:00:28 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1716980290; cv=none; d=zohomail.com; s=zohoarc; b=JrKHP+6d8VuFJEvAX2WgfwHew5eRUEUpCwnbVT4gyzVfWtji9vd6Evq81dMogkZM3pucVsu8jOBAD92NN52cDFZBP7msYh7UqYXO2ZlvMezovfbs5ZA1ODwaRE+xsi56GisJRzttjuc6yk9PerFeeH3bdy5PqVlW/l2CcLF7sdc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716980290; 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=ivIpsfOlJxFdI0h0TITtXjCjV49diKYNRKwCuXImVts=; b=eY8IGMvjoiw8hhFMOL8ca1HJepQww7iJooaVC+gomsVnNM/PnLp5rJ2xSZ7SQAqH/q6+7a4NzmXKTqd5fwiXsLZa9luA7ZItUZzDm85dNc/91Q0QCrgQD6HAHMpv0HF8M+mvgD+xZ4KhWSu3Ndsfu9Wl+bLNFGDhQMH0w8TlpEY= 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 1716980290170672.6432848130585; Wed, 29 May 2024 03:58:10 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCGxt-0004jg-21; Wed, 29 May 2024 06:55:29 -0400 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 1sCGxr-0004ix-D8 for qemu-devel@nongnu.org; Wed, 29 May 2024 06:55:27 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sCGxp-0003Fw-Jw for qemu-devel@nongnu.org; Wed, 29 May 2024 06:55:27 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-655-6IvZQDQQM9yfccyyo_oMbg-1; Wed, 29 May 2024 06:55:21 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CA19B800169; Wed, 29 May 2024 10:55:20 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id 44BFE105480A; Wed, 29 May 2024 10:55:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716980124; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ivIpsfOlJxFdI0h0TITtXjCjV49diKYNRKwCuXImVts=; b=ecWy6084i+p9MPPDe92eS18UQ7HhgcmjdHWfEXMTBgyeEazl6e4Vwj17lnKptH5D0xY0y+ mv4fMjBO9CXj6/r6Mb56NNlO+fkhz8KYeyCeii5TyFN1CLktRuletb+igguK1C2aCr3PYk odryJpYtdOLyagYVTK5fkco7CJoWBoA= X-MC-Unique: 6IvZQDQQM9yfccyyo_oMbg-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: qemu-s390x@nongnu.org Subject: [PULL 12/22] target/s390x: Simplify per_ifetch, per_check_exception Date: Wed, 29 May 2024 12:54:44 +0200 Message-ID: <20240529105454.1149225-13-thuth@redhat.com> In-Reply-To: <20240529105454.1149225-1-thuth@redhat.com> References: <20240529105454.1149225-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 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=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.036, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 @redhat.com) X-ZM-MESSAGEID: 1716980291758100007 Content-Type: text/plain; charset="utf-8" From: Richard Henderson Set per_address and ilen in per_ifetch; this is valid for all PER exceptions and will last until the end of the instruction. Therefore we don't need to give the same data to per_check_exception. Signed-off-by: Richard Henderson Message-ID: <20240502054417.234340-13-richard.henderson@linaro.org> [thuth: Silence checkpatch.pl errors] Signed-off-by: Thomas Huth --- target/s390x/helper.h | 4 ++-- target/s390x/tcg/misc_helper.c | 23 +++++++++-------------- target/s390x/tcg/translate.c | 20 ++++++++++++-------- 3 files changed, 23 insertions(+), 24 deletions(-) diff --git a/target/s390x/helper.h b/target/s390x/helper.h index 31bd193322..1a8a76abb9 100644 --- a/target/s390x/helper.h +++ b/target/s390x/helper.h @@ -359,9 +359,9 @@ DEF_HELPER_FLAGS_4(ipte, TCG_CALL_NO_RWG, void, env, i6= 4, i64, i32) DEF_HELPER_FLAGS_1(ptlb, TCG_CALL_NO_RWG, void, env) DEF_HELPER_FLAGS_1(purge, TCG_CALL_NO_RWG, void, env) DEF_HELPER_3(lra, i64, env, i64, i64) -DEF_HELPER_FLAGS_3(per_check_exception, TCG_CALL_NO_WG, void, env, i64, i3= 2) +DEF_HELPER_FLAGS_1(per_check_exception, TCG_CALL_NO_WG, void, env) DEF_HELPER_FLAGS_3(per_branch, TCG_CALL_NO_WG, void, env, i64, i32) -DEF_HELPER_FLAGS_2(per_ifetch, TCG_CALL_NO_WG, void, env, i64) +DEF_HELPER_FLAGS_2(per_ifetch, TCG_CALL_NO_WG, void, env, i32) DEF_HELPER_FLAGS_2(per_store_real, TCG_CALL_NO_WG, noreturn, env, i32) DEF_HELPER_FLAGS_1(stfl, TCG_CALL_NO_RWG, void, env) =20 diff --git a/target/s390x/tcg/misc_helper.c b/target/s390x/tcg/misc_helper.c index 43cacc448f..303f86d363 100644 --- a/target/s390x/tcg/misc_helper.c +++ b/target/s390x/tcg/misc_helper.c @@ -604,12 +604,10 @@ static G_NORETURN void per_raise_exception_log(CPUS39= 0XState *env) per_raise_exception(env); } =20 -void HELPER(per_check_exception)(CPUS390XState *env, uint64_t next_pc, - uint32_t ilen) +void HELPER(per_check_exception)(CPUS390XState *env) { + /* psw_addr, per_address and int_pgm_ilen are already set. */ if (unlikely(env->per_perc_atmid)) { - env->psw.addr =3D next_pc; - env->int_pgm_ilen =3D ilen; per_raise_exception_log(env); } } @@ -639,23 +637,20 @@ void HELPER(per_branch)(CPUS390XState *env, uint64_t = dest, uint32_t ilen) per_raise_exception_log(env); } =20 -void HELPER(per_ifetch)(CPUS390XState *env, uint64_t addr) +void HELPER(per_ifetch)(CPUS390XState *env, uint32_t ilen) { - if (get_per_in_range(env, addr)) { - env->per_address =3D addr; + if (get_per_in_range(env, env->psw.addr)) { + env->per_address =3D env->psw.addr; + env->int_pgm_ilen =3D ilen; env->per_perc_atmid =3D PER_CODE_EVENT_IFETCH | get_per_atmid(env); =20 /* If the instruction has to be nullified, trigger the exception immediately. */ if (env->cregs[9] & PER_CR9_EVENT_IFETCH_NULLIFICATION) { - CPUState *cs =3D env_cpu(env); - env->per_perc_atmid |=3D PER_CODE_EVENT_NULLIFICATION; - env->int_pgm_code =3D PGM_PER; - env->int_pgm_ilen =3D get_ilen(cpu_ldub_code(env, addr)); - - cs->exception_index =3D EXCP_PGM; - cpu_loop_exit(cs); + qemu_log_mask(CPU_LOG_INT, "PER interrupt before 0x%" PRIx64 "= \n", + env->per_address); + per_raise_exception(env); } } } diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index 5bb15a46e0..c9a5a1687e 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -6258,8 +6258,8 @@ static DisasJumpType translate_one(CPUS390XState *env= , DisasContext *s) =20 #ifndef CONFIG_USER_ONLY if (s->base.tb->flags & FLAG_MASK_PER_IFETCH) { - TCGv_i64 addr =3D tcg_constant_i64(s->base.pc_next); - gen_helper_per_ifetch(tcg_env, addr); + /* With ifetch set, psw_addr and cc_op are always up-to-date. */ + gen_helper_per_ifetch(tcg_env, tcg_constant_i32(s->ilen)); } #endif =20 @@ -6358,14 +6358,18 @@ static DisasJumpType translate_one(CPUS390XState *e= nv, DisasContext *s) =20 #ifndef CONFIG_USER_ONLY if (s->base.tb->flags & FLAG_MASK_PER_IFETCH) { - TCGv_i64 next_pc =3D psw_addr; - - if (ret =3D=3D DISAS_NEXT || ret =3D=3D DISAS_TOO_MANY) { - next_pc =3D tcg_constant_i64(s->pc_tmp); + switch (ret) { + case DISAS_TOO_MANY: + s->base.is_jmp =3D DISAS_PC_CC_UPDATED; + /* fall through */ + case DISAS_NEXT: + tcg_gen_movi_i64(psw_addr, s->pc_tmp); + break; + default: + break; } update_cc_op(s); - gen_helper_per_check_exception(tcg_env, next_pc, - tcg_constant_i32(s->ilen)); + gen_helper_per_check_exception(tcg_env); } #endif =20 --=20 2.45.1 From nobody Mon Nov 25 05:00:28 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1716980183; cv=none; d=zohomail.com; s=zohoarc; b=HVkvDyvdPHRHwKGKLVPOPdKemTz7Hd8KbYvmebH8FutKPs/Ay0CaYt+iR5L9g3jjBDzVd61OD55F5YXFdjhkFxcgfD+LwWzIkdKTVbm2gUwS0KyqCdQCRXLC2WjNzzEy1x1dwN7z+bAGsC404unXsZVUbBIih/Z41k3KvegrWgM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716980183; 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=nkKDc76J51Qy7WIb1m+w4mnGxgDf9WFrHs7jMDtsBg8=; b=J+IrOLcOFJRKqsEj9SjODvlHA66P/C57cvoNcZUVLiXXzSgxhuKV8CBaz0uLXRb+Yyd8KSoSKNJsC5V8LrYxXyCCych33SM1IF/FNuqvt4v8z79NGYH54icLvGTy5jKElxbw2q8jBU6GW2rBFyCqQoanxdUdUWhuHts4R9Hemwo= 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 1716980183058622.3600085602333; Wed, 29 May 2024 03:56:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCGxu-0004lR-MF; Wed, 29 May 2024 06:55:30 -0400 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 1sCGxs-0004jH-Hr for qemu-devel@nongnu.org; Wed, 29 May 2024 06:55:28 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sCGxq-0003II-PK for qemu-devel@nongnu.org; Wed, 29 May 2024 06:55:28 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-230-k8HMvFfmPwepiMvVr3FH8g-1; Wed, 29 May 2024 06:55:22 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6097781227E; Wed, 29 May 2024 10:55:22 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4E71E105480A; Wed, 29 May 2024 10:55:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716980126; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nkKDc76J51Qy7WIb1m+w4mnGxgDf9WFrHs7jMDtsBg8=; b=FKa7J5ImAFYBz21l8SmAQ6mJGjwo8sZrb6DvsvmpUTGRmCK5CJd1nhBpig/N/DY2UaHBsm 3YOh10Ps2qyDWfjfPu5AOAwbR/6Y2SsCBPxKnKqMjd9sS4LZjv5M8XQSsClk7KOHhX/9+G HwEzxKRpUWTu8sOuCPRwxkgXM0Zipo4= X-MC-Unique: k8HMvFfmPwepiMvVr3FH8g-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: qemu-s390x@nongnu.org Subject: [PULL 13/22] target/s390x: Adjust check of noreturn in translate_one Date: Wed, 29 May 2024 12:54:45 +0200 Message-ID: <20240529105454.1149225-14-thuth@redhat.com> In-Reply-To: <20240529105454.1149225-1-thuth@redhat.com> References: <20240529105454.1149225-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 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=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.036, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1716980185034100007 Content-Type: text/plain; charset="utf-8" From: Richard Henderson If help_op is not set, ret =3D=3D DISAS_NEXT. Shift the test up from surrounding help_wout, help_cout to skipping to out, as we do elsewhere in the function. Signed-off-by: Richard Henderson Message-ID: <20240502054417.234340-14-richard.henderson@linaro.org> Signed-off-by: Thomas Huth --- target/s390x/tcg/translate.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index c9a5a1687e..c81e035dea 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -6341,15 +6341,16 @@ static DisasJumpType translate_one(CPUS390XState *e= nv, DisasContext *s) } if (insn->help_op) { ret =3D insn->help_op(s, &o); - } - if (ret !=3D DISAS_NORETURN) { - if (insn->help_wout) { - insn->help_wout(s, &o); - } - if (insn->help_cout) { - insn->help_cout(s, &o); + if (ret =3D=3D DISAS_NORETURN) { + goto out; } } + if (insn->help_wout) { + insn->help_wout(s, &o); + } + if (insn->help_cout) { + insn->help_cout(s, &o); + } =20 /* io should be the last instruction in tb when icount is enabled */ if (unlikely(icount && ret =3D=3D DISAS_NEXT)) { --=20 2.45.1 From nobody Mon Nov 25 05:00:28 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1716980240; cv=none; d=zohomail.com; s=zohoarc; b=auEdsJLWuDdXpoZc1Pmds1u2NhLzXCgNFsauMXJpOCGbkgiEh8AswZtSGY1jWgkxKIqEKBVC/btkODzUew2N2irydBXt7WXgrQNmBtFvoU4kHU2w/kNKO5wA+6eBSaQlXpTPRXIECX/0EIFlpJcMseuB164lbGLgFUxAX5Zd1Ts= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716980240; 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=ngGf/SQd5QMjCLjCV3lBUt7ZAu8XYK+UDWz45TEjZKA=; b=KUS6VUWaJ4ibsANObLmEKnjdGQTVc2DupgyPHn6owLB3p6IuOI8vPKFZJxXLD52tNfxMUSEyB5g6lLo3WHRTcS57CvDU+oRLMWeG3cVmmJIakhcOVnWCISKuwvoK5ayTaXUM6iQAtNq9V5Pz1qZI2AkPp/zAaHXn9nGSn5O/Phk= 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 1716980240585654.0917512493072; Wed, 29 May 2024 03:57:20 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCGy3-0004vz-5A; Wed, 29 May 2024 06:55:39 -0400 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 1sCGxx-0004lt-1g for qemu-devel@nongnu.org; Wed, 29 May 2024 06:55:33 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sCGxu-0003Jz-Jy for qemu-devel@nongnu.org; Wed, 29 May 2024 06:55:32 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-244-TqatjgWWMnuH9nsLYWTR1w-1; Wed, 29 May 2024 06:55:25 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9F1C5101A525; Wed, 29 May 2024 10:55:24 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id BA0B0105480A; Wed, 29 May 2024 10:55:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716980130; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ngGf/SQd5QMjCLjCV3lBUt7ZAu8XYK+UDWz45TEjZKA=; b=TQ2CJwkHm+2+mgNScr/IMSYbpLrS1BEFXkahZvhc/UQOSA4SZGcGyoIBni86q3lbwD9ogq UsG6ABqOjpnGMgyyH9dNctB93fDS4h/D6jQenYwtZh+KXHQGH4D9AhULVatBNO/P6XYMHu 5oaLtnULa7I2fpftxnlu8ZONpBvqNnw= X-MC-Unique: TqatjgWWMnuH9nsLYWTR1w-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: qemu-s390x@nongnu.org, Ilya Leoshkevich Subject: [PULL 14/22] tests/tcg/s390x: Add per.S Date: Wed, 29 May 2024 12:54:46 +0200 Message-ID: <20240529105454.1149225-15-thuth@redhat.com> In-Reply-To: <20240529105454.1149225-1-thuth@redhat.com> References: <20240529105454.1149225-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 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=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.036, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 @redhat.com) X-ZM-MESSAGEID: 1716980241337100003 Content-Type: text/plain; charset="utf-8" From: Richard Henderson Add a small test to avoid regressions. Signed-off-by: Richard Henderson Acked-by: Ilya Leoshkevich Tested-by: Ilya Leoshkevich Message-ID: <20240502054417.234340-15-richard.henderson@linaro.org> Signed-off-by: Thomas Huth --- tests/tcg/s390x/Makefile.softmmu-target | 1 + tests/tcg/s390x/per.S | 82 +++++++++++++++++++++++++ 2 files changed, 83 insertions(+) create mode 100644 tests/tcg/s390x/per.S diff --git a/tests/tcg/s390x/Makefile.softmmu-target b/tests/tcg/s390x/Make= file.softmmu-target index 1a1f088b28..80159cccf5 100644 --- a/tests/tcg/s390x/Makefile.softmmu-target +++ b/tests/tcg/s390x/Makefile.softmmu-target @@ -25,6 +25,7 @@ ASM_TESTS =3D = \ lpswe-early = \ lra = \ mc = \ + per = \ precise-smc-softmmu = \ ssm-early = \ stosm-early = \ diff --git a/tests/tcg/s390x/per.S b/tests/tcg/s390x/per.S new file mode 100644 index 0000000000..79e704a6ff --- /dev/null +++ b/tests/tcg/s390x/per.S @@ -0,0 +1,82 @@ + .org 0x8d +ilc: + .org 0x8e +program_interruption_code: + .org 0x96 +per_code: + .org 0x98 +per_address: + .org 0x150 +program_old_psw: + .org 0x1d0 +program_new_psw: + .quad 0, pgm_handler + + .org 0x200 /* exit lowcore */ + +per_on_psw: + .quad 0x4000000000000000, start_per +per_on_regs: + .quad 0x80000000, 0, -1 /* successful-branching everywhere */ +per_off_regs: + .quad 0, 0 ,0 +success_psw: + .quad 0x2000000000000, 0xfff /* see is_special_wait_psw() */ +failure_psw: + .quad 0x2000000000000, 0 /* disabled wait */ + + .org 0x2000 /* exit lowcore pages */ + + .globl _start +_start: + lpswe per_on_psw +start_per: + lctlg %c9, %c11, per_on_regs + +/* Test unconditional relative branch. */ + larl %r0, j1 + larl %r1, d1 + lhi %r2, 0 +j1: j d1 + lpswe failure_psw +d1: + +/* Test unconditional indirect branch. */ + larl %r0, j2 + larl %r1, d2 +j2: br %r1 + lpswe failure_psw +d2: + +/* Test conditional relative branch. */ + larl %r0, j3 + larl %r1, d3 + clr %r1, %r2 /* d3 !=3D 0 */ +j3: jne d3 + lpswe failure_psw +d3: + +/* Test conditional register branch. */ + larl %r0, j4 + larl %r1, d4 + clr %r1, %r2 /* d4 !=3D 0 */ +j4: bner %r1 + lpswe failure_psw +d4: + +/* Success! */ + nop + lpswe success_psw + +pgm_handler: + chhsi program_interruption_code, 0x80 /* PER event? */ + jne fail + cli per_code, 0x80 /* successful-branching event? */ + jne fail + clg %r0, per_address /* per_address =3D=3D jump insn? */ + jne fail + clg %r1, program_old_psw+8 /* psw.addr updated to dest? */ + jne fail + lpswe program_old_psw +fail: + lpswe failure_psw --=20 2.45.1 From nobody Mon Nov 25 05:00:28 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1716980215; cv=none; d=zohomail.com; s=zohoarc; b=lCWDLWxXR58zHF31s9vV5zYs7wbiXy2aiPEhuDjCXK8D4N38SB95Fm2/mtCGepX20UiYmaBkkDLN6zgGC5YmjMqxEo7UHIB+f8s06bPozwelpupXtlw6aOajeDLBOgxJWatAcT3F38FFVqVj6kBMxe2mm8kXgy7+1mqLPjQLC+8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716980215; 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=hxVJw5TuWBIXWCwJ9zO3CyeusMuhUsYWd65t84oOLp8=; b=TF5E48mgz4m+ocwUIk/Nny0sJ82o+pSxfPwzNopXio1xa6gvp/KVnYCzar9ddIQ7rCPXRtFcybZNiLzS0l4nY5MD9OG1p0kEQASkj2nyQvlkCyKljWSpJvf2sfac94w502lCF3IBHXntqbTyv75ww5G086nSlaRiC6enH+06eUE= 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 1716980215707143.3881950535913; Wed, 29 May 2024 03:56:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCGy1-0004rU-29; Wed, 29 May 2024 06:55:37 -0400 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 1sCGxx-0004lv-2c for qemu-devel@nongnu.org; Wed, 29 May 2024 06:55:33 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sCGxu-0003K1-MX for qemu-devel@nongnu.org; Wed, 29 May 2024 06:55:32 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-300-ZzYrgfybMxiS2qgOpbwKPw-1; Wed, 29 May 2024 06:55:26 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5F9451C0512D; Wed, 29 May 2024 10:55:26 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id 318A2105480A; Wed, 29 May 2024 10:55:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716980130; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hxVJw5TuWBIXWCwJ9zO3CyeusMuhUsYWd65t84oOLp8=; b=fdg82bH9R0aBX4kbkbJbXzFyznasXRz/OUu2VS2Occpm0qVohnOf9Efka6U2b9E9aUVoV7 JOfrpr6YPO9qcnl7opxiixVoJECUs6d6jDyNff0qNYCKqLQdCpPycaN3hsBM5DYJK9flWx FT0eqXvvOyeIGYsdouB6YXxYqSLdUo0= X-MC-Unique: ZzYrgfybMxiS2qgOpbwKPw-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: qemu-s390x@nongnu.org, Alexander Bulekov Subject: [PULL 15/22] fuzz: specify audiodev for usb-audio Date: Wed, 29 May 2024 12:54:47 +0200 Message-ID: <20240529105454.1149225-16-thuth@redhat.com> In-Reply-To: <20240529105454.1149225-1-thuth@redhat.com> References: <20240529105454.1149225-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 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=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.036, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1716980217216100005 Content-Type: text/plain; charset="utf-8" From: Alexander Bulekov Fixes test-failure on Fedora 40 CI. Reported-by: Thomas Huth Signed-off-by: Alexander Bulekov Reviewed-by: Thomas Huth Message-ID: <20240527040711.311865-1-alxndr@bu.edu> Signed-off-by: Thomas Huth --- tests/qtest/fuzz/generic_fuzz_configs.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/qtest/fuzz/generic_fuzz_configs.h b/tests/qtest/fuzz/gen= eric_fuzz_configs.h index 4d7c8ca4ec..ef0ad95712 100644 --- a/tests/qtest/fuzz/generic_fuzz_configs.h +++ b/tests/qtest/fuzz/generic_fuzz_configs.h @@ -150,7 +150,8 @@ const generic_fuzz_config predefined_configs[] =3D { "-chardev null,id=3Dcd0 -chardev null,id=3Dcd1 " "-device usb-braille,chardev=3Dcd0 -device usb-ccid -device usb-cc= id " "-device usb-kbd -device usb-mouse -device usb-serial,chardev=3Dcd= 1 " - "-device usb-tablet -device usb-wacom-tablet -device usb-audio", + "-device usb-tablet -device usb-wacom-tablet " + "-device usb-audio,audiodev=3Dsnd0 -audiodev none,id=3Dsnd0", .objects =3D "*usb* *uhci* *xhci*", },{ .name =3D "pc-i440fx", --=20 2.45.1 From nobody Mon Nov 25 05:00:28 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1716980223; cv=none; d=zohomail.com; s=zohoarc; b=YqRYGzOBDDJo7eoaQteidyWgW8pJ2BxG7G0wDzaUOEycw+cW/crisXpS1SdDTWAR6MHyAEdXUfEFgEm1CSm0VGmK9lhTslMzrVaDQESqk+0ewP8AoR4gPgIufWWx4LwweBOSZIMdV3K+L8VYilBBaVZtNrtmSbtlU9t38KuO7vg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716980223; h=Content-Type: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=gwPXfyxG9ruVDUaPlaoS+JF6IaCbQ7jwVTcFgNI3kO8=; b=H3XGGzGxwToKoS+OAOE86gVfq0QITsg4s7txjckKlgOxbIXPR462IU/dt0m8sWb3j5ygMwwhgA2TMlpL39wX4ZztJY+a774toMn7aqH6BcI/M7/o21UxWbNSyb+AiN/O6VfbsoAdiC5h7/U8eDfPS5IjlkI1zSW7Sg7Dbg+q6dA= 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 1716980223536306.52261507857656; Wed, 29 May 2024 03:57:03 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCGy4-0004zC-TK; Wed, 29 May 2024 06:55:41 -0400 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 1sCGxy-0004rr-RG for qemu-devel@nongnu.org; Wed, 29 May 2024 06:55:36 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sCGxx-0003Ka-1F for qemu-devel@nongnu.org; Wed, 29 May 2024 06:55:34 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-516-7_Em8D7pMOe8ghePe9cE4w-1; Wed, 29 May 2024 06:55:28 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E7ED13C025B1; Wed, 29 May 2024 10:55:27 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id ADD51105480A; Wed, 29 May 2024 10:55:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716980132; 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=gwPXfyxG9ruVDUaPlaoS+JF6IaCbQ7jwVTcFgNI3kO8=; b=LumOuDJXKOrhciok2fFzJqq6jm8Fr3+QDI4x/DskKMb/UT+LXD6mC5BpFiLEpC/XM6WeOn f69YMSym0hm5uJ31lrFmf5riqM1lQJUVS4zZ0W8AV9B0FfTLizjBVMpJMI/0x72CoHfpkl ohpRcY9x00bpiIaAAP3p3dNb0unqBLE= X-MC-Unique: 7_Em8D7pMOe8ghePe9cE4w-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: qemu-s390x@nongnu.org, Alexander Bulekov , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 16/22] fuzz: disable leak-detection for oss-fuzz builds Date: Wed, 29 May 2024 12:54:48 +0200 Message-ID: <20240529105454.1149225-17-thuth@redhat.com> In-Reply-To: <20240529105454.1149225-1-thuth@redhat.com> References: <20240529105454.1149225-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 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=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.036, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1716980225221100006 From: Alexander Bulekov When we are building for OSS-Fuzz, we want to ensure that the fuzzer targets are actually created, regardless of leaks. Leaks will be detected by the subsequent tests of the individual fuzz-targets. Signed-off-by: Alexander Bulekov Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20240527150001.325565-1-alxndr@bu.edu> Signed-off-by: Thomas Huth --- scripts/oss-fuzz/build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/oss-fuzz/build.sh b/scripts/oss-fuzz/build.sh index 5238f83343..7398298173 100755 --- a/scripts/oss-fuzz/build.sh +++ b/scripts/oss-fuzz/build.sh @@ -92,6 +92,7 @@ make install DESTDIR=3D$DEST_DIR/qemu-bundle rm -rf $DEST_DIR/qemu-bundle/opt/qemu-oss-fuzz/bin rm -rf $DEST_DIR/qemu-bundle/opt/qemu-oss-fuzz/libexec =20 +export ASAN_OPTIONS=3Ddetect_leaks=3D0 targets=3D$(./qemu-fuzz-i386 | grep generic-fuzz | awk '$1 ~ /\*/ {print = $2}') base_copy=3D"$DEST_DIR/qemu-fuzz-i386-target-$(echo "$targets" | head -n 1= )" =20 --=20 2.45.1 From nobody Mon Nov 25 05:00:28 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1716980203; cv=none; d=zohomail.com; s=zohoarc; b=atTYNj/zrK9lv/yzl8jvvk2EwDW9regIH/SSZHXXa5rpu2kVvzMmnupJQbx+OjV/bn3F6KdYOZ7KDCIX8un5MISrRsf1FYq7rWYmk5qdEcIeCG1aDc6sCI4pIiAp5kE1qggodNo1L9jkLyA+ODzGNVr9hR/T/9OeBP80y6G+HYY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716980203; h=Content-Type: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=rGb/RILBhYMAN7fWJUVgnqoFXHbHayxm0agE2VkqDQE=; b=SroJWMAUWQA/409yLo7SxThEIdbNBgeVKvyoDrZpONCRppOIV+UsJEbhByvMpoGEI3OyCCwnZW5c3uvMopddrYZml/ERkPi4d4Vb66zdrVPEC+UNEGYb23nihQMeStq3s7v0s7DtCqwUb+XB4I1qnvM3irLgYZFwduid+ykj6OU= 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 1716980203136827.9636067522008; Wed, 29 May 2024 03:56:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCGy5-0004zw-D2; Wed, 29 May 2024 06:55:41 -0400 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 1sCGxy-0004rt-Rr for qemu-devel@nongnu.org; Wed, 29 May 2024 06:55:36 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sCGxw-0003KR-Ak for qemu-devel@nongnu.org; Wed, 29 May 2024 06:55:33 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-404-bub8m2oSMQ-9XNniAS4ABg-1; Wed, 29 May 2024 06:55:30 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D39B43806701; Wed, 29 May 2024 10:55:29 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id 33E63105480A; Wed, 29 May 2024 10:55:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716980131; 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=rGb/RILBhYMAN7fWJUVgnqoFXHbHayxm0agE2VkqDQE=; b=h/Utd7L74mTcjEA/FaDZu7fZ0EvHbufHcrMNIgZR8D3UPnIxpzS3uleuZ0Izy8NyypUuvh lnTyPxc6lPP4TcZ2M8CXAcdY7ugqoS2INkmmkBdS6e0XTm84cIljmWggdz+6pMM4uzycVe Tr+JE7O/14u5TtHwJ8W0PTiOG/ajUsQ= X-MC-Unique: bub8m2oSMQ-9XNniAS4ABg-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: qemu-s390x@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Eric Farman Subject: [PULL 17/22] hw/s390x: Remove unused macro VMSTATE_ADAPTER_ROUTES Date: Wed, 29 May 2024 12:54:49 +0200 Message-ID: <20240529105454.1149225-18-thuth@redhat.com> In-Reply-To: <20240529105454.1149225-1-thuth@redhat.com> References: <20240529105454.1149225-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 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=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.036, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1716980205155100003 It's not used anywhere, so let's simply remove it. Message-ID: <20240527121351.211266-1-thuth@redhat.com> Reviewed-by: C=C3=A9dric Le Goater Reviewed-by: Eric Farman Signed-off-by: Thomas Huth --- include/hw/s390x/s390_flic.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/include/hw/s390x/s390_flic.h b/include/hw/s390x/s390_flic.h index bcb081def5..382d9833f1 100644 --- a/include/hw/s390x/s390_flic.h +++ b/include/hw/s390x/s390_flic.h @@ -35,9 +35,6 @@ typedef struct AdapterRoutes { =20 extern const VMStateDescription vmstate_adapter_routes; =20 -#define VMSTATE_ADAPTER_ROUTES(_f, _s) \ - VMSTATE_STRUCT(_f, _s, 1, vmstate_adapter_routes, AdapterRoutes) - #define TYPE_S390_FLIC_COMMON "s390-flic" OBJECT_DECLARE_TYPE(S390FLICState, S390FLICStateClass, S390_FLIC_COMMON) --=20 2.45.1 From nobody Mon Nov 25 05:00:28 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1716980260; cv=none; d=zohomail.com; s=zohoarc; b=RfpSARkxwBni5p+xAYG1P53SSOgG8REhP0TWMwmxgvah2bnJ/bAa97txL7h+wFEW1/dhO4AaK3fjzDAqJw2PVcwqHk0ULVq4J+fXEPry7A0/7xYtpV/62wZE45sEt7AWtjbNmE9sOmKnJw53T0utxafrOROzVMTapy311ZgHilE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716980260; 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=QC0jAYyR2bNmdmEznldmZgb6CBlTH+lG3qyo9oNq+ZY=; b=FTBgudgK62Tc8ia20d8dCSxjVR5qp7j1gjrbQvHtSEXSAPToEVtm53Ad7MeBUXsVZ94X+Emn3/J1Lz59FoMmfGiwbybIyNmP5o12W4zjwy/4grf2kolB4jJd1Uj9k4yt+7dzaRiVpibJcJLS+ax4WEY8P9JIMyDgKFXP50jcb7M= 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 1716980260167420.5526400023964; Wed, 29 May 2024 03:57:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCGyA-00051L-AK; Wed, 29 May 2024 06:55:46 -0400 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 1sCGy2-0004uo-O0 for qemu-devel@nongnu.org; Wed, 29 May 2024 06:55:38 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sCGy0-0003LU-Ty for qemu-devel@nongnu.org; Wed, 29 May 2024 06:55:38 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-542-GpMplItpOf6UzXuL4wEZ-Q-1; Wed, 29 May 2024 06:55:32 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F0E158008A4; Wed, 29 May 2024 10:55:31 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id 47433105480A; Wed, 29 May 2024 10:55:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716980135; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QC0jAYyR2bNmdmEznldmZgb6CBlTH+lG3qyo9oNq+ZY=; b=b1e/WXOVTc06Lc9L5lhN57YwPL3eAykzI6V4vcN4/7KKeMbazJ9aij1ZRpe2biPU9Jj69z meUnrLzRmnoIGe4wjXenJ2XBGI/go2PU1GHe3vhlKFnEiOgf3aUiheO0/vc+IenYUjl7B9 zhg4sMMj46H/H6RBh6JuX+HAGHwqvnE= X-MC-Unique: GpMplItpOf6UzXuL4wEZ-Q-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: qemu-s390x@nongnu.org, "Michael S . Tsirkin" , Cornelia Huck Subject: [PULL 18/22] scripts/update-linux-headers.sh: Remove temporary directory inbetween Date: Wed, 29 May 2024 12:54:50 +0200 Message-ID: <20240529105454.1149225-19-thuth@redhat.com> In-Reply-To: <20240529105454.1149225-1-thuth@redhat.com> References: <20240529105454.1149225-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 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=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.036, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 @redhat.com) X-ZM-MESSAGEID: 1716980261455100003 Content-Type: text/plain; charset="utf-8" We are reusing the same temporary directory for installing the headers of all targets, so there could be stale files here when switching from one target to another. Make sure to delete the folder before installing a new set of target headers into it. Message-ID: <20240527060243.12647-1-thuth@redhat.com> Reviewed-by: Michael S. Tsirkin Acked-by: Cornelia Huck Signed-off-by: Thomas Huth --- scripts/update-linux-headers.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers= .sh index 8963c39189..fbf7e119bc 100755 --- a/scripts/update-linux-headers.sh +++ b/scripts/update-linux-headers.sh @@ -112,6 +112,7 @@ for arch in $ARCHLIST; do arch_var=3DARCH fi =20 + rm -rf "$hdrdir" make -C "$linux" O=3D"$blddir" INSTALL_HDR_PATH=3D"$hdrdir" $arch_var= =3D$arch headers_install =20 rm -rf "$output/linux-headers/asm-$arch" --=20 2.45.1 From nobody Mon Nov 25 05:00:28 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1716980310; cv=none; d=zohomail.com; s=zohoarc; b=Dw6cMtBn0fIA4NVqQaMgRd/YSbLx0Z5YmhO5w5i6a50NUK8yTDoWvzpeEaa9EGvqkAh4A88UcKAp9hmchpJAU8h4LicTy1fg3WAIeabGUYUsZIW8zXEep+GYBG+GP+uFATKQWjbkD4m3/aDYDKat9lH2j33KyJAdoIuZf6G3JsQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716980310; 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=2eTsiktoorRHNlqcrXrMdLgmU0SE5j4uCz6Wn2IZPMU=; b=kt4DkTmHwDORFl718o/4EOoqYmwve4m5Nc/2lSDcZKDg5c5gScObbq4PPLEMFTXRgM1F1hlbbMrdGG93X3aC9QypinEhueS70GePNXB7dKwj1nlxhNjVt61yS22lvKsDpKjgsTfrQCX+e/YR4SlBxofexHZFekCzeEbdZiJkQY4= 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 1716980310980260.6360515440516; Wed, 29 May 2024 03:58:30 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCGyH-00058W-AO; Wed, 29 May 2024 06:55:53 -0400 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 1sCGy4-0004yL-0k for qemu-devel@nongnu.org; Wed, 29 May 2024 06:55:40 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sCGy1-0003Ll-Pa for qemu-devel@nongnu.org; Wed, 29 May 2024 06:55:39 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-584-tZz2g-iJNPiidtxKXVOitQ-1; Wed, 29 May 2024 06:55:33 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5C260185A783; Wed, 29 May 2024 10:55:33 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id 44D6D1054820; Wed, 29 May 2024 10:55:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716980137; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2eTsiktoorRHNlqcrXrMdLgmU0SE5j4uCz6Wn2IZPMU=; b=fdeVRdIhH6FkP7xQFbvmGDBrjoyRngA8dffgIALdfxJg7SkfdKBzNcKOkfBDKXUVVImrCH GTlrxCb7c9bc47mxP4Lzv1dZdXnn7sYOYEFSeW5U/HPSdPXdi58U9szm7bV+eX6XRTQeJB 1wm74J/qSSxaiNCDsU9MFOhpIKwMRkA= X-MC-Unique: tZz2g-iJNPiidtxKXVOitQ-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: qemu-s390x@nongnu.org, Cornelia Huck Subject: [PULL 19/22] scripts/update-linux-headers.sh: Fix the path of setup_data.h Date: Wed, 29 May 2024 12:54:51 +0200 Message-ID: <20240529105454.1149225-20-thuth@redhat.com> In-Reply-To: <20240529105454.1149225-1-thuth@redhat.com> References: <20240529105454.1149225-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 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=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.036, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1716980311839100003 Content-Type: text/plain; charset="utf-8" When running the update-linx-headers.sh script, it currently fails with: scripts/update-linux-headers.sh: line 73: .../qemu/standard-headers/asm-x86= /setup_data.h: No such file or directory The "include" folder is obviously missing here - no clue how this could have worked before? Fixes: 66210a1a30 ("scripts/update-linux-headers: Add setup_data.h to impor= t list") Message-ID: <20240527060126.12578-1-thuth@redhat.com> Reviewed-by: Cornelia Huck Signed-off-by: Thomas Huth --- scripts/update-linux-headers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers= .sh index fbf7e119bc..23afe8c08a 100755 --- a/scripts/update-linux-headers.sh +++ b/scripts/update-linux-headers.sh @@ -159,7 +159,7 @@ for arch in $ARCHLIST; do cp_portable "$hdrdir/bootparam.h" \ "$output/include/standard-headers/asm-$arch" cp_portable "$hdrdir/include/asm/setup_data.h" \ - "$output/standard-headers/asm-x86" + "$output/include/standard-headers/asm-x86" fi if [ $arch =3D riscv ]; then cp "$hdrdir/include/asm/ptrace.h" "$output/linux-headers/asm-riscv= /" --=20 2.45.1 From nobody Mon Nov 25 05:00:28 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1716980303; cv=none; d=zohomail.com; s=zohoarc; b=ktoXlH9x3cNiYmlKEvGQQLXrgNGjAonO3Jow9pCSCKUyiYzSCZ3gMAXd7QbdWW/7sN40nymNJQjNTwIngugLsGNaNJuGOEI361YVuYkU6qBTQEUPiGghDF/eiR1Cv4nl4RMNNIj7DPEfq2PRuWsxscvDqHXOt4jCceak8sJZ4b4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716980303; h=Content-Type: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=KQY9ApQZppx3aW+IK49QuqQdfrtgH/UsXtQTINIOWPg=; b=Kwt071rI40MDwyJab7jKq8gHJUA1BU3ZatyLuw/H0cQDYBAcw2qq6dybcXfy9syWPGD/HK6bRtOa3vPDgkce/rm9aF5blj6I1TeCfo63DzoflM/wXpsJldbW97qDK2OJ2Vqj3MvMFk3IvDyNm62S641lV4O6as60xjvVIpLHRaU= 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 1716980303881113.05375292628423; Wed, 29 May 2024 03:58:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCGyH-00056k-3E; Wed, 29 May 2024 06:55:53 -0400 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 1sCGy6-00050S-3p for qemu-devel@nongnu.org; Wed, 29 May 2024 06:55:42 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sCGy4-0003MM-3K for qemu-devel@nongnu.org; Wed, 29 May 2024 06:55:41 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-554-C57Vd6bHPTSi-nMcJtxPIw-1; Wed, 29 May 2024 06:55:35 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 66C23101A525; Wed, 29 May 2024 10:55:35 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id CB375105480A; Wed, 29 May 2024 10:55:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716980139; 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=KQY9ApQZppx3aW+IK49QuqQdfrtgH/UsXtQTINIOWPg=; b=TIIJ3dLnKtViswqA4q+MfasFSZ9+/jWmCbpkpXc5Kmzk5wsCiXcSFkX0kuNl+ZgljvP4YM DT83cbgvQnod9auAV2j9x7cOgVDhMjRM07TK4pjjUPBtLRuXKcd84ggJ72xDH8swFcYZ4/ 0hFvq5g8eJDcnzR40zA8GOwc5VIWG10= X-MC-Unique: C57Vd6bHPTSi-nMcJtxPIw-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: qemu-s390x@nongnu.org, Akihiko Odaki , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 20/22] qemu-keymap: Make references to allocations static Date: Wed, 29 May 2024 12:54:52 +0200 Message-ID: <20240529105454.1149225-21-thuth@redhat.com> In-Reply-To: <20240529105454.1149225-1-thuth@redhat.com> References: <20240529105454.1149225-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 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=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.036, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 @redhat.com) X-ZM-MESSAGEID: 1716980305820100003 From: Akihiko Odaki LeakSanitizer complains about allocations whose references are held only by automatic variables. It is possible to free them to suppress the complaints, but it is a chore to make sure they are freed in all exit paths so make them static instead. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20240524-xkb-v4-1-2de564e5c859@daynix.com> Signed-off-by: Thomas Huth --- qemu-keymap.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/qemu-keymap.c b/qemu-keymap.c index 8c80f7a4ed..701e4332af 100644 --- a/qemu-keymap.c +++ b/qemu-keymap.c @@ -154,9 +154,9 @@ static xkb_mod_mask_t get_mod(struct xkb_keymap *map, c= onst char *name) =20 int main(int argc, char *argv[]) { - struct xkb_context *ctx; - struct xkb_keymap *map; - struct xkb_state *state; + static struct xkb_context *ctx; + static struct xkb_keymap *map; + static struct xkb_state *state; xkb_mod_index_t mod, mods; int rc; =20 @@ -234,8 +234,6 @@ int main(int argc, char *argv[]) =20 state =3D xkb_state_new(map); xkb_keymap_key_for_each(map, walk_map, state); - xkb_state_unref(state); - state =3D NULL; =20 /* add quirks */ fprintf(outfile, --=20 2.45.1 From nobody Mon Nov 25 05:00:28 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1716980183; cv=none; d=zohomail.com; s=zohoarc; b=C23yALXrOsfeAPrsUMB08GdDQ80RjfSLlIGKBiHv1PP3j+w8tfGwV904+WZgnim+M6mZbJrMiXrCHKg4zM2qEgK2LRieypCSTb9PMcnd0Vc3uvwUGnohZOKFuu0KQkECYyFXr2vmo6MaObEMa1Ycm/sBxBX4CmAsjKQE/S7r+08= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716980183; h=Content-Type: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=iGV5jSDaxeP4Lu/Tmb/dztGV+P7mIQAmemSK9AAsv5I=; b=VBeVE0bCaY+djAOlc9afrDN0hgA8B0E/QERWWk0XdkT95uNy/NUVi9O4MozPnqlY7fUvqKeO6LBj8xhU4qBYW6IRH4mewWjM5OpvaEevcQX/oXmkGOKmGvyP84wrYr8YNVX2sZUHMUZ1PZ3FejeSvOSZS9GyKB4b+fcF5ah9eXU= 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 1716980183163720.6137887032588; Wed, 29 May 2024 03:56:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCGyL-0005BJ-L3; Wed, 29 May 2024 06:55:57 -0400 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 1sCGyB-00054V-CF for qemu-devel@nongnu.org; Wed, 29 May 2024 06:55:48 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sCGy8-0003NB-6S for qemu-devel@nongnu.org; Wed, 29 May 2024 06:55:47 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-271-eRHqNa4kPUWeSLInASfyrA-1; Wed, 29 May 2024 06:55:37 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E7F6B3C025B2; Wed, 29 May 2024 10:55:36 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id D9706105480A; Wed, 29 May 2024 10:55:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716980143; 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=iGV5jSDaxeP4Lu/Tmb/dztGV+P7mIQAmemSK9AAsv5I=; b=hcm7jEgLt4Z7Gtt9KlWpinFvnPND2wvzwYWmhsruTDi1A0a/hwrh+KAIOq+fR5iuEv/IuC LbXB1ZLF1JsrnySjTlRbkVmLT6S4Uu+A4YEdMfyHvWYASzx6Y0pOiebdFsBVlsJInhUrMM Yeng2arl080uiDhUL3QA7EmCvzx++G0= X-MC-Unique: eRHqNa4kPUWeSLInASfyrA-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: qemu-s390x@nongnu.org, Akihiko Odaki , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 21/22] lockable: Do not cast function pointers Date: Wed, 29 May 2024 12:54:53 +0200 Message-ID: <20240529105454.1149225-22-thuth@redhat.com> In-Reply-To: <20240529105454.1149225-1-thuth@redhat.com> References: <20240529105454.1149225-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 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=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.036, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 @redhat.com) X-ZM-MESSAGEID: 1716980185060100009 From: Akihiko Odaki -fsanitize=3Dundefined complains if function pointers are casted. It also prevents enabling the strict mode of CFI which is currently disabled with -fsanitize-cfi-icall-generalize-pointers. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2345 Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20240524-xkb-v4-2-2de564e5c859@daynix.com> Signed-off-by: Thomas Huth --- include/qemu/lockable.h | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/include/qemu/lockable.h b/include/qemu/lockable.h index 62110d2eb7..66713bd429 100644 --- a/include/qemu/lockable.h +++ b/include/qemu/lockable.h @@ -43,15 +43,30 @@ qemu_null_lockable(void *x) return NULL; } =20 +#define QML_FUNC_(name) \ + static inline void qemu_lockable_ ## name ## _lock(void *x) \ + { \ + qemu_ ## name ## _lock(x); \ + } \ + static inline void qemu_lockable_ ## name ## _unlock(void *x) \ + { \ + qemu_ ## name ## _unlock(x); \ + } + +QML_FUNC_(mutex) +QML_FUNC_(rec_mutex) +QML_FUNC_(co_mutex) +QML_FUNC_(spin) + /* * In C, compound literals have the lifetime of an automatic variable. * In C++ it would be different, but then C++ wouldn't need QemuLockable * either... */ -#define QML_OBJ_(x, name) (&(QemuLockable) { \ - .object =3D (x), \ - .lock =3D (QemuLockUnlockFunc *) qemu_ ## name ## _lock, \ - .unlock =3D (QemuLockUnlockFunc *) qemu_ ## name ## _unlock \ +#define QML_OBJ_(x, name) (&(QemuLockable) { \ + .object =3D (x), \ + .lock =3D qemu_lockable_ ## name ## _lock, \ + .unlock =3D qemu_lockable_ ## name ## _unlock \ }) =20 /** --=20 2.45.1 From nobody Mon Nov 25 05:00:28 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1716980320; cv=none; d=zohomail.com; s=zohoarc; b=OnzF3+adffUR7hsecTI7fhHerkeOLXTGs6xQrnaOkbo9luiAobYQx8+DgNogVDpIZ0Z/9Hvt0t+RcAvetjMKRq6wspG1c0JwisDEDvVk/zIfOq7UbE6k1KQ37llwOSZ/DXauDqMCQsv4iJDEGSx/Gdct1Ruowf4cFRz1Am2tNYY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716980320; 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=VwF1CZkVPFaoB5L1KcjdmzvRfscLRg1sRwCs33bG7lg=; b=fuXikdH9IQjmY4X2UaPeIbK3tX/7lnN2LI7sjax1WT9161qJ2fgu5aNEv1VFJbWIpDe8Dfm/gjesCrrONVKk39ViEl0QQFlc+t9zsBkXx2yfg92SmNA4nIhftnM/nakQzSgpVGbnSe61CXa5W7RmmQJesRu1NIoI7prnQzS/YG4= 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 1716980320580463.4448580802307; Wed, 29 May 2024 03:58:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCGyH-00059F-MA; Wed, 29 May 2024 06:55:53 -0400 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 1sCGyA-00051m-Bq for qemu-devel@nongnu.org; Wed, 29 May 2024 06:55:46 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sCGy8-0003NC-5b for qemu-devel@nongnu.org; Wed, 29 May 2024 06:55:45 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-580-NhYlMHQzN1KEbm9BpAXH7A-1; Wed, 29 May 2024 06:55:39 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5897C3806701; Wed, 29 May 2024 10:55:39 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id 712FF105480A; Wed, 29 May 2024 10:55:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716980143; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VwF1CZkVPFaoB5L1KcjdmzvRfscLRg1sRwCs33bG7lg=; b=YmwmkT7B6ldSnSJhGLTej55yf0hnZoa3hiRGUCYADNq5nrcL94e4+PT1XlX4Px167cLPAP IsGsyxfdoZoMchnADSKl2yhjcGqK9e+AaNYFhzAYwixj9zRrdoDT4iaBO3Q653jSv5XIOL VIJKLYLDy1BAyjPMZmnsJeIT6/lH9Fw= X-MC-Unique: NhYlMHQzN1KEbm9BpAXH7A-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: qemu-s390x@nongnu.org, Akihiko Odaki , Markus Armbruster Subject: [PULL 22/22] qapi: Do not cast function pointers Date: Wed, 29 May 2024 12:54:54 +0200 Message-ID: <20240529105454.1149225-23-thuth@redhat.com> In-Reply-To: <20240529105454.1149225-1-thuth@redhat.com> References: <20240529105454.1149225-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 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=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.036, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1716980321954100003 Content-Type: text/plain; charset="utf-8" From: Akihiko Odaki Using -fsanitize=3Dundefined with Clang v18 causes an error if function pointers are casted: qapi/qapi-clone-visitor.c:188:5: runtime error: call to function visit_typ= e_SocketAddress through pointer to incorrect function type 'bool (*)(struct= Visitor *, const char *, void **, struct Error **)' /tmp/qemu-ubsan/qapi/qapi-visit-sockets.c:487: note: visit_type_SocketAddr= ess defined here #0 0x5642aa2f7f3b in qapi_clone qapi/qapi-clone-visitor.c:188:5 #1 0x5642aa2c8ce5 in qio_channel_socket_listen_async io/channel-socket= .c:285:18 #2 0x5642aa2b8903 in test_io_channel_setup_async tests/unit/test-io-ch= annel-socket.c:116:5 #3 0x5642aa2b8204 in test_io_channel tests/unit/test-io-channel-socket= .c:179:9 #4 0x5642aa2b8129 in test_io_channel_ipv4 tests/unit/test-io-channel-s= ocket.c:323:5 ... It also prevents enabling the strict mode of CFI which is currently disabled with -fsanitize-cfi-icall-generalize-pointers. The problematic casts are necessary to pass visit_type_T() and visit_type_T_members() as callbacks to qapi_clone() and qapi_clone_members(= ), respectively. Open-code these two functions to avoid the callbacks, and thus the type casts. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2346 Signed-off-by: Akihiko Odaki Reviewed-by: Markus Armbruster Message-ID: <20240524-xkb-v4-3-2de564e5c859@daynix.com> [thuth: Improve commit message according to Markus' suggestions] Signed-off-by: Thomas Huth --- include/qapi/clone-visitor.h | 37 +++++++++++++++++++++++------------- qapi/qapi-clone-visitor.c | 30 ++++------------------------- 2 files changed, 28 insertions(+), 39 deletions(-) diff --git a/include/qapi/clone-visitor.h b/include/qapi/clone-visitor.h index adf9a788e2..ebc182b034 100644 --- a/include/qapi/clone-visitor.h +++ b/include/qapi/clone-visitor.h @@ -11,6 +11,7 @@ #ifndef QAPI_CLONE_VISITOR_H #define QAPI_CLONE_VISITOR_H =20 +#include "qapi/error.h" #include "qapi/visitor.h" =20 /* @@ -20,11 +21,8 @@ */ typedef struct QapiCloneVisitor QapiCloneVisitor; =20 -void *qapi_clone(const void *src, bool (*visit_type)(Visitor *, const char= *, - void **, Error **)); -void qapi_clone_members(void *dst, const void *src, size_t sz, - bool (*visit_type_members)(Visitor *, void *, - Error **)); +Visitor *qapi_clone_visitor_new(void); +Visitor *qapi_clone_members_visitor_new(void); =20 /* * Deep-clone QAPI object @src of the given @type, and return the result. @@ -32,10 +30,18 @@ void qapi_clone_members(void *dst, const void *src, siz= e_t sz, * Not usable on QAPI scalars (integers, strings, enums), nor on a * QAPI object that references the 'any' type. Safe when @src is NULL. */ -#define QAPI_CLONE(type, src) \ - ((type *)qapi_clone(src, \ - (bool (*)(Visitor *, const char *, void **, \ - Error **))visit_type_ ## type)) +#define QAPI_CLONE(type, src) \ + ({ \ + Visitor *v_; \ + type *dst_ =3D (type *) (src); /* Cast away const */ \ + \ + if (dst_) { \ + v_ =3D qapi_clone_visitor_new(); \ + visit_type_ ## type(v_, NULL, &dst_, &error_abort); \ + visit_free(v_); \ + } \ + dst_; \ + }) =20 /* * Copy deep clones of @type members from @src to @dst. @@ -43,9 +49,14 @@ void qapi_clone_members(void *dst, const void *src, size= _t sz, * Not usable on QAPI scalars (integers, strings, enums), nor on a * QAPI object that references the 'any' type. */ -#define QAPI_CLONE_MEMBERS(type, dst, src) \ - qapi_clone_members(dst, src, sizeof(type), \ - (bool (*)(Visitor *, void *, \ - Error **))visit_type_ ## type ## _members) +#define QAPI_CLONE_MEMBERS(type, dst, src) \ + ({ \ + Visitor *v_; \ + \ + v_ =3D qapi_clone_members_visitor_new(); = \ + *(type *)(dst) =3D *(src); = \ + visit_type_ ## type ## _members(v_, (type *)(dst), &error_abort); \ + visit_free(v_); \ + }) =20 #endif diff --git a/qapi/qapi-clone-visitor.c b/qapi/qapi-clone-visitor.c index c45c5caa3b..bbf953698f 100644 --- a/qapi/qapi-clone-visitor.c +++ b/qapi/qapi-clone-visitor.c @@ -149,7 +149,7 @@ static void qapi_clone_free(Visitor *v) g_free(v); } =20 -static Visitor *qapi_clone_visitor_new(void) +Visitor *qapi_clone_visitor_new(void) { QapiCloneVisitor *v; =20 @@ -174,31 +174,9 @@ static Visitor *qapi_clone_visitor_new(void) return &v->visitor; } =20 -void *qapi_clone(const void *src, bool (*visit_type)(Visitor *, const char= *, - void **, Error **)) +Visitor *qapi_clone_members_visitor_new(void) { - Visitor *v; - void *dst =3D (void *) src; /* Cast away const */ - - if (!src) { - return NULL; - } - - v =3D qapi_clone_visitor_new(); - visit_type(v, NULL, &dst, &error_abort); - visit_free(v); - return dst; -} - -void qapi_clone_members(void *dst, const void *src, size_t sz, - bool (*visit_type_members)(Visitor *, void *, - Error **)) -{ - Visitor *v; - - v =3D qapi_clone_visitor_new(); - memcpy(dst, src, sz); + Visitor *v =3D qapi_clone_visitor_new(); to_qcv(v)->depth++; - visit_type_members(v, dst, &error_abort); - visit_free(v); + return v; } --=20 2.45.1