From patchwork Mon Sep 26 13:38:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 609312 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp1864588pvb; Mon, 26 Sep 2022 06:44:22 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5110oTXFYKL/9r7fEwYrer08PxGshihMWiDFlVyLYAVbKLcETpJTtTprbKvJyLK7kOii8B X-Received: by 2002:a05:620a:801b:b0:6cf:9e29:dfda with SMTP id ee27-20020a05620a801b00b006cf9e29dfdamr3577028qkb.10.1664199861904; Mon, 26 Sep 2022 06:44:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664199861; cv=none; d=google.com; s=arc-20160816; b=1CYK3D9wYtAbI2vBYCQXmWKC6hnX0deqWapMPFLlEbEAVtxQGfwKXY+fks/WnLeYF7 +AV2RshsKiAjC/h7epXE8uc+JZyeYWjeDFmHQlUip3MfuJJVLxRDl+VN5Y/LntiwrfTn AsZWqLhS1ya1Ko1NkxrorYrbeO59ng2ujlhrkw3wFQP9/P4ejEe672JFyb/ketX1i6s1 owVubWfLaDsZn7HcZd+t9ReOik1ncR+IQ0b9M1HGfPkVIYfkZINHMCIB+apHG4fEMlcK /NaaqU+ZlAexk0IeKDO7Q62WDn2yrG0kFe0QKA7bwfdAxJKNhWmBrgO/ftwg7kNaZAJn HgGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=gCnfusu3BjpQePbKlJglN1S0tmOGdGMgTpCQYlDZ79M=; b=vxT4lCk32HdIHSC174IPvbUilLAKp3VApjRE0VI7877wNmnkrKV1uvS9CbhLllQVut jxx9gR/7fXg7FGDJi1ZjlCVs6zxAZzy8r+DhEhNxXJQOsgQve/s2gZjrfwnG0TdsPozu WO3ztuGr0NGJZVBGOmPaZaUbmnGffcqZvsOXe33uBqMWvVQi5XD6wrLOWlZxT8CW84JA BsznOcNSR9pQs+HEi07RRD+omHwwQdJMYBlBubea8pz4HMZtmI+DQqMoCn0cjcMQ3yMB fmNJAPNDlSKoieb8/5O3AMP4H3MP73QOmXnK/t1r41pxxkNq3H+v8iBHX45zMxXtq4Li X1gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=caSO6Lcp; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id v4-20020a05620a0f0400b006b5f144690csi9654506qkl.762.2022.09.26.06.44.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 26 Sep 2022 06:44:21 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=caSO6Lcp; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51684 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ocoPF-0008Tc-DK for patch@linaro.org; Mon, 26 Sep 2022 09:44:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48168) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ocoKF-0001y5-0n for qemu-devel@nongnu.org; Mon, 26 Sep 2022 09:39:11 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:34618) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ocoKD-0005e7-0A for qemu-devel@nongnu.org; Mon, 26 Sep 2022 09:39:10 -0400 Received: by mail-wr1-x435.google.com with SMTP id z6so10315991wrq.1 for ; Mon, 26 Sep 2022 06:39:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=gCnfusu3BjpQePbKlJglN1S0tmOGdGMgTpCQYlDZ79M=; b=caSO6LcpzkdF8a+WkvEoytWnJTiux13XyafD2GYGFicK0xjFrC4ayQeu+9KkiAhj6E 8dZaLsi5KPTIsoaDDfP7a/1b+K94Z5hgY/Qvti5op89xCjNSyYY2Y3ortVziTqFJXaIa ZsZp01UNSaA3cwSyiGqP+H1uAYtsq9LM3HHKvuYO9m6fUuUUJyPtoVSnP5z4l4UnfXu9 gaAWVES2C9LL5i3SU6KqM8IkLPhZXzw8H2EiG0Ss4DeGM0peifnL+B5yJ7OAl9DEBL7k bAo5lPqMwIF2BWy00VFU5GCknnE5UYuQtX4tdD8bfI+l+dTXW8Q65WExnRKjyW0Nt8gI cixw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=gCnfusu3BjpQePbKlJglN1S0tmOGdGMgTpCQYlDZ79M=; b=UKxtwtu02G00V60OXJez/9F1clh+9L6F2gOBpnIuc3rzRA53y5EecH2B9xrAH/sRb8 p6vFkjalLXlBQmiWyUEUKG1s/6zP+HNe+/RZATHNSbsWrSwtMIZd2B4Lsau1Ah9eP8Jo ashtIpw//HI3+Ehed58OQ24KKOhDJear4SpO98xIt+XiQ/0b1/vWZn0SuNSPx99UmsUv VtF1yl719YfXMzT+daaqVBVYYS4s/tOb3mLvW9xAiukkDqSbNL3ZApIXliuXdWOI7KmJ 6p+Iup1kFoSxGsL129W2sY/oITFasjKLpfPIMW0+g/4UBFU14PWIuG19MDMlSyXAxnrh 8g8A== X-Gm-Message-State: ACrzQf0ox6pk5ZItO0GjszsfuRFzlaWyGKmvZU/MV4K3gOpqxvD0uHnk i4HTRdih3knpjmsIWT62I0nyrQ== X-Received: by 2002:a5d:64e5:0:b0:22a:3cae:93bf with SMTP id g5-20020a5d64e5000000b0022a3cae93bfmr13786257wri.323.1664199546728; Mon, 26 Sep 2022 06:39:06 -0700 (PDT) Received: from zen.linaroharston ([185.81.254.11]) by smtp.gmail.com with ESMTPSA id x12-20020adfffcc000000b0022ac672654dsm14103341wrs.58.2022.09.26.06.39.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Sep 2022 06:39:05 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id AD0D41FFB7; Mon, 26 Sep 2022 14:39:04 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: f4bug@amsat.org, mads@ynddal.dk, qemu-arm@nongnu.org, =?utf-8?q?Alex_Ben?= =?utf-8?q?n=C3=A9e?= Subject: [PATCH v2 00/11] gdbstub/next (MemTxAttrs and re-factoring) Date: Mon, 26 Sep 2022 14:38:53 +0100 Message-Id: <20220926133904.3297263-1-alex.bennee@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x435.google.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Hi, This is v3 of the MexTxAttrs update alongside the current state of gdbstub/next (as fixing current_cpu from gdbstub was the original motivation). Following feedback I've drastically simplified the first patch and push the all the setting of requester_id to the per-arch tlb_fill and get_phys_page_attrs_debug helpers to fill in correctly. There is also a new patch to fix up HVF on Aarch64 which rely mostly on software modelled devices. The later re-factoring is unchanged having sailed through review without any comments. The following are left for review: - qtest: make read/write operation appear to be from CPU - target/arm: ensure HVF traps set appropriate MemTxAttrs - target/arm: enable tracking of CPU index in MemTxAttrs - hw: encode accessing CPU index in MemTxAttrs Alex Bennée (11): hw: encode accessing CPU index in MemTxAttrs target/arm: enable tracking of CPU index in MemTxAttrs target/arm: ensure HVF traps set appropriate MemTxAttrs qtest: make read/write operation appear to be from CPU hw/intc/gic: use MxTxAttrs to divine accessing CPU hw/timer: convert mptimer access to attrs to derive cpu index configure: move detected gdb to TCG's config-host.mak gdbstub: move into its own sub directory gdbstub: move sstep flags probing into AccelClass gdbstub: move breakpoint logic to accel ops gdbstub: move guest debug support check to ops configure | 7 ++ meson.build | 4 +- accel/kvm/kvm-cpus.h | 4 + gdbstub/internals.h | 17 ++++ gdbstub/trace.h | 1 + include/exec/memattrs.h | 17 +++- include/qemu/accel.h | 12 +++ include/sysemu/accel-ops.h | 7 ++ include/sysemu/cpus.h | 3 + include/sysemu/kvm.h | 20 ----- accel/accel-common.c | 10 +++ accel/kvm/kvm-accel-ops.c | 9 ++ accel/kvm/kvm-all.c | 44 +++++----- accel/stubs/kvm-stub.c | 16 ---- accel/tcg/tcg-accel-ops.c | 98 +++++++++++++++++++++ accel/tcg/tcg-all.c | 17 ++++ gdbstub.c => gdbstub/gdbstub.c | 156 ++++----------------------------- gdbstub/softmmu.c | 51 +++++++++++ gdbstub/user.c | 68 ++++++++++++++ hw/intc/arm_gic.c | 39 +++++---- hw/timer/arm_mptimer.c | 25 +++--- softmmu/cpus.c | 7 ++ softmmu/qtest.c | 26 +++--- target/arm/hvf/hvf.c | 4 +- target/arm/ptw.c | 3 + MAINTAINERS | 2 +- gdbstub/meson.build | 9 ++ gdbstub/trace-events | 29 ++++++ trace-events | 28 ------ 29 files changed, 461 insertions(+), 272 deletions(-) create mode 100644 gdbstub/internals.h create mode 100644 gdbstub/trace.h rename gdbstub.c => gdbstub/gdbstub.c (95%) create mode 100644 gdbstub/softmmu.c create mode 100644 gdbstub/user.c create mode 100644 gdbstub/meson.build create mode 100644 gdbstub/trace-events