From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by sourceware.org (Postfix) with ESMTPS id 025BB3858D1E for ; Tue, 7 May 2024 00:56:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 025BB3858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 025BB3858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::42e ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715043373; cv=none; b=HOhkOXUeeGSInCnI56spB3bK8IodfgNfCCNGezGy6F04pRi2yvA4CLEUjxkD4AcDxG3owFzPtXBxtJ+iLP9NG+b7X558o0BNMEQQjH5+TWQjdSZlV7Af0rb8bD7UgRMLT+GCGNd21GwKnGx2xKZwVdgE/s4AgbPprMK1jxqpBjE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715043373; c=relaxed/simple; bh=8ypQsejQa2NbKH10XpVEigZOYsZq5CRvGhaNLXSZ+RM=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=buN+/6QUk75V/ZbffD6apeuA8ZBkunys2wfPB7tnacZp/jxDZ2qTQ8QxxaW9MZM+6KGpfcK6JRWC9lAQ7teD1bKpRCDWY6d+m9cD71qmxWl9xBi0pdyAy8Rovr/wHKw7rcFtH3UXrXaVrF0ZhNBtdA0wgP8/RLw63a78Sv0Pir4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-6f450f43971so1940025b3a.3 for ; Mon, 06 May 2024 17:56:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715043370; x=1715648170; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:user-agent :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MaL5CZjYGAjhytdzQ+BeEdwS1sGy1mUZiXTfFd8PIbQ=; b=vMu21+LD4ZBIOiPUMCSF01rnmBJaKosQM90iR6AfgYz8bOV5vYhIaoCClwO3FUJQDc 7uAtrZoB2go74D8+A0i419GFadVAOh83V9/0/0SXo7yvBE84NXBfg6uBfMymUJI0lmPY tjmYFVdjjBUAl3O+1Lr9FJ1lbDtBrVQCuQZ2LyHBg6GO5HsdgzPNpsHxsrE1WSUNrCgF FFhoLSxbbZQ8rLjqN1Uury3kD7kXI3AC1EzNFi8hc1fxYDMwODoXqERpDSe3W8TkpGTh Eo+cRM4E3qEVpCiCATsq1QKsPjSqkmbvj4Uiy37NqA0Xtm+arzsXhclbmdxTRy9v5auO 3Nmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715043370; x=1715648170; h=content-transfer-encoding:mime-version:message-id:date:user-agent :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=MaL5CZjYGAjhytdzQ+BeEdwS1sGy1mUZiXTfFd8PIbQ=; b=wbSLZ/wYi5NTBP9TqhNPkRL50ECUKOPAJN5Q8OpPb9oDJ9PUU/He2R9E2rF/gyImOR hHcereOdi5NzGXlDEjIbLoh8ZDtJ6nCDKizfoMBvYiMS8maZwSUE+bThlxufAfrRDfVD 732uYpHTtarNCgXaWQrbEyIq5KN+a4+ApEJ/HW7P3h17oA0BHvdYQJJM6VFjz8ZD2MgO Tj0Ro8fCWGsdzRUd9RPdbY+5+XyQRFB7wvyWt6kyt6tC8t1Uh+HDg5HVmU1nm34NQ6oB l22g/PLP+kMsgCJFyLoeOgmgdyFu3ONBwpdKEZok5cRCB7VsOGDK0VYbwVMJ/RVkM9Ir PMyA== X-Gm-Message-State: AOJu0YxTvh/OXXK+uYCD0w5s/S5l9l1geiJlmzvUjqeWxUiguNfNRkza kfPteSYtT6s4yJELlN/qjtAGu++870JstWBS8LC8IY/FCReptCipHFgq40Q4uyqk9nReSupSQEq J X-Google-Smtp-Source: AGHT+IGXegjbyaMz1wSyZ/pRd7dO1klmYtpkSt3v8IaA8jagQdB39P/XSfae7vjAfXo4Bg6Q0+rU3A== X-Received: by 2002:a05:6a21:2d8a:b0:1a7:4944:d49 with SMTP id ty10-20020a056a212d8a00b001a749440d49mr14168630pzb.0.1715043369477; Mon, 06 May 2024 17:56:09 -0700 (PDT) Received: from localhost ([2804:14d:7e39:8470:38ad:4156:59df:8141]) by smtp.gmail.com with ESMTPSA id fh21-20020a056a00391500b006e6c16179dbsm8318961pfb.24.2024.05.06.17.56.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 17:56:09 -0700 (PDT) From: Thiago Jung Bauermann To: Christophe Lyon Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 1/5] gdb/aarch64: Implement software single stepping for MOPS instructions In-Reply-To: (Christophe Lyon's message of "Mon, 6 May 2024 11:29:50 +0200") References: <20240504000521.314531-1-thiago.bauermann@linaro.org> <20240504000521.314531-2-thiago.bauermann@linaro.org> User-Agent: mu4e 1.12.4; emacs 29.3 Date: Mon, 06 May 2024 21:56:06 -0300 Message-ID: <87bk5ih23d.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hello Christophe, Thanks for the patch review! Christophe Lyon writes: > On Sat, 4 May 2024 at 02:05, Thiago Jung Bauermann > wrote: >> >> @@ -3808,8 +3909,10 @@ aarch64_displaced_step_copy_insn (struct gdbarch = *gdbarch, >> if (aarch64_decode_insn (insn, &inst, 1, NULL) !=3D 0) >> return NULL; >> >> - /* Look for a Load Exclusive instruction which begins the sequence. = */ >> - if (inst.opcode->iclass =3D=3D ldstexcl && bit (insn, 22)) >> + /* Look for a Load Exclusive instruction which begins the sequence, >> + or for a MOPS instruction. */ >> + if ((inst.opcode->iclass =3D=3D ldstexcl && bit (insn, 22)) >> + || AARCH64_CPU_HAS_FEATURE (*inst.opcode->avariant, MOPS)) > > Sorry for the naive question: doesn't this check that the CPU supports > MOPS, rather than the instruction sequence is a MOPS one? It's an interesting question actually, at least for me because it's my first time calling opcode functions. You're right that AARCH64_CPU_HAS_FEATURE checks whether the given CPU supports the given feature. But the call above uses the inst.opcode->avariant "CPU": /* Which architecture variant provides this instruction. */ const aarch64_feature_set *avariant; For MOPS instructions that field points to aarch64_feature_mops, defined in opcodes/aarch64-tbl.h as: static const aarch64_feature_set aarch64_feature_mops =3D AARCH64_FEATURE (MOPS); Which defines a CPU containing only the MOPS feature. I also checked =E2=80=94 just to be sure =E2=80=94 that whether or not the = VM's CPU support the MOPS feature, the above description holds and the check returns true for a MOPS instruction and false otherwise. >> { >> /* We can't displaced step atomic sequences. */ >> return NULL; --=20 Thiago