From patchwork Wed Jun 17 21:01:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190899 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp797355ilo; Wed, 17 Jun 2020 14:03:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBJYfEV4YVOIrwSlAohGtfYgvQypFcAYFgyahIi1dl/VWRjLf/tKApu2rbQVPtyFSRhdty X-Received: by 2002:a25:b8c6:: with SMTP id g6mr1462425ybm.101.1592427826021; Wed, 17 Jun 2020 14:03:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592427826; cv=none; d=google.com; s=arc-20160816; b=I45KUWZRvGDxq4LKMzg8FmuPYRrxgifAGwfDEcDjPi8T+9mWU85yShuuFsw0X9lDJW b0xaL70iu54W/hqSdorw/BKxwDD6JTrvcWxawDCQOM84sdB1kmzzla7WfDxXOEtHBe40 PH1Jk4O2pJ/K84zH1yBHlV1KC/TOO0M7w83+GK4wfCAhTnm+2wN/rk0DeP4/uE2KCIkR hynTlhdqmKAy++rfZaNz7zc+AET5ua/5FKktYYef2zygY6uwM3PDN2UbhAH3S3nUUQfQ 7JjCcLBt/Avzc1m0WcOiGqy4HFR9Yp+uQ1bWzy2ExPiWCUnBgZSupaeFpJoi6mul6Xrw Q+8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=Dhx8kBlipihHAeKCJXfkKKAuD+dwgXnNkcughiZZtFw=; b=qpeX0d4RZ5QNESK8xAFqWIp4ry+eIjcPSkr456zYrMAZ5a64VTYDjdp7d9Ij+yYmoo rAsizaWZX/f8h6fPfRpLWcTwQjZOVf8I/9Cblu3/UkqRGFPmfkchv/EpTX7D77798hS4 CrjblIjDNI6YeUBIpsA9otZq3FM7yME2amEo8R56/HJVztELpo10bRTVyP4T561/HyzY kP23HSY5/uUZTG2ksDGKbk1itN2FgdqHHYc1r4s01k6ixuJKAEIN3dE4OhaUzOlhPDDN iDpCJEmGxxHL/a4k1H1cFwmsLsgo5h5Mxjt9t3Hc7Hr1Mfsc7RSvJjy9YXDfKhfMv73p 1HEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="ZUm9OP/p"; 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=fail (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 y10si695355ybg.401.2020.06.17.14.03.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:03:46 -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=fail header.i=@linaro.org header.s=google header.b="ZUm9OP/p"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:33754 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfDl-0002d3-DO for patch@linaro.org; Wed, 17 Jun 2020 17:03:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36816) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfDO-0002bL-KJ for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:03:22 -0400 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]:36356) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfDJ-0008OM-A1 for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:03:22 -0400 Received: by mail-qk1-x742.google.com with SMTP id 205so3517535qkg.3 for ; Wed, 17 Jun 2020 14:03:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Dhx8kBlipihHAeKCJXfkKKAuD+dwgXnNkcughiZZtFw=; b=ZUm9OP/ppA5whu7a9OgxbPtF42XrPrAo3DlE/0Oi8XdHuGRkCj8ljfQu4IZ+PPMZMx 3SxjAS6qfhPkLmupKJY2PDyYcrZ4hiHz7DgeJEN0v96tLPAWs5SOT3tDE73CHfHAdbVX vGa4A+z+Z4UktE/zkKvJpPgN5+pc0dfddvQ2CuakTgZdfACZyl7VHlyZvRGjEkH/ModE sJ1TSSi5lA09LkKMVhqPO3KaIUzW3TqArcjbwD1DB+uGvBKowxJBDTqKoUxWzMj1jyF1 0zrSrdLyE7JfcAHg6f5DtlFb363BiXBJ9dnc2/GaAL2Cy0Ktrg0Pkpa/hUJbuQo/H+Kw I/oQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Dhx8kBlipihHAeKCJXfkKKAuD+dwgXnNkcughiZZtFw=; b=ixTWwtW6QqgbzBtqDffgnF2yFjTcLeXvF2y+CZKTlwyf2Pf6bey7KB85afhNrWMPFR z4J3eJoKDLkCTydK0e3O7WMtn7huoyjh9NjKCidgtrl/ZncYn7CbsdxNLNC1MYSeT7sH YZXGMedM3b2XCbjNjUUhHNqBQbYS/hQben32mSUb7JZUhqEuAJmenPOW2/WncJFCzxi8 URANrZOSbTw9NDWIrVenz4CLzl1WCVHSkObTP1L8//qoma2790wz1uaDIa78crZK4WBc qLk19LzqyyP37zoTGKRBqbUOq7eUMG5uQiIvd/XsWj6l3ijFn+/FYlF7CI2SwDMjigmF /Fmw== X-Gm-Message-State: AOAM530bzCxr4F5JavuoOvLBt5AEQu2WMPdvAtvfoY+DVxnd8tYaKKuJ bPRWRKm1v9TJ3uuGHIGGnN9NxOv/GsnUxg== X-Received: by 2002:a05:620a:164c:: with SMTP id c12mr500828qko.343.1592427796072; Wed, 17 Jun 2020 14:03:16 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.03.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:03:15 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 01/73] cpu: rename cpu->work_mutex to cpu->lock Date: Wed, 17 Jun 2020 17:01:19 -0400 Message-Id: <20200617210231.4393-2-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::742; envelope-from=robert.foley@linaro.org; helo=mail-qk1-x742.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robert.foley@linaro.org, Eduardo Habkost , cota@braap.org, Paolo Bonzini , peter.puhov@linaro.org, alex.bennee@linaro.org, Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" This lock will soon protect more fields of the struct. Give it a more appropriate name. Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- cpus-common.c | 14 +++++++------- cpus.c | 4 ++-- hw/core/cpu.c | 4 ++-- include/hw/core/cpu.h | 6 ++++-- 4 files changed, 15 insertions(+), 13 deletions(-) -- 2.17.1 diff --git a/cpus-common.c b/cpus-common.c index 8f5512b3d7..622430bd33 100644 --- a/cpus-common.c +++ b/cpus-common.c @@ -105,10 +105,10 @@ struct qemu_work_item { static void queue_work_on_cpu(CPUState *cpu, struct qemu_work_item *wi) { - qemu_mutex_lock(&cpu->work_mutex); + qemu_mutex_lock(&cpu->lock); QSIMPLEQ_INSERT_TAIL(&cpu->work_list, wi, node); wi->done = false; - qemu_mutex_unlock(&cpu->work_mutex); + qemu_mutex_unlock(&cpu->lock); qemu_cpu_kick(cpu); } @@ -300,15 +300,15 @@ void process_queued_cpu_work(CPUState *cpu) { struct qemu_work_item *wi; - qemu_mutex_lock(&cpu->work_mutex); + qemu_mutex_lock(&cpu->lock); if (QSIMPLEQ_EMPTY(&cpu->work_list)) { - qemu_mutex_unlock(&cpu->work_mutex); + qemu_mutex_unlock(&cpu->lock); return; } while (!QSIMPLEQ_EMPTY(&cpu->work_list)) { wi = QSIMPLEQ_FIRST(&cpu->work_list); QSIMPLEQ_REMOVE_HEAD(&cpu->work_list, node); - qemu_mutex_unlock(&cpu->work_mutex); + qemu_mutex_unlock(&cpu->lock); if (wi->exclusive) { /* Running work items outside the BQL avoids the following deadlock: * 1) start_exclusive() is called with the BQL taken while another @@ -324,13 +324,13 @@ void process_queued_cpu_work(CPUState *cpu) } else { wi->func(cpu, wi->data); } - qemu_mutex_lock(&cpu->work_mutex); + qemu_mutex_lock(&cpu->lock); if (wi->free) { g_free(wi); } else { atomic_mb_set(&wi->done, true); } } - qemu_mutex_unlock(&cpu->work_mutex); + qemu_mutex_unlock(&cpu->lock); qemu_cond_broadcast(&qemu_work_cond); } diff --git a/cpus.c b/cpus.c index 7317ae06b9..3c011ec452 100644 --- a/cpus.c +++ b/cpus.c @@ -101,9 +101,9 @@ static inline bool cpu_work_list_empty(CPUState *cpu) { bool ret; - qemu_mutex_lock(&cpu->work_mutex); + qemu_mutex_lock(&cpu->lock); ret = QSIMPLEQ_EMPTY(&cpu->work_list); - qemu_mutex_unlock(&cpu->work_mutex); + qemu_mutex_unlock(&cpu->lock); return ret; } diff --git a/hw/core/cpu.c b/hw/core/cpu.c index 0f23409f1d..1cba5b6e69 100644 --- a/hw/core/cpu.c +++ b/hw/core/cpu.c @@ -369,7 +369,7 @@ static void cpu_common_initfn(Object *obj) cpu->nr_cores = 1; cpu->nr_threads = 1; - qemu_mutex_init(&cpu->work_mutex); + qemu_mutex_init(&cpu->lock); QSIMPLEQ_INIT(&cpu->work_list); QTAILQ_INIT(&cpu->breakpoints); QTAILQ_INIT(&cpu->watchpoints); @@ -381,7 +381,7 @@ static void cpu_common_finalize(Object *obj) { CPUState *cpu = CPU(obj); - qemu_mutex_destroy(&cpu->work_mutex); + qemu_mutex_destroy(&cpu->lock); } static int64_t cpu_common_get_arch_id(CPUState *cpu) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index b3f4b79318..afc8081ca8 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -331,7 +331,8 @@ struct qemu_work_item; * @opaque: User data. * @mem_io_pc: Host Program Counter at which the memory was accessed. * @kvm_fd: vCPU file descriptor for KVM. - * @work_mutex: Lock to prevent multiple access to @work_list. + * @lock: Lock to prevent multiple access to per-CPU fields. Must be acquired + * after the BQL. * @work_list: List of pending asynchronous work. * @trace_dstate_delayed: Delayed changes to trace_dstate (includes all changes * to @trace_dstate). @@ -375,7 +376,8 @@ struct CPUState { uint64_t random_seed; sigjmp_buf jmp_env; - QemuMutex work_mutex; + QemuMutex lock; + /* fields below protected by @lock */ QSIMPLEQ_HEAD(, qemu_work_item) work_list; CPUAddressSpace *cpu_ases; From patchwork Wed Jun 17 21:01:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190902 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp799130ilo; Wed, 17 Jun 2020 14:06:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNSiPBibuHaI/bJh998nI0j5bb4LzczuKpuHmQCatXcGzMvnu8XfL7XNQXv9nBB3oQBTN8 X-Received: by 2002:a05:6902:729:: with SMTP id l9mr1418445ybt.381.1592427966709; Wed, 17 Jun 2020 14:06:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592427966; cv=none; d=google.com; s=arc-20160816; b=rq0leqr3WLmdCMZCgtSDXx81c0MgSkwumNtwCJiyoYhV4EGrCLDSLKl/St10ZMDuM2 Nm3P2cspfjsLjF91tNyAsYxLkOcyZYXcLtlM7Y8IZZgVIBcbhwoBragu/JMiDDwFAbGM kBJMZIP4H/KCXGvRy6W+Va70aqVdNN/JBqffFzOaagqbe51dK7I4d544yJilV7ueEb1h ixmL1BnAOEwk6OHjef/Gscth/hK/4oQmtggx8ZtzCUJUQUB3NzZdmvU1tLQeEdnFw6va SAGbX6if51TjM9BrwapnTA3TUU9XGtSmVtH1Du6QhNCQ3wAINmwJSHYdV0knzS0g1ZNS qZYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=ZYteIUkqExuWadWFdiCSlI10s1/zCIoztEZoLySpuAc=; b=kwNdTJmIZNJoCFORjqP3WnpVjudAXySgSSc9nJEoxbuUroQCFlW2whd99SjZGo/yjB dhp0qvhzPq+TOe2Ob5AW+H6mvydIx8hdIUwdMpxklOHcJUBinzddpTaGJ11BxKlwi1S3 blIu+rEWOEUqaeFqPxnp+DOMxOLeRez3qtACN+1JNbxlxU92kv56ZRFiwhghCDgd+JkH UqRSPopcHJgrlV7ftZwOSDT4nIPYIaFkzEg19P0uSChh1ftIzUX/0ZLsD2LbRq6+xuKZ 3EVqepkkFpe4d+2q2aT0izL+ZXQZaWhtNMlFTChA6DdqmfQX0Q6jqqTmaehe07dZsOxo /6Pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=TF8X0jiQ; 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=fail (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 k5si668973ybk.27.2020.06.17.14.06.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:06:06 -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=fail header.i=@linaro.org header.s=google header.b=TF8X0jiQ; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:41488 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfG2-0006Cj-5h for patch@linaro.org; Wed, 17 Jun 2020 17:06:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36902) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfDT-0002eg-Sr for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:03:29 -0400 Received: from mail-qt1-x842.google.com ([2607:f8b0:4864:20::842]:39413) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfDO-0008Pk-Cr for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:03:27 -0400 Received: by mail-qt1-x842.google.com with SMTP id k22so2751469qtm.6 for ; Wed, 17 Jun 2020 14:03:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ZYteIUkqExuWadWFdiCSlI10s1/zCIoztEZoLySpuAc=; b=TF8X0jiQLJdX49wvJNWN2EsKmh/+c0yHko7XgtzikAtgnaI0Y4mrYSZxsWOEAUdyWG jq6/qkzab3HtMsOqgl31+2qgEeD+TEhQ4MSIVRo7i/JlEs6g1/FIktPLPJqw2LWR55Sx /MKWheQmtNhLbxe43ti56Me9dvxauU56jaPQ8/j+G2XlMGc7llAM1m9SpPWi+ST+fcMd wuWdLJ9qRjgqZ8tehLZ8CeuHHgr02kT4P+MpgbiAr3ZPB0ANwhKasF4s+wd0CifsXBIA wnXSyVrC8+2GP1e506rLR+QaAAPUA2eE1gBwDI+DzAZlwzt3J8JmdfeKGPF2eNOn6aPM LpcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ZYteIUkqExuWadWFdiCSlI10s1/zCIoztEZoLySpuAc=; b=Diw5btKJujA5Vv7YvYixVPfTfqVG54b0tRgQabKZStONKapie6rMvWyyotNIie1GT3 SgQC2dJ2gPin7Gw1pCl/wYzOLrbLRkpS6bUPdIIaei+kPPpuVoxLSkRhmo1q673AA2fA kwP6uVA7lV3y6FcWFHxOM0u3QLEFK8gaerUixEl8iU9DSs+knyIctJtnyDIfAQwYBypf TrhGKDL5TIzgIc/mPrHrYvrxdwOeMaoI5w8y1/S7TPJU9UYZYa5suThuh4nIGFRMww3w b7/6sVcz+WTGKeBA+osx7yH9KBSHPkwykuBikg/Hmjx+MMrIjuPGd5yshxtMUpbIlBSv /QBw== X-Gm-Message-State: AOAM533ukJ1ssuCol39qEo3etRsjEZnkRw9/yKmIgBMZdjha51ac6wtR cwhl+cO8QR/XejtOsjYzf61vPOIyaiaebw== X-Received: by 2002:ac8:6f5c:: with SMTP id n28mr1097058qtv.269.1592427797718; Wed, 17 Jun 2020 14:03:17 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.03.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:03:17 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 02/73] cpu: introduce cpu_mutex_lock/unlock Date: Wed, 17 Jun 2020 17:01:20 -0400 Message-Id: <20200617210231.4393-3-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::842; envelope-from=robert.foley@linaro.org; helo=mail-qt1-x842.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robert.foley@linaro.org, Eduardo Habkost , cota@braap.org, Paolo Bonzini , peter.puhov@linaro.org, alex.bennee@linaro.org, Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" The few direct users of &cpu->lock will be converted soon. The per-thread bitmap introduced here might seem unnecessary, since a bool could just do. However, once we complete the conversion to per-vCPU locks, we will need to cover the use case where all vCPUs are locked by the same thread, which explains why the bitmap is introduced here. Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota [RF: Add assert in smp_parse. Make cpu_mutex_lock stub empty] Signed-off-by: Robert Foley --- cpus.c | 45 +++++++++++++++++++++++++++++++++++++++++-- hw/core/machine.c | 1 + include/hw/core/cpu.h | 36 ++++++++++++++++++++++++++++++++++ stubs/Makefile.objs | 1 + stubs/cpu-lock.c | 20 +++++++++++++++++++ 5 files changed, 101 insertions(+), 2 deletions(-) create mode 100644 stubs/cpu-lock.c -- 2.17.1 diff --git a/cpus.c b/cpus.c index 3c011ec452..ca271411a4 100644 --- a/cpus.c +++ b/cpus.c @@ -92,6 +92,44 @@ static unsigned int throttle_percentage; #define CPU_THROTTLE_PCT_MAX 99 #define CPU_THROTTLE_TIMESLICE_NS 10000000 +/* + * Note: we index the bitmap with cpu->cpu_index + 1 so that the logic + * also works during early CPU initialization, when cpu->cpu_index is set to + * UNASSIGNED_CPU_INDEX == -1. + */ +static __thread DECLARE_BITMAP(cpu_lock_bitmap, CPU_LOCK_BITMAP_SIZE); + +bool no_cpu_mutex_locked(void) +{ + return bitmap_empty(cpu_lock_bitmap, CPU_LOCK_BITMAP_SIZE); +} + +void cpu_mutex_lock_impl(CPUState *cpu, const char *file, int line) +{ +/* coverity gets confused by the indirect function call */ +#ifdef __COVERITY__ + qemu_mutex_lock_impl(&cpu->lock, file, line); +#else + QemuMutexLockFunc f = atomic_read(&qemu_mutex_lock_func); + + g_assert(!cpu_mutex_locked(cpu)); + set_bit(cpu->cpu_index + 1, cpu_lock_bitmap); + f(&cpu->lock, file, line); +#endif +} + +void cpu_mutex_unlock_impl(CPUState *cpu, const char *file, int line) +{ + g_assert(cpu_mutex_locked(cpu)); + qemu_mutex_unlock_impl(&cpu->lock, file, line); + clear_bit(cpu->cpu_index + 1, cpu_lock_bitmap); +} + +bool cpu_mutex_locked(const CPUState *cpu) +{ + return test_bit(cpu->cpu_index + 1, cpu_lock_bitmap); +} + bool cpu_is_stopped(CPUState *cpu) { return cpu->stopped || !runstate_is_running(); @@ -101,9 +139,9 @@ static inline bool cpu_work_list_empty(CPUState *cpu) { bool ret; - qemu_mutex_lock(&cpu->lock); + cpu_mutex_lock(cpu); ret = QSIMPLEQ_EMPTY(&cpu->work_list); - qemu_mutex_unlock(&cpu->lock); + cpu_mutex_unlock(cpu); return ret; } @@ -1865,6 +1903,9 @@ void qemu_mutex_lock_iothread_impl(const char *file, int line) { QemuMutexLockFunc bql_lock = atomic_read(&qemu_bql_mutex_lock_func); + /* enforce locking order */ + g_assert(no_cpu_mutex_locked()); + g_assert(!qemu_mutex_iothread_locked()); bql_lock(&qemu_global_mutex, file, line); iothread_locked = true; diff --git a/hw/core/machine.c b/hw/core/machine.c index 1d80ab0e1d..74edd3c86d 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -769,6 +769,7 @@ static void smp_parse(MachineState *ms, QemuOpts *opts) ms->smp.threads = threads; ms->smp.sockets = sockets; } + assert(ms->smp.max_cpus <= CPU_LOCK_BITMAP_SIZE); if (ms->smp.cpus > 1) { Error *blocker = NULL; diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index afc8081ca8..4d4006f1fb 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -457,6 +457,39 @@ extern CPUTailQ cpus; extern __thread CPUState *current_cpu; +/** + * cpu_mutex_lock - lock a CPU's mutex + * @cpu: the CPU whose mutex is to be locked + * + * To avoid deadlock, a CPU's mutex must be acquired after the BQL. + */ +#define cpu_mutex_lock(cpu) \ + cpu_mutex_lock_impl(cpu, __FILE__, __LINE__) +void cpu_mutex_lock_impl(CPUState *cpu, const char *file, int line); + +/** + * cpu_mutex_unlock - unlock a CPU's mutex + * @cpu: the CPU whose mutex is to be unlocked + */ +#define cpu_mutex_unlock(cpu) \ + cpu_mutex_unlock_impl(cpu, __FILE__, __LINE__) +void cpu_mutex_unlock_impl(CPUState *cpu, const char *file, int line); + +/** + * cpu_mutex_locked - check whether a CPU's mutex is locked + * @cpu: the CPU of interest + * + * Returns true if the calling thread is currently holding the CPU's mutex. + */ +bool cpu_mutex_locked(const CPUState *cpu); + +/** + * no_cpu_mutex_locked - check whether any CPU mutex is held + * + * Returns true if the calling thread is not holding any CPU mutex. + */ +bool no_cpu_mutex_locked(void); + static inline void cpu_tb_jmp_cache_clear(CPUState *cpu) { unsigned int i; @@ -1184,4 +1217,7 @@ extern const VMStateDescription vmstate_cpu_common; #define UNASSIGNED_CPU_INDEX -1 #define UNASSIGNED_CLUSTER_INDEX -1 +/* XXX: is this really the max number of CPUs? */ +#define CPU_LOCK_BITMAP_SIZE 2048 + #endif diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs index 28e48171d1..becf8f6986 100644 --- a/stubs/Makefile.objs +++ b/stubs/Makefile.objs @@ -1,6 +1,7 @@ stub-obj-y += blk-commit-all.o stub-obj-y += cpu-get-clock.o stub-obj-y += cpu-get-icount.o +stub-obj-y += cpu-lock.o stub-obj-y += dump.o stub-obj-y += error-printf.o stub-obj-y += fdset.o diff --git a/stubs/cpu-lock.c b/stubs/cpu-lock.c new file mode 100644 index 0000000000..1981a00fb3 --- /dev/null +++ b/stubs/cpu-lock.c @@ -0,0 +1,20 @@ +#include "qemu/osdep.h" +#include "hw/core/cpu.h" + +void cpu_mutex_lock_impl(CPUState *cpu, const char *file, int line) +{ +} + +void cpu_mutex_unlock_impl(CPUState *cpu, const char *file, int line) +{ +} + +bool cpu_mutex_locked(const CPUState *cpu) +{ + return true; +} + +bool no_cpu_mutex_locked(void) +{ + return true; +} From patchwork Wed Jun 17 21:01:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190903 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp799268ilo; Wed, 17 Jun 2020 14:06:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwf++QvdBd0TACZPy7n2daJadBcpAofg7w9gCLdvCc8tAC+jlRCTyQQgUQwZ7P8J/EfARaL X-Received: by 2002:a25:d6cb:: with SMTP id n194mr1409700ybg.278.1592427978204; Wed, 17 Jun 2020 14:06:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592427978; cv=none; d=google.com; s=arc-20160816; b=R4okANalMWTG0gNNViHgE6bAY0FO+fVsVr8YomIBL9nYPvoz9bJ7X8/NEfpK3iQcIe wPExon5t+qP4SAzTmW/gW/wAwzCXt8IV0WnZvLcmIChdNBFE2Gvh+iDFzMsONgqqpE+4 uclIEx1Xo16BG4iEwEaeP50XR4i+4c7SmHKUZ5iudR5WeLxw4vTMTLIXEwfoeETne5p1 ZDguCZMOrIMJs8LurpY/dH8/B1IqzhNQ1QwLCojwTeLEwI4uStlylxlhCxzOY8JIWPHs kvl593jBcB5RfZ65TEgekW8pw2MT5SG8DeizhTeoLvXty2UIwpovmE32t1xqeoZLpk/A 7cgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=pQeS3ErQJYe6lUMZTvW4HI5IzahbrklWfBxpVQvJbIg=; b=wkLBWw0dlwvyZ21Q3H1gQvZCXcZQok+eMFs6MStrFmijB8EEK9fZLCtDPjfESg+nFB TCpY2y3l7WpRLNe7t5WKKgQMpR8V0DmKXAao5QXysGL0mXLghxGdMP3i5CrGtw7EMNTm UYzIE7nyaloV/4WDVVr7p7m1EUS56kqc0qlkIr/uMo067UIXrYZqUE4gGrauUdaf6RFu 1b3yCIgCUn9aYIYyk6aYRDBCOnir2D+9Ly9xSu2E6qJjUSLNYWHsu8OCAvltINpbD8r6 tKis5DQS6Rp29CfUhNwwB1Yctvgdj16y0FQZY98x0H7fiFzvCxWAYIpzv/hx/ogCtI6z +40g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Zt4xqudC; 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=fail (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 i205si573656yba.151.2020.06.17.14.06.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:06:18 -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=fail header.i=@linaro.org header.s=google header.b=Zt4xqudC; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:42258 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfGD-0006VM-FP for patch@linaro.org; Wed, 17 Jun 2020 17:06:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36886) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfDS-0002dT-2G for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:03:26 -0400 Received: from mail-qt1-x841.google.com ([2607:f8b0:4864:20::841]:36374) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfDO-0008Pv-Co for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:03:25 -0400 Received: by mail-qt1-x841.google.com with SMTP id w9so2761265qtv.3 for ; Wed, 17 Jun 2020 14:03:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pQeS3ErQJYe6lUMZTvW4HI5IzahbrklWfBxpVQvJbIg=; b=Zt4xqudCRQ0OUAqxQ8rsAwSTaiB7Ot9EnCA+XPlHCfM1HpEPiuTaGSlQNU0nM6R9Xk zsqX3HrWFtcYLMkGwt1QkSmVLIrKyj3jLzV6YHigqNioDLLu1PIlxhw7KpT7CgIQfxyC gvSWI5KSo3ZoZCU3Y6d9+6H33bnrC51Wp004WhWtTQ+/tHxbajTZsk0NemVmPNI+0NLJ k1cW6nIIXIHSEBbCWywd8U+Ddz9dMdtShANprE9XMWnEjUijiz0ReLu2s3oh0Cmn5vfY MQRHNFPpeVdJQUBsguK3NunKDflIpP0dVdQRwmc++ZxCV65ZXISsPWrIyMLIdXn0SU8L LROg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pQeS3ErQJYe6lUMZTvW4HI5IzahbrklWfBxpVQvJbIg=; b=oif95DmAGlL9BX/bVxXa33TW7vjm4CEz1jL8ZfxyAdjJDaYg0LSDL2v2OSnv4CEvNt /4ZPp8YKYufo1dQ/OP7+TDEaRBLDFRmLwpJmnrxa1d4h5Cw06NJh7bkEAmACXORJAmHY KzkACe9PMJrtvEkmWDLc3EMHRco836gv8n4y+aiJxTCECD9JlaOqLGHsW54FesJlQEx+ 6qsO8Bq4MCMCLxEvlmzb2enuEZsFNjDb3j4D4mY7QPwpKae+Ucn4jfcBUUVXfUmj63Aq U99yKJUj5C8TlZiN/L+9+YDVuChNlir/VdiPXcDKnXrptkkeKjXd6Q3ojVAMhCqDGNDX gE6g== X-Gm-Message-State: AOAM532r3pmvVFL5/Y9Gajhbsfhfh4Wp1BHTyOMPoUfz+DCUweeFTHti 3OW7knNN3dK949PPkm9vZkrii/1/CVU74g== X-Received: by 2002:ac8:538b:: with SMTP id x11mr1116947qtp.84.1592427799432; Wed, 17 Jun 2020 14:03:19 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.03.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:03:18 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 03/73] cpu: make qemu_work_cond per-cpu Date: Wed, 17 Jun 2020 17:01:21 -0400 Message-Id: <20200617210231.4393-4-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::841; envelope-from=robert.foley@linaro.org; helo=mail-qt1-x841.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robert.foley@linaro.org, Eduardo Habkost , cota@braap.org, Paolo Bonzini , peter.puhov@linaro.org, alex.bennee@linaro.org, Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" This eliminates the need to use the BQL to queue CPU work. While at it, give the per-cpu field a generic name ("cond") since it will soon be used for more than just queueing CPU work. Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- cpus-common.c | 72 ++++++++++++++++++++++++++++++++++--------- cpus.c | 2 +- hw/core/cpu.c | 1 + include/hw/core/cpu.h | 6 ++-- 4 files changed, 63 insertions(+), 18 deletions(-) -- 2.17.1 diff --git a/cpus-common.c b/cpus-common.c index 622430bd33..57d9fc6ea1 100644 --- a/cpus-common.c +++ b/cpus-common.c @@ -27,7 +27,6 @@ static QemuMutex qemu_cpu_list_lock; static QemuCond exclusive_cond; static QemuCond exclusive_resume; -static QemuCond qemu_work_cond; /* >= 1 if a thread is inside start_exclusive/end_exclusive. Written * under qemu_cpu_list_lock, read with atomic operations. @@ -43,7 +42,6 @@ void qemu_init_cpu_list(void) qemu_mutex_init(&qemu_cpu_list_lock); qemu_cond_init(&exclusive_cond); qemu_cond_init(&exclusive_resume); - qemu_cond_init(&qemu_work_cond); } void cpu_list_lock(void) @@ -103,23 +101,37 @@ struct qemu_work_item { bool free, exclusive, done; }; -static void queue_work_on_cpu(CPUState *cpu, struct qemu_work_item *wi) +/* Called with the CPU's lock held */ +static void queue_work_on_cpu_locked(CPUState *cpu, struct qemu_work_item *wi) { - qemu_mutex_lock(&cpu->lock); QSIMPLEQ_INSERT_TAIL(&cpu->work_list, wi, node); wi->done = false; - qemu_mutex_unlock(&cpu->lock); qemu_cpu_kick(cpu); } -void do_run_on_cpu(CPUState *cpu, run_on_cpu_func func, run_on_cpu_data data, - QemuMutex *mutex) +static void queue_work_on_cpu(CPUState *cpu, struct qemu_work_item *wi) +{ + cpu_mutex_lock(cpu); + queue_work_on_cpu_locked(cpu, wi); + cpu_mutex_unlock(cpu); +} + +void do_run_on_cpu(CPUState *cpu, run_on_cpu_func func, run_on_cpu_data data) { struct qemu_work_item wi; + bool has_bql = qemu_mutex_iothread_locked(); + + g_assert(no_cpu_mutex_locked()); if (qemu_cpu_is_self(cpu)) { - func(cpu, data); + if (has_bql) { + func(cpu, data); + } else { + qemu_mutex_lock_iothread(); + func(cpu, data); + qemu_mutex_unlock_iothread(); + } return; } @@ -129,13 +141,34 @@ void do_run_on_cpu(CPUState *cpu, run_on_cpu_func func, run_on_cpu_data data, wi.free = false; wi.exclusive = false; - queue_work_on_cpu(cpu, &wi); + cpu_mutex_lock(cpu); + queue_work_on_cpu_locked(cpu, &wi); + + /* + * We are going to sleep on the CPU lock, so release the BQL. + * + * During the transition to per-CPU locks, we release the BQL _after_ + * having kicked the destination CPU (from queue_work_on_cpu_locked above). + * This makes sure that the enqueued work will be seen by the CPU + * after being woken up from the kick, since the CPU sleeps on the BQL. + * Once we complete the transition to per-CPU locks, we will release + * the BQL earlier in this function. + */ + if (has_bql) { + qemu_mutex_unlock_iothread(); + } + while (!atomic_mb_read(&wi.done)) { CPUState *self_cpu = current_cpu; - qemu_cond_wait(&qemu_work_cond, mutex); + qemu_cond_wait(&cpu->cond, &cpu->lock); current_cpu = self_cpu; } + cpu_mutex_unlock(cpu); + + if (has_bql) { + qemu_mutex_lock_iothread(); + } } void async_run_on_cpu(CPUState *cpu, run_on_cpu_func func, run_on_cpu_data data) @@ -299,6 +332,7 @@ void async_safe_run_on_cpu(CPUState *cpu, run_on_cpu_func func, void process_queued_cpu_work(CPUState *cpu) { struct qemu_work_item *wi; + bool has_bql = qemu_mutex_iothread_locked(); qemu_mutex_lock(&cpu->lock); if (QSIMPLEQ_EMPTY(&cpu->work_list)) { @@ -316,13 +350,23 @@ void process_queued_cpu_work(CPUState *cpu) * BQL, so it goes to sleep; start_exclusive() is sleeping too, so * neither CPU can proceed. */ - qemu_mutex_unlock_iothread(); + if (has_bql) { + qemu_mutex_unlock_iothread(); + } start_exclusive(); wi->func(cpu, wi->data); end_exclusive(); - qemu_mutex_lock_iothread(); + if (has_bql) { + qemu_mutex_lock_iothread(); + } } else { - wi->func(cpu, wi->data); + if (has_bql) { + wi->func(cpu, wi->data); + } else { + qemu_mutex_lock_iothread(); + wi->func(cpu, wi->data); + qemu_mutex_unlock_iothread(); + } } qemu_mutex_lock(&cpu->lock); if (wi->free) { @@ -332,5 +376,5 @@ void process_queued_cpu_work(CPUState *cpu) } } qemu_mutex_unlock(&cpu->lock); - qemu_cond_broadcast(&qemu_work_cond); + qemu_cond_broadcast(&cpu->cond); } diff --git a/cpus.c b/cpus.c index ca271411a4..035f41a997 100644 --- a/cpus.c +++ b/cpus.c @@ -1216,7 +1216,7 @@ void qemu_init_cpu_loop(void) void run_on_cpu(CPUState *cpu, run_on_cpu_func func, run_on_cpu_data data) { - do_run_on_cpu(cpu, func, data, &qemu_global_mutex); + do_run_on_cpu(cpu, func, data); } static void qemu_kvm_destroy_vcpu(CPUState *cpu) diff --git a/hw/core/cpu.c b/hw/core/cpu.c index 1cba5b6e69..07251d83df 100644 --- a/hw/core/cpu.c +++ b/hw/core/cpu.c @@ -370,6 +370,7 @@ static void cpu_common_initfn(Object *obj) cpu->nr_threads = 1; qemu_mutex_init(&cpu->lock); + qemu_cond_init(&cpu->cond); QSIMPLEQ_INIT(&cpu->work_list); QTAILQ_INIT(&cpu->breakpoints); QTAILQ_INIT(&cpu->watchpoints); diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 4d4006f1fb..ebff239ad3 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -333,6 +333,7 @@ struct qemu_work_item; * @kvm_fd: vCPU file descriptor for KVM. * @lock: Lock to prevent multiple access to per-CPU fields. Must be acquired * after the BQL. + * @cond: Condition variable for per-CPU events. * @work_list: List of pending asynchronous work. * @trace_dstate_delayed: Delayed changes to trace_dstate (includes all changes * to @trace_dstate). @@ -378,6 +379,7 @@ struct CPUState { QemuMutex lock; /* fields below protected by @lock */ + QemuCond cond; QSIMPLEQ_HEAD(, qemu_work_item) work_list; CPUAddressSpace *cpu_ases; @@ -774,12 +776,10 @@ bool cpu_is_stopped(CPUState *cpu); * @cpu: The vCPU to run on. * @func: The function to be executed. * @data: Data to pass to the function. - * @mutex: Mutex to release while waiting for @func to run. * * Used internally in the implementation of run_on_cpu. */ -void do_run_on_cpu(CPUState *cpu, run_on_cpu_func func, run_on_cpu_data data, - QemuMutex *mutex); +void do_run_on_cpu(CPUState *cpu, run_on_cpu_func func, run_on_cpu_data data); /** * run_on_cpu: From patchwork Wed Jun 17 21:01:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190900 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp798151ilo; Wed, 17 Jun 2020 14:04:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQEmDHr+ruNa6Yt/3T1Bieh8N2JAwWglMU0Mgl4CI9BZ5le17HaoZ+GiLgNwUX/Hd7TOIB X-Received: by 2002:a5b:78b:: with SMTP id b11mr1391065ybq.42.1592427888351; Wed, 17 Jun 2020 14:04:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592427888; cv=none; d=google.com; s=arc-20160816; b=ge4p+2XTzBcXA9f608uOYMeaDs8EKgvSNvefoVfF1/dVwJn2cZ6W5UibHuzPILkjc2 bvTu2H+zBAiUQR+pv5Jk8nglgyERGVVvA0vihLdm4fhwimuiPvlrLOIa9LGCjlaFN2tc jJC9zS4WdVqGYNX3w0o0MGr3BjoCJAhFTwAU2QxRDOO5KmqPTe4MD1NMQN1bIQaHXsdk yj++Jcz28czG1TzEB3Yfq+EkbIfmctRPUm5Ka0wXtPNvtrMRiQRG2JMHKClsMUiiZKYC 2aasywEXX0ovM/3wEuPpVVLav58YlN4Q5THqLYGMsy/fww+jjXhD1fCTgt6ZpVgLwzMY 4L8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=QNZB54KyQChgQjAJ4p/NXb5SKwXOjBRD9J4KOgYTGDc=; b=tl0QhHZQZM5ljZsjOhlbIhAjyjw38o/GIr20XhlufmVbc95JCy7pkpAuPGN9Ksa0Oc 1B0/zwsqZVKdltwISoQyt7DI3xKC+zkH9GIMjeA/FvtxTs0BeoELYCAUgE+vB6+i00u1 AbQdbDXxoMufA4xJ+qZj7Xa8Um3tY0CbWmhbh3T4GXBqK+sdwDCUQT6JtO+E5o//T08W qyX034nVcIhS/M2hInBWMwkjOfbb71u5KbwUWV1JX4Zin/TT9MpYtOxBfeVSHBCYmjbh xGhhoJa7vsqlOioEnlfQXG0o5dEgOGJ8oyACdwW1IrhSdLAJRjkzWhilHChYP5bTYT/H rhDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=AA2z7orh; 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=fail (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 a14si614750ybp.184.2020.06.17.14.04.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:04:48 -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=fail header.i=@linaro.org header.s=google header.b=AA2z7orh; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:33914 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfEl-0002hX-ES for patch@linaro.org; Wed, 17 Jun 2020 17:04:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36926) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfDV-0002fG-Sa for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:03:29 -0400 Received: from mail-qt1-x842.google.com ([2607:f8b0:4864:20::842]:42436) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfDO-0008Q3-Cg for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:03:29 -0400 Received: by mail-qt1-x842.google.com with SMTP id q14so2741522qtr.9 for ; Wed, 17 Jun 2020 14:03:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QNZB54KyQChgQjAJ4p/NXb5SKwXOjBRD9J4KOgYTGDc=; b=AA2z7orh/m+mwEWFgQscfE4OJA8CSw68Kuhox/bKvytcSM8YZvkftQB7TO16rvo0eM fhWp068tIALYrvq/uUyZEaB2jQe5FUEKV3dbou1qpxpMhqcG0TEuOfBt36LWBQL+Akr6 yAlBmE+vRbhV8EaxNBElT1idS3uGuiC20f7zX/M/KjDTEcpny+v2Y1C/W4P/pI3V214S XhgB94mTYZ5AwsIY4UUVo4ujR+pCw5c9PZxsahotK4zc65O7Z0wiX1V6Kl8zW06vyMlM QOPWkaoFLG0UhfOhk+DkHHZeLg+wtzKhb87kjDeNzvScYgXpUzj2K8zmtYJ+qjYD7DW4 laOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QNZB54KyQChgQjAJ4p/NXb5SKwXOjBRD9J4KOgYTGDc=; b=HwUcYW7OjlyjdKt5qHQ8xmIN3t43/mc2DZ4l5Al8wYtwDhRubfLcemIqKUZVUUkHXB l05Nps5ZNWWI9imR1uoY3Vzfag8w/Vw0zpXVWveWRW5ML0VnTJqVY/qjUYj3kiYoKq5x 4WZNNX309Lx5t8OjJF8dUkIfaBOfrH2cas4KDybbVAYLE4ngkKeUvaspqnI6/VHX+1Aj JVb10QS83aQiGUnX/uKqXXIwampXSRm74vBUGkgQVLZIyqJAsnpFDgRFG79Le6LAhQlU KVlPLnnFI0VlkzGXnmSv7hkFw1+vNNEN2wuW3oVlS2m29Ogi2NinwhsOWM6ST9qWMIdz t3Hw== X-Gm-Message-State: AOAM5323gq7Vk52nsNVZb9DvEJS4bbIjZwuyv961af4+3IVwjYA1gt0W aEcn2uE7lTlWlxzr3jcZAK6sPyBdq2LBfA== X-Received: by 2002:ac8:6edb:: with SMTP id f27mr1035447qtv.325.1592427801035; Wed, 17 Jun 2020 14:03:21 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.03.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:03:20 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 04/73] cpu: move run_on_cpu to cpus-common Date: Wed, 17 Jun 2020 17:01:22 -0400 Message-Id: <20200617210231.4393-5-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::842; envelope-from=robert.foley@linaro.org; helo=mail-qt1-x842.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robert.foley@linaro.org, Eduardo Habkost , cota@braap.org, Paolo Bonzini , peter.puhov@linaro.org, alex.bennee@linaro.org, Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" We don't pass a pointer to qemu_global_mutex anymore. Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- cpus-common.c | 2 +- cpus.c | 5 ----- include/hw/core/cpu.h | 10 ---------- 3 files changed, 1 insertion(+), 16 deletions(-) -- 2.17.1 diff --git a/cpus-common.c b/cpus-common.c index 57d9fc6ea1..b1069193c1 100644 --- a/cpus-common.c +++ b/cpus-common.c @@ -117,7 +117,7 @@ static void queue_work_on_cpu(CPUState *cpu, struct qemu_work_item *wi) cpu_mutex_unlock(cpu); } -void do_run_on_cpu(CPUState *cpu, run_on_cpu_func func, run_on_cpu_data data) +void run_on_cpu(CPUState *cpu, run_on_cpu_func func, run_on_cpu_data data) { struct qemu_work_item wi; bool has_bql = qemu_mutex_iothread_locked(); diff --git a/cpus.c b/cpus.c index 035f41a997..8e54916169 100644 --- a/cpus.c +++ b/cpus.c @@ -1214,11 +1214,6 @@ void qemu_init_cpu_loop(void) qemu_thread_get_self(&io_thread); } -void run_on_cpu(CPUState *cpu, run_on_cpu_func func, run_on_cpu_data data) -{ - do_run_on_cpu(cpu, func, data); -} - static void qemu_kvm_destroy_vcpu(CPUState *cpu) { if (kvm_destroy_vcpu(cpu) < 0) { diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index ebff239ad3..e3f7ec06ff 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -771,16 +771,6 @@ void qemu_cpu_kick(CPUState *cpu); */ bool cpu_is_stopped(CPUState *cpu); -/** - * do_run_on_cpu: - * @cpu: The vCPU to run on. - * @func: The function to be executed. - * @data: Data to pass to the function. - * - * Used internally in the implementation of run_on_cpu. - */ -void do_run_on_cpu(CPUState *cpu, run_on_cpu_func func, run_on_cpu_data data); - /** * run_on_cpu: * @cpu: The vCPU to run on. From patchwork Wed Jun 17 21:01:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190905 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp799659ilo; Wed, 17 Jun 2020 14:06:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyoBYgusn5AgjtyLM9Xlqwach0teph/Mq60m9E+lGKJ0dl7xpttANC3KSBuknR9TqkOYeCA X-Received: by 2002:a25:ce4b:: with SMTP id x72mr1441134ybe.78.1592428006506; Wed, 17 Jun 2020 14:06:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592428006; cv=none; d=google.com; s=arc-20160816; b=AYBDZ5q5N7SuCu4CVmM9ES5NF8aIzN9uqGk4GJBAyLnL3lljxTTyzwo4Y3+9gSwrqZ HWiK3K+U7o0tOEXsj7v6Q592tGO1fz7udJZkj4jXWR2fj3Z7b+G5RzCqnRcpelsh1qXK i2PTp6o9zZjVSNF89aVrLh+BRLmHMV8Z7qMQuhMMFif9D5BOu8zzsAdGkOkdVsXtCTDd MPtUIEKFom/4u83WWuNHO5t/jd0n+ZFfspXSCJNDuDqqjpWwZszd1gan3ubV6tpUsJuk SxmRS8XKJymZXhUBlh6zhTI0vDxPfJwki7WI2gg7PmC/X5t3KwIjH593DnWBCTwP8qIZ +9Bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=Hf6KnrMMAO78JvrEU5J5AEUZKfa7iIkvGpGZcKZJQGs=; b=uWSCR3QbX9bccfAac+XvbrOexs6tUnyF2jGTlB8ZAkA+4kRqIwH+3QGngjUm/uF9Sa KVwT53ENoxMfW/OW+ZlOZ5JinrznQslnJs3P6AtYAFeOZ+VRKnyiU9ufKuFloMgEoVbh W0O8zYCM2RuraRFr2avepbnpM+c4uv8aVPTbpEvsguu4yXYqvVqlue9Y3lACPmTAHMXR z9xKWY4umJBhBAdi5xPGK+M9+5eQVJlNA58xi6bxiZ2OP5oTz5qfv0cJrpTFV0H09TU9 enj/Zl/TVpLtf5KjjV1q8P2mkS7H0TnXos8eePTpIxX6O+HrW0c6PTM/njRyPEnZtm2J kf/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=XMYikFss; 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=fail (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 184si600017ybc.322.2020.06.17.14.06.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:06:46 -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=fail header.i=@linaro.org header.s=google header.b=XMYikFss; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:42584 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfGf-0006dJ-Ua for patch@linaro.org; Wed, 17 Jun 2020 17:06:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36970) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfDc-0002iK-E0 for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:03:36 -0400 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]:41360) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfDP-0008QF-Qe for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:03:34 -0400 Received: by mail-qk1-x742.google.com with SMTP id n11so3487335qkn.8 for ; Wed, 17 Jun 2020 14:03:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Hf6KnrMMAO78JvrEU5J5AEUZKfa7iIkvGpGZcKZJQGs=; b=XMYikFsscz06ROPMZ9LLk/ydPwrUpyhSe/DtawZ3X35OB/tmH6mv3wRhWZ8VU65em+ 4675uYtMi9RFmjkG4w5PHAXD5xfxs2FpNGzAKvDqLXiBFGbcr9B7knrDL2y0xX5/40HR /IMu4cdcct442Zw7n1ccynwRASWFWG5Tl5stH3eCrdHpf6Bd7mulfVUqhx8JOLcXJrBE +BAcAi+dt6FBYYDEv69Df5AUPRQyUGa/BTWep0zgYRhryK0uXE9LyCB//QX269jGtpk0 IdJKSzS2z2h1uRWz3u8H/GVrPWI5OzsL+37T+4RrexjJDnJ5Av+rkFeS9Z4hofImj6Xq JgrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Hf6KnrMMAO78JvrEU5J5AEUZKfa7iIkvGpGZcKZJQGs=; b=nDPrUWdda/Eqi5i6PtvwOIc/7EqF2+2AKe4XFgVPCG8P/DUrdkvM0v+m8LXlap7lm4 pD02JFDiS3GvZFlmBuVcVdAccn+gMvqZolIUFTzDjTQLp1/tKTrk5+Z49g7eSvIbEfAv qQ5rvRKoOa8WQ2dRVq74ZDd3sHkg9Hr4LjmvZL9aC1Mc8JssKtFV1zBV2Q+s3xoRx4t2 gVRMj8j8BowD+0uXonZb7r27OT38ASdclt/SBWT8NePWYPgjPY2epofagGvKWPLfEGu9 sfjduspvIFZG/+dmIRQnlv4twx9JYZuhnciEl4SdEDObjGISlQY9snsVfngafGKjaKR7 lztg== X-Gm-Message-State: AOAM530SKy1Qkf7lPqc2Vj/OA12zHZsseEyQN2SQNRBDy7DLNiN8yYNB sI1X383UuwSxXTjKRv3Az/pUnxwXnGbcXg== X-Received: by 2002:a37:4ed2:: with SMTP id c201mr602204qkb.138.1592427802647; Wed, 17 Jun 2020 14:03:22 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.03.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:03:21 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 05/73] cpu: introduce process_queued_cpu_work_locked Date: Wed, 17 Jun 2020 17:01:23 -0400 Message-Id: <20200617210231.4393-6-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::742; envelope-from=robert.foley@linaro.org; helo=mail-qk1-x742.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robert.foley@linaro.org, cota@braap.org, Paolo Bonzini , peter.puhov@linaro.org, alex.bennee@linaro.org, Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" This completes the conversion to cpu_mutex_lock/unlock in the file. Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- cpus-common.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) -- 2.17.1 diff --git a/cpus-common.c b/cpus-common.c index b1069193c1..6f51ae127c 100644 --- a/cpus-common.c +++ b/cpus-common.c @@ -329,20 +329,19 @@ void async_safe_run_on_cpu(CPUState *cpu, run_on_cpu_func func, queue_work_on_cpu(cpu, wi); } -void process_queued_cpu_work(CPUState *cpu) +/* Called with the CPU's lock held */ +static void process_queued_cpu_work_locked(CPUState *cpu) { struct qemu_work_item *wi; bool has_bql = qemu_mutex_iothread_locked(); - qemu_mutex_lock(&cpu->lock); if (QSIMPLEQ_EMPTY(&cpu->work_list)) { - qemu_mutex_unlock(&cpu->lock); return; } while (!QSIMPLEQ_EMPTY(&cpu->work_list)) { wi = QSIMPLEQ_FIRST(&cpu->work_list); QSIMPLEQ_REMOVE_HEAD(&cpu->work_list, node); - qemu_mutex_unlock(&cpu->lock); + cpu_mutex_unlock(cpu); if (wi->exclusive) { /* Running work items outside the BQL avoids the following deadlock: * 1) start_exclusive() is called with the BQL taken while another @@ -368,13 +367,19 @@ void process_queued_cpu_work(CPUState *cpu) qemu_mutex_unlock_iothread(); } } - qemu_mutex_lock(&cpu->lock); + cpu_mutex_lock(cpu); if (wi->free) { g_free(wi); } else { atomic_mb_set(&wi->done, true); } } - qemu_mutex_unlock(&cpu->lock); qemu_cond_broadcast(&cpu->cond); } + +void process_queued_cpu_work(CPUState *cpu) +{ + cpu_mutex_lock(cpu); + process_queued_cpu_work_locked(cpu); + cpu_mutex_unlock(cpu); +} From patchwork Wed Jun 17 21:01:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190908 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp800473ilo; Wed, 17 Jun 2020 14:07:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQCHI4Gws74xUPfgP5Ex6CZ2uQOcmQoKKqC+mbjOmFGf+5eSMaJ7BXY+F9EGFVnruBzDb4 X-Received: by 2002:a25:408:: with SMTP id 8mr1325170ybe.500.1592428073281; Wed, 17 Jun 2020 14:07:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592428073; cv=none; d=google.com; s=arc-20160816; b=MnU7FPOA3XoAI48a6Iz6NjB9rm/8apOLFjYsy447Yuo/78lpQMa0Yv9uSVCSHoFHb9 RdJRcJqYRaFWBM1EI92JviOuYhb/nfFdibkcQ7Y8ibsj7/f69fU5GK05RV8dhduG7aq0 TKNvuXtiWeOnjADrBhQWpoPXO31q5s8XM8PQPXSdTgzqA2z4GIYYjAH4qKS1bZrWuyRA 5KMi3r/K/Ve6q5CtZ81XZAlthkaqaBisshHihl48a/+EJiArdU6tXZWAId3vRrOLzCZU A4i8zaU52VINXbfZqYKqFXG2uQc59Byps2PfD8hEUTbXsxzegfNjFDqRLgeIv7n0NluX 8VOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=Aa0/6c3+jxPlKOE23QHPcFZBwOZeQHpI9u7mvd3Wohw=; b=mkHbr0qgIlio1jINyQ7iw0LEy7iDN1eK4IW/inlTafvnkJ9q1UuGZRf1AgA6OzxPZ/ IZ10MIjVwz8kAXMy5w3Ebik5lsFicsdvXCW6zuYoZgrcKmVLIGA4ieknBs9xdNxwBlvn 3K7OqbeDFTcnPPCJFTsvrnMmWyVpT9yvtndlUEFWpGwBZ8/hXEyU+ZrDEUOhEwYWcGcC DTBtplhD0Bw3fHOzhWuxLyF0r782mBiE5nlYPlni6rCBfLupWP5GtVoo7I5OXRwuZ30b S/S+bVju8BXwa+WHKSmL02YXVaB38d5u6KfiIsv3eL9zFDk8lwFZ1Hk9taYaiMMaBzlU nmQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=vsKZ3f93; 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=fail (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 d78si713929ybc.122.2020.06.17.14.07.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:07:53 -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=fail header.i=@linaro.org header.s=google header.b=vsKZ3f93; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:50892 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfHk-0001Wa-Nb for patch@linaro.org; Wed, 17 Jun 2020 17:07:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36950) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfDX-0002h4-Lp for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:03:31 -0400 Received: from mail-qk1-x744.google.com ([2607:f8b0:4864:20::744]:34508) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfDR-0008QT-Qr for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:03:31 -0400 Received: by mail-qk1-x744.google.com with SMTP id f18so3521294qkh.1 for ; Wed, 17 Jun 2020 14:03:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Aa0/6c3+jxPlKOE23QHPcFZBwOZeQHpI9u7mvd3Wohw=; b=vsKZ3f93HJuY3GvGrAXQ7l5e+XOcoG9zvWYvYbpqEbZqwQIbAowyjOTD76BNEs1Ghy fJfYzI9qKJmPANTZvxEbaA6smJsk01IbfzQypoZSPif7MyLX7vKhqq4HCFl/UKGbL4/i GnbHHO15EoeRsF+C9ipNcO0KmGb/AaeikzBq9sfWDkObJVcvOXHpvhJ8ZRp0hnXFAP+c QuFnJqhDkByHaHJODzt1349WMnQ2rOrFiWMpnb+zrMyRSrJiCDSp0plSASjArNwYduP8 MGdKvEuJW0jbdJ2cNkXjqU4GYTq77s9OAr1SNk4HAGViYzddSPYTh2A9JZWk89OfpKCz TvHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Aa0/6c3+jxPlKOE23QHPcFZBwOZeQHpI9u7mvd3Wohw=; b=dB2cXa6k3nv32dSbCoEOM6oGAIv5YjOLHjM/8A2XM7ckptJU8FDsMH/9Q52n+MuXbJ LDUtEuZ++7ydcAI3BFsCXMrsyuNJTeoYDjj6ay7vXpzMm31YHlJaHVkjCym3ggGTHok1 YHE4KU/pMsWBM4bFFihrKNKECUqz+P7xnBPnKwX7AXQs884t1W6L5Xe/2KnWlW1+QQIh OaXUD+CZi/vcFXnmeraYk3rlISSEssg8wcc8Ux+Xn10wtpwxXJ1h/RNVzw5Iz7PKKzgR MDnL/ZVuqK5UXLd6bEARA5uSCkDrBWCevAqCCAabzIGlXQB66/mOYR0i3gLVnPAod+MJ +8FQ== X-Gm-Message-State: AOAM533zd1ubvuMrqupu0NOaf0UMHIvoyTRAiBi4KUOBDTw7qE8vy7E6 1WK/ns0qiDXThNyIus/ISN6RIfBQU9R8dg== X-Received: by 2002:a37:4acc:: with SMTP id x195mr594325qka.454.1592427804435; Wed, 17 Jun 2020 14:03:24 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.03.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:03:23 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 06/73] cpu: make per-CPU locks an alias of the BQL in TCG rr mode Date: Wed, 17 Jun 2020 17:01:24 -0400 Message-Id: <20200617210231.4393-7-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::744; envelope-from=robert.foley@linaro.org; helo=mail-qk1-x744.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robert.foley@linaro.org, Eduardo Habkost , cota@braap.org, Paolo Bonzini , peter.puhov@linaro.org, alex.bennee@linaro.org, Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Before we can switch from the BQL to per-CPU locks in the CPU loop, we have to accommodate the fact that TCG rr mode (i.e. !MTTCG) cannot work with separate per-vCPU locks. That would lead to deadlock since we need a single lock/condvar pair on which to wait for events that affect any vCPU, e.g. in qemu_tcg_rr_wait_io_event. At the same time, we are moving towards an interface where the BQL and CPU locks are independent, and the only requirement is that the locking order is respected, i.e. the BQL is acquired first if both locks have to be held at the same time. In this patch we make the BQL a recursive lock under the hood. This allows us to (1) keep the BQL and CPU locks interfaces separate, and (2) use a single lock for all vCPUs in TCG rr mode. Note that the BQL's API (qemu_mutex_lock/unlock_iothread) remains non-recursive. Added cpu_mutex_destroy, and call from cpu_common_finalize, to avoid destroying qemu_global_mutex, when cpu mutex is destroyed. Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota [RF: Fixed destroy issue, added cpu_mutex_destroy.] Signed-off-by: Robert Foley --- cpus-common.c | 2 +- cpus.c | 101 ++++++++++++++++++++++++++++++++++++++---- hw/core/cpu.c | 5 ++- include/hw/core/cpu.h | 8 +++- stubs/cpu-lock.c | 7 +++ 5 files changed, 110 insertions(+), 13 deletions(-) -- 2.17.1 diff --git a/cpus-common.c b/cpus-common.c index 6f51ae127c..0287018dc4 100644 --- a/cpus-common.c +++ b/cpus-common.c @@ -161,7 +161,7 @@ void run_on_cpu(CPUState *cpu, run_on_cpu_func func, run_on_cpu_data data) while (!atomic_mb_read(&wi.done)) { CPUState *self_cpu = current_cpu; - qemu_cond_wait(&cpu->cond, &cpu->lock); + qemu_cond_wait(&cpu->cond, cpu->lock); current_cpu = self_cpu; } cpu_mutex_unlock(cpu); diff --git a/cpus.c b/cpus.c index 8e54916169..8edc9858d6 100644 --- a/cpus.c +++ b/cpus.c @@ -92,6 +92,12 @@ static unsigned int throttle_percentage; #define CPU_THROTTLE_PCT_MAX 99 #define CPU_THROTTLE_TIMESLICE_NS 10000000 +static inline bool qemu_is_tcg_rr(void) +{ + /* in `make check-qtest', "use_icount && !tcg_enabled()" might be true */ + return use_icount || (tcg_enabled() && !qemu_tcg_mttcg_enabled()); +} + /* * Note: we index the bitmap with cpu->cpu_index + 1 so that the logic * also works during early CPU initialization, when cpu->cpu_index is set to @@ -104,25 +110,75 @@ bool no_cpu_mutex_locked(void) return bitmap_empty(cpu_lock_bitmap, CPU_LOCK_BITMAP_SIZE); } -void cpu_mutex_lock_impl(CPUState *cpu, const char *file, int line) +static __thread bool iothread_locked; +/* + * In TCG rr mode, we make the BQL a recursive mutex, so that we can use it for + * all vCPUs while keeping the interface as if the locks were per-CPU. + * + * The fact that the BQL is implemented recursively is invisible to BQL users; + * the mutex API we export (qemu_mutex_lock_iothread() etc.) is non-recursive. + * + * Locking order: the BQL is always acquired before CPU locks. + */ +static __thread int iothread_lock_count; + +static void rr_cpu_mutex_lock(void) { -/* coverity gets confused by the indirect function call */ + if (iothread_lock_count++ == 0) { + /* + * Circumvent qemu_mutex_lock_iothread()'s state keeping by + * acquiring the BQL directly. + */ + qemu_mutex_lock(&qemu_global_mutex); + } +} + +static void rr_cpu_mutex_unlock(void) +{ + g_assert(iothread_lock_count > 0); + if (--iothread_lock_count == 0) { + /* + * Circumvent qemu_mutex_unlock_iothread()'s state keeping by + * releasing the BQL directly. + */ + qemu_mutex_unlock(&qemu_global_mutex); + } +} + +static void do_cpu_mutex_lock(CPUState *cpu, const char *file, int line) +{ + /* coverity gets confused by the indirect function call */ #ifdef __COVERITY__ - qemu_mutex_lock_impl(&cpu->lock, file, line); + qemu_mutex_lock_impl(cpu->lock, file, line); #else QemuMutexLockFunc f = atomic_read(&qemu_mutex_lock_func); + f(cpu->lock, file, line); +#endif +} + +void cpu_mutex_lock_impl(CPUState *cpu, const char *file, int line) +{ g_assert(!cpu_mutex_locked(cpu)); set_bit(cpu->cpu_index + 1, cpu_lock_bitmap); - f(&cpu->lock, file, line); -#endif + + if (qemu_is_tcg_rr()) { + rr_cpu_mutex_lock(); + } else { + do_cpu_mutex_lock(cpu, file, line); + } } void cpu_mutex_unlock_impl(CPUState *cpu, const char *file, int line) { g_assert(cpu_mutex_locked(cpu)); - qemu_mutex_unlock_impl(&cpu->lock, file, line); clear_bit(cpu->cpu_index + 1, cpu_lock_bitmap); + + if (qemu_is_tcg_rr()) { + rr_cpu_mutex_unlock(); + return; + } + qemu_mutex_unlock_impl(cpu->lock, file, line); } bool cpu_mutex_locked(const CPUState *cpu) @@ -130,6 +186,20 @@ bool cpu_mutex_locked(const CPUState *cpu) return test_bit(cpu->cpu_index + 1, cpu_lock_bitmap); } +void cpu_mutex_destroy(CPUState *cpu) +{ + /* + * In TCG RR, cpu->lock is the BQL under the hood. In all other modes, + * cpu->lock is a standalone per-CPU lock. + */ + if (qemu_is_tcg_rr()) { + cpu->lock = NULL; + } else { + qemu_mutex_destroy(cpu->lock); + g_free(cpu->lock); + } +} + bool cpu_is_stopped(CPUState *cpu) { return cpu->stopped || !runstate_is_running(); @@ -1883,8 +1953,6 @@ bool qemu_in_vcpu_thread(void) return current_cpu && qemu_cpu_is_self(current_cpu); } -static __thread bool iothread_locked = false; - bool qemu_mutex_iothread_locked(void) { return iothread_locked; @@ -1903,6 +1971,8 @@ void qemu_mutex_lock_iothread_impl(const char *file, int line) g_assert(!qemu_mutex_iothread_locked()); bql_lock(&qemu_global_mutex, file, line); + g_assert(iothread_lock_count == 0); + iothread_lock_count++; iothread_locked = true; } @@ -1910,7 +1980,10 @@ void qemu_mutex_unlock_iothread(void) { g_assert(qemu_mutex_iothread_locked()); iothread_locked = false; - qemu_mutex_unlock(&qemu_global_mutex); + g_assert(iothread_lock_count > 0); + if (--iothread_lock_count == 0) { + qemu_mutex_unlock(&qemu_global_mutex); + } } void qemu_cond_wait_iothread(QemuCond *cond) @@ -2146,6 +2219,16 @@ void qemu_init_vcpu(CPUState *cpu) cpu_address_space_init(cpu, 0, "cpu-memory", cpu->memory); } + /* + * In TCG RR, cpu->lock is the BQL under the hood. In all other modes, + * cpu->lock is a standalone per-CPU lock. + */ + if (qemu_is_tcg_rr()) { + qemu_mutex_destroy(cpu->lock); + g_free(cpu->lock); + cpu->lock = &qemu_global_mutex; + } + if (kvm_enabled()) { qemu_kvm_start_vcpu(cpu); } else if (hax_enabled()) { diff --git a/hw/core/cpu.c b/hw/core/cpu.c index 07251d83df..1d2cafe76c 100644 --- a/hw/core/cpu.c +++ b/hw/core/cpu.c @@ -369,7 +369,8 @@ static void cpu_common_initfn(Object *obj) cpu->nr_cores = 1; cpu->nr_threads = 1; - qemu_mutex_init(&cpu->lock); + cpu->lock = g_new(QemuMutex, 1); + qemu_mutex_init(cpu->lock); qemu_cond_init(&cpu->cond); QSIMPLEQ_INIT(&cpu->work_list); QTAILQ_INIT(&cpu->breakpoints); @@ -382,7 +383,7 @@ static void cpu_common_finalize(Object *obj) { CPUState *cpu = CPU(obj); - qemu_mutex_destroy(&cpu->lock); + cpu_mutex_destroy(cpu); } static int64_t cpu_common_get_arch_id(CPUState *cpu) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index e3f7ec06ff..9d25fc25a2 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -377,7 +377,7 @@ struct CPUState { uint64_t random_seed; sigjmp_buf jmp_env; - QemuMutex lock; + QemuMutex *lock; /* fields below protected by @lock */ QemuCond cond; QSIMPLEQ_HEAD(, qemu_work_item) work_list; @@ -485,6 +485,12 @@ void cpu_mutex_unlock_impl(CPUState *cpu, const char *file, int line); */ bool cpu_mutex_locked(const CPUState *cpu); +/** + * cpu_mutex_destroy - Handle how to destroy this CPU's mutex + * @cpu: the CPU whose mutex to destroy + */ +void cpu_mutex_destroy(CPUState *cpu); + /** * no_cpu_mutex_locked - check whether any CPU mutex is held * diff --git a/stubs/cpu-lock.c b/stubs/cpu-lock.c index 1981a00fb3..97a81f447d 100644 --- a/stubs/cpu-lock.c +++ b/stubs/cpu-lock.c @@ -18,3 +18,10 @@ bool no_cpu_mutex_locked(void) { return true; } + +void cpu_mutex_destroy(CPUState *cpu) +{ + qemu_mutex_destroy(cpu->lock); + g_free(cpu->lock); + cpu->lock = NULL; +} From patchwork Wed Jun 17 21:01:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190910 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp800837ilo; Wed, 17 Jun 2020 14:08:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyHFNhQk40jw2mUuAkyTWHOUCkuBVTloJtJKr3TSrBiBOvERUSt4XUfKDbO4qQFdRwZbaIm X-Received: by 2002:a5b:f4d:: with SMTP id y13mr1411890ybr.286.1592428100777; Wed, 17 Jun 2020 14:08:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592428100; cv=none; d=google.com; s=arc-20160816; b=vYAf6aBaj/S5Ac9Yyigp0jhMoG9zRstZLZhau/1x4MYjXCIk3VkU55heFLnS7lVVtn 6eIfifYaZ/Ut4teFoBMM7kdL6NXZnJsSfByxV6dlRtXZGUVTIXk4nzY6ofmO8VOrBEsh yi1bgcLPmJRYLp6rmI2NYhdFcRnkl8LpWjpXY72stGfyjZ/DzJSKp57MRQ57mmGFgZ2Y DbgauWLA3mTbsJRy1TQCr4LcCpL6BS3rew39fayxvjgnMNqgabc2AFbiN1hLbYf5r4zl Ei8dKq31nDCc5o3r2h96L3xsTKIa7/WqbZr8hXrxlYXAAE+qWLRU3z+2u6e3r9gE6uTh 3lvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=1vOKTGG7r7jNUJaDxhAJRyKeVBws+iqtlbFnw8ux2yw=; b=IR1yjpuA40uUuR5Jn+drJR63cKaKZw5greukhg0jWBrEafKTrGR7BUIBzcHBayvUdG 18XhpO6yAM/slH6O9posd1+k5JqUbW/FmNH1JUfB6X34kz45MaFpLJRrQpdgzqxL+Tga XJEYxpS/kvkHBbcjSK0Hb9MhIT2XDm1Om+WxLYX7ENKN3/Nw32RYzIUGtbsW1MdqLzVR AIV+CBJdfYLWWRE7vC2axqVxZJ8VXdmiUczck8zz66z91UaxTfsIcyPa6P/hEEiNTScX ny1vTHVDP1UZ8mX0DV+YELjZN9Gle2Hv8UTkKTLIx3u7jnS4onYPNkQhnl/Fogkyw4lo S/vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=PeGyUbkM; 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=fail (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 v64si651198ybb.444.2020.06.17.14.08.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:08:20 -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=fail header.i=@linaro.org header.s=google header.b=PeGyUbkM; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51048 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfIC-0001aM-6v for patch@linaro.org; Wed, 17 Jun 2020 17:08:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37008) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfDd-0002lr-Vl for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:03:38 -0400 Received: from mail-qt1-x842.google.com ([2607:f8b0:4864:20::842]:45562) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfDT-0008Qe-LQ for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:03:37 -0400 Received: by mail-qt1-x842.google.com with SMTP id y1so2729877qtv.12 for ; Wed, 17 Jun 2020 14:03:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1vOKTGG7r7jNUJaDxhAJRyKeVBws+iqtlbFnw8ux2yw=; b=PeGyUbkMI3pOovZHdFQmrpdylYHtgbPgM8pdzXFMziKQBbXZESlYWjeDUsk0obRFiW L/GIlCYWa8t8oC89L0YJUU193J4kaI5MUCJ8qWlAqlafFUb/VO33UorfmUoQVr+yC81h KcZ2GuYzSxNusMV94s/DiqFkdKk0I0Ivg7e3YRLWPv85ca4uUDg708A2YTohk1kthvE+ Mb8ueMsV9nkWgyPHta5gzyNpm6/boxqx1F7oT4tqNxo7SupapHvRcB3bZtHJOuJdjDYz aOEeS1pU7Ssn1SSvx8H278xuzlTKYzWAWS9znoK6wRe4zKqjQWb/gtViyXjG/am7ctZh 9iJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1vOKTGG7r7jNUJaDxhAJRyKeVBws+iqtlbFnw8ux2yw=; b=bXGKVMdCFTAdxGfeIVbi5ufUnXGBtiQfxiEq1I7bvNhwrX6a5nCqm9lhTsE+l+/gfe ehB5d+w7odjE5Mp6o0HdMdqcZkNK6Yx4i5rRVQJmbknUfqFkgOyfpqBe/4vFAARKaeMk sdQz3EJIrF1aoXcwRkaiCVz7WmMewf0Q/LCx8potE3zwadnZ9yyMcjDDoYExqux4Xe43 MhHNg1KENtJEw2mE3IVfAuFg2eku8iJmgDNEgvUi86jAmymS9004f2wGkwHSCTTYp77Z 78N1Sa70xvjc6dSLb5JAzcXMD2ID+qOqCYEiuQODPKbM0p6EEErAVcURAc10vLbp8M8a yEUg== X-Gm-Message-State: AOAM533vRQAIwDzOEQ3t0dOh1G4+ez0qWw8t+F8/0KltVaTbPTai28fK otOfOz6sJ2u0iq4NHUAZmnhaXZ5Ujzy18A== X-Received: by 2002:aed:3f55:: with SMTP id q21mr1146781qtf.190.1592427805826; Wed, 17 Jun 2020 14:03:25 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.03.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:03:25 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 07/73] tcg-runtime: define helper_cpu_halted_set Date: Wed, 17 Jun 2020 17:01:25 -0400 Message-Id: <20200617210231.4393-8-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::842; envelope-from=robert.foley@linaro.org; helo=mail-qt1-x842.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robert.foley@linaro.org, cota@braap.org, Paolo Bonzini , peter.puhov@linaro.org, alex.bennee@linaro.org, Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- accel/tcg/tcg-runtime.c | 7 +++++++ accel/tcg/tcg-runtime.h | 2 ++ 2 files changed, 9 insertions(+) -- 2.17.1 diff --git a/accel/tcg/tcg-runtime.c b/accel/tcg/tcg-runtime.c index 446465a09a..32ec18fe40 100644 --- a/accel/tcg/tcg-runtime.c +++ b/accel/tcg/tcg-runtime.c @@ -168,3 +168,10 @@ void HELPER(exit_atomic)(CPUArchState *env) { cpu_loop_exit_atomic(env_cpu(env), GETPC()); } + +void HELPER(cpu_halted_set)(CPUArchState *env, uint32_t val) +{ + CPUState *cpu = env_cpu(env); + + cpu->halted = val; +} diff --git a/accel/tcg/tcg-runtime.h b/accel/tcg/tcg-runtime.h index 4eda24e63a..eb7af0e6f0 100644 --- a/accel/tcg/tcg-runtime.h +++ b/accel/tcg/tcg-runtime.h @@ -28,6 +28,8 @@ DEF_HELPER_FLAGS_1(lookup_tb_ptr, TCG_CALL_NO_WG_SE, ptr, env) DEF_HELPER_FLAGS_1(exit_atomic, TCG_CALL_NO_WG, noreturn, env) +DEF_HELPER_FLAGS_2(cpu_halted_set, TCG_CALL_NO_RWG, void, env, i32) + #ifdef CONFIG_SOFTMMU DEF_HELPER_FLAGS_5(atomic_cmpxchgb, TCG_CALL_NO_WG, From patchwork Wed Jun 17 21:01:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190911 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp801656ilo; Wed, 17 Jun 2020 14:09:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvYQUCDDK25lZazm+HKXhMOZNhZMZQrDc8ovB01pIFqy4Y9cEi908KLhh59MT0KvVmgI/m X-Received: by 2002:a25:cd87:: with SMTP id d129mr1258144ybf.395.1592428170046; Wed, 17 Jun 2020 14:09:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592428170; cv=none; d=google.com; s=arc-20160816; b=EoCgfUVe6Fa3LVu2BWqpjoF2Wfg2ZAaGfPUKF2JPUFQW0yPCh3pScrpfwt4zx4jnjG ojynwat1I9SnV9sPr/TpbYZECLQrqJwqNcwYjVJWs4x58szZaXrkvnxQshXRzSB51hpB WRPD1oVSBkmomIUWSQGnMts/DjkowIzG31ASsIvOtq/bZyc3vyOxmW7EWnRxpp9/ibGj aSmBP83XoavilWHAzs14N8/gp7fqyishGyhOE8m2NtWVA1jbbftNO53Xc8IyTrEYcCR4 1askMCEUmTPLhAkM+5NOIB6irjQYMFKIzW7A8P4kGraP8Vh0mUVySdI3AocPeYFCElDC yL9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=nYtL05IMdrK2PLihxK9n2nGdaQygV4Nn/DL2l37l62U=; b=ujWKZ3G4KuxIjC1aF0bK9l7teCZQ76JVV1LwSKaHNL1Rx9vTFDLrVhH8ceEJM/h6q4 CKQTtU3QG3XcoyyUlGspzHZFDjKKl/lbeXf/7m6UgDmnXBbRgY6bcZF3Qlj2qXNPAm8y MT0tsfr+SVg80C8pem2bo5Pnz/Wx8vvUBg5TgB/+ltdSi15HrCptRcmtWBVZ9BSSlAv8 PqX1VXsZUV18+MNjYEI54qTzJWszxImA7l48MJBzOSeu2wNa1uChEU5EtFj6/kLpCK5l nsulBbtkHBLkF5kXnpud/EgKY76olbqUVQWfZo7o9zxk+LDuMmN7yLPVxjAHejaLS8JF W+gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=uf2sSmV1; 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=fail (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 z11si607184ybp.361.2020.06.17.14.09.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:09:30 -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=fail header.i=@linaro.org header.s=google header.b=uf2sSmV1; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:58450 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfJJ-0004ZH-Ho for patch@linaro.org; Wed, 17 Jun 2020 17:09:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37030) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfDe-0002nG-KF for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:03:38 -0400 Received: from mail-qv1-xf43.google.com ([2607:f8b0:4864:20::f43]:38875) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfDV-0008Qv-K6 for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:03:38 -0400 Received: by mail-qv1-xf43.google.com with SMTP id ec10so1758972qvb.5 for ; Wed, 17 Jun 2020 14:03:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nYtL05IMdrK2PLihxK9n2nGdaQygV4Nn/DL2l37l62U=; b=uf2sSmV1u0B0TpF0NljmOMjFOfBWEdoYIHpMMtB5x4sJWIcBCHgIL6cvPlhDmOhjBR upte1RQ8EBrJXbztVgOgi1AocARBTmewIZtuWR7Msmuu1hsKj1d9heUzvsTvVQ5c+W38 LVbKP+t00bXNQgoGlFVsWnfjhKr14GsABcg9SWB8Xdp4+YxGMJEKRd6TralB2KIdfiRr URFQ+UKgtPa6hJqwgy36FjfJkSWvXMhPh1gGnslt7SXaPJeqFo5s6wB0t6CnSEbusW/F rLWdRnXPM+NXOhatbziPAHdLQ2LijA0liaM7Hfb5ZYU1q21CsxFesqpmceaxWqjJm2r5 T3TQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nYtL05IMdrK2PLihxK9n2nGdaQygV4Nn/DL2l37l62U=; b=UM1ejAs5qak4atDqXbbhslIJYAmZlwo1RJfBdOxVq0CC3W1AT3vn4PejXkkbgr686d XHDC/XrYpc/U6FF45Y/UTPRvCG+rp+ucl80dWJT0S6ChnJUeWUiKj7PWxBpDZB0D0NCa XMYN0Zh1OQ/Irwv/LMz4aRn2EcKLts9kcmhuaqKwv/Cy/7zCs9/BHXztsttYuNxHhaVL tuIjGqwGWLgSmWDtrjKV03BG0opkM6Lycy8BCkZkQ19d7x1dU1LwE9SoXJ4WKwabOZzo AbP2JqvxgduB3YiJSZJ1rosBRzkXNQdJ1zuLleRQzfxq4z0AWgswPzOYC2J+eA1iCzOP a7Lw== X-Gm-Message-State: AOAM532S7f4sVHE24wn1Fhrg6nrvgI5IIJjHVcKN21vLUql7MfO0yt3W UcM0Ouk93iYgfZ+3A1051PvKCRDkgmlKOQ== X-Received: by 2002:ad4:4851:: with SMTP id t17mr594808qvy.160.1592427807531; Wed, 17 Jun 2020 14:03:27 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.03.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:03:26 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 08/73] ppc: convert to helper_cpu_halted_set Date: Wed, 17 Jun 2020 17:01:26 -0400 Message-Id: <20200617210231.4393-9-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::f43; envelope-from=robert.foley@linaro.org; helo=mail-qv1-xf43.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robert.foley@linaro.org, cota@braap.org, qemu-ppc@nongnu.org, peter.puhov@linaro.org, alex.bennee@linaro.org, David Gibson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Cc: qemu-ppc@nongnu.org Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Acked-by: David Gibson Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- target/ppc/translate.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) -- 2.17.1 diff --git a/target/ppc/translate.c b/target/ppc/translate.c index 4ce3d664b5..d30c2159fa 100644 --- a/target/ppc/translate.c +++ b/target/ppc/translate.c @@ -1596,8 +1596,7 @@ GEN_LOGICAL2(nor, tcg_gen_nor_tl, 0x03, PPC_INTEGER); static void gen_pause(DisasContext *ctx) { TCGv_i32 t0 = tcg_const_i32(0); - tcg_gen_st_i32(t0, cpu_env, - -offsetof(PowerPCCPU, env) + offsetof(CPUState, halted)); + gen_helper_cpu_halted_set(cpu_env, t0); tcg_temp_free_i32(t0); /* Stop translation, this gives other CPUs a chance to run */ @@ -3621,8 +3620,7 @@ static void gen_sync(DisasContext *ctx) static void gen_wait(DisasContext *ctx) { TCGv_i32 t0 = tcg_const_i32(1); - tcg_gen_st_i32(t0, cpu_env, - -offsetof(PowerPCCPU, env) + offsetof(CPUState, halted)); + gen_helper_cpu_halted_set(cpu_env, t0); tcg_temp_free_i32(t0); /* Stop translation, as the CPU is supposed to sleep from now */ gen_exception_nip(ctx, EXCP_HLT, ctx->base.pc_next); From patchwork Wed Jun 17 21:01:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190912 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp801865ilo; Wed, 17 Jun 2020 14:09:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgoQZ0P66AQvpAWeYq5Ph97jb/fummCaVmI+0z5PRfu27S2A6HYiZMgJZnP0Z+lFVddvG/ X-Received: by 2002:a25:2604:: with SMTP id m4mr1325928ybm.470.1592428190164; Wed, 17 Jun 2020 14:09:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592428190; cv=none; d=google.com; s=arc-20160816; b=HdDeL+dW3xcD2DFM9OScsEK3Ph9bj3KZwfASGRVs/+iq9bGHKZJ5b+2Lg2JjeFNJhD hBvoTPMlzwZvgZCEt60bkzCxkTlK7fOTTK1+Q+b9edUsXRKboweKDVfpdX4QK65RqIUp JTgoA7G+FNYZhr3nJB7ehW4YXHCWGqUZK+EwDUz5Xb+pZAbQY0MwyTIuUxP2UMHmrVKb O7ipwqwWYQ66VzJqo2/5kgakQwYUZetO/0BP/gaw1LBL9TUi00q8BO6kfLECcmDpbSKu +7m7YsOOY/fbp6XcTLUUcYYE5VgxPrNq14NTO6HxCezcMbHI8hj2RbSlzOzypvVyGKMo VeXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=I06C2sE0s7zrdX3gLkjEgs8DOpvCtPpl7x1fQYW5h5A=; b=rhHylgPEx7cOWtN3PatkWMwhBVdxE8DK0kJ+zvZz/jEj+yCpxQStW1aee3g3as4oi0 H5h81oOjQStZgF/hEXqde9bw0z2lHnsLPCgwUY46tDaX6Flh98lfm9rGLjjo5XI2/P5v 83ZMSBvAUf9HtVB7uvsImRuPPXL9yQHYZLGnH/Ah8dWaJrQebr9zBhRmC69r2OJQBYuu NpRqR2GmJtBfWaHPPQvOuERwrGEuGiM+fWeJlHoII9CWpIgIXRWYLkF90lEU1Kle99u/ 5qQ/iQxL5TNKzlxBKnZsF5PHlQzDIQ84e9jMm1lpZMjbawbTEpojY6vyjc1srH91ccbY Xauw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=GakJUK72; 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=fail (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 l83si560363ybb.355.2020.06.17.14.09.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:09:50 -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=fail header.i=@linaro.org header.s=google header.b=GakJUK72; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:60506 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfJd-0005Oh-Km for patch@linaro.org; Wed, 17 Jun 2020 17:09:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37014) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfDe-0002mJ-7x for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:03:38 -0400 Received: from mail-qv1-xf43.google.com ([2607:f8b0:4864:20::f43]:40741) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfDX-0008R7-BJ for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:03:37 -0400 Received: by mail-qv1-xf43.google.com with SMTP id e2so1755979qvw.7 for ; Wed, 17 Jun 2020 14:03:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=I06C2sE0s7zrdX3gLkjEgs8DOpvCtPpl7x1fQYW5h5A=; b=GakJUK72IOEF2gr6ZnvdYEt0Ixa+LSj089KcAo663SMsOh9Uak7fxg/4RTtL+mO/MT PTE7gH/2bwCTbggFfOsuC5l+tVIk4K0elPXfLB5UO5tkeVl06+gcSDDgSoFO+Zh3UBgS c/O5TfHPAOpU4BP+sTgs6tI+NOptFFEdJIOFYhcaRHEJ+NLN9ftoqUHNPrOE+I5dgfnW 5ZNP2awYQ7jhNJtlDzXDP+oVQbSZTm9hZ/JVOcVgqVqvgRBLrlftglE26Q70h7udHtCq NzSiiXRuNlFJRRT+5crJkVvLm77Nc87XH5veZyvfRFP3rRbjeizlhaBs6MijS0LTCG5w iaCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=I06C2sE0s7zrdX3gLkjEgs8DOpvCtPpl7x1fQYW5h5A=; b=f3iACXxGqMRJELipjCGYzGRc9K7XJa2FbmZua1av2LYTblWtygHVpW9ssPyngGmGtS rpQv2i23R+DhdvFxoiyR4OwtLuukVasZaC0/X4IRnNKnpSOSde+3zKk1wEw7tY+AxJaA meG+g3PV61LoD8CGsn0RtGLkvpIaL6OufM+stlR3MB3fneJza1zNIpofU3xt18CQqdT8 ZwASnKv1yGw72/oA/6qIkZLOmcWRsVgWjtjrWP6EUqzaNqdyKRO9WWUPIodJSyEraTNe a9P3AAn5CIkyfjohQGbm8vBI4Wcn2VmMZe/Lo1a8bJ30rDMD4TsAbYZlVi6bUrbQezqC KlLg== X-Gm-Message-State: AOAM533ujACWKtlq5q3mqcz1ZGJAYh8MW8z4n1cduE8uywbTYknJSRNA k9O3LGwkAHie8uGm6maaB2FBDmXCJXYd0w== X-Received: by 2002:a05:6214:848:: with SMTP id dg8mr552195qvb.152.1592427809217; Wed, 17 Jun 2020 14:03:29 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.03.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:03:28 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 09/73] cris: convert to helper_cpu_halted_set Date: Wed, 17 Jun 2020 17:01:27 -0400 Message-Id: <20200617210231.4393-10-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::f43; envelope-from=robert.foley@linaro.org; helo=mail-qv1-xf43.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.puhov@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, "Edgar E. Iglesias" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" And fix the temp leak along the way. Reviewed-by: Edgar E. Iglesias Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- target/cris/translate.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/target/cris/translate.c b/target/cris/translate.c index aaa46b5bca..6c4f091b7a 100644 --- a/target/cris/translate.c +++ b/target/cris/translate.c @@ -2823,8 +2823,9 @@ static int dec_rfe_etc(CPUCRISState *env, DisasContext *dc) cris_cc_mask(dc, 0); if (dc->op2 == 15) { - tcg_gen_st_i32(tcg_const_i32(1), cpu_env, - -offsetof(CRISCPU, env) + offsetof(CPUState, halted)); + TCGv_i32 tmp = tcg_const_i32(1); + gen_helper_cpu_halted_set(cpu_env, tmp); + tcg_temp_free_i32(tmp); tcg_gen_movi_tl(env_pc, dc->pc + 2); t_gen_raise_exception(EXCP_HLT); return 2; From patchwork Wed Jun 17 21:01:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190907 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp800293ilo; Wed, 17 Jun 2020 14:07:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZIuLbxUXr//b1KkZpNbHdyKeh9MQaXNzzS6RbPne8bu+ErL9f5tXNdt31isq4cCeznVlK X-Received: by 2002:a25:d08c:: with SMTP id h134mr1345558ybg.513.1592428055876; Wed, 17 Jun 2020 14:07:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592428055; cv=none; d=google.com; s=arc-20160816; b=sGm3a8BybioLBYKVi5pWPwh9ARgWqFyhSYTsINb4EtvYRUEXhzhWyR2cpR6CDApPIQ OzGAtIbSDJsXYH1W0kSrGwaxPolIlPX959ShX5/0PacSsEe6doGq/JTMSIhANnARKuRz 95zFeJHQye3NYSProHW6BYQle/XX2sxTryRxTPyT+RQJZfO2cGUDcS9ikQEhR3LrxdzB 0RVdH04bPsLP8Lz00pDTfPzVJr+6G2i05GDIbGGF/QHJR0zeA/6deqkhBO1Z4NJJF6cJ 9mYW44V+sd+kxxM39f/Zcdd4awpD6PrHHXKEBxhUfexr0O7erW4EqAukK1jtTBuYoFSK YDKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=wrWqzZuurKLoDMN6QCL6bZgCudK/zrEU5r5KFbp+gtw=; b=tzaBpCZYEJlBJMrlbr9VQ4Nhvs/ffYlNOK4rnmzwbE6vtCDnl4c1+/9w9RMVjE96QA +JY0rodZxOM1xMwpjTW0aEPwGdNHy9hBipC0+MBOSZCljYJcibfFBmgzXg2cVy7JDPKy FmuXp72CrUEiRxn0Smr1N7kDKOETQ1nbDba+wFof48wa6toPjrjh9P4Qxbc2FyvbE+rg ZUSrM0joDMAt3YWcqL+TTPG2/TdO0i87avTN2kIP55yapSHPPzejUPXqdrG5io6s0/6q Ote/qzOCw/OdaLnwVWB5ajLDShlDziIwy2nMy51JA+KJ0f8umU2K0CXGthMzLgshkzEQ s5jA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=hQoCPWgl; 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=fail (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 g18si636188ybh.69.2020.06.17.14.07.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:07:35 -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=fail header.i=@linaro.org header.s=google header.b=hQoCPWgl; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:50014 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfHT-0001B7-Aq for patch@linaro.org; Wed, 17 Jun 2020 17:07:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37004) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfDd-0002lU-Ot for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:03:37 -0400 Received: from mail-qv1-xf41.google.com ([2607:f8b0:4864:20::f41]:39813) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfDX-0008RF-Q4 for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:03:37 -0400 Received: by mail-qv1-xf41.google.com with SMTP id r16so1760442qvm.6 for ; Wed, 17 Jun 2020 14:03:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wrWqzZuurKLoDMN6QCL6bZgCudK/zrEU5r5KFbp+gtw=; b=hQoCPWglOq4TovAqV8Vh7jPChis7GkW1FdcQ/q/4+2mPBL552PrmZoA95o2z/wtxwl 307nBu0ery1QUYdSLMNvgWKVvHh667gKWdReAhHnG3msMMfPO14KgDFAoSJxi0zD+Y4O N7RAT4TEmn178wK9mszQO6HeCV47LXV6ZRsh7cETFIg1BYWdb+39qQBxHW1ruNxIO9oL blKSVaCcT9Hn8rMBSCBQzPQYJq2PcJylOAKUPVTlFtsLx4nB5XoVNlypuRIuHrz4Gkr2 7E5+zdO3NOSaz+P4V+L1IWgkv4pei+jzLw6TozajGuGpe0DlkvAmjBnE5Xbv2QdKO6m6 quhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wrWqzZuurKLoDMN6QCL6bZgCudK/zrEU5r5KFbp+gtw=; b=eOHqJkqIf1fsxZ4p5M+ma6OxWp5HSjDl/p2V1kga2TUB6LDb/hlKA4MdY646SV6UqI SmOnVTeU4BL79QsJTsr19cWXFKLc5oK7/nqsVeI0cK74dwCkKvPJswLGbV4QS4d2LBH8 JB1GdGTbrj2KUAh1BK1sS0lAseExqjpMmbjLB/AQ91zyBNP9NvZuGcsb4xZX2gxVoeGj FswcS9BB8GbGTNlkeePBO1vWgE+NG5V37xB4s1ByDH2Hw+Rhtlyw+68Jla11Z3RfiO+G 4DoNvefelbN8dtysYILEVChxZ/T1f8cXsuyAs1EtaEoZn2qkQRXf6rautE7HtY8X69+N L+5g== X-Gm-Message-State: AOAM532enHAS678a/hiKFvW5cUlVmn71xAo9H38TS5I/pt8Q2acA/4aH 8wJ6ow9+Vk3kVVOhwv2NnvGdD/Gbe/xdgA== X-Received: by 2002:a0c:806e:: with SMTP id 101mr520295qva.173.1592427810525; Wed, 17 Jun 2020 14:03:30 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.03.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:03:29 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 10/73] hppa: convert to helper_cpu_halted_set Date: Wed, 17 Jun 2020 17:01:28 -0400 Message-Id: <20200617210231.4393-11-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::f41; envelope-from=robert.foley@linaro.org; helo=mail-qv1-xf41.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.puhov@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- target/hppa/translate.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.17.1 diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 52d7bea1ea..9c4d5b28b0 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2725,8 +2725,7 @@ static bool trans_or(DisasContext *ctx, arg_rrr_cf *a) /* Tell the qemu main loop to halt until this cpu has work. */ tmp = tcg_const_i32(1); - tcg_gen_st_i32(tmp, cpu_env, -offsetof(HPPACPU, env) + - offsetof(CPUState, halted)); + gen_helper_cpu_halted_set(cpu_env, tmp); tcg_temp_free_i32(tmp); gen_excp_1(EXCP_HALTED); ctx->base.is_jmp = DISAS_NORETURN; From patchwork Wed Jun 17 21:01:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190917 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp803906ilo; Wed, 17 Jun 2020 14:12:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJa5gxyTh0Dkqe5OOjxunvuR6gNHZCdVpG0JvylnZ+0irkr+ZIrdr4++hBhD2j7cb9mYN1 X-Received: by 2002:a5b:582:: with SMTP id l2mr1262543ybp.147.1592428359841; Wed, 17 Jun 2020 14:12:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592428359; cv=none; d=google.com; s=arc-20160816; b=hnUgweZqf92atvVl2fchLCsyNyAGHI8FQWj3NQ0v56aeHNr8SHDgARlNeTWzQo0yZ7 A4OQ26BcVp4uP6K5BYrlm9cuy/0XNpanh5xHz8RH0Z+yPcc3CDKk8wLqQRBA/fbH37cf l0KMFzzt2t24H5spiApmv8ZTPSJhkbWjPZWymcabXmu7NuzUtYdYVH8ule2XbQqk9A0m EDTbKbWBnxpxBf+oKEB29aA+SVsiJ4pTtPGHZ/4v36KY1txt2xLbyh/AppHWdJdrY+m5 YqBYelzaA8xgo5Wxf5lJgK+4cnuI2P4v3fLUrH/lQh4NBV5925tTgP0MjOQg96hFil0X SBHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=4iFy7dIAe5u1Ho2N3UqzjTBmrVGvnP56Md9pXka22/M=; b=Z6J1asaKbTVSeIpWbYg/BvNcX6i+i1Jzb6pztHvRsPQfvsl4vCg3SpkyvRYTIbH6iu HXWxZ2qqKTwgI4oOCaJfBfUDKfGeDBNBY4tlGYRx3W0NrT+Zo9/NfORIbAdNs8XyjQz7 FuHzm/Gun4y1MRR+BZgMUzz2674k+OR0nVNoIyO1O3NZsGY8Tpn0IPNPLzPeF6pg0EpV sNwlBlmMya1tHi0z0vdvYvhzT7ypjlv1bTlT3Eoz+jY95uOMXuK3QTSs2YL7Q9ZhhIpj KAvOT90Wm8jvDFNq1JaIOTYeUugr4dwpDAmKgR1TI1sOqkocdWXSfR1CM7miXAIiSOaR HpIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=GJq01Zl5; 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=fail (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 k5si679299ybk.27.2020.06.17.14.12.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:12:39 -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=fail header.i=@linaro.org header.s=google header.b=GJq01Zl5; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:40852 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfMN-0000k8-9O for patch@linaro.org; Wed, 17 Jun 2020 17:12:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37022) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfDe-0002mp-DX for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:03:38 -0400 Received: from mail-qv1-xf42.google.com ([2607:f8b0:4864:20::f42]:39814) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfDc-0008RR-5t for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:03:38 -0400 Received: by mail-qv1-xf42.google.com with SMTP id r16so1760478qvm.6 for ; Wed, 17 Jun 2020 14:03:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4iFy7dIAe5u1Ho2N3UqzjTBmrVGvnP56Md9pXka22/M=; b=GJq01Zl56emhpKBWqwD25by/f/y3PvwaKGnN0S0csqDXR/pc0jXiKAhmSkiFIrB7Va /DICE6EnNdLRrs7vSecpwhhTK/fOiWc96RqAkxcnTvNwZVTmTSjfqemkvlnsgr5IDuYM MUfHB6nlnV/2X+g8bKtSgyN3FNVJkj+jQCGkLRslQGywFb9C1x9O1A34RdUkz6y9x0U5 3onK6H0WYJdS0iZOu99mqQa2aXMQT/KtXXhanb0gY5iTPtPLvTfs1URL0aJlyi/SCh+f O+QBcPiTKiR3lALzRugPM/2VK7rriaNlT+tWNGrsc4QU78uXLdUaMsUZAIyM46E8a1gX 1dIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4iFy7dIAe5u1Ho2N3UqzjTBmrVGvnP56Md9pXka22/M=; b=KUubNBeD2hEy6jnY6t/TWmWrIUIeC7F8gpsW+nMsuV8U7Ha0+jKB1nJ8UlcEJpIaJV y1Pn2EwZ6Kdi2wIMO9mExmJ6QAgEO29Wu2/Idy8WGbs3GL6cQ47fUKd3BOsCyNPezQoX wi7yKeTSE1Y/TjessCn1us8NlYmclb2aAdBZDD1KVRCapv8UVaS2B4BQRagl66DW35nL ANCoDgwVIr8BXTLwXYtbJWqf2dzVY9h6HEqpDYfMc640eqk7UpJgpxoqCPGk2G77dCn2 YWgUaB9XGY6oZ9TBiCcqCdDqsHA1Zrn/LK0Z0Yqv8h26O7Roo3unhh86OaNkmbUe1Vpx 43nQ== X-Gm-Message-State: AOAM530w7lWM+DolTJhBqBaw1XTiHMR4rLrQze5ESczHzY13HSqumOZa 43RRLvc7h8YEdGMg0Gi04Jettkt44DMkrA== X-Received: by 2002:ad4:48c7:: with SMTP id v7mr559228qvx.190.1592427811804; Wed, 17 Jun 2020 14:03:31 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.03.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:03:31 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 11/73] m68k: convert to helper_cpu_halted_set Date: Wed, 17 Jun 2020 17:01:29 -0400 Message-Id: <20200617210231.4393-12-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::f42; envelope-from=robert.foley@linaro.org; helo=mail-qv1-xf42.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.puhov@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, Laurent Vivier Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Reviewed-by: Laurent Vivier Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- target/m68k/translate.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) -- 2.17.1 diff --git a/target/m68k/translate.c b/target/m68k/translate.c index 3fc67aa452..35086ff449 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -44,7 +44,6 @@ #undef DEFO32 #undef DEFO64 -static TCGv_i32 cpu_halted; static TCGv_i32 cpu_exception_index; static char cpu_reg_names[2 * 8 * 3 + 5 * 4]; @@ -80,9 +79,6 @@ void m68k_tcg_init(void) #undef DEFO32 #undef DEFO64 - cpu_halted = tcg_global_mem_new_i32(cpu_env, - -offsetof(M68kCPU, env) + - offsetof(CPUState, halted), "HALTED"); cpu_exception_index = tcg_global_mem_new_i32(cpu_env, -offsetof(M68kCPU, env) + offsetof(CPUState, exception_index), @@ -4698,6 +4694,7 @@ DISAS_INSN(halt) DISAS_INSN(stop) { uint16_t ext; + TCGv_i32 tmp; if (IS_USER(s)) { gen_exception(s, s->base.pc_next, EXCP_PRIVILEGE); @@ -4707,7 +4704,9 @@ DISAS_INSN(stop) ext = read_im16(env, s); gen_set_sr_im(s, ext, 0); - tcg_gen_movi_i32(cpu_halted, 1); + tmp = tcg_const_i32(1); + gen_helper_cpu_halted_set(cpu_env, tmp); + tcg_temp_free_i32(tmp); gen_exception(s, s->pc, EXCP_HLT); } From patchwork Wed Jun 17 21:01:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190921 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp805458ilo; Wed, 17 Jun 2020 14:14:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxaD1cbNGEMVHBY4lu13PGmefbonBhYoc4mMlARymhUsxK6M2WvzLwjViVOMnaudPDoqCjO X-Received: by 2002:a25:c052:: with SMTP id c79mr1426330ybf.23.1592428493319; Wed, 17 Jun 2020 14:14:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592428493; cv=none; d=google.com; s=arc-20160816; b=Xb9ozIrgUS6aldAhinRSI+HU27SNQJU6CsrfhRI+p3N2S0/7hXYa6O4Zq2961vUPdg QWY4J9LvTt/vkE3oHmYh9VklIX91AY9FaYUCabCqYlvEO8wdsMcbBCtWCZfr5pkb5i9K OyF3aJlcwUQQXUUeqwOMv2+Cd+9Om5S4+NKiZRHO+A3IyZSgrwZgECSe/m0rHWRaXYLh PM2JnkhHJUsjsPQ9hPunWqsEbzj4e7K8g+Q0B8NAkLmEI1AtF0kuhKIXusxB9mmWu+5S ZDRgquTddSNq4gIA+Cu93uNYgsptl/Kuj0V2ZV/qSeb/5JbTmKe4nxzku1yIbgYeQS57 9HuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=8O2wd0xMJ+DcB/CefCYufYGHDOjb2p67mBVobEDCvB4=; b=mtoqgNFnk757S17mj/cGTRUZxQxQ8yowFW82XXSMKjG447Ik7t1syM+SKsyqUgs3Ws bcgyIrB4Ny2fbZr8FMiQUJig59DVDstzbHuntb7k/fitdTqk14NS7rfHGujHhSUXr7J0 ZLKeMhKNpZWcbDC00TBKmunDR17uJRJWpMudQFwyI9i2hRKnRJfyqIKCeO/Y2UKpG7wU 0yvLF1OoEmgo2loj1b5ShPcLWrTZ/s9i7/SziObqu+gbmSM4y9XzglRC9iIcmqX6mirv Dj+ihGZStsTN1e0Ukkarlsu8VV/93/k9Vjpf+XaqZbGqyb2SkaNp8czp2acJiDjnDdRZ mXwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=EZZo5knf; 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=fail (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 f77si649228yba.56.2020.06.17.14.14.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:14:53 -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=fail header.i=@linaro.org header.s=google header.b=EZZo5knf; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:49378 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfOW-0005DB-Qz for patch@linaro.org; Wed, 17 Jun 2020 17:14:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37056) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfDf-0002p4-80 for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:03:39 -0400 Received: from mail-qk1-x741.google.com ([2607:f8b0:4864:20::741]:37430) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfDc-0008RV-69 for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:03:38 -0400 Received: by mail-qk1-x741.google.com with SMTP id b27so3508327qka.4 for ; Wed, 17 Jun 2020 14:03:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8O2wd0xMJ+DcB/CefCYufYGHDOjb2p67mBVobEDCvB4=; b=EZZo5knfSSDy73/TMZC+g9YfOw3kPYfcF3JMZTKAwDBZ4SD9AxG1sdOmVBprdYx4Fz kMe9jM7AwQ+AqTmf8k0cMLGgsw6JpcKCxzqxOmgD2uZvSG4seCOGnTfgrC+H5c6M3kP5 HwmMOxwDIOGSP5+3nUPAFr0iv0h6/rmtFNPN/90kf9kxcdYEh5bjvU7DAdiizz7pIEqf fSk61QFF9tufPWnFzYtoR0lsljChcD1Y1qFT3M/hbn3LXg2Wik9am7hQwhhSHnqKG+h1 GDR42sWfmg9VLb2kwWDyY2c9YInj73nMuH7mbVp32ovpph73zEWQpXrhODuNmYTjydJ6 qe4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8O2wd0xMJ+DcB/CefCYufYGHDOjb2p67mBVobEDCvB4=; b=CMH7en96ymm6jXKiOeLIq4bfHFKNQN5rWJFygK3t0+qy94lfmB94xeR/JVgmbtjtk7 FL6x4pXM5qsj8jbquNoE9ld3hBer5PH5E5JPtoEQtdLW1NHk7UnSbb1HHdLotEvfBP48 m8vve/bb21f+kTk/+sBTtoluPpuShGnAM1sZa0vRgnsdZjt4sm57Q4s2dA2Mo/N5MFew mYH0Wa0XcJLSC6iX0puj3eVbS7Z8CWDszjjIMhgFktPbTQz4yXeknmsq9TZdwanj5l4M EMpcLmkocrPP0iER7Qb8bMkEp+/c2A07mCSh33NstRCJ2uDyreIaEmuCMNDJB4rmSPsZ 1yTg== X-Gm-Message-State: AOAM530kOepO6wNjEbP+JmBwRCdQIzNZy9JpDgP5Ya5DQpBL2HlmOd6x KkrJLyJU18g1rmyb9B0NvxH3qUL8cH5aPg== X-Received: by 2002:a05:620a:200a:: with SMTP id c10mr590690qka.218.1592427813151; Wed, 17 Jun 2020 14:03:33 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.03.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:03:32 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 12/73] alpha: convert to helper_cpu_halted_set Date: Wed, 17 Jun 2020 17:01:30 -0400 Message-Id: <20200617210231.4393-13-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::741; envelope-from=robert.foley@linaro.org; helo=mail-qk1-x741.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.puhov@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- target/alpha/translate.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) -- 2.17.1 diff --git a/target/alpha/translate.c b/target/alpha/translate.c index 8870284f57..b1cd55e6ca 100644 --- a/target/alpha/translate.c +++ b/target/alpha/translate.c @@ -1226,8 +1226,7 @@ static DisasJumpType gen_call_pal(DisasContext *ctx, int palcode) /* WTINT */ { TCGv_i32 tmp = tcg_const_i32(1); - tcg_gen_st_i32(tmp, cpu_env, -offsetof(AlphaCPU, env) + - offsetof(CPUState, halted)); + gen_helper_cpu_halted_set(cpu_env, tmp); tcg_temp_free_i32(tmp); } tcg_gen_movi_i64(ctx->ir[IR_V0], 0); @@ -1381,8 +1380,7 @@ static DisasJumpType gen_mtpr(DisasContext *ctx, TCGv vb, int regno) /* WAIT */ { TCGv_i32 tmp = tcg_const_i32(1); - tcg_gen_st_i32(tmp, cpu_env, -offsetof(AlphaCPU, env) + - offsetof(CPUState, halted)); + gen_helper_cpu_halted_set(cpu_env, tmp); tcg_temp_free_i32(tmp); } return gen_excp(ctx, EXCP_HALTED, 0); From patchwork Wed Jun 17 21:01:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190925 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp807407ilo; Wed, 17 Jun 2020 14:17:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6HEw4YD1UkNHkRE4VgIRAojfAOcg1cBhzv/pTi1srkGnnTMb22lxRbb0Qfc45VVIP6x/O X-Received: by 2002:a25:5d5:: with SMTP id 204mr1364863ybf.24.1592428666566; Wed, 17 Jun 2020 14:17:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592428666; cv=none; d=google.com; s=arc-20160816; b=yiT5mK6CnKVfqiu9TBndt4BM1oD4NxoxmUmMIBlya2rBpJ45RWGBEu0xGL+jr6lQdY k3+RJe5S2aKkrzT4E2E5/4HXXBUipL3IU4ootMUCBDWU9pjcIIbyCyw5/uWi5vZUY+Kt q+NkON5/Fq8lE5anCxf6xPwPntACBSMkRT+59SrqQd6G+RYTGhXOJm10+S4v5yoeeOZL nQJDVmjj2W3OOMi/Pby2fx4XW7+lPV5bbMp601F1Jd/+5o3e20Pfo574MUZzVrLGTsD9 zlHrHQlHC7wZFPuAeWLAZAZ02kqLhcB/nPZL+ksAnpCodXAJ2uOnR9bS2Ii6l7+JShJN pHJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=XOL0McJNxpiiKDMcuEDzDPwcyrSarpMmiP9igPMccJY=; b=DgouqB8xsA6iYwNkw24kSorXlKpyNIgYBO+jquGv2wzt1dzKUlWihokU8DuFAK0Onp ImNbP40JtcD2WZNvtBWFF50SVCqSH4c1atcHxssOGBMnoQ6A8bJD2yu1cAjJgGTYMw9N hyJCSsFqElqM8eRaGM8HSpsOgt6HQh99LkrdWZgikMrxqBgl3zMQRwH7bHw0FaEiNiOD tROodOE3OPC1bC+aYD9Lq0RQpSG6DEN9RXqx5KSPrJSj4t87kpWEBE5PCtBdEazq+xx0 3Yx1KEJbhQOR0vHJ9VfR0wQ0XlWUuU4BxkGwG9AqoSwPQo+MpKwQRqoabWKTD1+kewZZ Okzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=bWUG+Nn5; 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=fail (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 z6si641947ybf.10.2020.06.17.14.17.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:17:46 -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=fail header.i=@linaro.org header.s=google header.b=bWUG+Nn5; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:57824 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfRK-0001K8-0G for patch@linaro.org; Wed, 17 Jun 2020 17:17:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37122) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfDh-0002t4-Cr for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:03:41 -0400 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]:43930) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfDc-0008Rb-6Q for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:03:41 -0400 Received: by mail-qk1-x743.google.com with SMTP id j68so138258qkb.10 for ; Wed, 17 Jun 2020 14:03:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XOL0McJNxpiiKDMcuEDzDPwcyrSarpMmiP9igPMccJY=; b=bWUG+Nn58G7tf1GVpLj8HXfMR8FrqALNXTDR30Ey5jrxh4ryzsblivnkfST/l5sm0e WAx/s9rdvzkFkCNuoblOq+NDoYMdotzjYIJaC+uINryWEwPfzxrTrEKUlQaTSwCgjI7a Phudp5IaC3VZPmO1Mzm1h474xpskwCp78qAb2Q22heWlEetVQVEsRaLFRgLptur39CPY CJBF6ckB4l3uRFdkque5De7gdofqS8i42aHWGnYHt98B9/+Z1f3rG5yUFZGv9PeWcTDn DBAhH+D4r+5m1pIstGRmB4TwI1FunumjbhwCuyY6QhbEwJmJSHqwSQYbT86c1pnGyVbD 8ZXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XOL0McJNxpiiKDMcuEDzDPwcyrSarpMmiP9igPMccJY=; b=p77qYu3Hm8vewZxrkwq+L2kaA1GE3Nni6axZWywBvgXNqEQXPuXRyfqMmocAyOqfYS RUqojaAdW+HFsf5h5cYt4leGu2MAdoNd1GfWtTEXuBEZACerYMMm3Y9l9qmCobSavgUK f5ooQ5KSC/PCJhlG+84yAb2gC+WTUOgB4+lpJYB7Q97ujEvZ/IbJiv2f+zJRE7M0mX/2 eVzKs919Dju+roEb5FxjmXUY9vPf79kDmrKuzKTSh8vsyS4O2LoO62KNZeP6Rf4anZXt KTxEdv5fXkKS3bDZzuhU6U63w89EfB66JOdcT39z6P4clx05DS4fYcdPgGsFo4WIMPv+ uoog== X-Gm-Message-State: AOAM5331fFfQY1PTfJ5rKYexoI/AU0r+rURRn2kne8T4xSD8O7ce7pLb IlZln+JI7iaqdbj5m+2041eWYYloYMK/pw== X-Received: by 2002:a05:620a:12cd:: with SMTP id e13mr567675qkl.143.1592427814586; Wed, 17 Jun 2020 14:03:34 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.03.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:03:34 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 13/73] microblaze: convert to helper_cpu_halted_set Date: Wed, 17 Jun 2020 17:01:31 -0400 Message-Id: <20200617210231.4393-14-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::743; envelope-from=robert.foley@linaro.org; helo=mail-qk1-x743.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.puhov@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, "Edgar E. Iglesias" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Reviewed-by: Edgar E. Iglesias Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- target/microblaze/translate.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) -- 2.17.1 diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index f6ff2591c3..c08a7f1d39 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -1237,9 +1237,7 @@ static void dec_br(DisasContext *dc) LOG_DIS("sleep\n"); t_sync_flags(dc); - tcg_gen_st_i32(tmp_1, cpu_env, - -offsetof(MicroBlazeCPU, env) - +offsetof(CPUState, halted)); + gen_helper_cpu_halted_set(cpu_env, tmp_1); tcg_gen_movi_i64(cpu_SR[SR_PC], dc->pc + 4); gen_helper_raise_exception(cpu_env, tmp_hlt); tcg_temp_free_i32(tmp_hlt); From patchwork Wed Jun 17 21:01:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190901 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp798400ilo; Wed, 17 Jun 2020 14:05:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxUBHHJTJuQDp4jXld1KlsdaS5N0J3lYMrulL82HxoDaKNYco7znGiF6THTtWXbqWL9U5vA X-Received: by 2002:a25:2313:: with SMTP id j19mr1474163ybj.144.1592427909411; Wed, 17 Jun 2020 14:05:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592427909; cv=none; d=google.com; s=arc-20160816; b=QNyCPdJ/ogrKC7z+C6or3dRe1v2PqJ4+zxJ/rxK8qKXGd1NAU7JEUXpkymwk5kvxlV oEthkUZs3ZF2jRryWSquBBey2T6b26FhrPeFgTJNNnH6oqlKEQenPeC+vAbpZxHxBB0o zHHRLgQA7/VtqV6xsn83ENKxDSNtdAKmr4EsV6Pw0E6vlwrheEC1JjKSekgxiLQtOx1O LiGiftjtoLgVWpyUpJSwTSFjKOQMg+6XN7kgJqAUwO45VsTvHpG7EranHtWUrCNwRBFl Q5z4DNTWtQAK9Ur8DWbxjm97U7nxnjRUWWhpgWZ5On/RmHM1zshqvGhpGw05JUOmSMVO bwEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=38XOeCAg8eirTLUPmY4XSVCYcrFE+9q7Dk1aEtr2HSc=; b=NgbvGq7uljbPwvNXXMhRNIevEfhIsPSh1e2aBdwnva4EwR6vJSmJWu/oDdwy6CfDOu eodtfnnY0dmg9MYiochP4ZeGdgiF1pBtnnHqaemWbXcGZTILsEFjpGKnVqUt3/ik1JlC Q3ndUlwu7MRcYKsRpOx+cRJCi0JBoLoJRTwjl/ujC7K+KjoM5G4CMf+5ucFSWtxsf37q Jv5WoDcRaGoxeEvdT/576mLGlmbt+5n/6ymSDOiB+/Xo+iK5HUa8PQVcRqyRbZNCqLuX y+i6tm5zXziqh2EruLYYTeq/ENUzAy+erOLB9wOgyLeJCMrv+rfpin3K8089/YvDYm++ MDaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=QtqWXwkH; 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=fail (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 b204si596154ybg.181.2020.06.17.14.05.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:05:09 -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=fail header.i=@linaro.org header.s=google header.b=QtqWXwkH; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:34522 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfF6-0002yj-SG for patch@linaro.org; Wed, 17 Jun 2020 17:05:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37070) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfDf-0002q1-Og for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:03:39 -0400 Received: from mail-qv1-xf42.google.com ([2607:f8b0:4864:20::f42]:41385) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfDd-0008Rp-0R for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:03:39 -0400 Received: by mail-qv1-xf42.google.com with SMTP id er17so1755317qvb.8 for ; Wed, 17 Jun 2020 14:03:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=38XOeCAg8eirTLUPmY4XSVCYcrFE+9q7Dk1aEtr2HSc=; b=QtqWXwkH/gGVezhhKpEW7oEkU6PGrLgNCGeRarDoft3Nbw73bQO9gWAlCHjQ+tnSjA gGEElf8eJJuOkr8OBu+CYGdCWGpmcXKHZ38H6o5bCRwVcoguXDME9xVmDK83DIodCZo/ LF2uHOF2Dfkqs18U9flgZVn36PuvcEV01wNFSb7E5kdN7QRg6QmH35K1NB2hfqClGP7p 0rdGigepcWmzigRNdNFz8SjNz8+xQsdCV96rf7yfr3BFRVDFx5i/yj27gtIGVzGqE/+n rMWG4T6+OA87VReCwXhhn19Wtkh0szfEOjH3DRH2OirA6etWTxzq7H/U5NLbmUfJ/VBA q/Bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=38XOeCAg8eirTLUPmY4XSVCYcrFE+9q7Dk1aEtr2HSc=; b=f9ILX8p+mTeRd+IwEcqfKKjW7Nymmvus3o2B3QRykG8YzP0qJbRIDu8Id7EL8GLqtw GNanjWra8xBygxqOysw0HD8U7iKzVsmzfvtg48Kc/9drmANwgw+H3XoK9LhAo2sudwGk NxA39C3FugkC3zlI+dbkyuKM20a+1VOuKMk2ximSZc7yFD1cP4223B4TezhYsjyTN8q4 EjK7di8UWMoEB//jdvS5gMr1BXFXkXcWiwPYeJsVqSfgru5qqlGsASp1UXYnr02UtHBH IZIUpBPpWahmcY1zdbfvtGlsZ7nhXqPU+0og4onIAWlqnXKnIBBugEc82QaPfTbANUvS btEg== X-Gm-Message-State: AOAM5307tvVwUYbl3GcXtX+UQnZM9zF54KONGlQcWnUP9xDl0PDnkzG+ wB9dKG/EYLQUazBJ4scmgW2p4Od3WlwARA== X-Received: by 2002:ad4:590d:: with SMTP id ez13mr555335qvb.177.1592427815933; Wed, 17 Jun 2020 14:03:35 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.03.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:03:35 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 14/73] cpu: define cpu_halted helpers Date: Wed, 17 Jun 2020 17:01:32 -0400 Message-Id: <20200617210231.4393-15-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::f42; envelope-from=robert.foley@linaro.org; helo=mail-qv1-xf42.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robert.foley@linaro.org, cota@braap.org, peter.puhov@linaro.org, alex.bennee@linaro.org, Eduardo Habkost Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" cpu->halted will soon be protected by cpu->lock. We will use these helpers to ease the transition, since right now cpu->halted has many direct callers. Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- include/hw/core/cpu.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) -- 2.17.1 diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 9d25fc25a2..92069ebc59 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -498,6 +498,30 @@ void cpu_mutex_destroy(CPUState *cpu); */ bool no_cpu_mutex_locked(void); +static inline uint32_t cpu_halted(CPUState *cpu) +{ + uint32_t ret; + + if (cpu_mutex_locked(cpu)) { + return cpu->halted; + } + cpu_mutex_lock(cpu); + ret = cpu->halted; + cpu_mutex_unlock(cpu); + return ret; +} + +static inline void cpu_halted_set(CPUState *cpu, uint32_t val) +{ + if (cpu_mutex_locked(cpu)) { + cpu->halted = val; + return; + } + cpu_mutex_lock(cpu); + cpu->halted = val; + cpu_mutex_unlock(cpu); +} + static inline void cpu_tb_jmp_cache_clear(CPUState *cpu) { unsigned int i; From patchwork Wed Jun 17 21:01:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190931 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp810244ilo; Wed, 17 Jun 2020 14:21:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1EhgSDusoY7frJyEGKFulryqN3JV/sl8ZgT8VTx9v4UeJCE+ZCSqH89zC1EcXN4zhr2Vd X-Received: by 2002:a25:b8c7:: with SMTP id g7mr1478486ybm.103.1592428912138; Wed, 17 Jun 2020 14:21:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592428912; cv=none; d=google.com; s=arc-20160816; b=idZBlkmW+uN2zpMyUQacR+tiNsc0sOMEfU8D9+oQJ101+/Ce8dKUlj6rqmUYed0CHJ zqVTPxeuByOSKPRNtbnAcjhM2eAlx1aBbX+5SIpF0+xFzFZqEXJCxXfwBvD1tgHHGY8d 0rltmqE89M/Id0m/5Lb7JvdCw9YEqH2i32CqFVFAMKNLsZCOpc9s0ZtfQeXZ6v/HEeyz rT21367s4p6vnyNc1wJ6GFBKv8qhl8nxGm9gcHSsWEpnM0RWxeXERqBRLbH7IXlTse2E GCADzgrjXVx2GsRINCUQEHcVws1Cy+GyaCTNf/sikW9B5l7/0JLKeoFgi+a9OGdGkKo4 Ksiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=5p5QVMZ54qL4PKza/xfxsC7DswUaUr8tRQACxDFIq5U=; b=tjKFfszqzPOi/pqogZ9Y2ez1W5pDFj5AZ/klSlfu4HVcD1jfwaS0xP//vikJsoKGN1 cz7b2mqwZudNnltVGd9AIipb5DPNlsMJZBNyoY9iI5mKXqzOB0RBSenlaOvZkMMlqRVm qFjSXH5zEuLAEasDYYP2jTMw4/cnoj9GbZ40uePXodwwvTou7EWpDEwtd+vVefKJ8Qck X/SsP/C4e4byk7h9TOb/tP3MsltgmbqQSHcNeB6QxswoIuQEp93NFOaiG5a1E4STj9Y5 YQckYXaF2QlUJ//1MAcdonYqbZnfEi0PtKiYAxDTjZ6no8UvmHA7dkdhbG9fODTU7jry NfGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Ko47ccey; 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=fail (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 q16si693653ybk.13.2020.06.17.14.21.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:21:52 -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=fail header.i=@linaro.org header.s=google header.b=Ko47ccey; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:46692 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfVH-0000Tq-Fv for patch@linaro.org; Wed, 17 Jun 2020 17:21:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37154) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfDi-0002vJ-DE for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:03:42 -0400 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]:42865) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfDe-0008S8-GE for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:03:42 -0400 Received: by mail-qk1-x743.google.com with SMTP id l17so3471079qki.9 for ; Wed, 17 Jun 2020 14:03:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5p5QVMZ54qL4PKza/xfxsC7DswUaUr8tRQACxDFIq5U=; b=Ko47cceyF6xkP1sqhiKJJfvtLpsMqHO2ctU5ho3y93gZ72PKeO8FjMj7g0orB+jRnQ mRt9t7raBAkBcU4xXIAx8Qp+w01TR0dZMjWke81TLI5UXMCvShzZODMEpdO52ewAD1CQ B1+J8Rczl9oeQzX5hceglsk9VeoFHpf+bbb4UTY8iIQP0Z32hz0LhRKE9mkjUw/uRGCS nsPkzTW70M9JMDGga7cnYULifBvGzZfCK1660ye9wa9FC3kSAo0ljkJVFPZMC/yL+RAX JSiXRhmE5dDRDHt70/M6V/vmTQbLHAF6IVn99uiQ0EYxC+W5GudRX5B6qEdMSwUk/mW9 ffKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5p5QVMZ54qL4PKza/xfxsC7DswUaUr8tRQACxDFIq5U=; b=bBJY0xZdN21P6mTif+DLy4Uz/sJeqBD/984R6dVz5fj8yZSiVyeH08pTPyjT5A+d1S xv2kK61TEHEQxd835pkeIG79REQiflsWpcl23c3RKxNBWauf90ZN6FQIWVhFa1OQhcQ5 pdgj9O9WTpFPKuo64xZJZpGmPG8/Q2gLHa6zF/1nib0iJA4FBaqw4/WWT1jmftuPPJqB pypi2aXS0JUkskgV9hKLhk63+niiKxIIbRxQu+AhkUptde/hEgz/jchcdXEun18QRSsv XWyZ0EWEISmhb7HXMuNluLBTMKzoNWDjkIM4KLgzuxU4LNkor15/Wped3rXaFD6hY80R F3YA== X-Gm-Message-State: AOAM533wpHmAMs6GRK+FL/Z7O27fjvNXec6j+RqsomusmaLeoMfRCp8N IeS5UCOUi3olvqimnjzCHcwqp+DFOrsv4g== X-Received: by 2002:a37:5e07:: with SMTP id s7mr622767qkb.20.1592427817350; Wed, 17 Jun 2020 14:03:37 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.03.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:03:36 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 15/73] tcg-runtime: convert to cpu_halted_set Date: Wed, 17 Jun 2020 17:01:33 -0400 Message-Id: <20200617210231.4393-16-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::743; envelope-from=robert.foley@linaro.org; helo=mail-qk1-x743.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robert.foley@linaro.org, cota@braap.org, Paolo Bonzini , peter.puhov@linaro.org, alex.bennee@linaro.org, Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- accel/tcg/tcg-runtime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/accel/tcg/tcg-runtime.c b/accel/tcg/tcg-runtime.c index 32ec18fe40..ca0774d3bf 100644 --- a/accel/tcg/tcg-runtime.c +++ b/accel/tcg/tcg-runtime.c @@ -173,5 +173,5 @@ void HELPER(cpu_halted_set)(CPUArchState *env, uint32_t val) { CPUState *cpu = env_cpu(env); - cpu->halted = val; + cpu_halted_set(cpu, val); } From patchwork Wed Jun 17 21:01:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190929 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp809045ilo; Wed, 17 Jun 2020 14:20:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzeNUaE+p4U8EqTWoRZ6892WCkd6UEVK32dKbwxx7TFESL2zh28kts9Nx3IWsR77y5wTMs6 X-Received: by 2002:a25:bb0d:: with SMTP id z13mr1355685ybg.417.1592428806490; Wed, 17 Jun 2020 14:20:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592428806; cv=none; d=google.com; s=arc-20160816; b=mXDzK/Is+Qjw6lqnZdJ68Bg4a7Cv3suBeQ2ew/f/VeU8aVQgTlNuOJrzxE+LoJVv2R 7+CNqNTwBXpLrrXjaCp1elXfDx+8pbIScj3K11YbtiUjq++E9S7RgeNlIjpca0OIGtL0 wKJd8uTiW/JsB9a3OOuqhA8xMan8f/mdKLwW2imvuvZSg5ijl4/bjGRhAn3MJjgTrG6H 9ySC1DKdAcLhHJZ1FLGc9kb0x1J7T6TCnu5rkEikineaPIWFB5sNTuKCs7XUds99bMpr y5U6S5hYjMQb+8JJMiJ328gmSPOHwCcX/BydQ1oOi0mQ1ta7sSXPkgu0s89xnUAH1MIi gg2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=Vm7jFPC3E4tKVChYDNiheUybVx+cA91nQK1Z4PmgN4c=; b=x6BWO9Fhtrhdocyn+sufZcgZfeiBYmbpxOQY4BJhPla16t0CCFLL2ky/gHSsLpvsHA b54vh8WtMajpbC60ic2QHib0MHkM8uZApkksw/f6smnsVq8ayemZeesdWBdrFUaiCtun 2tu6h3BR1DRpvSnjd1QD6WqkGkBNLc9lixPr+1DYvuzU7/Y7ySnvCcRiJcitUGwTCvHZ iaSVSQOe3GIfW3HLzR2IHMjGk26pFbRJqHZGiNbauBgHqcKROpXsUJGUkezpP4p9iAJF IPKnek6iVDQjva/xJkHa5l+vAd/A4lkoCa9okd3UQJS8qAggr6EhdCJTKgr6JWIGVp5r 8q7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=dz4gDTBP; 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=fail (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 d11si674729ybs.21.2020.06.17.14.20.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:20:06 -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=fail header.i=@linaro.org header.s=google header.b=dz4gDTBP; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:38126 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfTZ-0004jy-TL for patch@linaro.org; Wed, 17 Jun 2020 17:20:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37144) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfDi-0002uf-3C for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:03:42 -0400 Received: from mail-qt1-x841.google.com ([2607:f8b0:4864:20::841]:39416) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfDf-0008Sd-Sw for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:03:41 -0400 Received: by mail-qt1-x841.google.com with SMTP id k22so2752340qtm.6 for ; Wed, 17 Jun 2020 14:03:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Vm7jFPC3E4tKVChYDNiheUybVx+cA91nQK1Z4PmgN4c=; b=dz4gDTBPsD18T3Jayz0+UMxJvvLmkge2RVqGqhqy7tNMCT8cngvkz43bMlSqYwKNWY zaAdaU4Oj4V8J6wmSlQDg5uqY+sBUYWOmbvlu5Q4in73BLiwvGZsDdA+lY98aFQckC6Q 8YO0/A0ssfFJFohg4VdBqI2QR2DNpzxuh5sz09A5aZSS8EXs82w/QMi7MhhEsP5bYp9K fJlODxSPzYmfKakZBh9h4hKaIOUFHUayYnmhBqv/ozlKy+hwePlv3Kp9krckIA88qe8F QBpmI2pEAX8UvUhbISrebCG3s0aZd53QbZKgwIwu1RdpjPvYm9ndQfgxylpu9BCl3VjH jClQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Vm7jFPC3E4tKVChYDNiheUybVx+cA91nQK1Z4PmgN4c=; b=TWUU0xoGTpU8Sw/BlRT1mNR3SoXM6hGWhUDHIKLogHP+QHYvM7+KxTyFAi9Tdh3HgT BxMrIqBH0+Dty9tWA26Ad1RIil/YE/fU+IgS+YCFTnLBr2BUZ3r0Sh2jLckIr3JVcy2Y 0OLbJI8rXIoEg8wquomEj1npHBPkAi1xJIMWnO18XzN4t5kCtN2jhiGxPQYpMTaZRAui /l/3R4CKOoVtcEZBPnvXyJngzchopz8IvQJHop43tTA5DZrQEADnUDT6qNlffxcWylqT 8cC0jWYaVFA653qiZpdHlChLUzlIlpVBK9506dX5U1PTBef0XGQ9RUUgkII/2w8ysTQE z9Ig== X-Gm-Message-State: AOAM533iLD7C1I8qgTgtU4XgHNOl9K4kl2Jt2UZrrxr5mW7Z8ceLuAnr C/a4zH5lH8A0RoFhV+Sg7FmWMLpucXD74A== X-Received: by 2002:ac8:1285:: with SMTP id y5mr1096548qti.245.1592427818712; Wed, 17 Jun 2020 14:03:38 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.03.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:03:38 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 16/73] hw/semihosting: convert to cpu_halted_set Date: Wed, 17 Jun 2020 17:01:34 -0400 Message-Id: <20200617210231.4393-17-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::841; envelope-from=robert.foley@linaro.org; helo=mail-qt1-x841.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.puhov@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Robert Foley Reviewed-by: Alex Bennée --- hw/semihosting/console.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/hw/semihosting/console.c b/hw/semihosting/console.c index 22e7827824..01cafa4bca 100644 --- a/hw/semihosting/console.c +++ b/hw/semihosting/console.c @@ -130,7 +130,7 @@ static void console_wake_up(gpointer data, gpointer user_data) { CPUState *cs = (CPUState *) data; /* cpu_handle_halt won't know we have work so just unbung here */ - cs->halted = 0; + cpu_halted_set(cs, 0); qemu_cpu_kick(cs); } @@ -153,7 +153,7 @@ target_ulong qemu_semihosting_console_inc(CPUArchState *env) g_assert(current_cpu); if (fifo8_is_empty(&c->fifo)) { c->sleeping_cpus = g_slist_prepend(c->sleeping_cpus, current_cpu); - current_cpu->halted = 1; + cpu_halted_set(current_cpu, 1); current_cpu->exception_index = EXCP_HALTED; cpu_loop_exit(current_cpu); /* never returns */ From patchwork Wed Jun 17 21:01:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190937 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp812028ilo; Wed, 17 Jun 2020 14:24:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxBFlQUMg35tSm6/ftZrKvFXOm8h/XwSmTIo4J1TwJJHFzwczz1qK3CdZgg9u+tMixUan4m X-Received: by 2002:a25:c74b:: with SMTP id w72mr1563897ybe.191.1592429076259; Wed, 17 Jun 2020 14:24:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592429076; cv=none; d=google.com; s=arc-20160816; b=YxeJYK8g+Z9gyivRKscHmonQXq0RZx04bQ3pztfAwL4PlW2uc3r4lVPpXQBwklIpf1 vwmYOdogvZyN8C7LrPsHxkEMCTJggXS6PPEFjGpSU/GpEzPcNYhP+4UPI9Fs6KvLoiEV jBJsAG9DhIqRcrJfSOBlDvPsl3MMk5DwkTGrzzv/Sj0vyhg9zaTLmc9KTwHMMKvAR04M 5nzd9AU+hYGI5iBWhmZy8NUY09sMIAMPi9TrzMZZ1AbHwSpN9lntJoLsW+UEnPds4nzu FoGheP+sNHnjW/AoXpzS6+sNf1/+cTkxYOExj8qdRLfMGFuk3efPLm8eZp7486pu/ePK rU/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=8/IOqlv1sAgxjuNf6Y85K/ZDCKml0j6c2FyJ0KPQgug=; b=BLktrCtiKyNsG4vo0Fm0o8WeXNUGG6Hm/ONstECjT3qG7xsBthT5H4VI4v1BKhZGTV CLesXEbYtP3UNU3ch1/Rm2LnGbXh/YGwQ5uITrUm2/oFVK1qoPvNCJd5EVGb6TP2B+oe u3oEeemjlF+rf+3fBORo9t8uBwUl0b/VOP1ZqcRrsEM181alELtDGlVlNpIas89DJIY1 Iin+lmkQR+7Ryga1hPoyU615OxUMayQ7+rAVMFvFqeXCo9cRkJUHSeFIsyVRmYWpJfjD nj66RG5Lx2C/HMmxVCcfe5xzSqKEijRT+EbNRtSO2+gdjHAhO17xMAt//7rnLZsjxnwU 4+WA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=UaETTkwf; 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=fail (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 y2si656545ybo.286.2020.06.17.14.24.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:24:36 -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=fail header.i=@linaro.org header.s=google header.b=UaETTkwf; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:55122 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfXv-0003sT-N8 for patch@linaro.org; Wed, 17 Jun 2020 17:24:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37176) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfDj-0002xr-GY for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:03:43 -0400 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]:37823) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfDh-0008T7-Ho for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:03:43 -0400 Received: by mail-qt1-x843.google.com with SMTP id d27so2765364qtg.4 for ; Wed, 17 Jun 2020 14:03:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8/IOqlv1sAgxjuNf6Y85K/ZDCKml0j6c2FyJ0KPQgug=; b=UaETTkwfDdnYPXLtIYH5paeb1vy/0aphoujhPrx+mgSsso+GIaJR6UIeoBCE78mT7Z 6FruA6t8aHcrQ98v33eAc8R0suRVo6PUjRdIPuzDyqj7r8NUd4Hzk9pKvYPpdYiEpS6i An6MkTkh+l1GxUZSi2Lkmt0rXkOwlj8VVLgZrnZhpSZptW0lg0akKVwJNr73JM/cl7XE ZYqUoCwTRY6bKuWMYoKv73msc8QQOe9HEpEYN7i4i4QiVtFxsKW0WX9YEwh937gewEWk f0zxdmh/6IlpQeLQsIMUjL81/OUOVjnOFDA9hnWPq0He2VjhTaNkmfiQLyTLiEMeqwnt X54A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8/IOqlv1sAgxjuNf6Y85K/ZDCKml0j6c2FyJ0KPQgug=; b=TiRadLFBTncll8IuBlVJ726z6yNI5GpzKZ1Du+jHC6lqh9RKE/UH3Tg7w48ENkhNE6 jF/GGpVzK3Iana8ru+M7/ysaSPtlInvxvo2NKXYfZ43R8DSfGchcSrZsAL2zmzg4p9Hq 7rFvwCWtQpI7MChgwDGPz9AaF+LYKNdDbxfnvylaUxR+iRVYYlXaYKpqMJ6XoiE3xeIK FISSfVSiOhG6MDyfjDSsHBrwcXMP/rqZUnlLBXUHG7J2O5lac8pnp53anfNS53nH0P7C EoXvkk1B8a9Hs4e0oNhNjUjHYpuFiTAsGlX5kwMRYQ4I99nNIGpnvhfVKiGGHgiRkupK A+DA== X-Gm-Message-State: AOAM5327fjU6B2MXHlZlAhabakh/cvH2CeffYekx0s1O20XFdV8++KRk uA0swO3rmn8dJ0mK/ZIg3P/uwN9+8Moz9g== X-Received: by 2002:ac8:6bc1:: with SMTP id b1mr1111814qtt.65.1592427820196; Wed, 17 Jun 2020 14:03:40 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.03.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:03:39 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 17/73] arm: convert to cpu_halted Date: Wed, 17 Jun 2020 17:01:35 -0400 Message-Id: <20200617210231.4393-18-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::843; envelope-from=robert.foley@linaro.org; helo=mail-qt1-x843.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , robert.foley@linaro.org, cota@braap.org, qemu-arm@nongnu.org, peter.puhov@linaro.org, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Cc: Andrzej Zaborowski Cc: Peter Maydell Cc: qemu-arm@nongnu.org Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- hw/arm/omap1.c | 4 ++-- hw/arm/pxa2xx_gpio.c | 2 +- hw/arm/pxa2xx_pic.c | 2 +- target/arm/arm-powerctl.c | 6 +++--- target/arm/cpu.c | 2 +- target/arm/op_helper.c | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) -- 2.17.1 diff --git a/hw/arm/omap1.c b/hw/arm/omap1.c index 6ba0df6b6d..d0963a7ff7 100644 --- a/hw/arm/omap1.c +++ b/hw/arm/omap1.c @@ -1776,7 +1776,7 @@ static uint64_t omap_clkdsp_read(void *opaque, hwaddr addr, case 0x18: /* DSP_SYSST */ cpu = CPU(s->cpu); return (s->clkm.clocking_scheme << 11) | s->clkm.cold_start | - (cpu->halted << 6); /* Quite useless... */ + (cpu_halted(cpu) << 6); /* Quite useless... */ } OMAP_BAD_REG(addr); @@ -3797,7 +3797,7 @@ void omap_mpu_wakeup(void *opaque, int irq, int req) struct omap_mpu_state_s *mpu = (struct omap_mpu_state_s *) opaque; CPUState *cpu = CPU(mpu->cpu); - if (cpu->halted) { + if (cpu_halted(cpu)) { cpu_interrupt(cpu, CPU_INTERRUPT_EXITTB); } } diff --git a/hw/arm/pxa2xx_gpio.c b/hw/arm/pxa2xx_gpio.c index d6d0d0b08e..266a1d45b4 100644 --- a/hw/arm/pxa2xx_gpio.c +++ b/hw/arm/pxa2xx_gpio.c @@ -132,7 +132,7 @@ static void pxa2xx_gpio_set(void *opaque, int line, int level) pxa2xx_gpio_irq_update(s); /* Wake-up GPIOs */ - if (cpu->halted && (mask & ~s->dir[bank] & pxa2xx_gpio_wake[bank])) { + if (cpu_halted(cpu) && (mask & ~s->dir[bank] & pxa2xx_gpio_wake[bank])) { cpu_interrupt(cpu, CPU_INTERRUPT_EXITTB); } } diff --git a/hw/arm/pxa2xx_pic.c b/hw/arm/pxa2xx_pic.c index 105c5e63f2..3c58546e30 100644 --- a/hw/arm/pxa2xx_pic.c +++ b/hw/arm/pxa2xx_pic.c @@ -59,7 +59,7 @@ static void pxa2xx_pic_update(void *opaque) PXA2xxPICState *s = (PXA2xxPICState *) opaque; CPUState *cpu = CPU(s->cpu); - if (cpu->halted) { + if (cpu_halted(cpu)) { mask[0] = s->int_pending[0] & (s->int_enabled[0] | s->int_idle); mask[1] = s->int_pending[1] & (s->int_enabled[1] | s->int_idle); if (mask[0] || mask[1]) { diff --git a/target/arm/arm-powerctl.c b/target/arm/arm-powerctl.c index b75f813b40..f0db413519 100644 --- a/target/arm/arm-powerctl.c +++ b/target/arm/arm-powerctl.c @@ -64,7 +64,7 @@ static void arm_set_cpu_on_async_work(CPUState *target_cpu_state, /* Initialize the cpu we are turning on */ cpu_reset(target_cpu_state); - target_cpu_state->halted = 0; + cpu_halted_set(target_cpu_state, 0); if (info->target_aa64) { if ((info->target_el < 3) && arm_feature(&target_cpu->env, @@ -241,7 +241,7 @@ static void arm_set_cpu_on_and_reset_async_work(CPUState *target_cpu_state, /* Initialize the cpu we are turning on */ cpu_reset(target_cpu_state); - target_cpu_state->halted = 0; + cpu_halted_set(target_cpu_state, 0); /* Finally set the power status */ assert(qemu_mutex_iothread_locked()); @@ -297,7 +297,7 @@ static void arm_set_cpu_off_async_work(CPUState *target_cpu_state, assert(qemu_mutex_iothread_locked()); target_cpu->power_state = PSCI_OFF; - target_cpu_state->halted = 1; + cpu_halted_set(target_cpu_state, 1); target_cpu_state->exception_index = EXCP_HLT; } diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 5b7a36b5d7..df5c019145 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -175,7 +175,7 @@ static void arm_cpu_reset(DeviceState *dev) env->vfp.xregs[ARM_VFP_MVFR2] = cpu->isar.mvfr2; cpu->power_state = cpu->start_powered_off ? PSCI_OFF : PSCI_ON; - s->halted = cpu->start_powered_off; + cpu_halted_set(s, cpu->start_powered_off); if (arm_feature(env, ARM_FEATURE_IWMMXT)) { env->iwmmxt.cregs[ARM_IWMMXT_wCID] = 0x69051000 | 'Q'; diff --git a/target/arm/op_helper.c b/target/arm/op_helper.c index eb0de080f1..88c86a4346 100644 --- a/target/arm/op_helper.c +++ b/target/arm/op_helper.c @@ -305,7 +305,7 @@ void HELPER(wfi)(CPUARMState *env, uint32_t insn_len) } cs->exception_index = EXCP_HLT; - cs->halted = 1; + cpu_halted_set(cs, 1); cpu_loop_exit(cs); } From patchwork Wed Jun 17 21:01:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190915 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp803718ilo; Wed, 17 Jun 2020 14:12:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzu8h7gShr6sJ4IktEP1p2DtxXK2/xcoY1cqAhZs1BCVxddXBF+ow3x44RWL8bg8Bm7XVdt X-Received: by 2002:a25:ad5a:: with SMTP id l26mr1407002ybe.188.1592428343493; Wed, 17 Jun 2020 14:12:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592428343; cv=none; d=google.com; s=arc-20160816; b=RbdYgXLfO3KYtNuhqt0Gzf7r5y/W9CE6ntdDy/K0/gwAhYRTEssppsmo1Irs8/CmPh +BMSmdrOBj5HNjLkDAq2+K2M+irUwQFpHcY3sR/RciyuI3kDEnf6NwwPWbKUDM0tik0Y w+DO4CPI07mI6xEUzzJkHR10BUPe0eXbBxT78j6rfFrl2iD0oyxMzx3Gt5ahpQiU6+jC 5L/wRFOQASHOAJH5Ih6cKjMLkfYebtHSkWLLwZq7aOqo8q31a4sKrl82JgtcILRMnX/A 0nT2uf0LVcaf0u6mo97FgKkK8XaMWvKlYh63y7hOrzvnzP7Ev9vlKXmZNwXhQA6kkCDU FXHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=gPDP1ha9C7ALCv7aOZuUhe7Y6Lzn4ZCDvLz9ksRTpOw=; b=GB1tgpMjqUn4Hi40SyDF1JPIrNMMoE5sCNazLyzgMulgU1vZVxk8szr94wUmLwkmkM Uk5QulWUpJFexDvZT5BTinEHXgEFYTPj/XaFwZa3voG8Q2+r7vXWQ+R8OmNM98IClgQA Hgy0vbN2a8DKswPiJyruzU/4Tl6NhniwgthqIJnDggDPSG7GgrtHhVjndnnXo1V+ftmd mYeIoHZDEw+RYM/zHg8WU+i1eALm14Upem1j300oOAlgfMz5pgyKoSgGYW3V4RHhdunz lT7P/ZsFHH9YZxo8W802OJwWpwxJJRmnNqM27pNYefUB/BEPBV3g0CYpC2rbbEqEXS5O F8SA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=sA0vVj2C; 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=fail (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 n184si684335ybc.403.2020.06.17.14.12.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:12:23 -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=fail header.i=@linaro.org header.s=google header.b=sA0vVj2C; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:41814 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfM6-000197-U9 for patch@linaro.org; Wed, 17 Jun 2020 17:12:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37208) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfDl-00031b-Bk for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:03:45 -0400 Received: from mail-qv1-xf44.google.com ([2607:f8b0:4864:20::f44]:44138) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfDj-0008Ta-9m for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:03:44 -0400 Received: by mail-qv1-xf44.google.com with SMTP id g7so1744157qvx.11 for ; Wed, 17 Jun 2020 14:03:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=gPDP1ha9C7ALCv7aOZuUhe7Y6Lzn4ZCDvLz9ksRTpOw=; b=sA0vVj2C/T5fgTJcomwXG4DEUyfnGpSLfMJ1kos7SFwPDLVieh/gJnYXpKAZOdD6LN lcTFAVOREhqIR0dRc0ImvaoLt61/M7w1WADmt3NsXKnHqKSOx7KmM3p3gBLjVyFKQpip Iyxi7qGbggq8pet/UFssBvVNnAQwUgOTPJWp37PzoTfCDATA6rdK9mjppXj5p6Xv1MCE C8wJz8M/QHE4bkkd4CKcvnAhby8sYfViIMQX9aU2tM4C9G7zG0k+uoEXNmXSqS82EYhk BwBVbZKT/h2BjVqBwaUCdE78b3gVawD7tGpNxKuleTAH/tZAyr5uYk2bW+YinWog1qUu o6Dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=gPDP1ha9C7ALCv7aOZuUhe7Y6Lzn4ZCDvLz9ksRTpOw=; b=tn0Rq6XhtPCk9BIbXa0ZBVRxI3gIuaiNVOGLxix6QEwzMnuoemcubWMUTQFmrEu89q PWTc5FUeV+JQmQWxeG96VLTj09daLFNODySoOOtu1zrRhXhiSvz9kc3Vq+bZ8e2nu7hN sn25nV45KclytDluJqIKFfkTb6c2wWPcgFEyRfmtbI8RQPN8a3JZmjqpWwh4PMYSFPM5 3ZWViLYxRcs8T4cFtC5hzS+RrPW7i4/B1KJYSuNtcb0ubp7Pa8vu/IbAeUFszOXrZaGR trieaqLEgS8QkMd/Q77nWwjKhI1GGnSWGfHFD43nGRMzVo2gf9/ydJDAbfmepcSWqREM x8Ww== X-Gm-Message-State: AOAM533HYaJzVPCLALWA8be82izsRr1gqZ9lQEAEIWyZakFv/qWbOgUf vEE5umJMfSI2IC8g7s3aG9cao7Bswunfww== X-Received: by 2002:a0c:9ae2:: with SMTP id k34mr516617qvf.247.1592427821833; Wed, 17 Jun 2020 14:03:41 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.03.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:03:41 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 18/73] ppc: convert to cpu_halted Date: Wed, 17 Jun 2020 17:01:36 -0400 Message-Id: <20200617210231.4393-19-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::f44; envelope-from=robert.foley@linaro.org; helo=mail-qv1-xf44.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robert.foley@linaro.org, cota@braap.org, qemu-ppc@nongnu.org, peter.puhov@linaro.org, alex.bennee@linaro.org, David Gibson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" In ppce500_spin.c, acquire the lock just once to update both cpu->halted and cpu->stopped. In hw/ppc/spapr_hcall.c, acquire the lock just once to update cpu->halted and call cpu_has_work, since later in the series we'll acquire the BQL (if not already held) from cpu_has_work. Cc: qemu-ppc@nongnu.org Reviewed-by: Richard Henderson Acked-by: David Gibson Signed-off-by: Emilio G. Cota [RF: hw/ppc/spapr_hcall.c, spapr_rtas.c more conversions] Signed-off-by: Robert Foley --- hw/ppc/e500.c | 4 ++-- hw/ppc/ppc.c | 10 +++++----- hw/ppc/ppce500_spin.c | 6 ++++-- hw/ppc/spapr_cpu_core.c | 4 ++-- hw/ppc/spapr_hcall.c | 14 ++++++++------ hw/ppc/spapr_rtas.c | 8 ++++---- target/ppc/excp_helper.c | 4 ++-- target/ppc/helper_regs.h | 2 +- target/ppc/kvm.c | 4 ++-- target/ppc/translate_init.inc.c | 8 ++++---- 10 files changed, 34 insertions(+), 30 deletions(-) -- 2.17.1 diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index 51bf95b303..89db681edd 100644 --- a/hw/ppc/e500.c +++ b/hw/ppc/e500.c @@ -706,7 +706,7 @@ static void ppce500_cpu_reset_sec(void *opaque) /* Secondary CPU starts in halted state for now. Needs to change when implementing non-kernel boot. */ - cs->halted = 1; + cpu_halted_set(cs, 1); cs->exception_index = EXCP_HLT; } @@ -720,7 +720,7 @@ static void ppce500_cpu_reset(void *opaque) cpu_reset(cs); /* Set initial guest state. */ - cs->halted = 0; + cpu_halted_set(cs, 0); env->gpr[1] = (16 * MiB) - 8; env->gpr[3] = bi->dt_base; env->gpr[4] = 0; diff --git a/hw/ppc/ppc.c b/hw/ppc/ppc.c index 4a11fb1640..0e7386ff88 100644 --- a/hw/ppc/ppc.c +++ b/hw/ppc/ppc.c @@ -149,7 +149,7 @@ static void ppc6xx_set_irq(void *opaque, int pin, int level) /* XXX: Note that the only way to restart the CPU is to reset it */ if (level) { LOG_IRQ("%s: stop the CPU\n", __func__); - cs->halted = 1; + cpu_halted_set(cs, 1); } break; case PPC6xx_INPUT_HRESET: @@ -228,10 +228,10 @@ static void ppc970_set_irq(void *opaque, int pin, int level) /* XXX: TODO: relay the signal to CKSTP_OUT pin */ if (level) { LOG_IRQ("%s: stop the CPU\n", __func__); - cs->halted = 1; + cpu_halted_set(cs, 1); } else { LOG_IRQ("%s: restart the CPU\n", __func__); - cs->halted = 0; + cpu_halted_set(cs, 0); qemu_cpu_kick(cs); } break; @@ -445,10 +445,10 @@ static void ppc40x_set_irq(void *opaque, int pin, int level) /* Level sensitive - active low */ if (level) { LOG_IRQ("%s: stop the CPU\n", __func__); - cs->halted = 1; + cpu_halted_set(cs, 1); } else { LOG_IRQ("%s: restart the CPU\n", __func__); - cs->halted = 0; + cpu_halted_set(cs, 0); qemu_cpu_kick(cs); } break; diff --git a/hw/ppc/ppce500_spin.c b/hw/ppc/ppce500_spin.c index 66c1065db2..79313944cf 100644 --- a/hw/ppc/ppce500_spin.c +++ b/hw/ppc/ppce500_spin.c @@ -107,9 +107,11 @@ static void spin_kick(CPUState *cs, run_on_cpu_data data) map_start = ldq_p(&curspin->addr) & ~(map_size - 1); mmubooke_create_initial_mapping(env, 0, map_start, map_size); - cs->halted = 0; - cs->exception_index = -1; + cpu_mutex_lock(cs); + cpu_halted_set(cs, 0); cs->stopped = false; + cpu_mutex_unlock(cs); + cs->exception_index = -1; qemu_cpu_kick(cs); } diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c index 26ad566f42..b69c6c292d 100644 --- a/hw/ppc/spapr_cpu_core.c +++ b/hw/ppc/spapr_cpu_core.c @@ -39,7 +39,7 @@ static void spapr_reset_vcpu(PowerPCCPU *cpu) /* All CPUs start halted. CPU0 is unhalted from the machine level * reset code and the rest are explicitly started up by the guest * using an RTAS call */ - cs->halted = 1; + cpu_halted_set(cs, 1); env->spr[SPR_HIOR] = 0; @@ -88,7 +88,7 @@ void spapr_cpu_set_entry_state(PowerPCCPU *cpu, target_ulong nip, env->gpr[3] = r3; env->gpr[4] = r4; kvmppc_set_reg_ppc_online(cpu, 1); - CPU(cpu)->halted = 0; + cpu_halted_set(CPU(cpu), 0); /* Enable Power-saving mode Exit Cause exceptions */ ppc_store_lpcr(cpu, env->spr[SPR_LPCR] | pcc->lpcr_pm); } diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c index 0f54988f2e..e678ca29a5 100644 --- a/hw/ppc/spapr_hcall.c +++ b/hw/ppc/spapr_hcall.c @@ -1058,17 +1058,19 @@ static target_ulong h_cede(PowerPCCPU *cpu, SpaprMachineState *spapr, env->msr |= (1ULL << MSR_EE); hreg_compute_hflags(env); + cpu_mutex_lock(cs); if (spapr_cpu->prod) { spapr_cpu->prod = false; + cpu_mutex_unlock(cs); return H_SUCCESS; } if (!cpu_has_work(cs)) { - cs->halted = 1; + cpu_halted_set(cs, 1); cs->exception_index = EXCP_HLT; cs->exit_request = 1; } - + cpu_mutex_unlock(cs); return H_SUCCESS; } @@ -1085,7 +1087,7 @@ static target_ulong h_confer_self(PowerPCCPU *cpu) spapr_cpu->prod = false; return H_SUCCESS; } - cs->halted = 1; + cpu_halted_set(cs, 1); cs->exception_index = EXCP_HALTED; cs->exit_request = 1; @@ -1116,7 +1118,7 @@ static target_ulong h_join(PowerPCCPU *cpu, SpaprMachineState *spapr, } /* Don't have a way to indicate joined, so use halted && MSR[EE]=0 */ - if (!cs->halted || (e->msr & (1ULL << MSR_EE))) { + if (!cpu_halted(cs) || (e->msr & (1ULL << MSR_EE))) { last_unjoined = false; break; } @@ -1199,7 +1201,7 @@ static target_ulong h_prod(PowerPCCPU *cpu, SpaprMachineState *spapr, spapr_cpu = spapr_cpu_state(tcpu); spapr_cpu->prod = true; - cs->halted = 0; + cpu_halted_set(cs, 0); qemu_cpu_kick(cs); return H_SUCCESS; @@ -1685,7 +1687,7 @@ target_ulong do_client_architecture_support(PowerPCCPU *cpu, if (cs == CPU(cpu)) { continue; } - if (!cs->halted) { + if (!cpu_halted(cs)) { warn_report("guest has multiple active vCPUs at CAS, which is not allowed"); return H_MULTI_THREADS_ACTIVE; } diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c index bcac0d00e7..2306f2985e 100644 --- a/hw/ppc/spapr_rtas.c +++ b/hw/ppc/spapr_rtas.c @@ -111,7 +111,7 @@ static void rtas_query_cpu_stopped_state(PowerPCCPU *cpu_, id = rtas_ld(args, 0); cpu = spapr_find_cpu(id); if (cpu != NULL) { - if (CPU(cpu)->halted) { + if (cpu_halted(CPU(cpu))) { rtas_st(rets, 1, 0); } else { rtas_st(rets, 1, 2); @@ -155,7 +155,7 @@ static void rtas_start_cpu(PowerPCCPU *callcpu, SpaprMachineState *spapr, env = &newcpu->env; pcc = POWERPC_CPU_GET_CLASS(newcpu); - if (!CPU(newcpu)->halted) { + if (!cpu_halted(CPU(newcpu))) { rtas_st(rets, 0, RTAS_OUT_HW_ERROR); return; } @@ -213,7 +213,7 @@ static void rtas_stop_self(PowerPCCPU *cpu, SpaprMachineState *spapr, */ ppc_store_lpcr(cpu, env->spr[SPR_LPCR] & ~pcc->lpcr_pm); env->spr[SPR_PSSCR] |= PSSCR_EC; - cs->halted = 1; + cpu_halted_set(cs, 1); kvmppc_set_reg_ppc_online(cpu, 0); qemu_cpu_kick(cs); } @@ -238,7 +238,7 @@ static void rtas_ibm_suspend_me(PowerPCCPU *cpu, SpaprMachineState *spapr, } /* See h_join */ - if (!cs->halted || (e->msr & (1ULL << MSR_EE))) { + if (!cpu_halted(cs) || (e->msr & (1ULL << MSR_EE))) { rtas_st(rets, 0, H_MULTI_THREADS_ACTIVE); return; } diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index a988ba15f4..507f64c9e7 100644 --- a/target/ppc/excp_helper.c +++ b/target/ppc/excp_helper.c @@ -305,7 +305,7 @@ static inline void powerpc_excp(PowerPCCPU *cpu, int excp_model, int excp) qemu_log("Machine check while not allowed. " "Entering checkstop state\n"); } - cs->halted = 1; + cpu_halted_set(cs, 1); cpu_interrupt_exittb(cs); } if (env->msr_mask & MSR_HVB) { @@ -1134,7 +1134,7 @@ void helper_pminsn(CPUPPCState *env, powerpc_pm_insn_t insn) CPUState *cs; cs = env_cpu(env); - cs->halted = 1; + cpu_halted_set(cs, 1); /* * The architecture specifies that HDEC interrupts are discarded diff --git a/target/ppc/helper_regs.h b/target/ppc/helper_regs.h index d78c2af63e..f84438f639 100644 --- a/target/ppc/helper_regs.h +++ b/target/ppc/helper_regs.h @@ -168,7 +168,7 @@ static inline int hreg_store_msr(CPUPPCState *env, target_ulong value, #if !defined(CONFIG_USER_ONLY) if (unlikely(msr_pow == 1)) { if (!env->pending_interrupts && (*env->check_pow)(env)) { - cs->halted = 1; + cpu_halted_set(cs, 1); excp = EXCP_HALTED; } } diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c index 2692f76130..aae2ef0ad4 100644 --- a/target/ppc/kvm.c +++ b/target/ppc/kvm.c @@ -1342,7 +1342,7 @@ MemTxAttrs kvm_arch_post_run(CPUState *cs, struct kvm_run *run) int kvm_arch_process_async_events(CPUState *cs) { - return cs->halted; + return cpu_halted(cs); } static int kvmppc_handle_halt(PowerPCCPU *cpu) @@ -1351,7 +1351,7 @@ static int kvmppc_handle_halt(PowerPCCPU *cpu) CPUPPCState *env = &cpu->env; if (!(cs->interrupt_request & CPU_INTERRUPT_HARD) && (msr_ee)) { - cs->halted = 1; + cpu_halted_set(cs, 1); cs->exception_index = EXCP_HLT; } diff --git a/target/ppc/translate_init.inc.c b/target/ppc/translate_init.inc.c index a40888411c..ac59648541 100644 --- a/target/ppc/translate_init.inc.c +++ b/target/ppc/translate_init.inc.c @@ -8540,7 +8540,7 @@ static bool cpu_has_work_POWER7(CPUState *cs) PowerPCCPU *cpu = POWERPC_CPU(cs); CPUPPCState *env = &cpu->env; - if (cs->halted) { + if (cpu_halted(cs)) { if (!(cs->interrupt_request & CPU_INTERRUPT_HARD)) { return false; } @@ -8702,7 +8702,7 @@ static bool cpu_has_work_POWER8(CPUState *cs) PowerPCCPU *cpu = POWERPC_CPU(cs); CPUPPCState *env = &cpu->env; - if (cs->halted) { + if (cpu_halted(cs)) { if (!(cs->interrupt_request & CPU_INTERRUPT_HARD)) { return false; } @@ -8902,7 +8902,7 @@ static bool cpu_has_work_POWER9(CPUState *cs) PowerPCCPU *cpu = POWERPC_CPU(cs); CPUPPCState *env = &cpu->env; - if (cs->halted) { + if (cpu_halted(cs)) { uint64_t psscr = env->spr[SPR_PSSCR]; if (!(cs->interrupt_request & CPU_INTERRUPT_HARD)) { @@ -9118,7 +9118,7 @@ static bool cpu_has_work_POWER10(CPUState *cs) PowerPCCPU *cpu = POWERPC_CPU(cs); CPUPPCState *env = &cpu->env; - if (cs->halted) { + if (cpu_halted(cs)) { uint64_t psscr = env->spr[SPR_PSSCR]; if (!(cs->interrupt_request & CPU_INTERRUPT_HARD)) { From patchwork Wed Jun 17 21:01:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190906 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp799882ilo; Wed, 17 Jun 2020 14:07:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4BI5TdfFRVUeSCm8D6aZSXXVPHTosGuWQv9TAZZhOpRRd47er5hF9wr8Ct8Pun9NNHfe+ X-Received: by 2002:a25:b90e:: with SMTP id x14mr1489221ybj.8.1592428023326; Wed, 17 Jun 2020 14:07:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592428023; cv=none; d=google.com; s=arc-20160816; b=IUXApnW4N/5BhAbRhZ29BdChKkDGxvnHN2uzQNs4eGobHuJxwJuPMDbRAwRTPh6EcH cep2XPynZKlIiyGcdZIlCOkB0+RB/wVh+DydBiO0TsqaBCq/2vx04yi2R8IKgBNot17L AzelD7c1JRGHVyZ7plYp6Pc4aQwJkeqgGBw9O9mE2tHKTvfflGpN51O0Dhly7JQbfVSq vovubts/h/3c4d9YIJby68OgIRVeJFxwy0fufVF++Kjqi7uHVAPL7UHYcdozHQ+cj8gW e2Lb8k0BsCEA4cTxiRV+xjCizd7wDNeXt9eEjiiVNSeba6kbvxVp85Ct5/M2nsR2h2G2 bi+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=B03XAH5wL6d9wQMcetAjOEJJOmedJjFZih4s04YDqvs=; b=ac5CeS0DL4LALw+v9O2yVZ3eaa+Tk34sRGlHeXRI6OTDlu5e6ml13aOtAY+E1tuzep NPdCRXNjqS65GNEPFb8Bj3MfjFv5jiR7lwVcAmW0NKqn+jn9OcDIDHAkOkOliHRXAUbZ SsPpUx7mBQCekIjWqD7AEsHYyqLtLuSwL95d2jvgdCoy1IjPOowVPE88+MHx91JLlC44 NhMt73FmyIw3fTfIEILlk6eWwdg7lfdbYxBnOzulYwzwdMawogMnKIZ+KedZ4rgANbwC dwceHl6fZ6tYnmF66e5u4VLRjySp2ig1nZTZdXy1H6b8grTQoUSchHOT+ufmCZOLjjUZ ji8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=FywU01ug; 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=fail (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 80si694561ybl.93.2020.06.17.14.07.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:07:03 -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=fail header.i=@linaro.org header.s=google header.b=FywU01ug; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:44332 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfGw-0007Ll-OH for patch@linaro.org; Wed, 17 Jun 2020 17:07:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37218) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfDm-00033R-2N for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:03:46 -0400 Received: from mail-qk1-x741.google.com ([2607:f8b0:4864:20::741]:37431) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfDk-0008Tq-CF for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:03:45 -0400 Received: by mail-qk1-x741.google.com with SMTP id b27so3508836qka.4 for ; Wed, 17 Jun 2020 14:03:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=B03XAH5wL6d9wQMcetAjOEJJOmedJjFZih4s04YDqvs=; b=FywU01ugE/Po4A3CGfnl2o0/Ueb0CbiUSIbfHaG0Q+RawwrkEG/urfCMCbxEPZOV7b sfKbFfEHWjCsbfrff3TW717e/zE/rs3PamGHa9nPyVxq6wbDfFqyhTLE0j2NfkLGB+Bq Gc0+HDhi8d+5XjVNYT+2VygAi7bKxv2iTAXoTkbOz39lyExiVXNxyTlzuIItkH1Nb1l6 AKzagW0eE0lvQcNZtD1yXc8qqNY+jIGw/gXUt734RBohaQ8E6vShWXimLD9Gq6GxxjZu o8ZfgmW+9cSelMiapXMoPyShmdt1vqlOputb9AfbJ1eYEJ/TKwqvz4SA6JgecrqYFKkE EUiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=B03XAH5wL6d9wQMcetAjOEJJOmedJjFZih4s04YDqvs=; b=X8vd2nWOfASF3c/TOUULKj/imyey6I7BIfiHL2jK6shQnEpPpTIes3pO/Zj2ocM9b5 m267jNyvy5IGIn3xkQmbxlQ+fu8PyExCmlLBxPBnQbUQnBW2rlmlYJXttOIAdevM3yl+ J3hBQ2X474Tk3jGWYyJNrW4WWyUfN/NfJphPeKCKif22Yury1ON+6yXDQ9+MV/KNsfbN q70jhe5dJay9R5+/rxuWH38bKE8AA8sHB2w61jHjYYegx4sBNzxxkfIokrnzQh47QPcE zJ+D67GNFR5T3GXmL+QqRyBIM30/L4IqEaqvagDgd+/WRI3dNZeciK/WphCfGPzkt7Eu gtTg== X-Gm-Message-State: AOAM532v3H0kYHEyfKJ2eVZTD+pIdJjX7yBAlxhsJcmJUMk2rwxjbhlb L8QbtWY2gbrQCZ0cB/0V/o/0lMaIklWpoA== X-Received: by 2002:a05:620a:14b8:: with SMTP id x24mr531887qkj.284.1592427823243; Wed, 17 Jun 2020 14:03:43 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.03.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:03:42 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 19/73] sh4: convert to cpu_halted Date: Wed, 17 Jun 2020 17:01:37 -0400 Message-Id: <20200617210231.4393-20-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::741; envelope-from=robert.foley@linaro.org; helo=mail-qk1-x741.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robert.foley@linaro.org, Yoshinori Sato , cota@braap.org, peter.puhov@linaro.org, alex.bennee@linaro.org, Aurelien Jarno Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Cc: Aurelien Jarno Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- target/sh4/op_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/target/sh4/op_helper.c b/target/sh4/op_helper.c index 14c3db0f48..d338bbe871 100644 --- a/target/sh4/op_helper.c +++ b/target/sh4/op_helper.c @@ -90,7 +90,7 @@ void helper_sleep(CPUSH4State *env) { CPUState *cs = env_cpu(env); - cs->halted = 1; + cpu_halted_set(cs, 1); env->in_sleep = 1; raise_exception(env, EXCP_HLT, 0); } From patchwork Wed Jun 17 21:01:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190909 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp800725ilo; Wed, 17 Jun 2020 14:08:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3Q31WbbJj+L2FbSym4rGe2gJipA2H8QTn/tjj1SzfdUdROQW4Zh5aoF98qSbMIlbQpq5s X-Received: by 2002:a25:3610:: with SMTP id d16mr1441671yba.213.1592428091998; Wed, 17 Jun 2020 14:08:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592428091; cv=none; d=google.com; s=arc-20160816; b=eYZVrfgrYZna585dwSuSkN9TyXKAEVISUXdjxTFAszUi+a1SxzLy1ktg8JqC/7sDlo Jr+tqMTfADfU513zKXESktBn8r2ewpH/fZBNwbDVhv4lBNmCmwJVnjgQbr9ZPXd0ZY3R r8XmS3Ziv2NJ+kjk8Vz2IIu6g+H3zNmfutiodcWBpbUlt3uUyNvIQ/xYtTGyC7bg2GMO 9dcE7jnXrGZo6qmbMnmXwRV5krd8hqGYUu/owiIY3YpClw21PMK8G4LHAMyuxeF+ujA0 bEXauslKP4r4ACUB+giftZnvxI+pIJSxRE5UihU0uREMyCHz/NzS782M2iWXHBKI/IGH HCzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=Rba7pljRMVc6wa2lS86kVUPY7O/d9hkT9SFA7+vY6nY=; b=pzClDZWlEYiWOZ5zWpVJaB8lSpRO78INPj4xcVMFk0ssoycnc+2bKBQ64LlM0Gqsw0 97AGrIvdCEh4A3vV9prpXRcb7zoowDVwvX7Y54uddpjxUtJ+PSceVAywUvcxU410ohT5 eVO0avnigzN9yHnAmEKhqxRep+yUxSrx5F28GmUwy30zX4Dg+mbhot2hklM2wPCtVcVd URrJrxcg52pEqrDCne6CDk/dH9UqJuqiWfV3bgau5JP9amx8/7Wl67yABiKSWsvnd4OR z2Kndg5afrJByWYD2oEO/3sdxExlLOevhNWEZnKT7sDh6qEQ7QzeIZEdbzWZNTpUsHaJ qw+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=R5z5IR5F; 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=fail (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 e129si641865yba.333.2020.06.17.14.08.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:08:11 -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=fail header.i=@linaro.org header.s=google header.b=R5z5IR5F; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:52806 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfI3-0002JB-Ch for patch@linaro.org; Wed, 17 Jun 2020 17:08:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37242) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfDo-00039i-IF for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:03:48 -0400 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]:45353) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfDm-0008U7-Fu for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:03:48 -0400 Received: by mail-qk1-x742.google.com with SMTP id q8so3449651qkm.12 for ; Wed, 17 Jun 2020 14:03:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Rba7pljRMVc6wa2lS86kVUPY7O/d9hkT9SFA7+vY6nY=; b=R5z5IR5FLnMnMqf2RggbF8wnsY2icPxT3w46kmMuEmy69k/4Mr4UNe+RuR+WiEPvG3 9c8CJRRyY7m6nltryWkmWziQvRZfYasj4SE4VArK46KiVyJ+gazqevXOxXuZqTuDay8U 9X86q5vyz5COzSuzfdMrSntdJ3rZjYQt7Eq5Lt1dQttkcMCrcVV8Vo1J9H6x1Btp9rjo 6Sr1nzX1mKh5hhoW25c15laX42Nri5JALP/VjoR4EXVD56IZn2Zv6dyI+FR9L/LqrxXz fbXETyMyprillHLMW8zUjP4+c2fyHOBDmvmInXSFqQ+yIOGH5Gtlr4YE5cLe6r/hZBmA uerw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Rba7pljRMVc6wa2lS86kVUPY7O/d9hkT9SFA7+vY6nY=; b=DZwubFykX9o+h2C337PtU/9T/36KpWMO3X7ToalaKP0eIIwKU1kmSJYQmIFI/UQbAG oAmXK/JGw0vbuVX8LzKjqvjeWaK7iqR9k2xIeIatvQGWQ90tZaQ19CBRTWwoi2+R2Ngm 15a+CKq9g1faWAQPHQXUUOLFGUQke0x6DH7d5K1hux1/A15ilFS+HCcOvMUFvSqzbCc+ Iovs6/ZiYVsySE0N99oG02Md1SAdq1mJr4gCLQFHZnADqGAm28xpybjhj0FaCaqRn1qw C75GSicr4ufQ2x7TEgpYFRBYqw+qn3CzzQUEsH8oI/vknpMYkY/j+S/x4uas8g4BuCld Icqw== X-Gm-Message-State: AOAM530IJJI1jN5DVLN29GSFkH9B9LDYR1ZPU4w+tThKCScjsbwOqO++ G4PU/NnbHaiT/iz8XjjlJ+gQw8HcUGpmhw== X-Received: by 2002:a37:9684:: with SMTP id y126mr589113qkd.348.1592427825231; Wed, 17 Jun 2020 14:03:45 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.03.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:03:44 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 20/73] i386: convert to cpu_halted Date: Wed, 17 Jun 2020 17:01:38 -0400 Message-Id: <20200617210231.4393-21-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::742; envelope-from=robert.foley@linaro.org; helo=mail-qk1-x742.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robert.foley@linaro.org, "open list:X86 KVM CPUs" , "open list:X86 HAXM CPUs" , Marcelo Tosatti , Roman Bolshakov , cota@braap.org, Colin Xu , Wenchao Wang , Paolo Bonzini , peter.puhov@linaro.org, Sunil Muthuswamy , Richard Henderson , alex.bennee@linaro.org, Eduardo Habkost Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Cc: Eduardo Habkost Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota [RF: Converted new code in i386/hax-all.c to cpu_halted] Signed-off-by: Robert Foley --- target/i386/cpu.c | 2 +- target/i386/cpu.h | 2 +- target/i386/hax-all.c | 6 +++--- target/i386/helper.c | 4 ++-- target/i386/hvf/hvf.c | 4 ++-- target/i386/hvf/x86hvf.c | 4 ++-- target/i386/kvm.c | 10 +++++----- target/i386/misc_helper.c | 2 +- target/i386/whpx-all.c | 6 +++--- 9 files changed, 20 insertions(+), 20 deletions(-) -- 2.17.1 diff --git a/target/i386/cpu.c b/target/i386/cpu.c index b1b311baa2..4d3ab0f3a2 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -6084,7 +6084,7 @@ static void x86_cpu_reset(DeviceState *dev) /* We hard-wire the BSP to the first CPU. */ apic_designate_bsp(cpu->apic_state, s->cpu_index == 0); - s->halted = !cpu_is_bsp(cpu); + cpu_halted_set(s, !cpu_is_bsp(cpu)); if (kvm_enabled()) { kvm_arch_reset_vcpu(cpu); diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 7d77efd9e4..c618b90568 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1880,7 +1880,7 @@ static inline void cpu_x86_load_seg_cache_sipi(X86CPU *cpu, sipi_vector << 12, env->segs[R_CS].limit, env->segs[R_CS].flags); - cs->halted = 0; + cpu_halted_set(cs, 0); } int cpu_x86_get_descr_debug(CPUX86State *env, unsigned int selector, diff --git a/target/i386/hax-all.c b/target/i386/hax-all.c index c93bb23a44..acfb7a6e10 100644 --- a/target/i386/hax-all.c +++ b/target/i386/hax-all.c @@ -511,7 +511,7 @@ static int hax_vcpu_hax_exec(CPUArchState *env) if (((cpu->interrupt_request & CPU_INTERRUPT_HARD) && (env->eflags & IF_MASK)) || (cpu->interrupt_request & CPU_INTERRUPT_NMI)) { - cpu->halted = 0; + cpu_halted_set(cpu, 0); } if (cpu->interrupt_request & CPU_INTERRUPT_INIT) { @@ -529,7 +529,7 @@ static int hax_vcpu_hax_exec(CPUArchState *env) hax_vcpu_sync_state(env, 1); } - if (cpu->halted) { + if (cpu_halted(cpu)) { /* If this vcpu is halted, we must not ask HAXM to run it. Instead, we * break out of hax_smp_cpu_exec() as if this vcpu had executed HLT. * That way, this vcpu thread will be trapped in qemu_wait_io_event(), @@ -594,7 +594,7 @@ static int hax_vcpu_hax_exec(CPUArchState *env) !(cpu->interrupt_request & CPU_INTERRUPT_NMI)) { /* hlt instruction with interrupt disabled is shutdown */ env->eflags |= IF_MASK; - cpu->halted = 1; + cpu_halted_set(cpu, 1); cpu->exception_index = EXCP_HLT; ret = 1; } diff --git a/target/i386/helper.c b/target/i386/helper.c index c3a6e4fabe..058de4073d 100644 --- a/target/i386/helper.c +++ b/target/i386/helper.c @@ -450,7 +450,7 @@ void x86_cpu_dump_state(CPUState *cs, FILE *f, int flags) (env->hflags >> HF_INHIBIT_IRQ_SHIFT) & 1, (env->a20_mask >> 20) & 1, (env->hflags >> HF_SMM_SHIFT) & 1, - cs->halted); + cpu_halted(cs)); } else #endif { @@ -477,7 +477,7 @@ void x86_cpu_dump_state(CPUState *cs, FILE *f, int flags) (env->hflags >> HF_INHIBIT_IRQ_SHIFT) & 1, (env->a20_mask >> 20) & 1, (env->hflags >> HF_SMM_SHIFT) & 1, - cs->halted); + cpu_halted(cs)); } for(i = 0; i < 6; i++) { diff --git a/target/i386/hvf/hvf.c b/target/i386/hvf/hvf.c index be016b951a..b3bd2285fa 100644 --- a/target/i386/hvf/hvf.c +++ b/target/i386/hvf/hvf.c @@ -709,7 +709,7 @@ int hvf_vcpu_exec(CPUState *cpu) vmx_update_tpr(cpu); qemu_mutex_unlock_iothread(); - if (!cpu_is_bsp(X86_CPU(cpu)) && cpu->halted) { + if (!cpu_is_bsp(X86_CPU(cpu)) && cpu_halted(cpu)) { qemu_mutex_lock_iothread(); return EXCP_HLT; } @@ -742,7 +742,7 @@ int hvf_vcpu_exec(CPUState *cpu) (env->eflags & IF_MASK)) && !(cpu->interrupt_request & CPU_INTERRUPT_NMI) && !(idtvec_info & VMCS_IDT_VEC_VALID)) { - cpu->halted = 1; + cpu_halted_set(cpu, 1); ret = EXCP_HLT; break; } diff --git a/target/i386/hvf/x86hvf.c b/target/i386/hvf/x86hvf.c index 5cbcb32ab6..c09cf160ef 100644 --- a/target/i386/hvf/x86hvf.c +++ b/target/i386/hvf/x86hvf.c @@ -446,7 +446,7 @@ int hvf_process_events(CPUState *cpu_state) if (((cpu_state->interrupt_request & CPU_INTERRUPT_HARD) && (env->eflags & IF_MASK)) || (cpu_state->interrupt_request & CPU_INTERRUPT_NMI)) { - cpu_state->halted = 0; + cpu_halted_set(cpu_state, 0); } if (cpu_state->interrupt_request & CPU_INTERRUPT_SIPI) { hvf_cpu_synchronize_state(cpu_state); @@ -458,5 +458,5 @@ int hvf_process_events(CPUState *cpu_state) apic_handle_tpr_access_report(cpu->apic_state, env->eip, env->tpr_access_type); } - return cpu_state->halted; + return cpu_halted(cpu_state); } diff --git a/target/i386/kvm.c b/target/i386/kvm.c index b3c13cb898..eda51904dd 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -3594,7 +3594,7 @@ static int kvm_get_mp_state(X86CPU *cpu) } env->mp_state = mp_state.mp_state; if (kvm_irqchip_in_kernel()) { - cs->halted = (mp_state.mp_state == KVM_MP_STATE_HALTED); + cpu_halted_set(cs, mp_state.mp_state == KVM_MP_STATE_HALTED); } return 0; } @@ -4152,7 +4152,7 @@ int kvm_arch_process_async_events(CPUState *cs) kvm_queue_exception(env, EXCP12_MCHK, 0, 0); env->has_error_code = 0; - cs->halted = 0; + cpu_halted_set(cs, 0); if (kvm_irqchip_in_kernel() && env->mp_state == KVM_MP_STATE_HALTED) { env->mp_state = KVM_MP_STATE_RUNNABLE; } @@ -4175,7 +4175,7 @@ int kvm_arch_process_async_events(CPUState *cs) if (((cs->interrupt_request & CPU_INTERRUPT_HARD) && (env->eflags & IF_MASK)) || (cs->interrupt_request & CPU_INTERRUPT_NMI)) { - cs->halted = 0; + cpu_halted_set(cs, 0); } if (cs->interrupt_request & CPU_INTERRUPT_SIPI) { kvm_cpu_synchronize_state(cs); @@ -4188,7 +4188,7 @@ int kvm_arch_process_async_events(CPUState *cs) env->tpr_access_type); } - return cs->halted; + return cpu_halted(cs); } static int kvm_handle_halt(X86CPU *cpu) @@ -4199,7 +4199,7 @@ static int kvm_handle_halt(X86CPU *cpu) if (!((cs->interrupt_request & CPU_INTERRUPT_HARD) && (env->eflags & IF_MASK)) && !(cs->interrupt_request & CPU_INTERRUPT_NMI)) { - cs->halted = 1; + cpu_halted_set(cs, 1); return EXCP_HLT; } diff --git a/target/i386/misc_helper.c b/target/i386/misc_helper.c index b6b1d41b14..c396b6c7b9 100644 --- a/target/i386/misc_helper.c +++ b/target/i386/misc_helper.c @@ -558,7 +558,7 @@ static void do_hlt(X86CPU *cpu) CPUX86State *env = &cpu->env; env->hflags &= ~HF_INHIBIT_IRQ_MASK; /* needed if sti is just before */ - cs->halted = 1; + cpu_halted_set(cs, 1); cs->exception_index = EXCP_HLT; cpu_loop_exit(cs); } diff --git a/target/i386/whpx-all.c b/target/i386/whpx-all.c index c78baac6df..efc2d88810 100644 --- a/target/i386/whpx-all.c +++ b/target/i386/whpx-all.c @@ -759,7 +759,7 @@ static int whpx_handle_halt(CPUState *cpu) (env->eflags & IF_MASK)) && !(cpu->interrupt_request & CPU_INTERRUPT_NMI)) { cpu->exception_index = EXCP_HLT; - cpu->halted = true; + cpu_halted_set(cpu, true); ret = 1; } qemu_mutex_unlock_iothread(); @@ -918,7 +918,7 @@ static void whpx_vcpu_process_async_events(CPUState *cpu) if (((cpu->interrupt_request & CPU_INTERRUPT_HARD) && (env->eflags & IF_MASK)) || (cpu->interrupt_request & CPU_INTERRUPT_NMI)) { - cpu->halted = false; + cpu_halted_set(cpu, false); } if (cpu->interrupt_request & CPU_INTERRUPT_SIPI) { @@ -944,7 +944,7 @@ static int whpx_vcpu_run(CPUState *cpu) int ret; whpx_vcpu_process_async_events(cpu); - if (cpu->halted) { + if (cpu_halted(cpu)) { cpu->exception_index = EXCP_HLT; atomic_set(&cpu->exit_request, false); return 0; From patchwork Wed Jun 17 21:01:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190913 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp802179ilo; Wed, 17 Jun 2020 14:10:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJmo+qLn8XcIsl4VvTkamtFBr4eays84TjH9ns3JW2qUq2zsfysrJINp0znfhsA1mmHJyr X-Received: by 2002:a25:748c:: with SMTP id p134mr1369722ybc.390.1592428215646; Wed, 17 Jun 2020 14:10:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592428215; cv=none; d=google.com; s=arc-20160816; b=BVCrPb1MdcNc4Jl79boBU0nf9YT7DPCTPPXqVuKnon7/KXk2rWN5XbccR9Q7nru85G 4XqCwPAlKs20XNd9jaGOOTkq986O0tc3HN164KqgIGSpjdPCKJcKVKTo0+OWG9ETViRg LRNG8WgVTav+D7OKGfydXljLjF50TM7fAoPu5lwcRoPOuLn6bzW5HqgXTtKY1LrEU7WK Rx91if7r3xPbinOwZ0+mY98Z52hxAZnhjbKAQef76M6H6epdXDCqxDFOanBghn6rhd5d vUmO9suE4gAxFcUHuBjR+b7HPNhX9D1CSn1W5fWrEBXWPjZi2WKP20pXciMZDvSiaIzp 4MdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=KjBP9WZwlnczZ3SxEnPdyurMaB67UgSlf8Umf0tpZgo=; b=p3E9FW3bXEkre9f/yS4H69JBhqVTbr76TwVylTbf0vTF7s9LfUBTVEG8IF4o524DEl U0ukzQJFoAyVJJMhJQEl4I48v4OchY2N5X2mnu7B6NkhlzvqrZzVCDrx/GjVPblg4ac8 k9XvDRFKwl0K71gXguyaJIWQi0C+yDQ/Z99nmXFwGjZF1x3lARkM65LUyyYnyftKG2N7 SUhM/VcR/4zuQLJhj82ByvrpQK30XJXwudxbDVbbAVQchd3vLLzJjclvhzS2qqelyxiZ P4g9iJofQG9AVdAswKO5dVkqelH4JB2fj8SJHsrO1R2sxQODKd1bsnVuVedYy8CQEaia D5GA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=abTi7xGx; 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=fail (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 d143si650378ybh.266.2020.06.17.14.10.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:10:15 -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=fail header.i=@linaro.org header.s=google header.b=abTi7xGx; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:59562 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfK3-00051y-14 for patch@linaro.org; Wed, 17 Jun 2020 17:10:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37292) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfDu-0003BP-Jz for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:03:58 -0400 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]:35143) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfDn-0008UC-NB for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:03:53 -0400 Received: by mail-qt1-x844.google.com with SMTP id z1so2776543qtn.2 for ; Wed, 17 Jun 2020 14:03:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KjBP9WZwlnczZ3SxEnPdyurMaB67UgSlf8Umf0tpZgo=; b=abTi7xGxOycXHf+FavHb7RymYID+HTzoPXque5EuWixdD9rNu2Y9loUZ+YbY5TWjSF 13h+mGlyuWYeGfFWN596I05f133hD2UBp76A5xL0XhIzCnqtardpZHtSJ6ijXKBDVHSW UHFWpW/FYkJI0S8/xzUJTTd92nKDj1dHsi12y42osj/AQahKmudEZSySmWnAm63Ny+Ie fBQgg9WTMpqtTEfRO2MdeL+kwd65McTsb+JIdReBEMtijNt3SsZ+glEzsl3hcOpBOwlt o3Wmi9SfhkZkGZTv/N1mUNlb227fQEf+dglSORWEwlS0ijxEcHrjnOUX58ivzRji9w+N a9HA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KjBP9WZwlnczZ3SxEnPdyurMaB67UgSlf8Umf0tpZgo=; b=sKZQ46kt6agPvB3LXmJiv5qyTPLXFyFpotA3yUCIVOJ3bGxdpCEuJjvjAzD00fbOO4 E7hNGh+jhxwvKYWC3Jxlnm9awba9Rc/R4113WAbaIcWUE77Bp/TstML3zeVgQc7gwkkd gWwZcmMdKxxxynVtKk46w1FoCRwXtnkxP81gh81tUgpG08MPlYVGZ8GQiBxsSeKvCgRR ceAFsb9Njdkk4Wa5sin103Ruzr1xo9PThc2MCgQ/dBys0wJiKEJ5q0Y397TDBKbEg9Ua 3SpVt+Zj/s/4ghUmn/89wT+J2BU6uUDhZjG8v0F7L7b/XGXkFxUFRzXMwLW2KDMGDawe YU7A== X-Gm-Message-State: AOAM533FwFE7mhNHTsvLIRhv1kRMujH6GqN+1a/ueODjesVGzZge7THn 6JO2TuS/Z7TUsxy3C5uE907mUQPMSvpRbA== X-Received: by 2002:ac8:7303:: with SMTP id x3mr1144098qto.44.1592427826541; Wed, 17 Jun 2020 14:03:46 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.03.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:03:46 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 21/73] lm32: convert to cpu_halted Date: Wed, 17 Jun 2020 17:01:39 -0400 Message-Id: <20200617210231.4393-22-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::844; envelope-from=robert.foley@linaro.org; helo=mail-qt1-x844.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.puhov@linaro.org, Michael Walle , cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Cc: Michael Walle Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- target/lm32/op_helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/target/lm32/op_helper.c b/target/lm32/op_helper.c index e39fcd5647..8e0bd57b9d 100644 --- a/target/lm32/op_helper.c +++ b/target/lm32/op_helper.c @@ -32,7 +32,7 @@ void HELPER(hlt)(CPULM32State *env) { CPUState *cs = env_cpu(env); - cs->halted = 1; + cpu_halted_set(cs, 1); cs->exception_index = EXCP_HLT; cpu_loop_exit(cs); } @@ -45,7 +45,7 @@ void HELPER(ill)(CPULM32State *env) "Connect a debugger or switch to the monitor console " "to find out more.\n"); vm_stop(RUN_STATE_PAUSED); - cs->halted = 1; + cpu_halted_set(cs, 1); raise_exception(env, EXCP_HALTED); #endif } From patchwork Wed Jun 17 21:01:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190916 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp803769ilo; Wed, 17 Jun 2020 14:12:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzPAiTFuiBxj3/fyEgSUDRjw4TdY8smz4mWYLlt/FeYeCPKSlZTJ//LkmS5A12dQ6o4Nu4e X-Received: by 2002:a25:e087:: with SMTP id x129mr1321108ybg.73.1592428349636; Wed, 17 Jun 2020 14:12:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592428349; cv=none; d=google.com; s=arc-20160816; b=ao/Sg/+O7bdt1t16VE8ZnEHMFC+7shqDm+oFWhfdwXgjrQboLYfakGS2eX5Uwl95S9 mthNCvBISqeUqFYw/CAjMMiLHWa2Xh674Z9hTLKcJFMFbZG5u8j7QrD23xiU/hnUG9a7 LNhNOSYBPT+RoPRogJK4vEZ2SG5dh7eYQWNcnRij85Bp1ahOZoGLECaVlX45ywfR7rzf l3fpPXM9VQxblLHV++Y5a9CaorL3hy092g/VGb/ALAY8RTC4BK5+tulfKc0WrFVC+km9 2XiLd5nyFui8BZ3sERafblKBMdzP0qdtuKFDQYbPmlQ3Kxc+AqTcbc/+n7b8G/26Ancb f3ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=9s3zaT975n7OFyLauiO739G/mW0fqcwhecj+9+iav3g=; b=S+jIhhZUZT4x1uKHV3BCYY1c6rWJsVEusNY4Sv+wEIBoKdwzDDFb5WLbRwaxrRY3rp W9xIXDKR7RgHcdojM+dfEX+bM0bv9IyeFak/1Tv1k6KbmwFuBHPfVfKJGgpC+r6ZnlQC 7yk+MC/CkQu8/+MsIa9NgahtWJeezrJBko7eCKqDaZn0PKGmQ9y4rB5hLtV5h/dCgu5T hSFx66DtV0tOFlGPCko97jEvjHgZOF93kCLNmcZPLOyo2QfpJTrii0+/S1jAc+HO/RGg lxhRGHQgca2zvjMubWLDCD9RhqUnpEEu5QeGFu8YG5WYdbQFAFt1mWkoHzr2TRnheG0Q VTPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=w8fUhqA+; 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=fail (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 t18si633899ybl.316.2020.06.17.14.12.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:12:29 -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=fail header.i=@linaro.org header.s=google header.b=w8fUhqA+; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:39932 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfMD-0000FZ-45 for patch@linaro.org; Wed, 17 Jun 2020 17:12:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37346) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfE0-0003Df-DS for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:00 -0400 Received: from mail-qt1-x841.google.com ([2607:f8b0:4864:20::841]:37823) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfDp-0008UK-0A for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:03:59 -0400 Received: by mail-qt1-x841.google.com with SMTP id d27so2765730qtg.4 for ; Wed, 17 Jun 2020 14:03:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9s3zaT975n7OFyLauiO739G/mW0fqcwhecj+9+iav3g=; b=w8fUhqA+iRJtmFSwrzoP1e2deJUjj6dpEpCzDxImxM7DOAErFKp9C4t4h7+MJD7ZXg /1nZx1qIC7Xnsev0Hd5GBo4j3Sp9h87u+6NgEnVxvkmRGc6Js30MhaGBJgHCmzHW3Ww9 JDs6miaZR/7uJYi+xPZb2XSODrRIAF1vHF9INTBsiT14DkoAhEmb1LzK/+OW52WjNhub qu8y9sPgHf/ijlQFPZ5GJ3D6I49IQ5V6Drku+Lgwt0+qwzrjrqQmHdwg29SePL+bH9Cq TOweATc9wxeX50YvwnyXF4CjT3ldL32OXqve0W22LSw7Bvrz4kPDEELvQrUCQWmmj9Cs avdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9s3zaT975n7OFyLauiO739G/mW0fqcwhecj+9+iav3g=; b=OJi9y6iLXsdaEXJcFlVXwscO/9yEWTX/O6ckGMpMgWxV4atqUz7Ieq2ZKTKroTdHXD 8wf2g4NOD52sa3+66kBJ/6GKdGb1NZ0VKmV3yjuk1PuBm5I+WRZ2Fb8MHh3g+F3G9D5a 7RDOBXTy+cXwQfZj1f4lxRDYKhHtzKmNlMVS78nnc2mxZ+zZ+/OuxHlzQR/1rLwClMWr 7mtSWxgOHxClbLkvhZjDDQsYvAj8nZ438fh30ltyyr4WEFc5jRtLG0TOflptQOT4jW8T Oh0eZPf1YhA88XhsnNFk99eoS5I52SG85Enqw0OE31jbqHKC9zxUDG05owr0400UDhlt /zrw== X-Gm-Message-State: AOAM532uZ1EGYrStnC1EmoghDVwwz2ay9jGBDoPQKqQ6YjTCAAGk6OrL Z+u5mPiOSKjHTtAGYqEjuJQ3SD2baxiHhA== X-Received: by 2002:ac8:7a90:: with SMTP id x16mr1080458qtr.233.1592427827917; Wed, 17 Jun 2020 14:03:47 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.03.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:03:47 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 22/73] m68k: convert to cpu_halted Date: Wed, 17 Jun 2020 17:01:40 -0400 Message-Id: <20200617210231.4393-23-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::841; envelope-from=robert.foley@linaro.org; helo=mail-qt1-x841.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.puhov@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, Laurent Vivier Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Reviewed-by: Richard Henderson Reviewed-by: Laurent Vivier Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- target/m68k/op_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/target/m68k/op_helper.c b/target/m68k/op_helper.c index 202498deb5..4a032a150e 100644 --- a/target/m68k/op_helper.c +++ b/target/m68k/op_helper.c @@ -222,7 +222,7 @@ static void cf_interrupt_all(CPUM68KState *env, int is_hw) do_m68k_semihosting(env, env->dregs[0]); return; } - cs->halted = 1; + cpu_halted_set(cs, 1); cs->exception_index = EXCP_HLT; cpu_loop_exit(cs); return; From patchwork Wed Jun 17 21:01:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190920 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp805105ilo; Wed, 17 Jun 2020 14:14:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqAQmlyT/AGZmhIcPQrTSbIGGzDK2X2S1HJSq6kEJ42P8sMxOM0mGrlfm9O9ZcXsgM0+5g X-Received: by 2002:a05:6902:508:: with SMTP id x8mr1369332ybs.474.1592428462988; Wed, 17 Jun 2020 14:14:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592428462; cv=none; d=google.com; s=arc-20160816; b=FruMu0fctzOSmoOIoYn9+3FhAnTovlXHzfYUp3uYhule1xR+qZsGhjevdZseGjunpo 5sgjxJUNDPdjdJvwD5SqgUaK73hjVKkb6mwayfDXXTWceWzuMyQc6whRtFmw262LkNAl F36u9/S5qsOVWxTd8ATWk10DB6SAT0HOZzwU7hYMpSRS/Zp/KlLdZMttmLkAQXboLbEx onhNHPtJONaM5jAhpfJTep3HM+s36bVrnHxVfmeU8cGRM7sp7frCIghgvbu3ocicbHuL PJoI6gms8SrbeOOq4/YLmEAG9X1vC9qXx/f7cMp8Mmmo6PO1cR+lyPfUeOh4JJHfsuL9 bJtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=bHkAJHEjthSszeufZ4EcOnf2q9qJPdqEDnGkc3v/vAE=; b=aV5UGhX+Af5SSTCgDOXksJ/fiRPXO9ccz91lJXgmEmX3FIQc+4h1nBVeEGuEwM+nvR CCguC9KdlpJijHgbtZSd9QMWlwzlBuvHOYcj7C4wXDzAWI7mW7V/lvcTiSjec50RM35a 0yFYDOlGzLvvC9Ca0itnLSZkOX2VLK32tWrsTzBqbWuFaGzVdxvruAHkvrUJBNKy3Mzw N6Af9hHRPqHM/GhEHzElKVIXDiJUPPOk5Ktex7UbNN4T9ai2nTiePxByUk2bk12X0G+T //UYERjkRzwPuQLPYS+bQXPxuYThSdrsNcsWot1keNMZozoWNbcoe3V+WBigaEm8qhU/ 7Mbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=UIrJ8GPS; 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=fail (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 d137si675088ybc.309.2020.06.17.14.14.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:14:22 -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=fail header.i=@linaro.org header.s=google header.b=UIrJ8GPS; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:50426 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfO2-0005xZ-C3 for patch@linaro.org; Wed, 17 Jun 2020 17:14:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37398) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfE5-0003F4-EK for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:05 -0400 Received: from mail-qk1-x741.google.com ([2607:f8b0:4864:20::741]:43931) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfDt-0008UP-PL for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:05 -0400 Received: by mail-qk1-x741.google.com with SMTP id j68so138959qkb.10 for ; Wed, 17 Jun 2020 14:03:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bHkAJHEjthSszeufZ4EcOnf2q9qJPdqEDnGkc3v/vAE=; b=UIrJ8GPSOnQW0OYDixWOg0Ybkar/cEywpT23s8H0785SiHHmx3gE3BkDOC8S24TbhO W2i7TfbkHj9fWXVoB7yCDfNSX+KfZct2JU4HcvrXnib+Bqnw7hJJnKhiZazpEFyPPXp1 YigjPlOw6PJjDLNazEzKxiSsgwjv4F0NVtS7qpjeFrmJE9KIFY5uarATkJZhw5dhwVw4 dHU3kNmH1iO911UiwLfJ5TOl0kXrfDND1Iv/O5YNK0bwn/RpBDNx/vJOEwcsqZQTKaJr F3GPexT8cH2blQdGoUBDDevmJUxs9RQ8TrOhLGNaRsq3CROVDrsBYYDChGtKn8ze10XB /gNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bHkAJHEjthSszeufZ4EcOnf2q9qJPdqEDnGkc3v/vAE=; b=HyelD1T+q21/thf0c8MnWbvIjghOxZuIlcDZ02FjuzIpuZt3UdPmroiUFEHjfJHrgu tAZHsV5Qufi1fQ3CXe4kyIQvwIRT3W2zLr/LeFMrdJcM1GqNQ1obeJSbUIIyLjLfFjmW 6iViiuhjC9BvQLTyhjeotRnNQtArrv7O8dSvGNf6qqvyyFUzGIheS72E2HRqBMF+ict4 bVRgcxaeQY/nRZNtgIAzFE13yzkHdLgLTF43ZMS1BQfnFKPfB7ya2MWEz6sKSqRNomAq mSLHfeurAJukWOj1jA3URd3njlPIneAYBUV/GbFJIEhbSllyWhsvTMke7lLqISOKlKj7 HF8g== X-Gm-Message-State: AOAM531J3nqMBM7aAA5VQgE5lGh/3dJJY5B23/faJuDhV38jDvH0Gz/P rO2FBjLWhuvGqEAndvtKFqodIpOARfr+UA== X-Received: by 2002:a37:9ad5:: with SMTP id c204mr546510qke.413.1592427829379; Wed, 17 Jun 2020 14:03:49 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.03.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:03:48 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 23/73] mips: convert to cpu_halted Date: Wed, 17 Jun 2020 17:01:41 -0400 Message-Id: <20200617210231.4393-24-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::741; envelope-from=robert.foley@linaro.org; helo=mail-qk1-x741.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aleksandar Rikalo , robert.foley@linaro.org, Aleksandar Markovic , cota@braap.org, peter.puhov@linaro.org, alex.bennee@linaro.org, Aurelien Jarno Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota [RF: Converted code in target/mips/kvm.c to cpu_halted.] Signed-off-by: Robert Foley --- hw/mips/cps.c | 2 +- hw/misc/mips_itu.c | 4 ++-- target/mips/cp0_helper.c | 6 +++--- target/mips/kvm.c | 2 +- target/mips/op_helper.c | 2 +- target/mips/translate.c | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) -- 2.17.1 diff --git a/hw/mips/cps.c b/hw/mips/cps.c index cdfab19826..51176e1be0 100644 --- a/hw/mips/cps.c +++ b/hw/mips/cps.c @@ -54,7 +54,7 @@ static void main_cpu_reset(void *opaque) cpu_reset(cs); /* All VPs are halted on reset. Leave powering up to CPC. */ - cs->halted = 1; + cpu_halted_set(cs, 1); } static bool cpu_mips_itu_supported(CPUMIPSState *env) diff --git a/hw/misc/mips_itu.c b/hw/misc/mips_itu.c index 3540985258..623a600ed1 100644 --- a/hw/misc/mips_itu.c +++ b/hw/misc/mips_itu.c @@ -183,7 +183,7 @@ static void wake_blocked_threads(ITCStorageCell *c) { CPUState *cs; CPU_FOREACH(cs) { - if (cs->halted && (c->blocked_threads & (1ULL << cs->cpu_index))) { + if (cpu_halted(cs) && (c->blocked_threads & (1ULL << cs->cpu_index))) { cpu_interrupt(cs, CPU_INTERRUPT_WAKE); } } @@ -193,7 +193,7 @@ static void wake_blocked_threads(ITCStorageCell *c) static void QEMU_NORETURN block_thread_and_exit(ITCStorageCell *c) { c->blocked_threads |= 1ULL << current_cpu->cpu_index; - current_cpu->halted = 1; + cpu_halted_set(current_cpu, 1); current_cpu->exception_index = EXCP_HLT; cpu_loop_exit_restore(current_cpu, current_cpu->mem_io_pc); } diff --git a/target/mips/cp0_helper.c b/target/mips/cp0_helper.c index bbf12e4a97..4d413c24d3 100644 --- a/target/mips/cp0_helper.c +++ b/target/mips/cp0_helper.c @@ -43,7 +43,7 @@ static bool mips_vpe_is_wfi(MIPSCPU *c) * If the VPE is halted but otherwise active, it means it's waiting for * an interrupt.\ */ - return cpu->halted && mips_vpe_active(env); + return cpu_halted(cpu) && mips_vpe_active(env); } static bool mips_vp_is_wfi(MIPSCPU *c) @@ -51,7 +51,7 @@ static bool mips_vp_is_wfi(MIPSCPU *c) CPUState *cpu = CPU(c); CPUMIPSState *env = &c->env; - return cpu->halted && mips_vp_active(env); + return cpu_halted(cpu) && mips_vp_active(env); } static inline void mips_vpe_wake(MIPSCPU *c) @@ -74,7 +74,7 @@ static inline void mips_vpe_sleep(MIPSCPU *cpu) * The VPE was shut off, really go to bed. * Reset any old _WAKE requests. */ - cs->halted = 1; + cpu_halted_set(cs, 1); cpu_reset_interrupt(cs, CPU_INTERRUPT_WAKE); } diff --git a/target/mips/kvm.c b/target/mips/kvm.c index 96cfa10cf2..92608cfe15 100644 --- a/target/mips/kvm.c +++ b/target/mips/kvm.c @@ -162,7 +162,7 @@ MemTxAttrs kvm_arch_post_run(CPUState *cs, struct kvm_run *run) int kvm_arch_process_async_events(CPUState *cs) { - return cs->halted; + return cpu_halted(cs); } int kvm_arch_handle_exit(CPUState *cs, struct kvm_run *run) diff --git a/target/mips/op_helper.c b/target/mips/op_helper.c index 9552b280e0..152b45826c 100644 --- a/target/mips/op_helper.c +++ b/target/mips/op_helper.c @@ -1124,7 +1124,7 @@ void helper_wait(CPUMIPSState *env) { CPUState *cs = env_cpu(env); - cs->halted = 1; + cpu_halted_set(cs, 1); cpu_reset_interrupt(cs, CPU_INTERRUPT_WAKE); /* * Last instruction in the block, PC was updated before diff --git a/target/mips/translate.c b/target/mips/translate.c index 9fad58ea2c..0d0792d701 100644 --- a/target/mips/translate.c +++ b/target/mips/translate.c @@ -31495,7 +31495,7 @@ void cpu_state_reset(CPUMIPSState *env) env->tcs[i].CP0_TCHalt = 1; } env->active_tc.CP0_TCHalt = 1; - cs->halted = 1; + cpu_halted_set(cs, 1); if (cs->cpu_index == 0) { /* VPE0 starts up enabled. */ @@ -31503,7 +31503,7 @@ void cpu_state_reset(CPUMIPSState *env) env->CP0_VPEConf0 |= (1 << CP0VPEC0_MVP) | (1 << CP0VPEC0_VPA); /* TC0 starts up unhalted. */ - cs->halted = 0; + cpu_halted_set(cs, 0); env->active_tc.CP0_TCHalt = 0; env->tcs[0].CP0_TCHalt = 0; /* With thread 0 active. */ From patchwork Wed Jun 17 21:01:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190914 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp802562ilo; Wed, 17 Jun 2020 14:10:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz6ejnwpci9pVFwAtu7WGpqbr6IBsuOpZhQcq9iMHKcm53U1R2umUPmr6q4U02ZrDzwE+zJ X-Received: by 2002:a25:ac1b:: with SMTP id w27mr1478109ybi.378.1592428247671; Wed, 17 Jun 2020 14:10:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592428247; cv=none; d=google.com; s=arc-20160816; b=gm27QjOEQwUs4fOGY0NBmyHc+4LUpCxve/06DBq9e9DOrVx4heRKLaVFdcCEtVfSEK wt7QEOwbt6eP9VXQLs1wVP74vt9XC6OVc7b7k4r12WW+Zwak6aPU2szpOKYPaTRKhW0D PV5KqAeY7SdREMaY2dyVaj5hEpHSI3XMH4IfF1SK8IWeQMU54Bh1HTT1ORmyGlarpUIN yMoLiT+rkKh4snHBY5c14lAgDBsaqusaqNky17rkD7fCpt8M/1SF7YwL4livlLo5kRCV Vl1vBQHlDhhVfCICpWOd8G/RJeoCsi8G/Sz+MNOx31aFyjZoW7Nwv8ztYwvnv3PVYmXX xQnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=YemnOlklw+URp/aLKC6SFqz2X8HrxCoaaT+NwLjZldo=; b=M5N/R9/bMsMARaEXOKnmzHtvkc/scerX7+NPe9QxSdOCjdpTIXwuiU0rZdV5qYLPh9 +90SXTXKm6vk/IKADu2Vmlcd2JySCwf22Hb/oLKv05DIjUVOJddFGZA3brLHu7SWn3lr +M1C8P+UyvVrWSQhVMG1RSjJ1dnJwhNEFvmCKxW0aFiQQg4+X0o0D7Z9f5VfWzHorfgU Wu1DLf1QqqkgPdOS4p+yQDAB/c9qEuyMQ1k3nkA/WRZEBz459m4nZN/mcY0ByjYLmeAq 4NZYMs41X/o1gp6p9VwBsR2Ln2dUUg3FNl1fIVenrJfE7De01SDbXunDkc61fVyEwHMU 2baA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=EaXicV2S; 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=fail (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 p123si607025ybg.360.2020.06.17.14.10.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:10:47 -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=fail header.i=@linaro.org header.s=google header.b=EaXicV2S; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:33402 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfKZ-0005px-0e for patch@linaro.org; Wed, 17 Jun 2020 17:10:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37368) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfE1-0003EU-4C for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:05 -0400 Received: from mail-qt1-x842.google.com ([2607:f8b0:4864:20::842]:44349) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfDt-0008UW-Pi for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:00 -0400 Received: by mail-qt1-x842.google.com with SMTP id c12so2730052qtq.11 for ; Wed, 17 Jun 2020 14:03:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=YemnOlklw+URp/aLKC6SFqz2X8HrxCoaaT+NwLjZldo=; b=EaXicV2SrI+jZc6jXA3EYsKOVyBml4iIwvFptjrgJSaDZTl1CxdsgLEDDrg+OTstid /p0bJ/ZhZckKfDS983OAVfF+wUVE7MwWOnt9zISrGsGAI0TdgZXjmtuZAkylfJPmuJCN rWV4jZmZvFyKeJ69TKoVLZO7ID9PNOqbFiQyfE7oNgXwzNxvShyC7SRsUU+wWv3dhOxC yRjfgEL1vTFweXxAEIsGR4Sy6ca4YsqjFEIcU7Fb2ifqarqgxi09BpQSMBdIr1A9I8As u+47cOCFkkr0RBF25khfp7+zOR4Xh0ga3ykD7odaen/IwSoFIRliyhzHsQkAhSo9Ul7J 0enA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=YemnOlklw+URp/aLKC6SFqz2X8HrxCoaaT+NwLjZldo=; b=Es6jOgL5zJbCXNpPjAhS9+OrpTaUwo9ZL9YyW0sCGjN4fHnTQ1ox4J+neeMg1W0NGA QhRpqksYIUH6GFeU7XlPKrr+BplvSiYVw/uIirxK2Q/exOyqJ6WB+3Qa5NRv1eW8UwHD t3UOmqzrCVLtgnt+HgIL7wuPyKEZH1YCawU1mPa9L3Ru2/hPTZFNQXxVZ5p6ztXlFuYS C0+s98Lfga7Eg+DelaI7ObFkpqG31sjBq2CBdcqUlpCAEvj1HBQSB/Uy3DZyWm08pZ5q 0m1IeVBHBYk142+Vh/ixyI35hRjmwsTXuH3lgjV4Eg/HDtpmNb5JRxL60oQlHcptkK30 dd7Q== X-Gm-Message-State: AOAM533bHK+QKolMnwzfcxiwKEq8GAeKluGEf7pyZRa7UsVEPRFzAMpP 1Nl5fJ4lhgT5SWm7ZsVca9aXRfj0BMs4xA== X-Received: by 2002:aed:35fa:: with SMTP id d55mr1054590qte.385.1592427830871; Wed, 17 Jun 2020 14:03:50 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.03.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:03:50 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 24/73] riscv: convert to cpu_halted Date: Wed, 17 Jun 2020 17:01:42 -0400 Message-Id: <20200617210231.4393-25-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::842; envelope-from=robert.foley@linaro.org; helo=mail-qt1-x842.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alistair Francis , "open list:RISC-V TCG CPUs" , robert.foley@linaro.org, Sagar Karandikar , Bastian Koppelmann , cota@braap.org, Palmer Dabbelt , peter.puhov@linaro.org, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Cc: Sagar Karandikar Cc: Bastian Koppelmann Reviewed-by: Palmer Dabbelt Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- target/riscv/op_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/target/riscv/op_helper.c b/target/riscv/op_helper.c index b0c49efc4a..fe1373a95d 100644 --- a/target/riscv/op_helper.c +++ b/target/riscv/op_helper.c @@ -176,7 +176,7 @@ void helper_wfi(CPURISCVState *env) riscv_cpu_virt_enabled(env)) { riscv_raise_exception(env, RISCV_EXCP_ILLEGAL_INST, GETPC()); } else { - cs->halted = 1; + cpu_halted_set(cs, 1); cs->exception_index = EXCP_HLT; cpu_loop_exit(cs); } From patchwork Wed Jun 17 21:01:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190924 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp807173ilo; Wed, 17 Jun 2020 14:17:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxnvC2c5/B7N2lahqKRXfeW/sPx/veeN9zUuhwmfd+nK1uPe8kgu6aFifbwOPRspFfJDiq+ X-Received: by 2002:a25:774a:: with SMTP id s71mr1554359ybc.518.1592428648317; Wed, 17 Jun 2020 14:17:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592428648; cv=none; d=google.com; s=arc-20160816; b=jcywW5WV5UkQRX31UvrfBLHXGTjpbzO85l/BnO5UBmyAw9lrRDpnv8f+z0QIT26+eL dh6pQy+NINfrfo0cdhIwz43B4a4HUAQFQ/BJeCsVGV/t3udljHZra1IGYT01dN2sBvzG rWaHKADVX3Y8wk17DWr9FbDRSEJedHcfyyZny14GjeAz9h9wiLtFYYvhPdT0BvE8u+tq 7WbDrJiZUFXnMT9s5X//akFk03PnvTTOMc5d6bKhTWYCCZ5mCo78pz0RM1AjPF97dNlX eEbs0ar2svcRTMr4yWZIARaMfDOXcql2XiL8BvfF8YIoDODnVxGRLjU4RWdsmhPzu7IZ m4+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=0Pwj8GypD7Z+8gMlM2oBcpPOEswoZuhb40JEwUc+M6A=; b=Y7VDLnE2XWFYh7DA78WcowGgM8m45+eAPoVkGFkf+32KOqlfy1I4KcAXOBQAxZpcGx pmt8jbWAWKxWQ7VbDKQtBBBe7pq65lVnMgiKP3fRGn4ujjhc+JmKrmZr4CgG+vNkyROC 9m75Lu6AkArKCy3mkbnEjHTcGXHdzYPgS3mr3QeBeX4GiXDec3OILOmNibuBs5Wn5fKU iNz4uNQ4L1IEGuGc9/2XzV7YfedxcIvFdtLAfwD2pEiZaegi/t6BJ0+0lbWn3CN/vk/N RD59LWMEjaKHwUWnaoD+U0wD5v2bPfcTYObIL6N/yzOw7yp+fTJFrnYTX93loPHcu+CZ kiOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=E22g1j7g; 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=fail (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 q5si817367ybc.290.2020.06.17.14.17.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:17:28 -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=fail header.i=@linaro.org header.s=google header.b=E22g1j7g; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:59034 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfR1-0001nU-DP for patch@linaro.org; Wed, 17 Jun 2020 17:17:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37444) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfE7-0003Gi-3A for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:07 -0400 Received: from mail-qk1-x744.google.com ([2607:f8b0:4864:20::744]:39455) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfDu-0008Uh-B4 for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:06 -0400 Received: by mail-qk1-x744.google.com with SMTP id w3so3495306qkb.6 for ; Wed, 17 Jun 2020 14:03:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0Pwj8GypD7Z+8gMlM2oBcpPOEswoZuhb40JEwUc+M6A=; b=E22g1j7gZAOIPfrauv7unDiVj8oaEUe996v6ANRYFpjRygV8JeJp7JnHGJ9sQ3wzhW 1BsMgIeaEStlO58KPdX4myJwvz4+OYjDEkwiXK5sRS4SJsa6YFA8L/VdJezBDtw8RlpZ fvjSmD4anJrNztLldX54PGIahyFY2fl05q/vbwTxJCl4v57DQi1MoSewIvTjlevG8fuy J0ijf9qp/gjHOIKpgTQlMXs1Iem/w3hHTfW9pT9xsvLbAY4B2pPyVDMadOZQ0w6Cp6NG kqPK1AAq/lF6kM/DP70rwv+ytPSS9TwG1DLBvFFXoZ6Y94mlOO4QPedKMvAjgear9e92 QYqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0Pwj8GypD7Z+8gMlM2oBcpPOEswoZuhb40JEwUc+M6A=; b=MG/WZZNWDETqDIEDa9qKWb/osO4OtBRB0ZUJCpjf2EzZJ1fppSudIxMPwaF3mwYPrL 80KpcUMkOrRXxWyJVYIXi0kI77/Fd51av1qQGjaq4XLszAPBWeOMgAQasyh86hAUXzEk /kpyqWnsY8wHthHyvmXQ7XVBBYpFJ3jBcqssXVTtI1XpPT2grKKVoNVUWEn/W/B//GJL U2QVUIwN3zD44Q6CqDmFMAoy/Syrk60wvb3QP3sMdsy7w4W6Ggs0SKYJsw24xyH5NgHK D9XVMnAzSicc1ZX3VXq/MAzj4koOzgKBJBp+eSSnpLfadguUxlb07YQg6PYh47FHQppX wu3g== X-Gm-Message-State: AOAM5325I/BimmgTgxxK5zeAdVUHSrwQMiaBsj191Y+bIbvJSW/i1J24 dlvJvTRw1ZrP3zjLM8lGS82lSkrYQeUYIg== X-Received: by 2002:a37:6813:: with SMTP id d19mr592483qkc.11.1592427832576; Wed, 17 Jun 2020 14:03:52 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.03.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:03:51 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 25/73] s390x: convert to cpu_halted Date: Wed, 17 Jun 2020 17:01:43 -0400 Message-Id: <20200617210231.4393-26-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::744; envelope-from=robert.foley@linaro.org; helo=mail-qk1-x744.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , robert.foley@linaro.org, David Hildenbrand , Cornelia Huck , Halil Pasic , Christian Borntraeger , qemu-s390x@nongnu.org, cota@braap.org, peter.puhov@linaro.org, alex.bennee@linaro.org, Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Cc: Christian Borntraeger Cc: David Hildenbrand Cc: qemu-s390x@nongnu.org Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Reviewed-by: Cornelia Huck Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- hw/intc/s390_flic.c | 2 +- target/s390x/cpu.c | 22 +++++++++++++++------- target/s390x/excp_helper.c | 2 +- target/s390x/kvm.c | 2 +- target/s390x/sigp.c | 8 ++++---- 5 files changed, 22 insertions(+), 14 deletions(-) -- 2.17.1 diff --git a/hw/intc/s390_flic.c b/hw/intc/s390_flic.c index aacdb1bbc2..46ec8272c0 100644 --- a/hw/intc/s390_flic.c +++ b/hw/intc/s390_flic.c @@ -200,7 +200,7 @@ static void qemu_s390_flic_notify(uint32_t type) } /* we always kick running CPUs for now, this is tricky */ - if (cs->halted) { + if (cpu_halted(cs)) { /* don't check for subclasses, CPUs double check when waking up */ if (type & FLIC_PENDING_SERVICE) { if (!(cpu->env.psw.mask & PSW_MASK_EXT)) { diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index 08eb674d22..d7a98bd52b 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -291,7 +291,7 @@ static void s390_cpu_initfn(Object *obj) S390CPU *cpu = S390_CPU(obj); cpu_set_cpustate_pointers(cpu); - cs->halted = 1; + cpu_halted_set(cs, 1); cs->exception_index = EXCP_HLT; #if !defined(CONFIG_USER_ONLY) object_property_add(obj, "crash-information", "GuestPanicInformation", @@ -318,8 +318,8 @@ static void s390_cpu_finalize(Object *obj) #if !defined(CONFIG_USER_ONLY) static bool disabled_wait(CPUState *cpu) { - return cpu->halted && !(S390_CPU(cpu)->env.psw.mask & - (PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK)); + return cpu_halted(cpu) && !(S390_CPU(cpu)->env.psw.mask & + (PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK)); } static unsigned s390_count_running_cpus(void) @@ -345,10 +345,16 @@ unsigned int s390_cpu_halt(S390CPU *cpu) CPUState *cs = CPU(cpu); trace_cpu_halt(cs->cpu_index); - if (!cs->halted) { - cs->halted = 1; + /* + * cpu_halted and cpu_halted_set acquire the cpu lock if it + * isn't already held, so acquire it first. + */ + cpu_mutex_lock(cs); + if (!cpu_halted(cs)) { + cpu_halted_set(cs, 1); cs->exception_index = EXCP_HLT; } + cpu_mutex_unlock(cs); return s390_count_running_cpus(); } @@ -358,10 +364,12 @@ void s390_cpu_unhalt(S390CPU *cpu) CPUState *cs = CPU(cpu); trace_cpu_unhalt(cs->cpu_index); - if (cs->halted) { - cs->halted = 0; + cpu_mutex_lock(cs); + if (cpu_halted(cs)) { + cpu_halted_set(cs, 0); cs->exception_index = -1; } + cpu_mutex_unlock(cs); } unsigned int s390_cpu_set_state(uint8_t cpu_state, S390CPU *cpu) diff --git a/target/s390x/excp_helper.c b/target/s390x/excp_helper.c index 3b58d10df3..db6640ba2c 100644 --- a/target/s390x/excp_helper.c +++ b/target/s390x/excp_helper.c @@ -537,7 +537,7 @@ try_deliver: if ((env->psw.mask & PSW_MASK_WAIT) || stopped) { /* don't trigger a cpu_loop_exit(), use an interrupt instead */ cpu_interrupt(CPU(cpu), CPU_INTERRUPT_HALT); - } else if (cs->halted) { + } else if (cpu_halted(cs)) { /* unhalt if we had a WAIT PSW somehwere in our injection chain */ s390_cpu_unhalt(cpu); } diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c index f2f75d2a57..f376c4a2f6 100644 --- a/target/s390x/kvm.c +++ b/target/s390x/kvm.c @@ -1094,7 +1094,7 @@ MemTxAttrs kvm_arch_post_run(CPUState *cs, struct kvm_run *run) int kvm_arch_process_async_events(CPUState *cs) { - return cs->halted; + return cpu_halted(cs); } static int s390_kvm_irq_to_interrupt(struct kvm_s390_irq *irq, diff --git a/target/s390x/sigp.c b/target/s390x/sigp.c index c604f17710..44d22ae3bf 100644 --- a/target/s390x/sigp.c +++ b/target/s390x/sigp.c @@ -115,7 +115,7 @@ static void sigp_stop(CPUState *cs, run_on_cpu_data arg) } /* disabled wait - sleeping in user space */ - if (cs->halted) { + if (cpu_halted(cs)) { s390_cpu_set_state(S390_CPU_STATE_STOPPED, cpu); } else { /* execute the stop function */ @@ -131,7 +131,7 @@ static void sigp_stop_and_store_status(CPUState *cs, run_on_cpu_data arg) SigpInfo *si = arg.host_ptr; /* disabled wait - sleeping in user space */ - if (s390_cpu_get_state(cpu) == S390_CPU_STATE_OPERATING && cs->halted) { + if (s390_cpu_get_state(cpu) == S390_CPU_STATE_OPERATING && cpu_halted(cs)) { s390_cpu_set_state(S390_CPU_STATE_STOPPED, cpu); } @@ -313,7 +313,7 @@ static void sigp_cond_emergency(S390CPU *src_cpu, S390CPU *dst_cpu, } /* this looks racy, but these values are only used when STOPPED */ - idle = CPU(dst_cpu)->halted; + idle = cpu_halted(CPU(dst_cpu)); psw_addr = dst_cpu->env.psw.addr; psw_mask = dst_cpu->env.psw.mask; asn = si->param; @@ -347,7 +347,7 @@ static void sigp_sense_running(S390CPU *dst_cpu, SigpInfo *si) } /* If halted (which includes also STOPPED), it is not running */ - if (CPU(dst_cpu)->halted) { + if (cpu_halted(CPU(dst_cpu))) { set_sigp_status(si, SIGP_STAT_NOT_RUNNING); } else { si->cc = SIGP_CC_ORDER_CODE_ACCEPTED; From patchwork Wed Jun 17 21:01:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190918 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp804001ilo; Wed, 17 Jun 2020 14:12:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlEqu6C5Wm9aKfuIDQQxj7pekule9MVObtV3KWvCTYPXzt5IUabO/xZCf1TSzLZ+m3Utn/ X-Received: by 2002:a25:a567:: with SMTP id h94mr1428992ybi.95.1592428371132; Wed, 17 Jun 2020 14:12:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592428371; cv=none; d=google.com; s=arc-20160816; b=TlYPUsLW2gvkUZvYPCQp9S8dXQCFaXIyqV9zRgulpAVgxYwambdify98gzBX8gdloE 6rVlUduxkCn33oXuapz8o3PllPmcfI//WKVQXWNPjVj+uzMuJd5gKC7CAi0o9gYdC76l jWnYuaQDFXj2XiTEUVQzL6JVW5NO4rDf2fiSB/3KocqcN9V9DOFmlMbsqmzsCcwZIo+g m+GjNHERT8ODg7gMhXJEJQcwdP7pHb9fVg8eioEmjc+GosWBbmZFlW03s21WsJf9tUWF rmOm8P3X+zfP71eMJfH56L21/YrGmjJDWWzLWOnj6hCrnd9wlW0vXEwMixePSGRx+Jlf 42wQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=P/Z/EXXqAnjV0sexMMAA4/Iljvg21zFf1h2uuTezcCs=; b=t/ULQuScHo5M0OKI3ARQLNcCd0sX2Sh9aka/BkAAwK8qOfxfDmXfm/7xoF4d9h/7Zf 1FdXKmI2LH6wmNkSAlMVW9xmyjOECeqoE7585PP0SiJb8u2lGr3fsLKRXc2tVh/huX3u a2R6LKhGpuEr6yneGKRcIt5lQw63yv/hnFLCwJCLSlotaq80EKpJvqmSbSkZoy8d7V73 obl8430+tKDWLymQE1ifaIyNhDtfhEXyK3heBhdVYEKew2fCW9gmgS0PpL96ZD2vL6IZ tfB8CuYWGubHzfm2ndH3XAzi5c7vD1TelJj77YbE4odbC/rxkpY40aOmnEqLFR9F9yY8 YeQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=rYl0g55d; 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=fail (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 x2si805665ybt.253.2020.06.17.14.12.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:12:51 -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=fail header.i=@linaro.org header.s=google header.b=rYl0g55d; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:41932 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfMY-0001CI-Ja for patch@linaro.org; Wed, 17 Jun 2020 17:12:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37404) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfE5-0003FF-Kh for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:05 -0400 Received: from mail-qk1-x735.google.com ([2607:f8b0:4864:20::735]:37882) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfDy-0008Ut-3e for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:05 -0400 Received: by mail-qk1-x735.google.com with SMTP id b27so3509458qka.4 for ; Wed, 17 Jun 2020 14:03:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=P/Z/EXXqAnjV0sexMMAA4/Iljvg21zFf1h2uuTezcCs=; b=rYl0g55datJBDFOzYMAmY/qRs0L2+E1EYtDPb3ksHvVLJcqUHrpW8wYokoG5DNO+Fi bIjE8ztfakJGXq7daiaJCguXuZUr9mFHSQI13yB6Gq4DLYnenjL/s5GHkfN0EqJ3hcnv qsxtamP9muOpEFwv2WCSvuUd32Gv44hUp43M5UtYygsJn1gIxvmb14fS4M8IDIFMsonY L5dJ+I0fJ6UTJiUbWaXWfxVEedsI+iviFZ6TOPxyM6Tv7B6N2y3kAtEhHrne1R4LMhj2 OYYltDDj9mEFHAbaUuHZ5rbBbPhQTqJ7jKjHJGpwjhopaW23i0wV4zUx766vuUXMFAj7 WJ8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=P/Z/EXXqAnjV0sexMMAA4/Iljvg21zFf1h2uuTezcCs=; b=mHUGu6OBDjucRaUMOMWhD2JtBulkxG0vtOyI+4YVyaDZIHavZ6yZ5vp5dcTkjALs0u MwNPGnNmjOSkbYfKnkpxWb649jQ1C4nFsO2pRSiUQPFEllPsXDCwLnbRC2HdnS7uWKPT PftSTy6SkTmk1HJmdFANZj2PzjPAhsKCa6LWZeBovi0LbTkppOGfZLKPsoY4yeER7ek3 biNdcJQuzuARxgsgQviaM9FPXWhcOzGOVRPIsggQeP3FP59ETyCx1ABA+wopd7zoPSvn hZmjyD4IZiXXYJN92d99ESIC58wp018zrrW0LWKJbffD/WCllQQCoc3Er1PH7YolrZ68 QzDQ== X-Gm-Message-State: AOAM533ye0HsY2QqPZ8rcKMzc6V++3MoTUPGA5OwYHDKQhtHEp0tBjs1 DGKrKX88vr2gikmAhibWKRb+/+/r13hEyg== X-Received: by 2002:a05:620a:14b8:: with SMTP id x24mr532712qkj.284.1592427834123; Wed, 17 Jun 2020 14:03:54 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.03.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:03:53 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 26/73] sparc: convert to cpu_halted Date: Wed, 17 Jun 2020 17:01:44 -0400 Message-Id: <20200617210231.4393-27-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::735; envelope-from=robert.foley@linaro.org; helo=mail-qk1-x735.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robert.foley@linaro.org, Mark Cave-Ayland , Fabien Chouteau , KONRAD Frederic , cota@braap.org, peter.puhov@linaro.org, alex.bennee@linaro.org, Artyom Tarasenko Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Cc: Fabien Chouteau Cc: Artyom Tarasenko Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Reviewed-by: Mark Cave-Ayland Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- hw/sparc/leon3.c | 2 +- hw/sparc/sun4m.c | 8 ++++---- hw/sparc64/sparc64.c | 4 ++-- target/sparc/helper.c | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) -- 2.17.1 diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c index d40b7891f6..aea1b4200f 100644 --- a/hw/sparc/leon3.c +++ b/hw/sparc/leon3.c @@ -132,7 +132,7 @@ static void main_cpu_reset(void *opaque) cpu_reset(cpu); - cpu->halted = 0; + cpu_halted_set(cpu, 0); env->pc = s->entry; env->npc = s->entry + 4; env->regbase[6] = s->sp; diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index ee52b5cbbc..12f9ac1b61 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -193,7 +193,7 @@ static void cpu_kick_irq(SPARCCPU *cpu) CPUSPARCState *env = &cpu->env; CPUState *cs = CPU(cpu); - cs->halted = 0; + cpu_halted_set(cs, 0); cpu_check_irqs(env); qemu_cpu_kick(cs); } @@ -224,7 +224,7 @@ static void main_cpu_reset(void *opaque) CPUState *cs = CPU(cpu); cpu_reset(cs); - cs->halted = 0; + cpu_halted_set(cs, 0); } static void secondary_cpu_reset(void *opaque) @@ -233,7 +233,7 @@ static void secondary_cpu_reset(void *opaque) CPUState *cs = CPU(cpu); cpu_reset(cs); - cs->halted = 1; + cpu_halted_set(cs, 1); } static void cpu_halt_signal(void *opaque, int irq, int level) @@ -832,7 +832,7 @@ static void cpu_devinit(const char *cpu_type, unsigned int id, } else { qemu_register_reset(secondary_cpu_reset, cpu); cs = CPU(cpu); - cs->halted = 1; + cpu_halted_set(cs, 1); } *cpu_irqs = qemu_allocate_irqs(cpu_set_irq, cpu, MAX_PILS); env->prom_addr = prom_addr; diff --git a/hw/sparc64/sparc64.c b/hw/sparc64/sparc64.c index 100b2fab17..fe9c678459 100644 --- a/hw/sparc64/sparc64.c +++ b/hw/sparc64/sparc64.c @@ -101,7 +101,7 @@ static void cpu_kick_irq(SPARCCPU *cpu) CPUState *cs = CPU(cpu); CPUSPARCState *env = &cpu->env; - cs->halted = 0; + cpu_halted_set(cs, 0); cpu_check_irqs(env); qemu_cpu_kick(cs); } @@ -116,7 +116,7 @@ void sparc64_cpu_set_ivec_irq(void *opaque, int irq, int level) if (!(env->ivec_status & 0x20)) { trace_sparc64_cpu_ivec_raise_irq(irq); cs = CPU(cpu); - cs->halted = 0; + cpu_halted_set(cs, 0); env->interrupt_index = TT_IVEC; env->ivec_status |= 0x20; env->ivec_data[0] = (0x1f << 6) | irq; diff --git a/target/sparc/helper.c b/target/sparc/helper.c index 07d87efa4e..90dfb1e92f 100644 --- a/target/sparc/helper.c +++ b/target/sparc/helper.c @@ -244,7 +244,7 @@ void helper_power_down(CPUSPARCState *env) { CPUState *cs = env_cpu(env); - cs->halted = 1; + cpu_halted_set(cs, 1); cs->exception_index = EXCP_HLT; env->pc = env->npc; env->npc = env->pc + 4; From patchwork Wed Jun 17 21:01:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190922 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp805768ilo; Wed, 17 Jun 2020 14:15:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxUjPKB4g0/tUhifnJbnZ5FRaAbc6rpVr1M3wKweqHPdsimdyKZfelnf8/HJyEeCbxgY4g X-Received: by 2002:a25:cbcc:: with SMTP id b195mr1445456ybg.91.1592428517571; Wed, 17 Jun 2020 14:15:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592428517; cv=none; d=google.com; s=arc-20160816; b=CW37CqdEqNJThL/adqa73+FqNqiqHFN8EzC7MH4ZF3b9AcUZn+afjXeoTpsUwOfWd0 km80M2efz5N3gqvW0Sxh2eo5LyuDZfFgLIDwrmZThNHkeHR6IxY4ySXw2RDkASpxffSS AmmMsrca2/yeDoZZpcEnYw1IWGnT+IuCLw48nEeQE9PBsRkRualu7rOMeodOjfEqSpcH +/o3AYpc4fBQgU3FcR1gepbng62EUFmPIhihAXckvfUOHISZ1Sq/GSXPGs2zVMvV2jtH wJfnPUNT8Un/5H0AahQuXpDxDrQ6FUlqnD8wr/fYV3qZJaj3wvcVmf9XyJXmsBmauz2k vl6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=LDQ6XQ/3vPiAN54mt6Pw+hfW8ObudV4rT2qqPEmK+8U=; b=WZ14p7MFmfs4N+C/NiJ1CIxLaanwngoY9sxYuy5t7m7Uv3uBdQENSgkdRkapZ+H71S vYziyke/4BeZrRF2RujdwydAJLmRZdjWumnEGu/9u9sQ+VESItCd/hlNyUcysRYysbIJ fV6iecB9LzWdGyvo8lqmgHyi3x0HjsvHUTkbGxHRRN8dA59KVypZ8sm0aM/lnDupJETe vfuwuIFr//wGgPi/ZgTQL2xGwSenw8rolIZCV25Z6HPo63Z/xAOOf2Y+Uil1DemW4o6N jiFl/hQAw9rROHuTi0ST87feoxKdVukqy/MJWkZmWkB4HEb2QxomgyQWX5DIA26e7Z3a bmNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=HOARYgXf; 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=fail (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 n7si613833ybo.264.2020.06.17.14.15.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:15:17 -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=fail header.i=@linaro.org header.s=google header.b=HOARYgXf; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:50452 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfOu-0005yi-Tw for patch@linaro.org; Wed, 17 Jun 2020 17:15:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37426) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfE6-0003GF-DH for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:06 -0400 Received: from mail-qv1-xf41.google.com ([2607:f8b0:4864:20::f41]:46789) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfDy-0008V0-5e for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:06 -0400 Received: by mail-qv1-xf41.google.com with SMTP id cv17so1737085qvb.13 for ; Wed, 17 Jun 2020 14:03:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LDQ6XQ/3vPiAN54mt6Pw+hfW8ObudV4rT2qqPEmK+8U=; b=HOARYgXfUN1w6kPg1m35xgFG7+zdTYVR2nuOJfUhF1lcd1PQVx1xDUlhNG6Hho4Xnm GVQqebUe69kQxHIcnR24Sc30EfbV8pOtG0ihqc59NGKxF59U8KpvsUePe4H+B+45lQcd YiP4zPsVGZ3sDnwGggTRReCkaHSl7oJQ3s0H/Lm1iGqW3LnT4d3va+1FnZKYGSindyty cgWN7fmwWXp4UFJQ9xB/E90NSGfALEqNzJLcbDZ/BhOx1q0nUzAirR3s7UK3awqPZvFe MUDX10Ii/CF1E3ptvGFYXFft7otsDk0iWDElUiP1f5fMBY181D11SP7vj6XQamALVFLi vRNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LDQ6XQ/3vPiAN54mt6Pw+hfW8ObudV4rT2qqPEmK+8U=; b=e82BMz5uG3hQRVJic3ReEwz4qV6K+jEGolCClFT8cm3MTCFR+d1ZC0roBZr8lXThYT D6rRLI6zUtYIkEfMExheivVYkamOcm1/Yw1c5uvL2sy4CgRUiaQHAowlxFIKmfFn3BP0 A7UvemrbExrpmX3bl1V9KA/7o8zWPWJnEHBru0s8Ti6QYJ+1D5LM83NPpK711cPTUIvM 3ZQNpaE/osfZqDO3vVEGzUACAbH+sLDHOu/KtQ/+ltfBjP+v8szZryRXNv4sxUioaXDA cWmTdAlBW/aIbO8K4+W+8h9RPz6Ldr0TDjMmibKCscGTTdLsKf/SgLotMtKJeTeqRu2q gM1Q== X-Gm-Message-State: AOAM531sPCO9dUULror8NWCXxVa3e0ysqRse8W+adKzOFL4V+aK8zkI6 OKHJwBJjgd0h1pdQcCx+jX+KHxgsTzA42A== X-Received: by 2002:ad4:46a9:: with SMTP id br9mr554986qvb.246.1592427835455; Wed, 17 Jun 2020 14:03:55 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.03.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:03:54 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 27/73] xtensa: convert to cpu_halted Date: Wed, 17 Jun 2020 17:01:45 -0400 Message-Id: <20200617210231.4393-28-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::f41; envelope-from=robert.foley@linaro.org; helo=mail-qv1-xf41.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.puhov@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, Max Filippov Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Cc: Max Filippov Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- target/xtensa/cpu.c | 2 +- target/xtensa/exc_helper.c | 2 +- target/xtensa/helper.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) -- 2.17.1 diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c index 82c2ee0679..fda4a73722 100644 --- a/target/xtensa/cpu.c +++ b/target/xtensa/cpu.c @@ -102,7 +102,7 @@ static void xtensa_cpu_reset(DeviceState *dev) #ifndef CONFIG_USER_ONLY reset_mmu(env); - s->halted = env->runstall; + cpu_halted_set(s, env->runstall); #endif } diff --git a/target/xtensa/exc_helper.c b/target/xtensa/exc_helper.c index 601341d13a..01d1e56feb 100644 --- a/target/xtensa/exc_helper.c +++ b/target/xtensa/exc_helper.c @@ -115,7 +115,7 @@ void HELPER(waiti)(CPUXtensaState *env, uint32_t pc, uint32_t intlevel) return; } - cpu->halted = 1; + cpu_halted_set(cpu, 1); HELPER(exception)(env, EXCP_HLT); } diff --git a/target/xtensa/helper.c b/target/xtensa/helper.c index 7073381f03..031a14cf86 100644 --- a/target/xtensa/helper.c +++ b/target/xtensa/helper.c @@ -328,7 +328,7 @@ void xtensa_runstall(CPUXtensaState *env, bool runstall) CPUState *cpu = env_cpu(env); env->runstall = runstall; - cpu->halted = runstall; + cpu_halted_set(cpu, runstall); if (runstall) { cpu_interrupt(cpu, CPU_INTERRUPT_HALT); } else { From patchwork Wed Jun 17 21:01:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190930 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp809391ilo; Wed, 17 Jun 2020 14:20:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3KD1DMeoJb0eFvyFWVetnW3/9CxeIC821BJWbORVM+i2dKrPXWm0J08Ue8FfLUK5mo8JQ X-Received: by 2002:a25:cbce:: with SMTP id b197mr1436535ybg.316.1592428836947; Wed, 17 Jun 2020 14:20:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592428836; cv=none; d=google.com; s=arc-20160816; b=klwLkFQXA1bcl7SAdPMm6ERJW+dKD20S0+RpXZlahm8pW9Dh/GUoJwiAlUC3Vp2sMC 116/hrQsaAa0t6UBKud19mrQs6EPMaVzzITyG3THinogsK77tUvDqFyS4pIaUUMWP80v AOAs0e7EsxBj+rT3q0GQjveV95Jg2vqANxq0BLZaM94awnQVeO49K3hQWqnbspiVeL+z vuxJy6YDuwwhteq9bjJvKXfTq4rl2kL6VgOzcD8tMEcXAMZuOru+gT2dFiD1VlvmU9V2 ukQNC4yHS/ilg26oUkZAxVhaJqhdhn8nihFb8D0s+Gxwh4FO4ArmYGNDbWrln1kt229N Agnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=r3ihf6Hm5TzP8tkXXmmJd+HhpHTqUNEyVizEpWsgvtc=; b=k2nm+IxpZLqY33tP7a0012j70rnc2pvXtYlYWhRmpH/kn0Cg5exE8M9JjFBPEdcxgI z+YKDXUhrLJzlLBEX7yz4xb9xVbdN12INc7VF4/th0qXICDZJ4IVdnhTOW5QPRyyLvQj XlFpCO5UPcUfOq5bzvDvGI5B+WDjj6SqmTQsgCNjRYq+a9jwAkLPrAnReKaRMh4vef+b EvfS6oPPL6bkfWXyXMu+2euGtMzHDvLQyhDq5IqCudXID7dbA83hS9ZwsF4PeCWbl89B 3udgKRmA0kEsR9OAYZFQ0JtEPfLUcrXl4tck/KaV3GubDA8QmAQOL04i6zP77c5SWrKH hbdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=FLazHiiM; 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=fail (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 1si662572ybe.134.2020.06.17.14.20.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:20:36 -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=fail header.i=@linaro.org header.s=google header.b=FLazHiiM; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:39460 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfU4-0005Hb-7D for patch@linaro.org; Wed, 17 Jun 2020 17:20:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37440) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfE7-0003Gg-3s for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:07 -0400 Received: from mail-qk1-x744.google.com ([2607:f8b0:4864:20::744]:39456) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfDy-0008V4-6M for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:06 -0400 Received: by mail-qk1-x744.google.com with SMTP id w3so3495522qkb.6 for ; Wed, 17 Jun 2020 14:03:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=r3ihf6Hm5TzP8tkXXmmJd+HhpHTqUNEyVizEpWsgvtc=; b=FLazHiiMttd3/Qd+Dl/Rze/N8LbtIMW3GoaMCj4W1fl1o0Yl35Z2o0BYg52G5ggmAB 7T2Um0hj/foyGWbpjIHDiGGGmhQ6MU+dJE0qTP1MbRPvyr7YkQ3KxOy/ZPeJa6S+BSl7 IOngYd60f5oHr5U7C8XS3o9sk2f3nrx3rpDx1bQ7G59v1tavYzGMINDx0YBufOUlEsAe w4lZb6tuyKCK+xm9owNYFNVcVcRHG+xrhFF3rSwD0xEnvfNE4FXquQoMu/NcXdoPu46j NZVeaUEJJHcW4jAFbUs+NZh/pD6Y7raWKPy+MJuTKwkLHfKGe7AdDHosd8JL15PudG+a 8mvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=r3ihf6Hm5TzP8tkXXmmJd+HhpHTqUNEyVizEpWsgvtc=; b=QfukeIaWbc3cYYfr2SGuqHl+gAbZVpNWzc+ZHG/brGcl8z+kCWqTDG5N1Kh2FosjxU VZKbduUn8bk53LbzTb8afodSNjMkpNW56ggVfd7IW9+TSEdlyvMZ8EMBtwmh2VYk/AUg G0I63AKSgJntYQJ3QM9Jl6b6eYiyqKzt+euZc4TowxjDEwBlhWM8saJIsE7apCmBqp39 GhaxDprH/2YvZkrOAEVl5iJ2wT4xO7DjYuHUaa0ukF7o8Mw2STCTF7ao36HRrZOd76XQ gsFpB47Tb8DTyMUABVQXi1UGt21nKFfm/Xd95YNFoOl0pGzwgRDXs1hIDauSpllhuwxo b5uQ== X-Gm-Message-State: AOAM530hAUMQKZbbUQM/U46M1XpwmEDS8JqErwl5OU1TBdp7ScLlt9pG DVTF4iOLS0au+t7p6mkzBmaAk4j6Au2dIA== X-Received: by 2002:a37:4ed2:: with SMTP id c201mr604934qkb.138.1592427836755; Wed, 17 Jun 2020 14:03:56 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.03.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:03:56 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 28/73] gdbstub: convert to cpu_halted Date: Wed, 17 Jun 2020 17:01:46 -0400 Message-Id: <20200617210231.4393-29-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::744; envelope-from=robert.foley@linaro.org; helo=mail-qk1-x744.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.puhov@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- gdbstub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/gdbstub.c b/gdbstub.c index 6950fd243f..b25796b33d 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -2062,10 +2062,10 @@ static void handle_query_thread_extra(GdbCmdContext *gdb_ctx, void *user_ctx) g_autofree char *cpu_name = object_get_canonical_path_component(OBJECT(cpu)); g_string_printf(rs, "%s %s [%s]", cpu_model, cpu_name, - cpu->halted ? "halted " : "running"); + cpu_halted(cpu) ? "halted " : "running"); } else { g_string_printf(rs, "CPU#%d [%s]", cpu->cpu_index, - cpu->halted ? "halted " : "running"); + cpu_halted(cpu) ? "halted " : "running"); } trace_gdbstub_op_extra_info(rs->str); memtohex(gdbserver_state.str_buf, (uint8_t *)rs->str, rs->len); From patchwork Wed Jun 17 21:01:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190940 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp813152ilo; Wed, 17 Jun 2020 14:26:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx0u7lf6s99szNBQpQzgqIn1RBA5TLkuayM+/+P1f/KnNhgbfbVSvyhBRVtFBktfUWN1n0A X-Received: by 2002:a25:cd83:: with SMTP id d125mr1478330ybf.38.1592429191167; Wed, 17 Jun 2020 14:26:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592429191; cv=none; d=google.com; s=arc-20160816; b=ifGEISSsaAbOSi2OfmXyWRZdyAfGajDpEuTIcABvPR+S24zpj0grsgwaDS7l4BxKDO sxOBTgW/cLbcCEKBxMSFdRtEC8+2UbDMm09pDW0Jzc2rhKxTcdYcLfjdmj7FLVwSfx8b +7MN+XQLU6hHiiaBFYJJIl8Y4bGpmibX8fj9EADZB5/J5NLdUAF3235hcTvTyLLNB7QO doQtL5+KEyq03OPrqg4srbQB66gZQZa37eZ5oYTz4IB8puZpWdCf5sOvDTgcXA3fM0/+ oHu9V/MFHgWDka70NHiby1AtIPq11S3CgVGX1Uz8Cy+C1dyohv13Lb5GqpRwAH1VcOPN 3Uow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=O0fBrT3P1tRSLH4phcxb7WjFxDduimB9rIeQgvMHfic=; b=niBJ3CE4/TBFYzApz7jEEZTDbBahXHtiePLaVVMLBrsVmPnqnbbWCKDJ+XP1YqGmKR xDCz6FtShhCiEreAqk5Wcw19ZiRA0CTw8iUktLIRf+a5N3hExp9batNKuHV1dOrk8qpR 68dtklVQzIrmKKjrfLesM4iR8EbwsMxFbJVYVod9Dll0oTnkZ1MdJGs41PdSRgB8SFVQ u+TdJZfi5YD9fJ+40E1xf1KMhgTy1E+P73+j204ObAi8H5N1inIykLq643SdeaSEJ8Gp BhH7IMvcDd/mHC0KyugOZfQywYR+6fUj9RB5nqGaLUY+IM6sGhVwGPIc8xmJ4pXDz7sX mqUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=IRM0C7pF; 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=fail (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 d137si698591ybc.309.2020.06.17.14.26.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:26:31 -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=fail header.i=@linaro.org header.s=google header.b=IRM0C7pF; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:36194 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfZm-0007x9-CB for patch@linaro.org; Wed, 17 Jun 2020 17:26:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37446) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfE7-0003Gm-4n for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:07 -0400 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]:45357) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfDz-0008VC-QP for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:06 -0400 Received: by mail-qk1-x743.google.com with SMTP id q8so3450292qkm.12 for ; Wed, 17 Jun 2020 14:03:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=O0fBrT3P1tRSLH4phcxb7WjFxDduimB9rIeQgvMHfic=; b=IRM0C7pFoTg1L2sxI+taEDC+ZG+BeUGjMY10i9SdEfHlp8J4ikn0QpCpjT46EbbG7F Li03oMkZyZCDVCAxh4gcJInYBus6QuVgHT4CV7kc8Gt0TjbpI/AAZmd2zo5h6cboMpG2 MG41Mt4E1It1M/E+CwmPObEW3vvXzdtG0YjZz0VtaoQl/30CDN3DfcIDju2vzBOr1XYk 2PI3lsk8tJ1QWxJctVPOR9SBT+3UXu7aQfY1S5OmtS+I0UPe2KJiUuucUr5HX3t4YVUA fthaMmkKyjP5VQoUWnEC+VjpbVulj2QKs+2MUExykcqKdFup8m+kEx5mYsAHS6/E1OgF Q/UQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=O0fBrT3P1tRSLH4phcxb7WjFxDduimB9rIeQgvMHfic=; b=DszzcW2csKduhfqt+QrMOaoZZkSSn5Q8TBk/+rOxd/NdlvJlYcK0GdY7Z15GF3LgsJ wORLddRiT+/8/aFL2Qnxu2pTEaaCPXVTVRJ3IvbVUbcK2zOPzoBVAMhHsxZvjyeEKarU 420ZhkdG+Ich0Xbv5UBrP3tZG2m02Mu/UyiIg0YqfFkFH4nbLOshG0BpztRCRJ+irCcq 9tIOQxy6aFa2O7msuibg47D2HRkVdCfwrqrqBSyiKIvruQEGUkW+kAc7xkMrQF3O7Qjr eidIxcAUhwM0g+CO2kePsxL/KCHvgbkE9MK5STYjNuam1wGaxziOYCLMI5rN1hOFskzK Zyzw== X-Gm-Message-State: AOAM532YK1A9LVJ4ZSD+XcK4aY7cLbHqNuTZAlPhI44rQzbkKxIGXWtX mdZn3H3WFsL92CPmuwDOhaIHjzwu3pLDJw== X-Received: by 2002:a05:620a:2213:: with SMTP id m19mr608072qkh.244.1592427838111; Wed, 17 Jun 2020 14:03:58 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.03.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:03:57 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 29/73] openrisc: convert to cpu_halted Date: Wed, 17 Jun 2020 17:01:47 -0400 Message-Id: <20200617210231.4393-30-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::743; envelope-from=robert.foley@linaro.org; helo=mail-qk1-x743.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.puhov@linaro.org, Stafford Horne , cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Cc: Stafford Horne Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- target/openrisc/sys_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/target/openrisc/sys_helper.c b/target/openrisc/sys_helper.c index d9fe6c5948..2615571ce7 100644 --- a/target/openrisc/sys_helper.c +++ b/target/openrisc/sys_helper.c @@ -134,7 +134,7 @@ void HELPER(mtspr)(CPUOpenRISCState *env, target_ulong spr, target_ulong rb) if (env->pmr & PMR_DME || env->pmr & PMR_SME) { cpu_restore_state(cs, GETPC(), true); env->pc += 4; - cs->halted = 1; + cpu_halted_set(cs, 1); raise_exception(cpu, EXCP_HALTED); } break; From patchwork Wed Jun 17 21:01:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190938 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp812260ilo; Wed, 17 Jun 2020 14:25:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGfLm+bdL77az3Bm3LFjr5EInvqirewM9Zrih/IVCqioQYZV81gSvQWzYY68CsXAjgSCxU X-Received: by 2002:a25:2415:: with SMTP id k21mr1473000ybk.349.1592429103189; Wed, 17 Jun 2020 14:25:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592429103; cv=none; d=google.com; s=arc-20160816; b=Hop9KdiooZHYVOsd8fHuutBMZoN5KN/WnDtbe4yyB907xkWbLSjdJlMR94VuGLhtI1 HmkP+BxMiLV4B635ZxcMvBT7gILHUqRcw9htHTzfFkpBqaXysRTHIJD8e8X27Q1jYGmQ OPielhU9TFFcbEpwuE+da9K4b7C+8et+61+/6LFgZ+sSEmzVvM6yuhybcE33F/xHiwYq 9kV8lutjzIoP9B5svIYR0L6kUcGvcfR76AB+6K98Ya8NP8ROiV+X2A7JxYurakDQtkCf wNbxXX5JEHhA4nyNi/KiusgJF4bdL8HTSj2r/TTSv+f1tzfdfXn4IoP6+p1njS8Bxg71 J5rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=pBQreEfimlo/TeCu0za1hNbEWK5jCOhKGwDICZx6xko=; b=j3i94hqO3KUxxoCpnk1YUKAe0NZvU00xQFoK4zf1qAAp9FQoyIzm6Vc+TKN5oQqyQJ 7T1KHWlhx/0G1EqqucoZV1/2W06HiAGYKTpK6BqdjqtQvFJtNfMwQ+cAQ6BNoLwRC605 bcy013mGOZ9LEhnPRR9G/OHt8DHk93ysF3RXCJYucViGedNhtDGzWwpOywXzCMGRnLq3 AHAPng+nuKy5uWUtcQxuH9psFEG2SF6M82E5XXyTqY7WT04llcAkBIcKzdQZLDha8m24 MuW00tcGyr2EiziFwXwWPr1N9Xsbzd3yW1UXxCZVByQMJw2+u2MsvkjTU+GJIIqLuKcI hp4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=mvQxS9Ba; 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=fail (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 l14si952201ybt.495.2020.06.17.14.25.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:25:03 -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=fail header.i=@linaro.org header.s=google header.b=mvQxS9Ba; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:56462 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfYM-0004WO-K5 for patch@linaro.org; Wed, 17 Jun 2020 17:25:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37542) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfEA-0003M7-Tm for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:10 -0400 Received: from mail-qv1-xf44.google.com ([2607:f8b0:4864:20::f44]:38879) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfE0-0008VI-Lt for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:10 -0400 Received: by mail-qv1-xf44.google.com with SMTP id ec10so1759797qvb.5 for ; Wed, 17 Jun 2020 14:04:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pBQreEfimlo/TeCu0za1hNbEWK5jCOhKGwDICZx6xko=; b=mvQxS9BaVCNlAsDmYqVgirbmHemc9z5WGJbjnkzJv9ld/zyyZnu2xIuYAEslfWbhRH F0UFFmKK9x7rybo2O0NewTwltqm2r1k+4KdIBj/9sJ2/Vmokmyry8qIJaWNKfScDuH63 qyu3ICvzmMwurx+Eoo+8C1+iFvJMGXX11vb+Uwx1e35m/kA8OPODIky6I7YThgaDKUf1 INQtuUChZzhR4ix/qMdLcXTbRXp+kbLvJGjit+ApcHspQ51etdD1mX2UO1kiLgnirtGZ 2rol7lbp1wGZ/6SbHz9PzLVSaJHsNlA0f8a7PFj0QK0f8530JVKEutKjUMfG/qPtMoPP uP4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pBQreEfimlo/TeCu0za1hNbEWK5jCOhKGwDICZx6xko=; b=OCKk5osMC81pB/ardUXjVUk7urg0QspjIQg8YkYYHYDft6N8ESj4AsjWyNFzez4hVV SSSOr5oe7dtACOhN9PjXZYIlg96wjBYXv0cA9kEY9KaQAWkUK1lWSA9QDi/mhJqigC6E HlDwq11cQsNMUuQYntFkiHqg3JWqdv4PHHRBjo83J326EncwmK1H9MwjUrgsJ11/9YuU 9icILbepu6aIpsSdrowCtORKhv9a6XQ5nCqgOLaeXa+W+5+jJzif2c6Y8/gjCh9pkuZr wDZ0gZJCZl1PKWjsu1Pqxe2TW27Zk//oQkUhjlMiXjRzV0xce0GToDJ4gFUYRfTR7NPv 6wiA== X-Gm-Message-State: AOAM532xGlLBVhoZEDT3+fpHmxB8c0RaQ/TgH+GyUWFBKewU8bvYWFk9 K/pE3PJwImibw+3Ia+ASj7WybTJKKYew7w== X-Received: by 2002:a0c:d40b:: with SMTP id t11mr623582qvh.0.1592427839478; Wed, 17 Jun 2020 14:03:59 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.03.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:03:58 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 30/73] cpu-exec: convert to cpu_halted Date: Wed, 17 Jun 2020 17:01:48 -0400 Message-Id: <20200617210231.4393-31-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::f44; envelope-from=robert.foley@linaro.org; helo=mail-qv1-xf44.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robert.foley@linaro.org, cota@braap.org, Paolo Bonzini , peter.puhov@linaro.org, alex.bennee@linaro.org, Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- accel/tcg/cpu-exec.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) -- 2.17.1 diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index d95c4848a4..e296894ea1 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -425,14 +425,21 @@ static inline TranslationBlock *tb_find(CPUState *cpu, return tb; } -static inline bool cpu_handle_halt(CPUState *cpu) +static inline bool cpu_handle_halt_locked(CPUState *cpu) { - if (cpu->halted) { + g_assert(cpu_mutex_locked(cpu)); + + if (cpu_halted(cpu)) { #if defined(TARGET_I386) && !defined(CONFIG_USER_ONLY) if ((cpu->interrupt_request & CPU_INTERRUPT_POLL) && replay_interrupt()) { X86CPU *x86_cpu = X86_CPU(cpu); + + /* prevent deadlock; cpu_mutex must be acquired _after_ the BQL */ + cpu_mutex_unlock(cpu); qemu_mutex_lock_iothread(); + cpu_mutex_lock(cpu); + apic_poll_irq(x86_cpu->apic_state); cpu_reset_interrupt(cpu, CPU_INTERRUPT_POLL); qemu_mutex_unlock_iothread(); @@ -442,12 +449,22 @@ static inline bool cpu_handle_halt(CPUState *cpu) return true; } - cpu->halted = 0; + cpu_halted_set(cpu, 0); } return false; } +static inline bool cpu_handle_halt(CPUState *cpu) +{ + bool ret; + + cpu_mutex_lock(cpu); + ret = cpu_handle_halt_locked(cpu); + cpu_mutex_unlock(cpu); + return ret; +} + static inline void cpu_handle_debug_exception(CPUState *cpu) { CPUClass *cc = CPU_GET_CLASS(cpu); @@ -546,7 +563,7 @@ static inline bool cpu_handle_interrupt(CPUState *cpu, } else if (interrupt_request & CPU_INTERRUPT_HALT) { replay_interrupt(); cpu->interrupt_request &= ~CPU_INTERRUPT_HALT; - cpu->halted = 1; + cpu_halted_set(cpu, 1); cpu->exception_index = EXCP_HLT; qemu_mutex_unlock_iothread(); return true; From patchwork Wed Jun 17 21:01:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190932 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp810463ilo; Wed, 17 Jun 2020 14:22:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgKcywstEaEz+y2EDjXgyceZNTzGtEuMlA40OO6jyfNxBll980fYYJTpfCoyGbmZECG11W X-Received: by 2002:a5b:143:: with SMTP id c3mr1325001ybp.168.1592428932341; Wed, 17 Jun 2020 14:22:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592428932; cv=none; d=google.com; s=arc-20160816; b=w5yKgSx7qIE4r+PB1PqJpjlRzQvE+NPJfUELUuy7GHhRPbQ7ydAFqgUviyqQ3QNsqG 3eEmV0X0i4cR3+pGlbrqJMu1RBejN22VkidKqXPbB1/x+4iW19EJmJoNHMI4s/PHaRAw 0dMYK8RNFfbjKOPmoeh8rWAmoB/FRVvjavmNKO7H83kQReVwaL9BbYJH7r+H9eO0rfu3 y646b+XGoh9Z84yXggde7DC4VT17bkoYFl4uem8JoYqpZt0ldyPzWelTkP+lq7U8+wpb 3bxZHBWf3xI0Uz2XK68IA6p81ev7XvGPpTuK7EDoRry+cAFUGF8/wiO3V8PEVEOWRzMi a/kA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=sbez58I4EiEfgiO/NYT9T3e4CNH+JdYMM0H0+QygWQ0=; b=kjfqLn8q1aYL/N6fXHxA910jwOOy/5AmCYzKBGljVPUCQMdjlN3rBBcs6DQ0tkrA8Y lbSgpsVurhRjWJWAwRefk+esfsiar3E18TC0nVteLoqAp9fXgrqxv7E0TwzbTaRku2Je ncjSC/HCLWe5QqcLklHVr+yH9prJtSMdyrlQGFYbLddpOTentJ0d+gU2D70fE5df5qov xKHSGOim4iG1tpqn50bBeCUXyU9T8H22+gjbc+V6TxpETKuUSw26bHBOHD7uYM5nls/N oTI2ncIvjJ0MKexh9g3BCfHqLsY7qk/48MlWFGZHKgSzTUexodhR1XcT2ddt/A3Y59l9 WIvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="r/cNR2lk"; 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=fail (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 s2si636733ybe.216.2020.06.17.14.22.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:22:12 -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=fail header.i=@linaro.org header.s=google header.b="r/cNR2lk"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:47928 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfVb-0000yT-Os for patch@linaro.org; Wed, 17 Jun 2020 17:22:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37492) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfE9-0003I3-8j for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:09 -0400 Received: from mail-qv1-xf43.google.com ([2607:f8b0:4864:20::f43]:43608) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfE5-0008Vc-2z for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:08 -0400 Received: by mail-qv1-xf43.google.com with SMTP id dp10so1742987qvb.10 for ; Wed, 17 Jun 2020 14:04:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=sbez58I4EiEfgiO/NYT9T3e4CNH+JdYMM0H0+QygWQ0=; b=r/cNR2lkier1zsQCfbqN+DznF2rDQqhEHqzWL8z3/6fRWGjh5S98S3sIqQB1jGRRxn jr66U4ove8He3107YfX8oGCerP7Q7KVb2Jqp5mgQ9cyEZnV3P5ezICRtEDTXVDkkgSzf 69WJvV+RVzFIjuqPxQ7yIVL4LcHulHZixEBPMF+CwLRbWrtI1MsO2df33qT0jHenJEd4 Duxo6v51uLzJgcqhijwqPoMddz/aVJtpaDpy3cFgkREkpZwHBToM9f3DKlv9v8IsfJHa 741NG9taUGI5akF6ktd1OR9CaOJJ43wwGOUJhTZIR1nTy86r6nR6QsoFRTjEJSn/9ne9 S7dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=sbez58I4EiEfgiO/NYT9T3e4CNH+JdYMM0H0+QygWQ0=; b=okRmljyn+swDJzvevu85T8SZaJYsbAPH5eRZ1zThDlCRjE4p9p+mmypPGyf/piDCN9 Ix3Iaru2p8iaizswKxOd3PnvKwWAzuZsBzy8PYxpQQBrA4wIZ1oTPPcaqOEWQjvOkyvT EAh349HaXEX5OX850VVLe2ax5wC4eUjm1e74qZUOY2mXk+OTu+36Ic9zGpWR/2xG90fi jo9Cucbcn/5qqYvO+xKOXtLSerUDVJN1+6nKSqQJDzA6EdvmAF5aHqC9kATWz9IfeErf ii7AXb08p4eLbaKbrvTeS/3/bJ8q5TvTZ82LCpmSmouclsxZtuExy6SRzQTbb1WLge8r 6fwg== X-Gm-Message-State: AOAM533ZRLpE+/jf21gwkKvuBXmqVZ6me0EmGWU513PEzHgLZ9QPqfWO 6oxUiL6WeWNDEUiKyC742Z5WWd2gC15/3A== X-Received: by 2002:a05:6214:1842:: with SMTP id d2mr535702qvy.197.1592427841007; Wed, 17 Jun 2020 14:04:01 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.03.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:04:00 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 31/73] cpu: convert to cpu_halted Date: Wed, 17 Jun 2020 17:01:49 -0400 Message-Id: <20200617210231.4393-32-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::f43; envelope-from=robert.foley@linaro.org; helo=mail-qv1-xf43.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robert.foley@linaro.org, Eduardo Habkost , cota@braap.org, Paolo Bonzini , peter.puhov@linaro.org, alex.bennee@linaro.org, Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" This finishes the conversion to cpu_halted. Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- accel/tcg/cpu-exec.c | 2 +- cpus.c | 4 ++-- hw/core/cpu.c | 2 +- hw/core/machine-qmp-cmds.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) -- 2.17.1 diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index e296894ea1..099dd83ee0 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -435,7 +435,7 @@ static inline bool cpu_handle_halt_locked(CPUState *cpu) && replay_interrupt()) { X86CPU *x86_cpu = X86_CPU(cpu); - /* prevent deadlock; cpu_mutex must be acquired _after_ the BQL */ + /* locking order: cpu_mutex must be acquired _after_ the BQL */ cpu_mutex_unlock(cpu); qemu_mutex_lock_iothread(); cpu_mutex_lock(cpu); diff --git a/cpus.c b/cpus.c index 8edc9858d6..e070bffbff 100644 --- a/cpus.c +++ b/cpus.c @@ -223,7 +223,7 @@ static bool cpu_thread_is_idle(CPUState *cpu) if (cpu_is_stopped(cpu)) { return true; } - if (!cpu->halted || cpu_has_work(cpu) || + if (!cpu_halted(cpu) || cpu_has_work(cpu) || kvm_halt_in_kernel()) { return false; } @@ -1865,7 +1865,7 @@ static void *qemu_tcg_cpu_thread_fn(void *arg) * * cpu->halted should ensure we sleep in wait_io_event */ - g_assert(cpu->halted); + g_assert(cpu_halted(cpu)); break; case EXCP_ATOMIC: qemu_mutex_unlock_iothread(); diff --git a/hw/core/cpu.c b/hw/core/cpu.c index 1d2cafe76c..64a1bf3e92 100644 --- a/hw/core/cpu.c +++ b/hw/core/cpu.c @@ -259,7 +259,7 @@ static void cpu_common_reset(DeviceState *dev) } cpu->interrupt_request = 0; - cpu->halted = 0; + cpu_halted_set(cpu, 0); cpu->mem_io_pc = 0; cpu->icount_extra = 0; atomic_set(&cpu->icount_decr_ptr->u32, 0); diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c index 2c5da8413d..a35559b5d8 100644 --- a/hw/core/machine-qmp-cmds.c +++ b/hw/core/machine-qmp-cmds.c @@ -62,7 +62,7 @@ CpuInfoList *qmp_query_cpus(Error **errp) info->value = g_malloc0(sizeof(*info->value)); info->value->CPU = cpu->cpu_index; info->value->current = (cpu == first_cpu); - info->value->halted = cpu->halted; + info->value->halted = cpu_halted(cpu); info->value->qom_path = object_get_canonical_path(OBJECT(cpu)); info->value->thread_id = cpu->thread_id; #if defined(TARGET_I386) From patchwork Wed Jun 17 21:01:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190945 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp815035ilo; Wed, 17 Jun 2020 14:29:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQgFPBqlatUHAYo8xCbo9VnkavqKeyyZdKxU275K+8c/qSTSNMQbOx8beFZptWyt0DfTZV X-Received: by 2002:a25:bf8f:: with SMTP id l15mr1433734ybk.453.1592429379912; Wed, 17 Jun 2020 14:29:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592429379; cv=none; d=google.com; s=arc-20160816; b=If869rVsj/28jmrcBLfensmaraHflyZUdjwQZs8k/ccr1va3aGHDtVV0/i1QY0Ihij rbV7F+Fteyg7Ot5TEfuUtdVBTRMFY2hthzBC7DPqB26jeFm813pCSwhpUdvMh97pHi+/ UMIyl62yvkyCpL7/bbdI/LPJFECq3VI9JSVkhbdDP0X4JXo8hud5GVZhcjkoDCXun0DP GO8Fy8JAyKdh9QeJG6vjFXmf417BeJ2YNXuw1U2mev2DuFMyivStf0RDOvtfKXxfnlJK bYWbVZdMRn57Gu8GY06FsIeO1LsodXaZW8twKNrS4+17LhFi2zIpwy8OJyUYIVBVA7KN xHAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=MqrgrNTQ/ix1Dv7Vxho5rUxV7/F8VuXS30653W0xsHs=; b=K8i6NzMKO5CR+PqaGDUqkO+tUoZSj8Q8HCXfGPscNp2JKpXgxkxou3Fb25iDitI+rI Kf9LwmTrFkJG+GDxUlSYdUohHF+4z5QAG4iUFK9QB4j4Dh0NmIxKFoKBbXDUHs1gx9Cs pckKtRTWKXOh1Lk6ohRzNFGXtHkpANcWMXfHsiGAl8Xcb3H+CbVchWyp/nf65eQ7FmWu MP0HQ9SH1VcFS6de6drBuu5t9UR4Do1bBV2bm0J2l7i+XsGfeJs7oxGQaalxYzf6Ez9U 0gG+nN4y6Egul2N0EbmCX7hFEWCrj4d32A8JMbgDeRKlg0KR59cKCsN7UsEzaDWFCqZj 0ooQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=pxbDiHWq; 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=fail (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 194si628820ybn.356.2020.06.17.14.29.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:29:39 -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=fail header.i=@linaro.org header.s=google header.b=pxbDiHWq; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:44716 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfcp-0003cF-Ah for patch@linaro.org; Wed, 17 Jun 2020 17:29:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37486) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfE9-0003Hi-0J for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:09 -0400 Received: from mail-qk1-x736.google.com ([2607:f8b0:4864:20::736]:36744) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfE5-0008Vj-2Z for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:07 -0400 Received: by mail-qk1-x736.google.com with SMTP id 205so3519792qkg.3 for ; Wed, 17 Jun 2020 14:04:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MqrgrNTQ/ix1Dv7Vxho5rUxV7/F8VuXS30653W0xsHs=; b=pxbDiHWqDjdbSYz4Nr7qe5Nnf8SNlv3vdF/xKuTyXCanWL0j11BVGokBv3jrVA3Pva Vpy7wd5AbO8HJ/ScuLEmDLK47ube3CtN8MBU7gS4qipZ75UpXCOzb4/GeJbCMfz9QUIJ VAwy5Iiozk9ejkKCiYZLxNnBWpRpvWTT6Mkh8Z1Dt2Sb462J7edP/vx855pnj3iioVbi RLFc6cDA2XM8IqOQyfqpPP98XCKSDRiffJCfX/h33K9e3zbp2/dgjNTcwjSXqykpnDVr MmHZrvSfsXXhQ+zlfq3wMr8m3mGgoAov+WkdeoaoYIL3IVaMAymWPpijGPit3+aYjCVi b63Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MqrgrNTQ/ix1Dv7Vxho5rUxV7/F8VuXS30653W0xsHs=; b=Z4A9TBqTfyz8W46nChgVXBuehH7WpIZ8GlRXWrHAKOJeeWi47EmqmE0LEc5Bvcn2CU WJDXhtczpRc6p+ObKINOuKhqSWzYHd3FFxHiSkO0Mltaz+Ei0QqIB3Wv4IsJoX7w4iDy gVgFMzLM3TwwdJ2tHy6NggANG9xt7MGF/xL0LAFTK1W+J9uzsRecaHKmS0BswsFdNGtc ew7vFccZFmK742BkUMa+DNd7eU7e0MReKd+MDUD4DKs0XUwcM3arBk0PA2Eo/hogxZa2 IhW6R99PJp0gHRNYMH5WiVso26b0WAJGs1GRQEtXpeN2YNulPYlppOk6jf5p/9FM//Tg djtg== X-Gm-Message-State: AOAM532AU8A7TnrAIqSqXLLQAZ1qX4hoIh1yE34EVXnvzEZ7CNiv21df PrdXJ2xNB2gqvxeuR5zdm+gf9pTi5PFZHg== X-Received: by 2002:a37:a84c:: with SMTP id r73mr332364qke.0.1592427842402; Wed, 17 Jun 2020 14:04:02 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.04.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:04:01 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 32/73] cpu: define cpu_interrupt_request helpers Date: Wed, 17 Jun 2020 17:01:50 -0400 Message-Id: <20200617210231.4393-33-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::736; envelope-from=robert.foley@linaro.org; helo=mail-qk1-x736.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robert.foley@linaro.org, cota@braap.org, peter.puhov@linaro.org, alex.bennee@linaro.org, Eduardo Habkost Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Add a comment about how atomic_read works here. The comment refers to a "BQL-less CPU loop", which will materialize toward the end of this series. Note that the modifications to cpu_reset_interrupt are there to avoid deadlock during the CPU lock transition; once that is complete, cpu_interrupt_request will be simple again. Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- hw/core/cpu.c | 27 +++++++++++++++++++++------ include/hw/core/cpu.h | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 6 deletions(-) -- 2.17.1 diff --git a/hw/core/cpu.c b/hw/core/cpu.c index 64a1bf3e92..d3223f6d42 100644 --- a/hw/core/cpu.c +++ b/hw/core/cpu.c @@ -99,14 +99,29 @@ static void cpu_common_get_memory_mapping(CPUState *cpu, * BQL here if we need to. cpu_interrupt assumes it is held.*/ void cpu_reset_interrupt(CPUState *cpu, int mask) { - bool need_lock = !qemu_mutex_iothread_locked(); + bool has_bql = qemu_mutex_iothread_locked(); + bool has_cpu_lock = cpu_mutex_locked(cpu); - if (need_lock) { - qemu_mutex_lock_iothread(); + if (has_bql) { + if (has_cpu_lock) { + atomic_set(&cpu->interrupt_request, cpu->interrupt_request & ~mask); + } else { + cpu_mutex_lock(cpu); + atomic_set(&cpu->interrupt_request, cpu->interrupt_request & ~mask); + cpu_mutex_unlock(cpu); + } + return; + } + + if (has_cpu_lock) { + cpu_mutex_unlock(cpu); } - cpu->interrupt_request &= ~mask; - if (need_lock) { - qemu_mutex_unlock_iothread(); + qemu_mutex_lock_iothread(); + cpu_mutex_lock(cpu); + atomic_set(&cpu->interrupt_request, cpu->interrupt_request & ~mask); + qemu_mutex_unlock_iothread(); + if (!has_cpu_lock) { + cpu_mutex_unlock(cpu); } } diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 92069ebc59..6f2c005171 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -522,6 +522,43 @@ static inline void cpu_halted_set(CPUState *cpu, uint32_t val) cpu_mutex_unlock(cpu); } +/* + * When sending an interrupt, setters OR the appropriate bit and kick the + * destination vCPU. The latter can then read interrupt_request without + * acquiring the CPU lock, because once the kick-induced completes, they'll read + * an up-to-date interrupt_request. + * Setters always acquire the lock, which guarantees that (1) concurrent + * updates from different threads won't result in data races, and (2) the + * BQL-less CPU loop will always see an up-to-date interrupt_request, since the + * loop holds the CPU lock. + */ +static inline uint32_t cpu_interrupt_request(CPUState *cpu) +{ + return atomic_read(&cpu->interrupt_request); +} + +static inline void cpu_interrupt_request_or(CPUState *cpu, uint32_t mask) +{ + if (cpu_mutex_locked(cpu)) { + atomic_set(&cpu->interrupt_request, cpu->interrupt_request | mask); + return; + } + cpu_mutex_lock(cpu); + atomic_set(&cpu->interrupt_request, cpu->interrupt_request | mask); + cpu_mutex_unlock(cpu); +} + +static inline void cpu_interrupt_request_set(CPUState *cpu, uint32_t val) +{ + if (cpu_mutex_locked(cpu)) { + atomic_set(&cpu->interrupt_request, val); + return; + } + cpu_mutex_lock(cpu); + atomic_set(&cpu->interrupt_request, val); + cpu_mutex_unlock(cpu); +} + static inline void cpu_tb_jmp_cache_clear(CPUState *cpu) { unsigned int i; From patchwork Wed Jun 17 21:01:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190926 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp807659ilo; Wed, 17 Jun 2020 14:18:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzsLRtKTYrvCfaSwg3+AQcPO7IMG+RPeIpDTG8LrQbQJc53z5sJNiUaK8GtMEEdtyW5H2nO X-Received: by 2002:a25:d4b:: with SMTP id 72mr1603763ybn.22.1592428687125; Wed, 17 Jun 2020 14:18:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592428687; cv=none; d=google.com; s=arc-20160816; b=0nZtCwTMxoSRl+GbrLSH6AEpJndjXrEsDeTIqtAGIhUPmt5SfrPwgJmWMGdPAaDzH8 1o7KnJmpuLksMi9aSOG2bEzW+SVIe5Rl42hgZjNVjdz4e5gHyTEhXAL4zC1xBEc9bHZp Xux11C3gdrIP3ZfLLu2KLByIUUzCN/49u9gGNSuWlXAntCM6HIv2oOThEho23bRY8ODl Hj0TVuklosq1MbcplGX5596chwzhHizaU+QU6GPa4H/rjT/+lZHaXENjZK/361T4sPvp Ovx6i2hbJe2Py+LUNAefg+np+pdzuzXYzNDDtIQkJC2kh5lBficJ+PRvT2Z3oqiMsfpn N45Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=9A7y00FSGgamAX20OqsIrmd5Bhg8NgpNlEQx1G0undg=; b=VTqM4GzgtAOAl/DzrJLvnI09jCgegDIpSdEONKOlUwgH0VAUmRr7iuNPmIt1EF97Kk G4pNXZnDDIf9/IRpSa3Jo8c69DWARBpTC2E3rLteGtvsJPODPBqPClOQldsK0z62JC5x EnfCyptIxN7rFPmMkqshnzygOxuZfSEIQZx4FRxNcQgI4BbDk4iQsGnamofPcKt4c++F +N388HN2kW5dFeeglMiNQKRTkvBxk7W440cpus6OGy76wWr4yAWfd9HuOIwO3l+kKQp7 m82+Jh2RGrZ98kLtSG8n/23aBV8Cler6hw1ebNsZwKzgH5UG8kdpmCTbJEmDR4ygkoBy TB0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ejmPWiR0; 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=fail (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 f96si648257ybi.131.2020.06.17.14.18.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:18:07 -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=fail header.i=@linaro.org header.s=google header.b=ejmPWiR0; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:58892 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfRe-0001kF-JB for patch@linaro.org; Wed, 17 Jun 2020 17:18:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37514) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfEA-0003KX-BP for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:10 -0400 Received: from mail-qt1-x841.google.com ([2607:f8b0:4864:20::841]:46910) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfE5-0008Vr-4S for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:09 -0400 Received: by mail-qt1-x841.google.com with SMTP id g18so2723364qtu.13 for ; Wed, 17 Jun 2020 14:04:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9A7y00FSGgamAX20OqsIrmd5Bhg8NgpNlEQx1G0undg=; b=ejmPWiR0v02UVxmZ398zLrIXxCek8QuDnCa6ZDQi298AcyuiOwoXb8UGDGN/LQ+kHN /k4Xcb/L3C+Fiq4BL7Z4/taW4VsO9qgjiGO4DfGYsOq4JBeMRg1WUlvXedRB8tPH1288 KUFkh59Q8Tb1H/MvV/r3tlQSVCvmq5WKMXC/0mUMs8CgFAC5lheR/r+UvtsvofxabO8K 6ORkMlYLMIKU/LNBA10Lh077jbH5Dr++2NR+7Bxvo3tbFimHnH5RZoK9RMU8ILwY2Gf7 epJiVHKCo7+yw+/E+A1K/3G/B72xOG+wwXgjV2WXgoOlQyDxU8GqoB7uZuNn5N2JejuN /ruQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9A7y00FSGgamAX20OqsIrmd5Bhg8NgpNlEQx1G0undg=; b=GuFz01+La0Y/XUTeA6GiUn9zT0w1A3gyY6shEOZfeCAkr4B4jcREEENLj3XXXrOuR4 jFPzUJSCioasTCvYQsx/lyvg928WJiYY/p653lXoqRsCSUWKY6WpMkM8jDBaU0EpfgP+ bLlb339wPuQhBMsQWzTYUV7JvPRd0CxGsX9X5t6HiUjxavV9FUlaV1WloUuSGS6gHXI9 EzSQnyI+sEi7QPchBSfoHjk+uCSJp9GqnOafxj7TwUMqCobNzm6oC9FJYGmdPbEcP7su Xuaa20aq9qkyFCc8re1fgHDIEknvC79dYjrvksawPKqKVtHMYhQEF8meoiH09vvrLPVZ ZEPA== X-Gm-Message-State: AOAM532e4S+CISupnH5k/Zx5w4mgqceJebND2KZeUycmGMzrGL9KPOEa HzNG5Kk4rENyajdEgFee+F0AE772zNQ2Jw== X-Received: by 2002:aed:3e5d:: with SMTP id m29mr1085289qtf.125.1592427843830; Wed, 17 Jun 2020 14:04:03 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.04.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:04:03 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 33/73] ppc: use cpu_reset_interrupt Date: Wed, 17 Jun 2020 17:01:51 -0400 Message-Id: <20200617210231.4393-34-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::841; envelope-from=robert.foley@linaro.org; helo=mail-qt1-x841.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robert.foley@linaro.org, cota@braap.org, qemu-ppc@nongnu.org, Paolo Bonzini , peter.puhov@linaro.org, alex.bennee@linaro.org, David Gibson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Paolo Bonzini Cc: qemu-ppc@nongnu.org Acked-by: David Gibson Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Paolo Bonzini Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- target/ppc/excp_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index 507f64c9e7..bf9e1e27e9 100644 --- a/target/ppc/excp_helper.c +++ b/target/ppc/excp_helper.c @@ -1060,7 +1060,7 @@ bool ppc_cpu_exec_interrupt(CPUState *cs, int interrupt_request) if (interrupt_request & CPU_INTERRUPT_HARD) { ppc_hw_interrupt(env); if (env->pending_interrupts == 0) { - cs->interrupt_request &= ~CPU_INTERRUPT_HARD; + cpu_reset_interrupt(cs, CPU_INTERRUPT_HARD); } return true; } From patchwork Wed Jun 17 21:01:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190928 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp808710ilo; Wed, 17 Jun 2020 14:19:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQfqC9ss0AutVyC/ZHdaYEfZimyEkIW71bCzQuQKxi+b/tqRCQ8vLvF8S21epnE0lzQrXl X-Received: by 2002:a25:dfd6:: with SMTP id w205mr1430100ybg.216.1592428777440; Wed, 17 Jun 2020 14:19:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592428777; cv=none; d=google.com; s=arc-20160816; b=OQm1d5wRRA9Ad66GkaD/mzV5poa5k9wjXsdeCTln9hwmSoZMU7+vysGrPXKWwq6BkE yElRSu70cEac7g5IXkLb+uvlOMi6CXDhoKIR0nUGYChqs5LMDtn5Bfb1hMo/mO2lFhAB cK9wQP+bCRPsi+m8hfI+FYvFS+nPlekAo/gPXE3rHppLAyBsz9PtIdiN8wJYNDZaXkYC BoVx6Di8v95q8oB2ED/RcWekDJn1fRs3CN2NCYrrcyKgeabS3CvqMa0Bql2nI7v8iVuR asSblzmzL4deFHWPqE7GC7UFnMRG1JQEvXIy5ziaPbXtrnFW7JN6QxGnHcWZlWmz4rV7 VFXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=kW0XRsqxaI6VAROraHDcJYsTCy7+fL1IiAmTn+bRRXA=; b=Pm/TSBnZQY2pvZ5GuYEpGhs5Cz/ql/JlFmBNribUvtMQwumfCTfYuX2B9opd6pp80X 5LUntdRVSlMjS5UpVYstHnbgZzsTcfeACIWaMqgnSvyk731mMcN3veBQUwytjvAR6ah1 gzETe9x0wqFFTdWtaUEDRq8yVwknhQgU7Mivoz1MlScpZGCGNKNQEtTS8LumNcXTINJv CZ85bSlHQy6GMtT9y5eJjq8tT9Rp5SmM602sQyFi8sisD9vMSte1O1C8/6jgPXjrgdAD O/E4v9LwZmQl3bePLbuY4vRMa0Aurtx6aNgsFPIWrc8rv1jpIdwE5L6HXsXEdew/ooVY bujw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="XM/7BK+/"; 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=fail (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 3si664554yba.308.2020.06.17.14.19.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:19:37 -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=fail header.i=@linaro.org header.s=google header.b="XM/7BK+/"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:39136 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfT6-00059j-V4 for patch@linaro.org; Wed, 17 Jun 2020 17:19:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37522) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfEA-0003L8-Ik for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:10 -0400 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]:43935) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfE6-0008W5-Ep for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:10 -0400 Received: by mail-qk1-x743.google.com with SMTP id j68so139639qkb.10 for ; Wed, 17 Jun 2020 14:04:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kW0XRsqxaI6VAROraHDcJYsTCy7+fL1IiAmTn+bRRXA=; b=XM/7BK+/iHa4FBsC1UBLrfofa7/j6P5RMeFU/Ek8K59mhBj47wxLUaaCGpCbX4em5m 5fM10wnUeGFErzBgK3m2N4P3Ht0oni0C5QoJt/6WV0s0AzRdxF8dwZyt221bV8PmDSPh 7CpwRw6/TfY8uRmXXGZfWKwKpSPbGutShDsAja4MIamIvhBUv+ekuyUm4KgGCpUFB65q 4b1xQeF3Ixs8gML2Uhe94Q34OPoQ8Qsi1jys6OlHJjcfKI9r80oQY12PZKzmsFd0Qvim ituAiAmJtsGTkUcI4HQenqDFJTHCdLXxdqaf7+RUdTEL3WyfFf4t6PSI9o4rk/0p/9H4 rsrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kW0XRsqxaI6VAROraHDcJYsTCy7+fL1IiAmTn+bRRXA=; b=VLTH/uXxWgFBG8vFj+mglvEkMmAtLoAkH5RnagPGKYH9VLm///qe7yK2O9NvYNtaMJ McTlvfajzr0Wwn9t1zIP2dQ5Lo3M5RWxlA/LM8c7sPZd1QitwYiHsuJFcBsrfMOkuk/2 ku2hktJTeEt1rvsd5Bt6vSV8qVhudQgVcamj/77NEzHvJSWWCUffa0UlF87FmEIig2Zb IugHiGGN02MubmgVQzJFKEkjMsbfJLvsfifazGWwMheJ4mZkwwxKzIsZOYjJFbkbZjqS LKAtsq13ZBOqwhICMup9FhdjyP6Sm0esNXArrkYzTK4uUz32ZoNXBlv/sho7561Mo6PE wlIQ== X-Gm-Message-State: AOAM5301He4jhU2eL3EO/HET25IG4lCA4pZpiyyJw3On5hVpAptjLB8y LFB4+IKmvEudWZ0eF7Pra+HTxnVPLU+WzA== X-Received: by 2002:a37:383:: with SMTP id 125mr522609qkd.487.1592427845272; Wed, 17 Jun 2020 14:04:05 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.04.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:04:04 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 34/73] exec: use cpu_reset_interrupt Date: Wed, 17 Jun 2020 17:01:52 -0400 Message-Id: <20200617210231.4393-35-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::743; envelope-from=robert.foley@linaro.org; helo=mail-qk1-x743.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robert.foley@linaro.org, cota@braap.org, Paolo Bonzini , peter.puhov@linaro.org, alex.bennee@linaro.org, Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- exec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/exec.c b/exec.c index d6712fba7e..58fc928801 100644 --- a/exec.c +++ b/exec.c @@ -752,7 +752,7 @@ static int cpu_common_post_load(void *opaque, int version_id) /* 0x01 was CPU_INTERRUPT_EXIT. This line can be removed when the version_id is increased. */ - cpu->interrupt_request &= ~0x01; + cpu_reset_interrupt(cpu, 1); tlb_flush(cpu); /* loadvm has just updated the content of RAM, bypassing the From patchwork Wed Jun 17 21:01:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190934 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp810921ilo; Wed, 17 Jun 2020 14:22:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5VGF2tFEl2ov4mTQ5R8iM4FQQrabTPYugXnixaBNSaiXSLQuMJadTdZkcballnrMtrsli X-Received: by 2002:a25:bfca:: with SMTP id q10mr1281909ybm.503.1592428974934; Wed, 17 Jun 2020 14:22:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592428974; cv=none; d=google.com; s=arc-20160816; b=BQhOqOs+unDveJ85Zq8D4ugtL1vamLCSGHuExoiTkzyoa5Cw5LRHCaQV9BuaiC8m6U CaS5qN0qttJ0gCnKyGf4OmxlS1wZ92ub/K7dJEoeAD+MHa6FbyAUl4y4gZfyEc2S+q6p UiU/7X9MQViYilhcVhhP5svInRFn1InakLgI4CsliItqA3wG+mtEO3rUZJwHxO6ByPxU p2E/fnxgVYiByGdeMrSvnzmecoyZ1eq72ENdA9NA3Ckf8/K0oHYf6CXIaPxuR8qTBqc1 xVNHjNVL0oDvTd+jVbuU5mqbhKB8v9sgIMkL4AN77tBei53+nebNGvBmwtBTpzmYujAl NbjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=D0B+23tpZukrgbMI7+fpAiYqU7WS51LFOzw8uiXiuuo=; b=NYk09iL5M5YdlNoWwqCvPGsmGxzHuTAC8PbLPhFtEZJ/H5hTiY1c7r0IFCOK2+gzAH H87uPEzz2dG4lAw0jY9J63jzwPuQ+vDsdiKnbL5BuGreQtIS6s79OkksUH0+AO31DDOv 7teWp4vXFI60m7/J99edVs8Ar9IUEB4bZapQE+ttbPzIPUdQXimPWDuarbO0Ekq4tFMp 1VbFFC2+wTWJViYmVe3nZC8iCaby/9aPLzFtkPHieOqEKnqJvkcbF3nwotL+CYey35Ch CfrpXGD7+uARtm7sTeKvL3MNUtWoNZKKbFhDoFjlkOpS0+5TO4NGhZXsaFD3UhYIDPgO vd/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=NySidOpP; 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=fail (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 l83si703382ybb.393.2020.06.17.14.22.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:22:54 -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=fail header.i=@linaro.org header.s=google header.b=NySidOpP; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:47766 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfWI-0000uR-Cw for patch@linaro.org; Wed, 17 Jun 2020 17:22:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37582) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfEC-0003Pd-9r for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:12 -0400 Received: from mail-qv1-xf42.google.com ([2607:f8b0:4864:20::f42]:38878) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfE8-00004u-Tv for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:11 -0400 Received: by mail-qv1-xf42.google.com with SMTP id ec10so1759998qvb.5 for ; Wed, 17 Jun 2020 14:04:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=D0B+23tpZukrgbMI7+fpAiYqU7WS51LFOzw8uiXiuuo=; b=NySidOpPj08qTC/OUAD4iCGfmMMUMdI8V27RWpNzsQj/0giNTvkASqGBb9i50IicKE 3u7ZNhhTJRjT8cAg/o4VPHVeT8cBkFu/VowQ3bXxZf5noPAGA3c4pZr2H0Y5VQtgLsNX oOge0ZsglI9P6rUDyI3I8tYa30WQdhU3FXok+pmewaPLYsY1Ku1xRpFyfsNCRIJDP17t Almw3DTLOPZLdd7k4hOxKCFm6BBLDZBrKLnDm+4dQ8WJd3fNwFYrmkoYLxNi+5KTrQ+n wyud3HedV46rnAqgXhfqVWRBxDunpln+eVi5ADy2DsZyUPQhbcKIoKJF0yt9gD7WtDWP Bv1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=D0B+23tpZukrgbMI7+fpAiYqU7WS51LFOzw8uiXiuuo=; b=pWKLHsHFIjR0FCWj7b7CwjTVwqrICLDsN5Q28EWAq9tge+Cb29wEisXb6H3M5u0LYM 7kWeOPnhF+ps9pm7KT6/Nvy/6XR6qCzfy2RTvcoxx650gDdFBDqgJRHTpExNGe3Q2U3k AsbUzxiDNsPZ784OKzPDzNM/MpKtsKxfO30D+45ha4fvlr7XSPtFLJqzrXTIlQo6O7s9 ZNYcz3DVvTEKei2JmQppTHeDw8BarQig0VflHrQH8v1W4V7nVUCdSCWfq6Wi4pr1w2E3 y5D54EB3IKIRsba3HlPfIERH3YuVU5JOhEt0Pbz1Wt3X+FvVFVFP/jOVsBr5Y4/B9Sul 6Bmw== X-Gm-Message-State: AOAM533+sk9vg0DNtyMNVBHzOFfx7yOh5H2wrROnGEat150KHr3DYtf/ y1ABgmgaAAT/OeJYzdAX4i29TvrbSko5SQ== X-Received: by 2002:a05:6214:1432:: with SMTP id o18mr549317qvx.57.1592427847060; Wed, 17 Jun 2020 14:04:07 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.04.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:04:06 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 35/73] i386: use cpu_reset_interrupt Date: Wed, 17 Jun 2020 17:01:53 -0400 Message-Id: <20200617210231.4393-36-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::f42; envelope-from=robert.foley@linaro.org; helo=mail-qv1-xf42.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robert.foley@linaro.org, "open list:X86 KVM CPUs" , Marcelo Tosatti , Eduardo Habkost , Roman Bolshakov , cota@braap.org, "open list:X86 HAXM CPUs" , Wenchao Wang , Paolo Bonzini , peter.puhov@linaro.org, Sunil Muthuswamy , Richard Henderson , alex.bennee@linaro.org, Colin Xu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Paolo Bonzini Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Paolo Bonzini Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- target/i386/hax-all.c | 4 ++-- target/i386/hvf/x86hvf.c | 8 ++++---- target/i386/kvm.c | 14 +++++++------- target/i386/seg_helper.c | 13 ++++++------- target/i386/svm_helper.c | 2 +- target/i386/whpx-all.c | 10 +++++----- 6 files changed, 25 insertions(+), 26 deletions(-) -- 2.17.1 diff --git a/target/i386/hax-all.c b/target/i386/hax-all.c index acfb7a6e10..6a4152730f 100644 --- a/target/i386/hax-all.c +++ b/target/i386/hax-all.c @@ -438,7 +438,7 @@ static int hax_vcpu_interrupt(CPUArchState *env) irq = cpu_get_pic_interrupt(env); if (irq >= 0) { hax_inject_interrupt(env, irq); - cpu->interrupt_request &= ~CPU_INTERRUPT_HARD; + cpu_reset_interrupt(cpu, CPU_INTERRUPT_HARD); } } @@ -486,7 +486,7 @@ static int hax_vcpu_hax_exec(CPUArchState *env) } if (cpu->interrupt_request & CPU_INTERRUPT_POLL) { - cpu->interrupt_request &= ~CPU_INTERRUPT_POLL; + cpu_reset_interrupt(cpu, CPU_INTERRUPT_POLL); apic_poll_irq(x86_cpu->apic_state); } diff --git a/target/i386/hvf/x86hvf.c b/target/i386/hvf/x86hvf.c index c09cf160ef..8e9b60d0a7 100644 --- a/target/i386/hvf/x86hvf.c +++ b/target/i386/hvf/x86hvf.c @@ -402,7 +402,7 @@ bool hvf_inject_interrupts(CPUState *cpu_state) if (cpu_state->interrupt_request & CPU_INTERRUPT_NMI) { if (!(env->hflags2 & HF2_NMI_MASK) && !(info & VMCS_INTR_VALID)) { - cpu_state->interrupt_request &= ~CPU_INTERRUPT_NMI; + cpu_reset_interrupt(cpu_state, CPU_INTERRUPT_NMI); info = VMCS_INTR_VALID | VMCS_INTR_T_NMI | EXCP02_NMI; wvmcs(cpu_state->hvf_fd, VMCS_ENTRY_INTR_INFO, info); } else { @@ -414,7 +414,7 @@ bool hvf_inject_interrupts(CPUState *cpu_state) (cpu_state->interrupt_request & CPU_INTERRUPT_HARD) && (env->eflags & IF_MASK) && !(info & VMCS_INTR_VALID)) { int line = cpu_get_pic_interrupt(&x86cpu->env); - cpu_state->interrupt_request &= ~CPU_INTERRUPT_HARD; + cpu_reset_interrupt(cpu_state, CPU_INTERRUPT_HARD); if (line >= 0) { wvmcs(cpu_state->hvf_fd, VMCS_ENTRY_INTR_INFO, line | VMCS_INTR_VALID | VMCS_INTR_T_HWINTR); @@ -440,7 +440,7 @@ int hvf_process_events(CPUState *cpu_state) } if (cpu_state->interrupt_request & CPU_INTERRUPT_POLL) { - cpu_state->interrupt_request &= ~CPU_INTERRUPT_POLL; + cpu_reset_interrupt(cpu_state, CPU_INTERRUPT_POLL); apic_poll_irq(cpu->apic_state); } if (((cpu_state->interrupt_request & CPU_INTERRUPT_HARD) && @@ -453,7 +453,7 @@ int hvf_process_events(CPUState *cpu_state) do_cpu_sipi(cpu); } if (cpu_state->interrupt_request & CPU_INTERRUPT_TPR) { - cpu_state->interrupt_request &= ~CPU_INTERRUPT_TPR; + cpu_reset_interrupt(cpu_state, CPU_INTERRUPT_TPR); hvf_cpu_synchronize_state(cpu_state); apic_handle_tpr_access_report(cpu->apic_state, env->eip, env->tpr_access_type); diff --git a/target/i386/kvm.c b/target/i386/kvm.c index eda51904dd..8628fa9111 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -3658,7 +3658,7 @@ static int kvm_put_vcpu_events(X86CPU *cpu, int level) */ events.smi.pending = cs->interrupt_request & CPU_INTERRUPT_SMI; events.smi.latched_init = cs->interrupt_request & CPU_INTERRUPT_INIT; - cs->interrupt_request &= ~(CPU_INTERRUPT_INIT | CPU_INTERRUPT_SMI); + cpu_reset_interrupt(cs, CPU_INTERRUPT_INIT | CPU_INTERRUPT_SMI); } else { /* Keep these in cs->interrupt_request. */ events.smi.pending = 0; @@ -4021,7 +4021,7 @@ void kvm_arch_pre_run(CPUState *cpu, struct kvm_run *run) if (cpu->interrupt_request & (CPU_INTERRUPT_NMI | CPU_INTERRUPT_SMI)) { if (cpu->interrupt_request & CPU_INTERRUPT_NMI) { qemu_mutex_lock_iothread(); - cpu->interrupt_request &= ~CPU_INTERRUPT_NMI; + cpu_reset_interrupt(cpu, CPU_INTERRUPT_NMI); qemu_mutex_unlock_iothread(); DPRINTF("injected NMI\n"); ret = kvm_vcpu_ioctl(cpu, KVM_NMI); @@ -4032,7 +4032,7 @@ void kvm_arch_pre_run(CPUState *cpu, struct kvm_run *run) } if (cpu->interrupt_request & CPU_INTERRUPT_SMI) { qemu_mutex_lock_iothread(); - cpu->interrupt_request &= ~CPU_INTERRUPT_SMI; + cpu_reset_interrupt(cpu, CPU_INTERRUPT_SMI); qemu_mutex_unlock_iothread(); DPRINTF("injected SMI\n"); ret = kvm_vcpu_ioctl(cpu, KVM_SMI); @@ -4068,7 +4068,7 @@ void kvm_arch_pre_run(CPUState *cpu, struct kvm_run *run) (env->eflags & IF_MASK)) { int irq; - cpu->interrupt_request &= ~CPU_INTERRUPT_HARD; + cpu_reset_interrupt(cpu, CPU_INTERRUPT_HARD); irq = cpu_get_pic_interrupt(env); if (irq >= 0) { struct kvm_interrupt intr; @@ -4139,7 +4139,7 @@ int kvm_arch_process_async_events(CPUState *cs) /* We must not raise CPU_INTERRUPT_MCE if it's not supported. */ assert(env->mcg_cap); - cs->interrupt_request &= ~CPU_INTERRUPT_MCE; + cpu_reset_interrupt(cs, CPU_INTERRUPT_MCE); kvm_cpu_synchronize_state(cs); @@ -4169,7 +4169,7 @@ int kvm_arch_process_async_events(CPUState *cs) } if (cs->interrupt_request & CPU_INTERRUPT_POLL) { - cs->interrupt_request &= ~CPU_INTERRUPT_POLL; + cpu_reset_interrupt(cs, CPU_INTERRUPT_POLL); apic_poll_irq(cpu->apic_state); } if (((cs->interrupt_request & CPU_INTERRUPT_HARD) && @@ -4182,7 +4182,7 @@ int kvm_arch_process_async_events(CPUState *cs) do_cpu_sipi(cpu); } if (cs->interrupt_request & CPU_INTERRUPT_TPR) { - cs->interrupt_request &= ~CPU_INTERRUPT_TPR; + cpu_reset_interrupt(cs, CPU_INTERRUPT_TPR); kvm_cpu_synchronize_state(cs); apic_handle_tpr_access_report(cpu->apic_state, env->eip, env->tpr_access_type); diff --git a/target/i386/seg_helper.c b/target/i386/seg_helper.c index b96de068ca..818f65f35f 100644 --- a/target/i386/seg_helper.c +++ b/target/i386/seg_helper.c @@ -1332,7 +1332,7 @@ bool x86_cpu_exec_interrupt(CPUState *cs, int interrupt_request) switch (interrupt_request) { #if !defined(CONFIG_USER_ONLY) case CPU_INTERRUPT_POLL: - cs->interrupt_request &= ~CPU_INTERRUPT_POLL; + cpu_reset_interrupt(cs, CPU_INTERRUPT_POLL); apic_poll_irq(cpu->apic_state); break; #endif @@ -1341,23 +1341,22 @@ bool x86_cpu_exec_interrupt(CPUState *cs, int interrupt_request) break; case CPU_INTERRUPT_SMI: cpu_svm_check_intercept_param(env, SVM_EXIT_SMI, 0, 0); - cs->interrupt_request &= ~CPU_INTERRUPT_SMI; + cpu_reset_interrupt(cs, CPU_INTERRUPT_SMI); do_smm_enter(cpu); break; case CPU_INTERRUPT_NMI: cpu_svm_check_intercept_param(env, SVM_EXIT_NMI, 0, 0); - cs->interrupt_request &= ~CPU_INTERRUPT_NMI; + cpu_reset_interrupt(cs, CPU_INTERRUPT_NMI); env->hflags2 |= HF2_NMI_MASK; do_interrupt_x86_hardirq(env, EXCP02_NMI, 1); break; case CPU_INTERRUPT_MCE: - cs->interrupt_request &= ~CPU_INTERRUPT_MCE; + cpu_reset_interrupt(cs, CPU_INTERRUPT_MCE); do_interrupt_x86_hardirq(env, EXCP12_MCHK, 0); break; case CPU_INTERRUPT_HARD: cpu_svm_check_intercept_param(env, SVM_EXIT_INTR, 0, 0); - cs->interrupt_request &= ~(CPU_INTERRUPT_HARD | - CPU_INTERRUPT_VIRQ); + cpu_reset_interrupt(cs, CPU_INTERRUPT_HARD | CPU_INTERRUPT_VIRQ); intno = cpu_get_pic_interrupt(env); qemu_log_mask(CPU_LOG_TB_IN_ASM, "Servicing hardware INT=0x%02x\n", intno); @@ -1372,7 +1371,7 @@ bool x86_cpu_exec_interrupt(CPUState *cs, int interrupt_request) qemu_log_mask(CPU_LOG_TB_IN_ASM, "Servicing virtual hardware INT=0x%02x\n", intno); do_interrupt_x86_hardirq(env, intno, 1); - cs->interrupt_request &= ~CPU_INTERRUPT_VIRQ; + cpu_reset_interrupt(cs, CPU_INTERRUPT_VIRQ); break; #endif } diff --git a/target/i386/svm_helper.c b/target/i386/svm_helper.c index 7b8105a1c3..63eb136743 100644 --- a/target/i386/svm_helper.c +++ b/target/i386/svm_helper.c @@ -700,7 +700,7 @@ void do_vmexit(CPUX86State *env, uint32_t exit_code, uint64_t exit_info_1) env->hflags &= ~HF_GUEST_MASK; env->intercept = 0; env->intercept_exceptions = 0; - cs->interrupt_request &= ~CPU_INTERRUPT_VIRQ; + cpu_reset_interrupt(cs, CPU_INTERRUPT_VIRQ); env->tsc_offset = 0; env->gdt.base = x86_ldq_phys(cs, env->vm_hsave + offsetof(struct vmcb, diff --git a/target/i386/whpx-all.c b/target/i386/whpx-all.c index efc2d88810..d5beb4a5e2 100644 --- a/target/i386/whpx-all.c +++ b/target/i386/whpx-all.c @@ -790,14 +790,14 @@ static void whpx_vcpu_pre_run(CPUState *cpu) if (!vcpu->interruption_pending && cpu->interrupt_request & (CPU_INTERRUPT_NMI | CPU_INTERRUPT_SMI)) { if (cpu->interrupt_request & CPU_INTERRUPT_NMI) { - cpu->interrupt_request &= ~CPU_INTERRUPT_NMI; + cpu_reset_interrupt(cpu, CPU_INTERRUPT_NMI); vcpu->interruptable = false; new_int.InterruptionType = WHvX64PendingNmi; new_int.InterruptionPending = 1; new_int.InterruptionVector = 2; } if (cpu->interrupt_request & CPU_INTERRUPT_SMI) { - cpu->interrupt_request &= ~CPU_INTERRUPT_SMI; + cpu_reset_interrupt(cpu, CPU_INTERRUPT_SMI); } } @@ -820,7 +820,7 @@ static void whpx_vcpu_pre_run(CPUState *cpu) vcpu->interruptable && (env->eflags & IF_MASK)) { assert(!new_int.InterruptionPending); if (cpu->interrupt_request & CPU_INTERRUPT_HARD) { - cpu->interrupt_request &= ~CPU_INTERRUPT_HARD; + cpu_reset_interrupt(cpu, CPU_INTERRUPT_HARD); irq = cpu_get_pic_interrupt(env); if (irq >= 0) { new_int.InterruptionType = WHvX64PendingInterrupt; @@ -911,7 +911,7 @@ static void whpx_vcpu_process_async_events(CPUState *cpu) } if (cpu->interrupt_request & CPU_INTERRUPT_POLL) { - cpu->interrupt_request &= ~CPU_INTERRUPT_POLL; + cpu_reset_interrupt(cpu, CPU_INTERRUPT_POLL); apic_poll_irq(x86_cpu->apic_state); } @@ -927,7 +927,7 @@ static void whpx_vcpu_process_async_events(CPUState *cpu) } if (cpu->interrupt_request & CPU_INTERRUPT_TPR) { - cpu->interrupt_request &= ~CPU_INTERRUPT_TPR; + cpu_reset_interrupt(cpu, CPU_INTERRUPT_TPR); whpx_cpu_synchronize_state(cpu); apic_handle_tpr_access_report(x86_cpu->apic_state, env->eip, env->tpr_access_type); From patchwork Wed Jun 17 21:01:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190919 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp804592ilo; Wed, 17 Jun 2020 14:13:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyelAVXAskbjcxCmEbBB0a49xKxjbG0d/GvS4lVCep+LirnPDYbzAL105uE8n/oeSrmhjFT X-Received: by 2002:a5b:9c1:: with SMTP id y1mr1366193ybq.62.1592428424085; Wed, 17 Jun 2020 14:13:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592428424; cv=none; d=google.com; s=arc-20160816; b=uN5wPsmoRGE5dhPwjhdmRspLB/iq7rr9EhZLGW3FV+OMY0iS5TIsI4p+ZdUgW7ciIY VesI/BbPC0g8DKCPL1Ubl3cev4QLS0LsAoftwSDqYQIGV9rsOvUX8Mx4Ucbd38xksyOH yt5yoFDrPJPmRZ31uea1pnQJFCB4h10VyFVrLmlUmAb7AecD51faWDDxdM75laBN0AJU W9BMS359UctnN7DeenvAct248lIjGLB5wm/BGlAJHgzPiQA+izPc+6PGQkotBX9ZDJtS hkLS9mJ+dWrKg3weOvwu0WEprF9MruOKb0symA/mY24fVOLLk/27vDRBSlgWJt2arDti zhrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=OzUdSzbvDHrAdBgz7T3QQ9Qj/8hER0zlUjzEzhKy+Cs=; b=fNjQSnrDIxZ3WvrCKNVvThwZTmhbG6pq0pQ8NeATGf+0OrNsDWkQ5K6MiyS7PMonDb bPxBhmNlgAy4pMTPbToZDIBfnens4TgT3FUrwW5UpsLu2/TMN37D+BnjGIMOUFXQzvZn nxKqb0VxF4t6EZpYHwtfFJ/akgX4S9WEEqk5/OkAQgmlCw8Y+pC5pDaU8KyHPN1QDuoa ToztPBFZK5KjyKaYlQikbkIuwJ9rnK+5izt2rd3sfaF/ykbUBYfAtoSkduSh/ZUT4YZY qlJfw2ky65Z0bxYV8nOK9PwR0qdm5wo0xate8JSTfQWsVWE2PUO3l5TrnMPEKnZgfkbj 9Eyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="FXuMrH/a"; 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=fail (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 v12si641032ybm.487.2020.06.17.14.13.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:13:44 -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=fail header.i=@linaro.org header.s=google header.b="FXuMrH/a"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:48478 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfNP-0004qy-Jg for patch@linaro.org; Wed, 17 Jun 2020 17:13:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37574) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfEB-0003Oi-Um for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:11 -0400 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]:43959) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfEA-00005O-0p for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:11 -0400 Received: by mail-qt1-x844.google.com with SMTP id v19so301336qtq.10 for ; Wed, 17 Jun 2020 14:04:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OzUdSzbvDHrAdBgz7T3QQ9Qj/8hER0zlUjzEzhKy+Cs=; b=FXuMrH/ayFieQeNBk58pBYu631HqHSlzSzfND2T+mxHfKeUhQVTf3u8CJd2e9tPV5L ki1uVigHNioK4v6sTW7g1KGdY7sCT/FuxItCNa/SmM+hnc6L7WpLGbbzUX3/Gfkbqkwh 6Bqw4zuOZpBlFas1ci0kqwt8xTXBaIs1CATSNfaJYdT61mUBiCYj0fxsTa0uQ47z1GoH YMxzb+k7L6kFvZnTKOY6FLhAiyKALfCBUknuAXfUnG2Usg7XheyXZilfOeJXMWqrk3Dp g5MdItvGr3bvtnbcpTQ60Wxj32vDgbd7pbJt59G5hqnZK1neKhA5Dtl3RE1mrW9bxy35 QqVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OzUdSzbvDHrAdBgz7T3QQ9Qj/8hER0zlUjzEzhKy+Cs=; b=uXzeDlphY5uaM3xVw9jpuAweAL8rDPQmd8jPSzHwXk+7iea9HAlaIJbpkpLSCQlQQw toXEVzPUNx7ysJe4fUcorsGqZ3igO05y8a1S+uzIaIZORbE4zrN224hTaJEQ/0PXELv3 +x7PZpkqJ7K4XXKWeLo75gSe7RyuGiqgBrkcBPkRvSY5y7VmLvREj/IlwTjCkTwkjkfE UhC4KkmQcWoGvD8imT5CodC/J6lJm9wA/NiYEPMuDGf7JJGK3ILoGBjDUQr+jpjIlV59 80QbbkyIrrf9KcKooLlHLQkyINK3cRHZ2U9iK0rF+zsgKhgXX06lnPQ4VFM1cBWx3O1G QIxg== X-Gm-Message-State: AOAM5325A1P7nFlcXdYbVVJrTeDMLr/ZtMm4LW1zJUR69kbjimrbhZuW X4CazGkklfF4pL+yEEQmcZZ4PzzDpxMlxw== X-Received: by 2002:ac8:341a:: with SMTP id u26mr1164523qtb.36.1592427848788; Wed, 17 Jun 2020 14:04:08 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.04.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:04:08 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 36/73] s390x: use cpu_reset_interrupt Date: Wed, 17 Jun 2020 17:01:54 -0400 Message-Id: <20200617210231.4393-37-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::844; envelope-from=robert.foley@linaro.org; helo=mail-qt1-x844.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , robert.foley@linaro.org, David Hildenbrand , Cornelia Huck , qemu-s390x@nongnu.org, cota@braap.org, Paolo Bonzini , peter.puhov@linaro.org, alex.bennee@linaro.org, Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Paolo Bonzini Cc: qemu-s390x@nongnu.org Reviewed-by: David Hildenbrand Reviewed-by: Richard Henderson Reviewed-by: Cornelia Huck Reviewed-by: Alex Bennée Signed-off-by: Paolo Bonzini Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- target/s390x/excp_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/target/s390x/excp_helper.c b/target/s390x/excp_helper.c index db6640ba2c..dde7afc2f0 100644 --- a/target/s390x/excp_helper.c +++ b/target/s390x/excp_helper.c @@ -530,7 +530,7 @@ try_deliver: /* we might still have pending interrupts, but not deliverable */ if (!env->pending_int && !qemu_s390_flic_has_any(flic)) { - cs->interrupt_request &= ~CPU_INTERRUPT_HARD; + cpu_reset_interrupt(cs, CPU_INTERRUPT_HARD); } /* WAIT PSW during interrupt injection or STOP interrupt */ From patchwork Wed Jun 17 21:01:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190936 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp811727ilo; Wed, 17 Jun 2020 14:24:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyl9dU2opH3oJZiLjLAixMTIzFbD1SyEOXQPWjtE3LWPq9CkruG39/T79mTTvOftcABjWw3 X-Received: by 2002:a25:d755:: with SMTP id o82mr1449204ybg.166.1592429047284; Wed, 17 Jun 2020 14:24:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592429047; cv=none; d=google.com; s=arc-20160816; b=wtpMHtsXXH7kCLF8pBuSLJJJUAa5EaVMBMH62JoHgH/T0YtnBHL6EiYai4OVrf4NZ3 IFqHN6xZyE3HCOIj7mg1l8quTBB/+J/qbgcDDKH0cgyUwKT7dodDvPz2YJoutOwexizg /9uj30pUjvAhBrV3NTp3r1nMsoC7+pVApUboJJbOmVJbya/ISo0a1Lj22c+SjZztVYng 2Wt8Z6VvLsi24xHuiDSCe3RVcAaSoMcuq4gjz6g5/VNZJb3+cUyyTb5bASIOHQivdwm5 dP0wsI5Nh0UVHjLx/Oa/j65K55TKkzlaJe5q5omQSczfX5uYOuomyZh0oRJHDoIRRqmP PhSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=UAoGpC+tFU+Lrmci3F+3S0Zh/4YRyJd+sLsoLGG3MBc=; b=w2RBfWnP95k/VWs0gW/atrH+bvJw3s4znFx715ArPidwaaWvjujoiPgHoc4kxa++lu nt76nyYso7OqvEL+mkyWLwgNRIdTqerdUecWIO46aP7CNtRgTDNjeGPC+IIGJqZhhTLp qTeW9Cu0krZ/MYtKFO49AVxDvqBdtJsnm+/ciZzA3BPYSNc0biHP2mhYVNGdC9/Pkh9O Qbkz9wk933t+7wpAtIFCW10R+SPU+Ak9u8vzyZVPZ0DSCgSE09lXbrs9cLJtMY4Q/z4l 7fCDHgIVU8iqALqfMYr6PJIGJ3Aq2VEdhTmIvMGzFkFub9GFS4TDPmii4waxd06lbr1n QTwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="GyJ/jnNz"; 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=fail (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 y130si669707yby.271.2020.06.17.14.24.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:24:07 -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=fail header.i=@linaro.org header.s=google header.b="GyJ/jnNz"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:56434 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfXR-0004Vx-Gt for patch@linaro.org; Wed, 17 Jun 2020 17:24:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37602) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfED-0003SI-EW for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:13 -0400 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]:41175) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfEB-00005t-8F for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:13 -0400 Received: by mail-qt1-x844.google.com with SMTP id w90so2749980qtd.8 for ; Wed, 17 Jun 2020 14:04:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UAoGpC+tFU+Lrmci3F+3S0Zh/4YRyJd+sLsoLGG3MBc=; b=GyJ/jnNzWFStVefIGozuSYyimRxYRgtyThR8wWWfcLxMxTgodWUbTNsJm7+K6Gk/jt Swkd65jaLs9BIyGmf19466GvogyyztH+CozDC/Yte5nSHy0Nc48vCEFBTBESqoVBh1Yz VJrfQqCdgSOOiIX/wIuXEmdALEyCro5PgiGD1bfanKbIg7upgrfvHzwxb3cVt/+SXiQq DsRayPIPVCe8tJ6bsHuL4oTi2q60Bvn6YaJvRU/ejBME1KoGFLKpVYxcMX3Jxv2x2D3Z Zommg/zn4c9xSlxqActFrbyX0CF40LU5I6RTnHXCzm6E28z8wfAzlP0lomBbZxgeuq/G yX2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UAoGpC+tFU+Lrmci3F+3S0Zh/4YRyJd+sLsoLGG3MBc=; b=LI4pNEsDl2mFDVd1ZzF6vYEa/g7m1lBF5vShVPac1S60UEoaslVz3oO1ydEjfvNoaV Zb4PhdSYbAjoqJradlrWb8vA+vFrUj2detdwODifSxOa2bcAYndFi0BsAWuvu+idZ+Ek xpN4jT5ICfT1xcpgvAEjDvFs/86GIHiuXjLFj/bO7UHZ502gmmWqZrDuFLwLE2oH7g9R 344AgJ2luTuBTolO/RIVTjyfvqSEXGd2MiTn1Yd5e4D0lE5vmTR7PDFwdZamOB5YP15O Qn5dJM5fD4v2xavUixucsUJDjJDoFj4zVvjMeyWSuF3RSj+sUdiIEzG4M9QN/4mAvlXn ZVIg== X-Gm-Message-State: AOAM5300Pj+7jxhWfjwRPFXMb4zl6jToFcdtkBNpLp2HjRtbQfmjdGzn pUBlV6h267prwyEEDdkveMhSAiTYcsmjjw== X-Received: by 2002:ac8:6edb:: with SMTP id f27mr1039501qtv.325.1592427850072; Wed, 17 Jun 2020 14:04:10 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.04.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:04:09 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 37/73] openrisc: use cpu_reset_interrupt Date: Wed, 17 Jun 2020 17:01:55 -0400 Message-Id: <20200617210231.4393-38-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::844; envelope-from=robert.foley@linaro.org; helo=mail-qt1-x844.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robert.foley@linaro.org, cota@braap.org, Paolo Bonzini , peter.puhov@linaro.org, Stafford Horne , alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Paolo Bonzini Cc: Stafford Horne Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Paolo Bonzini Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- target/openrisc/sys_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/target/openrisc/sys_helper.c b/target/openrisc/sys_helper.c index 2615571ce7..e54c148d4f 100644 --- a/target/openrisc/sys_helper.c +++ b/target/openrisc/sys_helper.c @@ -167,7 +167,7 @@ void HELPER(mtspr)(CPUOpenRISCState *env, target_ulong spr, target_ulong rb) env->ttmr = (rb & ~TTMR_IP) | ip; } else { /* Clear IP bit. */ env->ttmr = rb & ~TTMR_IP; - cs->interrupt_request &= ~CPU_INTERRUPT_TIMER; + cpu_reset_interrupt(cs, CPU_INTERRUPT_TIMER); } cpu_openrisc_timer_update(cpu); From patchwork Wed Jun 17 21:01:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190941 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp813183ilo; Wed, 17 Jun 2020 14:26:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyPRQTZfBpIgc2D9B/SfeLfXZR57Rw7vepZmRRrMNudzSga/SwLVTuLMxSjPv+X2TWWclX2 X-Received: by 2002:a25:4901:: with SMTP id w1mr1554003yba.31.1592429193736; Wed, 17 Jun 2020 14:26:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592429193; cv=none; d=google.com; s=arc-20160816; b=WBiPGV5kqqjznYnhnmYO8BdatN1MOZN/tA4GDd5y0lpduVXJPHovEsE7b1nR4WGnzn GqNppxEiRon36d9HRfboSkslPmkfl4pNShETIbwigPkGF26ruemEwkQR3aGPjXo7DptT jqDQoUbXIOzQATOpzaDSm/SDrsR6ARc8UZapNfSgETuzulUBXor4/OKOmZjDB53O+W15 NurLYXyZ5wfZ+3PFtBuPp1MQS8WAGDsx+qpJoPzepENrdsIKGWMzhavZO5KPWOpFwlRJ auL5iXcvPokGkC6pMvwk44XO2fH6o/GqTjtHXglpf//gNmgLwAgFoyizbdTmqhtPbFsn qVZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=w3X/TBVNKMn8EXCp7BpdBrJlJ5hMtFe3cm30uQpq+d0=; b=GQc4/f3OkvPBHBd8UWhbqMhbaTqV7kzzsjKi3yD6iUqBAgAmqsg5x2xWqwimNwfZuh kp9QiO3llExAFb1YVWClYjhZRluzkM8QIoWfRGA3hTXftGv8L/8BOpoE7Q/+gw+zV4O9 6rkbmZRlvHzswd1D/Q4awOuRTmOGPTbJBdA1/UO+TME60WJUBtZz+03IGX7tdPpBj7hE 6+XymfwSVxpZlG56K2/8n3psxbdqTAKCNZZ+X+lBZWOqVt2u3QsoAVUWLv/iLI/bOzUN K7XXVyr7ED91rKrt/X2qfOBuFYYSwX0gPXVYLtEw+wcjNxfS7EfRJnRXHpzfl0LbW+fw w5rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=GozekeXF; 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=fail (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 o9si775252ybe.224.2020.06.17.14.26.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:26:33 -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=fail header.i=@linaro.org header.s=google header.b=GozekeXF; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:36464 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfZp-00084J-4C for patch@linaro.org; Wed, 17 Jun 2020 17:26:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37626) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfEE-0003Vm-SH for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:14 -0400 Received: from mail-qt1-x841.google.com ([2607:f8b0:4864:20::841]:35146) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfEC-00006U-Qs for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:14 -0400 Received: by mail-qt1-x841.google.com with SMTP id z1so2777492qtn.2 for ; Wed, 17 Jun 2020 14:04:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=w3X/TBVNKMn8EXCp7BpdBrJlJ5hMtFe3cm30uQpq+d0=; b=GozekeXFYlWQXc1tMVUl/JqyJ9gj3I7wtlDcVuLTMgtCkIfkbkJSx66XqbZX6HxjoW xCTsRkmRhQmNSiIw3YYxP5pPqAP5gYylI4rPfzid97zPwDhcrSSDjgV6zBDuB1AACSad VKcvAdjwP2F0UgMR59wTRkSGMBy0FyxyLA4jScOfkz0Wja3f1qpwzzySRiKEij+xlNGE NrFf/C+jji+/nRN0A1eQIjENRQiM9lzVkepDE5DczAy/ZsXzlJsyWI7J77ox2rbkHsve MLmLE+ww80hJYbPM6Dat6tcyxeuBSOivaHKkjcl8hhuXco23AAsBmU/ec7CceBYzrzdu DFCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=w3X/TBVNKMn8EXCp7BpdBrJlJ5hMtFe3cm30uQpq+d0=; b=JOHxrSkGMOjQG91UJH2/5od5vVC4dDwocbEpIAx/JYwSf9XfeYrYqfbjhnTJ47pZLn thS57iLHDcW7IBwhUmI7wKh9mAGf5ymGQ3nsAegCnFC5iSLHhaT1Koc9yY+LuNSwoftm C91FfuG3Dw5dmxfpAtdZHQ3BRrlotBqc3wkXMcMfpr0SbA7ZphI699tS2xk113VtXyMD JkvE0ABvTSUAITHA9agOrRjdeimrqAjljMONOuBkavAOVgBIsrFjYXLG80e2q+u4LBJv wEbdZ+BLCk9EXCV1osYVhyoyeS4pINoxqLspAg3sh9RoXUbbXmJLzr/TuTJxUJlXsbwO UpWg== X-Gm-Message-State: AOAM532gqvhQbdmxzKBbFzaSIE+Jz6GwZ0x2Wt57qnLLBFteG7s/e4up zblyBsGw17URi2YPueWzTcP2ciGTvBkSjw== X-Received: by 2002:ac8:5354:: with SMTP id d20mr1105252qto.363.1592427851478; Wed, 17 Jun 2020 14:04:11 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.04.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:04:10 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 38/73] arm: convert to cpu_interrupt_request Date: Wed, 17 Jun 2020 17:01:56 -0400 Message-Id: <20200617210231.4393-39-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::841; envelope-from=robert.foley@linaro.org; helo=mail-qt1-x841.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , robert.foley@linaro.org, cota@braap.org, qemu-arm@nongnu.org, peter.puhov@linaro.org, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Cc: Peter Maydell Cc: qemu-arm@nongnu.org Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- target/arm/cpu.c | 6 +++--- target/arm/helper.c | 16 +++++++--------- target/arm/machine.c | 2 +- 3 files changed, 11 insertions(+), 13 deletions(-) -- 2.17.1 diff --git a/target/arm/cpu.c b/target/arm/cpu.c index df5c019145..2b11e126a8 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -75,7 +75,7 @@ static bool arm_cpu_has_work(CPUState *cs) ARMCPU *cpu = ARM_CPU(cs); return (cpu->power_state != PSCI_OFF) - && cs->interrupt_request & + && cpu_interrupt_request(cs) & (CPU_INTERRUPT_FIQ | CPU_INTERRUPT_HARD | CPU_INTERRUPT_VFIQ | CPU_INTERRUPT_VIRQ | CPU_INTERRUPT_EXITTB); @@ -586,7 +586,7 @@ void arm_cpu_update_virq(ARMCPU *cpu) bool new_state = (env->cp15.hcr_el2 & HCR_VI) || (env->irq_line_state & CPU_INTERRUPT_VIRQ); - if (new_state != ((cs->interrupt_request & CPU_INTERRUPT_VIRQ) != 0)) { + if (new_state != ((cpu_interrupt_request(cs) & CPU_INTERRUPT_VIRQ) != 0)) { if (new_state) { cpu_interrupt(cs, CPU_INTERRUPT_VIRQ); } else { @@ -607,7 +607,7 @@ void arm_cpu_update_vfiq(ARMCPU *cpu) bool new_state = (env->cp15.hcr_el2 & HCR_VF) || (env->irq_line_state & CPU_INTERRUPT_VFIQ); - if (new_state != ((cs->interrupt_request & CPU_INTERRUPT_VFIQ) != 0)) { + if (new_state != ((cpu_interrupt_request(cs) & CPU_INTERRUPT_VFIQ) != 0)) { if (new_state) { cpu_interrupt(cs, CPU_INTERRUPT_VFIQ); } else { diff --git a/target/arm/helper.c b/target/arm/helper.c index 972a766730..37ac1cabfe 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -2079,26 +2079,27 @@ static uint64_t isr_read(CPUARMState *env, const ARMCPRegInfo *ri) CPUState *cs = env_cpu(env); uint64_t hcr_el2 = arm_hcr_el2_eff(env); uint64_t ret = 0; + uint32_t interrupt_request = cpu_interrupt_request(cs); bool allow_virt = (arm_current_el(env) == 1 && (!arm_is_secure_below_el3(env) || (env->cp15.scr_el3 & SCR_EEL2))); if (allow_virt && (hcr_el2 & HCR_IMO)) { - if (cs->interrupt_request & CPU_INTERRUPT_VIRQ) { + if (interrupt_request & CPU_INTERRUPT_VIRQ) { ret |= CPSR_I; } } else { - if (cs->interrupt_request & CPU_INTERRUPT_HARD) { + if (interrupt_request & CPU_INTERRUPT_HARD) { ret |= CPSR_I; } } if (allow_virt && (hcr_el2 & HCR_FMO)) { - if (cs->interrupt_request & CPU_INTERRUPT_VFIQ) { + if (interrupt_request & CPU_INTERRUPT_VFIQ) { ret |= CPSR_F; } } else { - if (cs->interrupt_request & CPU_INTERRUPT_FIQ) { + if (interrupt_request & CPU_INTERRUPT_FIQ) { ret |= CPSR_F; } } @@ -9591,10 +9592,7 @@ void arm_cpu_do_interrupt(CPUState *cs) } #endif - /* Hooks may change global state so BQL should be held, also the - * BQL needs to be held for any modification of - * cs->interrupt_request. - */ + /* Hooks may change global state so BQL should be held */ g_assert(qemu_mutex_iothread_locked()); arm_call_pre_el_change_hook(cpu); @@ -9609,7 +9607,7 @@ void arm_cpu_do_interrupt(CPUState *cs) arm_call_el_change_hook(cpu); if (!kvm_enabled()) { - cs->interrupt_request |= CPU_INTERRUPT_EXITTB; + cpu_interrupt_request_or(cs, CPU_INTERRUPT_EXITTB); } } #endif /* !CONFIG_USER_ONLY */ diff --git a/target/arm/machine.c b/target/arm/machine.c index c5a2114f51..42f4368de3 100644 --- a/target/arm/machine.c +++ b/target/arm/machine.c @@ -713,7 +713,7 @@ static int cpu_post_load(void *opaque, int version_id) if (env->irq_line_state == UINT32_MAX) { CPUState *cs = CPU(cpu); - env->irq_line_state = cs->interrupt_request & + env->irq_line_state = cpu_interrupt_request(cs) & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_FIQ | CPU_INTERRUPT_VIRQ | CPU_INTERRUPT_VFIQ); } From patchwork Wed Jun 17 21:01:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190923 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp806743ilo; Wed, 17 Jun 2020 14:16:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXyzdywCjCRctf9qzDzQVC0ma6rb3H2mjj/nucw6nncyRWDWazibFQJIeIH5T+LDpGlkbd X-Received: by 2002:a25:ba09:: with SMTP id t9mr1549393ybg.128.1592428608314; Wed, 17 Jun 2020 14:16:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592428608; cv=none; d=google.com; s=arc-20160816; b=Ga1ijBjWY6GAfylmbbxVhJeBKquBevDbM8heIUz0gdN3OsaTuy1MCH2nlX2n9uqsqu zM+zajg3PGUueMErFumM951zqUN7oK+se8jDNGMv4wDlcBzCleT7b6rhjKBd4GPPz7I4 FyXCUyPa4PdwqELBu9tDmtfk3beT70KpZruy3F71eJ/SioaF967aLGHp91KzM4baLU3P hyq0RmfRMXSBvNfcD2YsWhc4sssi9e8wDC96f+H5zB67O5rRV+WVfQEE5FVui9V+UDac l7Q0RyIY7tUb3tl6hAKS5MuvUwuNaLYQRig79x073insJF4Z0na8wE1w8Ml9+I1FVD3G eNLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=4aryhQbcmaB7oNBbR9UD5nwcxfkIN5/StOGhgwEfKig=; b=duzl+85/aVe8SVcDMd6HPCeg8smaxS0EncX7RiM1Ri1rQMVOw5RZN2KtcSV3sWUfDv qiLKdGSg/vCs9uFybUClvHVGCg2SqSJ3OFpq9LOwwXU8wc2Q/mBU6b2ORzW8wv1P87xE g0xtrNHnFxMFNLoBvLMbXxN7upC/iily/ToJ7NNtr5wCZDFefzbqIq+ZMuETU2cnIQIz b3YSDfi6sDJD2IQdqRecCOyNlXhaeOBUSo5WXg3Yx/akgr7KDM7d8aa7UN8T1PWLUlzT KmkUaVq/hCtk+oVH/2rKqntXHP+afiWmB6LuYZ6DEqZPO6PZP3GtX8anWQ/A6edr/vX+ EKTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=BwPPvfcY; 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=fail (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 p8si670425ybl.187.2020.06.17.14.16.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:16:48 -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=fail header.i=@linaro.org header.s=google header.b=BwPPvfcY; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:57050 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfQN-000112-N4 for patch@linaro.org; Wed, 17 Jun 2020 17:16:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37642) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfEG-0003Wx-63 for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:16 -0400 Received: from mail-qk1-x731.google.com ([2607:f8b0:4864:20::731]:37880) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfEE-00007X-7u for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:15 -0400 Received: by mail-qk1-x731.google.com with SMTP id b27so3510324qka.4 for ; Wed, 17 Jun 2020 14:04:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4aryhQbcmaB7oNBbR9UD5nwcxfkIN5/StOGhgwEfKig=; b=BwPPvfcY3SN6EkACB8Aw04cAGgk26UutV0tjcSaMPiPDr1sX1TwEwIxzHSNEM7VtFn XbApUFCS09sXSuvnsdChjTl4LOx4Q6GXccgbUrI67MPyIPtsIT6RjUFIDK131NiQZjr0 HDXZLwi4OT0BmOf7kXLzMbLlIP22E7hQ0JVxpuajweYrdKMs+bwX2khBtvFGwvF/vaLs tDvn4n8dHBGMnLAVNw0OGT3MAeToKIHA0vzkbRdJ5UrCFSCD6B8Lrs5IQtYliEcQMKkv zHCJ4vXrmQjhc8K+Y5bsdtEJaCAuDSk55kIgCA04+FLw2nylCbE+KLbQANQGGCp0NuWM F1pQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4aryhQbcmaB7oNBbR9UD5nwcxfkIN5/StOGhgwEfKig=; b=N7PFu9oChtqbVvTsVvWvQXm6BQpX3xojLkSLEBWnhVkP7/nkTYZmzbBJWZHKm3XZHU kIl+RS3+CQoP8Hm+dahPmygp53r0qCAIw6nSzVAdG6hxFK9YsdRqgLu0RMs1tJ5MLGQz RhsrsYeFKjkTrDL3EHipsTdC+PHDoSRHRC9wxipEHrwjF2Lg4FV3qUAmen1R5pRocRlT V4d8elYUaJH+zLPDgKIPb5tRPJhchgEqyf7uKJc8+3TIoaKgd2pnAzgI1/SbGMaHi3Wq FeUqrigmsuogUU57gdLCR7yukpVQkHrPQZp2+eCPok7sIV4zZ+5KkxgskZG4je4gnqDX Lw8A== X-Gm-Message-State: AOAM532cEw/LGaBq6oT4uYAjTYupoDkYZRbCjTHE7p5gtoLUjTUm2R/0 aT4iwsqJ1Ix7Hs3qeHRlwp7ClGMKNriycA== X-Received: by 2002:a05:620a:3cc:: with SMTP id r12mr627072qkm.44.1592427852927; Wed, 17 Jun 2020 14:04:12 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.04.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:04:12 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 39/73] i386: convert to cpu_interrupt_request Date: Wed, 17 Jun 2020 17:01:57 -0400 Message-Id: <20200617210231.4393-40-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::731; envelope-from=robert.foley@linaro.org; helo=mail-qk1-x731.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robert.foley@linaro.org, Eduardo Habkost , cota@braap.org, Paolo Bonzini , peter.puhov@linaro.org, alex.bennee@linaro.org, Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- target/i386/cpu.c | 2 +- target/i386/helper.c | 4 ++-- target/i386/svm_helper.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) -- 2.17.1 diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 4d3ab0f3a2..59ac96bd01 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -7093,7 +7093,7 @@ int x86_cpu_pending_interrupt(CPUState *cs, int interrupt_request) static bool x86_cpu_has_work(CPUState *cs) { - return x86_cpu_pending_interrupt(cs, cs->interrupt_request) != 0; + return x86_cpu_pending_interrupt(cs, cpu_interrupt_request(cs)) != 0; } static void x86_disas_set_info(CPUState *cs, disassemble_info *info) diff --git a/target/i386/helper.c b/target/i386/helper.c index 058de4073d..623a7299ac 100644 --- a/target/i386/helper.c +++ b/target/i386/helper.c @@ -1029,12 +1029,12 @@ void do_cpu_init(X86CPU *cpu) CPUState *cs = CPU(cpu); CPUX86State *env = &cpu->env; CPUX86State *save = g_new(CPUX86State, 1); - int sipi = cs->interrupt_request & CPU_INTERRUPT_SIPI; + int sipi = cpu_interrupt_request(cs) & CPU_INTERRUPT_SIPI; *save = *env; cpu_reset(cs); - cs->interrupt_request = sipi; + cpu_interrupt_request_set(cs, sipi); memcpy(&env->start_init_save, &save->start_init_save, offsetof(CPUX86State, end_init_save) - offsetof(CPUX86State, start_init_save)); diff --git a/target/i386/svm_helper.c b/target/i386/svm_helper.c index 63eb136743..c739bf0d9c 100644 --- a/target/i386/svm_helper.c +++ b/target/i386/svm_helper.c @@ -316,7 +316,7 @@ void helper_vmrun(CPUX86State *env, int aflag, int next_eip_addend) if (int_ctl & V_IRQ_MASK) { CPUState *cs = env_cpu(env); - cs->interrupt_request |= CPU_INTERRUPT_VIRQ; + cpu_interrupt_request_or(cs, CPU_INTERRUPT_VIRQ); } /* maybe we need to inject an event */ @@ -674,7 +674,7 @@ void do_vmexit(CPUX86State *env, uint32_t exit_code, uint64_t exit_info_1) env->vm_vmcb + offsetof(struct vmcb, control.int_ctl)); int_ctl &= ~(V_TPR_MASK | V_IRQ_MASK); int_ctl |= env->v_tpr & V_TPR_MASK; - if (cs->interrupt_request & CPU_INTERRUPT_VIRQ) { + if (cpu_interrupt_request(cs) & CPU_INTERRUPT_VIRQ) { int_ctl |= V_IRQ_MASK; } x86_stl_phys(cs, From patchwork Wed Jun 17 21:01:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190927 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp808495ilo; Wed, 17 Jun 2020 14:19:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/yiXmKKnCV97jZMca3pQdfzcW4VdOfTfUnV/vFsFzJFTU1dyRB5NpARljypTq2ieIKBOz X-Received: by 2002:a25:388d:: with SMTP id f135mr1384324yba.201.1592428757635; Wed, 17 Jun 2020 14:19:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592428757; cv=none; d=google.com; s=arc-20160816; b=ElC5yjBsZOwuANAyXhYNswM9x2YmM/Oh9dIhMzaeB5wkQPYMKrzmT0l49Fx3hCf1/E L/EAW1XCoRu3I+LTXJBvCtTQkyprsx2jn7rwyBjX9ZBmoubRn0DgWHAR7DVik9CYCmvq x1ITEJirbiDZhDYSRTm8lV5pajtMnDzvgMsWemcsIDQcfkWKXHybXVWmCMJ0SVj7JsmI PSi4L5+T2OVhZW1i6qyyfTfTPKEmJdhKVm7jV+SXmQHRMmXh0wUFt5rX7NQnK3OVYZdM 6gVZDpZ0XQdxWlm1O8MU5xqJPadJlEtLK43ofi4VDCBpxYG8n+ypZrIgs2CrttYnHa/w VwMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=bMJDR0op9yYxk4Q3uQ7Lh3faQWxq/2pZw+Fv/nrXz+A=; b=y4zgq7rR2RnGkwwwRwublx15u4X74sx8i3g+M24N6K6BJm0mN8gBplWGql1/dpwV3z 7BY54VfUHlyFrpSBGhayaIYPjxmy9HH3zicJWzkPLgV3jSerGjUCJgV6P8X4rxPL0O01 hDjkQiDez6HKnkylo2CRJdxmxzdUlSZCUf5vOK5XLZpGhG6n7xbPBhFervC6JPqWZoY/ aC8lRjciLwTXR4Ky8wYM0ytImiQ23W3WqIoINFzVun8/WJE46lBSCrBoYEyG4iDQMKna azFVpoQByftlmy3LTJdetKPu5ZROpz0P0CXRddmLWRZTC4N81MAOZcdCcrvR9XbsJTbf s14Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=RQ63kTM3; 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=fail (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 x138si669632ybg.413.2020.06.17.14.19.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:19:17 -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=fail header.i=@linaro.org header.s=google header.b=RQ63kTM3; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:37296 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfSn-0004PZ-0w for patch@linaro.org; Wed, 17 Jun 2020 17:19:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37656) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfEH-0003aT-N3 for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:17 -0400 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]:43937) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfEF-00009C-J2 for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:17 -0400 Received: by mail-qk1-x743.google.com with SMTP id j68so140069qkb.10 for ; Wed, 17 Jun 2020 14:04:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bMJDR0op9yYxk4Q3uQ7Lh3faQWxq/2pZw+Fv/nrXz+A=; b=RQ63kTM3AKz8TNyE0qqe3WkxI4DWPU9SoW1W8pf9NzcSXpE0kY0LeFIbtftZnxkj4x xZuG7uhNcOEJpQEDpXhvC4mN6Up5589I6u4feY9dRApjrGtw0jzbP/VS3RgTMf+3aBMs KTTbCR481jg527+8nsl8LO+Vk/i0cl2OV8eCwCMyefErmZD3bZ1vHgf1mAxZ2ABZZCPj fT0xXvOy6UqjOHQopPv8256ETNp9vw1p7oH/cVAr7hjf0NIgnlygj/9hIa6OTvoYpio8 yEHxkxu+nZ+YVDtvv47ypap+qoRvdvBgWhM6O73KoW/1Uk32RfTR5O74JLUdSLiGrb3n Zk+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bMJDR0op9yYxk4Q3uQ7Lh3faQWxq/2pZw+Fv/nrXz+A=; b=q2PgbqpYXAvRDQTXAWTocHCJI2PR9vhI3SCgp+QzpYKrGiBzYRy06Wqx+wCO/VX1Oi QwASCsbAK+YcofbJk4svNJCpvv1gaK+LFA27UEDjrVl280tS+6+n10iLoYUI5+MY/igU uxX6SFed/C6EcImdciZJBP54bQq1XuL28330oHjakB7YPOL7oaA1SWFsKIM27THYzPFR dthz5cUJXMxGY7IKt3LCJVuZ4nXmCt/l6vQHiw/JCEcSyjYk/1FV00h2yIJTFFpPLbFe cOXLFfN9+drd6sDSIxNO+rV4vygvDiyHCKUyVy9EK0Ugag1pCLsgrlSH3kiHrGpmW87e QrLg== X-Gm-Message-State: AOAM533bj7LhLy9QAj0d2P2TWCnueGw+/iKJB/JjJrCuJ1MYom1coicA h1J3ZJDz7yfoHmFGG/XvED1/8Y2krRiQ2g== X-Received: by 2002:a37:5e07:: with SMTP id s7mr625733qkb.20.1592427854372; Wed, 17 Jun 2020 14:04:14 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.04.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:04:13 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 40/73] i386/kvm: convert to cpu_interrupt_request Date: Wed, 17 Jun 2020 17:01:58 -0400 Message-Id: <20200617210231.4393-41-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::743; envelope-from=robert.foley@linaro.org; helo=mail-qk1-x743.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robert.foley@linaro.org, "open list:X86 KVM CPUs" , Marcelo Tosatti , Eduardo Habkost , cota@braap.org, Paolo Bonzini , peter.puhov@linaro.org, alex.bennee@linaro.org, Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- target/i386/kvm.c | 58 ++++++++++++++++++++++++++++------------------- 1 file changed, 35 insertions(+), 23 deletions(-) -- 2.17.1 diff --git a/target/i386/kvm.c b/target/i386/kvm.c index 8628fa9111..415a6d8114 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -3653,11 +3653,14 @@ static int kvm_put_vcpu_events(X86CPU *cpu, int level) events.smi.smm = !!(env->hflags & HF_SMM_MASK); events.smi.smm_inside_nmi = !!(env->hflags2 & HF2_SMM_INSIDE_NMI_MASK); if (kvm_irqchip_in_kernel()) { + uint32_t interrupt_request; + /* As soon as these are moved to the kernel, remove them * from cs->interrupt_request. */ - events.smi.pending = cs->interrupt_request & CPU_INTERRUPT_SMI; - events.smi.latched_init = cs->interrupt_request & CPU_INTERRUPT_INIT; + interrupt_request = cpu_interrupt_request(cs); + events.smi.pending = interrupt_request & CPU_INTERRUPT_SMI; + events.smi.latched_init = interrupt_request & CPU_INTERRUPT_INIT; cpu_reset_interrupt(cs, CPU_INTERRUPT_INIT | CPU_INTERRUPT_SMI); } else { /* Keep these in cs->interrupt_request. */ @@ -4015,14 +4018,14 @@ void kvm_arch_pre_run(CPUState *cpu, struct kvm_run *run) { X86CPU *x86_cpu = X86_CPU(cpu); CPUX86State *env = &x86_cpu->env; + uint32_t interrupt_request; int ret; + interrupt_request = cpu_interrupt_request(cpu); /* Inject NMI */ - if (cpu->interrupt_request & (CPU_INTERRUPT_NMI | CPU_INTERRUPT_SMI)) { - if (cpu->interrupt_request & CPU_INTERRUPT_NMI) { - qemu_mutex_lock_iothread(); + if (interrupt_request & (CPU_INTERRUPT_NMI | CPU_INTERRUPT_SMI)) { + if (interrupt_request & CPU_INTERRUPT_NMI) { cpu_reset_interrupt(cpu, CPU_INTERRUPT_NMI); - qemu_mutex_unlock_iothread(); DPRINTF("injected NMI\n"); ret = kvm_vcpu_ioctl(cpu, KVM_NMI); if (ret < 0) { @@ -4030,10 +4033,8 @@ void kvm_arch_pre_run(CPUState *cpu, struct kvm_run *run) strerror(-ret)); } } - if (cpu->interrupt_request & CPU_INTERRUPT_SMI) { - qemu_mutex_lock_iothread(); + if (interrupt_request & CPU_INTERRUPT_SMI) { cpu_reset_interrupt(cpu, CPU_INTERRUPT_SMI); - qemu_mutex_unlock_iothread(); DPRINTF("injected SMI\n"); ret = kvm_vcpu_ioctl(cpu, KVM_SMI); if (ret < 0) { @@ -4047,16 +4048,22 @@ void kvm_arch_pre_run(CPUState *cpu, struct kvm_run *run) qemu_mutex_lock_iothread(); } + /* + * We might have cleared some bits in cpu->interrupt_request since reading + * it; read it again. + */ + interrupt_request = cpu_interrupt_request(cpu); + /* Force the VCPU out of its inner loop to process any INIT requests * or (for userspace APIC, but it is cheap to combine the checks here) * pending TPR access reports. */ - if (cpu->interrupt_request & (CPU_INTERRUPT_INIT | CPU_INTERRUPT_TPR)) { - if ((cpu->interrupt_request & CPU_INTERRUPT_INIT) && + if (interrupt_request & (CPU_INTERRUPT_INIT | CPU_INTERRUPT_TPR)) { + if ((interrupt_request & CPU_INTERRUPT_INIT) && !(env->hflags & HF_SMM_MASK)) { cpu->exit_request = 1; } - if (cpu->interrupt_request & CPU_INTERRUPT_TPR) { + if (interrupt_request & CPU_INTERRUPT_TPR) { cpu->exit_request = 1; } } @@ -4064,7 +4071,7 @@ void kvm_arch_pre_run(CPUState *cpu, struct kvm_run *run) if (!kvm_pic_in_kernel()) { /* Try to inject an interrupt if the guest can accept it */ if (run->ready_for_interrupt_injection && - (cpu->interrupt_request & CPU_INTERRUPT_HARD) && + (interrupt_request & CPU_INTERRUPT_HARD) && (env->eflags & IF_MASK)) { int irq; @@ -4088,7 +4095,7 @@ void kvm_arch_pre_run(CPUState *cpu, struct kvm_run *run) * interrupt, request an interrupt window exit. This will * cause a return to userspace as soon as the guest is ready to * receive interrupts. */ - if ((cpu->interrupt_request & CPU_INTERRUPT_HARD)) { + if ((cpu_interrupt_request(cpu) & CPU_INTERRUPT_HARD)) { run->request_interrupt_window = 1; } else { run->request_interrupt_window = 0; @@ -4134,8 +4141,9 @@ int kvm_arch_process_async_events(CPUState *cs) { X86CPU *cpu = X86_CPU(cs); CPUX86State *env = &cpu->env; + uint32_t interrupt_request; - if (cs->interrupt_request & CPU_INTERRUPT_MCE) { + if (cpu_interrupt_request(cs) & CPU_INTERRUPT_MCE) { /* We must not raise CPU_INTERRUPT_MCE if it's not supported. */ assert(env->mcg_cap); @@ -4158,7 +4166,7 @@ int kvm_arch_process_async_events(CPUState *cs) } } - if ((cs->interrupt_request & CPU_INTERRUPT_INIT) && + if ((cpu_interrupt_request(cs) & CPU_INTERRUPT_INIT) && !(env->hflags & HF_SMM_MASK)) { kvm_cpu_synchronize_state(cs); do_cpu_init(cpu); @@ -4168,20 +4176,21 @@ int kvm_arch_process_async_events(CPUState *cs) return 0; } - if (cs->interrupt_request & CPU_INTERRUPT_POLL) { + if (cpu_interrupt_request(cs) & CPU_INTERRUPT_POLL) { cpu_reset_interrupt(cs, CPU_INTERRUPT_POLL); apic_poll_irq(cpu->apic_state); } - if (((cs->interrupt_request & CPU_INTERRUPT_HARD) && + interrupt_request = cpu_interrupt_request(cs); + if (((interrupt_request & CPU_INTERRUPT_HARD) && (env->eflags & IF_MASK)) || - (cs->interrupt_request & CPU_INTERRUPT_NMI)) { + (interrupt_request & CPU_INTERRUPT_NMI)) { cpu_halted_set(cs, 0); } - if (cs->interrupt_request & CPU_INTERRUPT_SIPI) { + if (interrupt_request & CPU_INTERRUPT_SIPI) { kvm_cpu_synchronize_state(cs); do_cpu_sipi(cpu); } - if (cs->interrupt_request & CPU_INTERRUPT_TPR) { + if (cpu_interrupt_request(cs) & CPU_INTERRUPT_TPR) { cpu_reset_interrupt(cs, CPU_INTERRUPT_TPR); kvm_cpu_synchronize_state(cs); apic_handle_tpr_access_report(cpu->apic_state, env->eip, @@ -4195,10 +4204,13 @@ static int kvm_handle_halt(X86CPU *cpu) { CPUState *cs = CPU(cpu); CPUX86State *env = &cpu->env; + uint32_t interrupt_request; + + interrupt_request = cpu_interrupt_request(cs); - if (!((cs->interrupt_request & CPU_INTERRUPT_HARD) && + if (!((interrupt_request & CPU_INTERRUPT_HARD) && (env->eflags & IF_MASK)) && - !(cs->interrupt_request & CPU_INTERRUPT_NMI)) { + !(interrupt_request & CPU_INTERRUPT_NMI)) { cpu_halted_set(cs, 1); return EXCP_HLT; } From patchwork Wed Jun 17 21:01:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190946 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp815109ilo; Wed, 17 Jun 2020 14:29:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNUEPiyx07KdYRPxfi9lLjJEhOYyIWuDLrsT37DDutepjfWdh4Jq43DT6dAV3fvxRRifrn X-Received: by 2002:a05:6902:4e9:: with SMTP id w9mr1436938ybs.311.1592429386217; Wed, 17 Jun 2020 14:29:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592429386; cv=none; d=google.com; s=arc-20160816; b=tehQ6b0M50y2vryFBoPWiWrWvJvpPUYQlxjrSN0JpHglZNqui5xB43c7EkP3ajlvTG PqScnWh+TIxFR6uf2gt20qK9tzW4eYf2Uh3u2FISdAu/la9+IhjnVwFl7MXMVS4O6rcy FgExszvns2a/9cg7vmWzINreDUBJzZCtxBJY0XcJwMK9Lu+bVR5ci0f9V9kc7t6FdIqG yQuliUuEbNybtlbqxfNi5v56WywEcgFxFo7gVVmGQinwbmklPPFaB76OkDSk5pj/h3m6 aHfitvjBOMZowPM1ltXEs0Lu2ZeKuEBsFmI231YsNB0Mcp9sCCAt1BKaGueVQgUGgjgf l1qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=VHZjlUaQqM5GtwqE4D5+D6h1EspkQ+6Rl4guLSEBSAc=; b=Qzpiv34BAssStKQM8llbQnq7Xs/lg3VEzHeIx8gItJ4dPng3l7lF/P3nfcRGi35i01 c/ZHVCIoeuALpVpYJ4lX0Rp0j4MW5zwQ2dDmO4/hieVNj9Tliy5rovSexS9P2jN2lGz7 8tiumg1S71sxfKBjlLzQJiagkLIBB1eG8TbnAjuilsoKobop4/9nSSyn8CD17kv0Ycal U5Mm9pNF3T0IdA+XknIwgFICw3p/5cNokfFR1D0VOLlJ3e1qbeFVSEkvdwc0yLnZsVWW UxOyQkXdmUE4JZpP06BsAg4yJU82t9AdXrgcjEwhdn/wjwqdYU7wG1VJ/x2kG3AKR9q9 9Dqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=rW65jctj; 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=fail (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 m8si675880ybo.29.2020.06.17.14.29.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:29:46 -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=fail header.i=@linaro.org header.s=google header.b=rW65jctj; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:45292 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfcv-0003ul-J9 for patch@linaro.org; Wed, 17 Jun 2020 17:29:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37670) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfEJ-0003fb-3G for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:19 -0400 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]:40509) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfEH-0000As-8o for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:18 -0400 Received: by mail-qk1-x742.google.com with SMTP id c185so3482973qke.7 for ; Wed, 17 Jun 2020 14:04:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=VHZjlUaQqM5GtwqE4D5+D6h1EspkQ+6Rl4guLSEBSAc=; b=rW65jctjvH3r1V0QQCpLFxV92Q8HELkZYRBzjiw48re9Oq4ktX+sKEWxBDM3ToS+ER wGl/jf00OTfgHLkjaKMUpx/AoKKU56sPW8nVgfFS8xc0NHsBx5Z0SqUxpYJkHEqVT6PW wbVuh145a6dEWUWL2+NNgeydVGpTxRn1qBE03mNHOW6y+Jk3IcIWww6e+gJjG3X6WCQz uv7hoPuReXuxzaPsL4epXTzDdHp96L2z9q939unvGXhrUdAebUwJAsXMvaJGS/1D21Yk Cw0FKFVyrCJCa1VXdjTtSb/985jjNnylrH9eCKny0oMnxqVqYFs6AP37CcZNZV4uNSQW kulw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VHZjlUaQqM5GtwqE4D5+D6h1EspkQ+6Rl4guLSEBSAc=; b=ooYWCfz2JyLcsMcxQqQjjVjhkxcUo9j5NadwiHv6lrqB597gDenFaIefD9pHKuN4mT Y/Ka5DrkWtInAusXne8sci/f4fgqr5zlYH60hA9vsbu8nxKmcNcGMDqOQ87dGZe7eVwQ IrIpTHnF+J15dCXuPVMJyOfJ8gqqeRy3iAPXxL79FBLZKTFeMWpO5XzeDSWoWoFdFv3x z0KQSk8OsNO5ojuOS8FhJzP57OECDEfiWcw+H7F4TTcf3YCUnld9J6iNT2wWuQNSqdD3 OAf+V6wUFfAC2I79gx9Yr4/GS7PX440Em4s6ktybuFqERaYjTkkUa6Py8J1mbn4IWBau XN4A== X-Gm-Message-State: AOAM530ofFmWDcdX/ZRPMNIP5zx3eiT/Wzmg+DfVhsNtm+0gFIXFB7fH knm7a3lUBMrZFggfaDf/FV0tIA0w3YPRlg== X-Received: by 2002:a37:9ad5:: with SMTP id c204mr548600qke.413.1592427855921; Wed, 17 Jun 2020 14:04:15 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.04.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:04:15 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 41/73] i386/hax-all: convert to cpu_interrupt_request Date: Wed, 17 Jun 2020 17:01:59 -0400 Message-Id: <20200617210231.4393-42-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::742; envelope-from=robert.foley@linaro.org; helo=mail-qk1-x742.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robert.foley@linaro.org, Eduardo Habkost , cota@braap.org, "open list:X86 HAXM CPUs" , Colin Xu , Paolo Bonzini , peter.puhov@linaro.org, Richard Henderson , alex.bennee@linaro.org, Wenchao Wang Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota [RF: Converted new code to cpu_interrupt_request] Signed-off-by: Robert Foley --- target/i386/hax-all.c | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) -- 2.17.1 diff --git a/target/i386/hax-all.c b/target/i386/hax-all.c index 6a4152730f..20a75a891f 100644 --- a/target/i386/hax-all.c +++ b/target/i386/hax-all.c @@ -298,7 +298,7 @@ int hax_vm_destroy(struct hax_vm *vm) static void hax_handle_interrupt(CPUState *cpu, int mask) { - cpu->interrupt_request |= mask; + cpu_interrupt_request_or(cpu, mask); if (!qemu_cpu_is_self(cpu)) { qemu_cpu_kick(cpu); @@ -432,7 +432,7 @@ static int hax_vcpu_interrupt(CPUArchState *env) * Unlike KVM, HAX kernel check for the eflags, instead of qemu */ if (ht->ready_for_interrupt_injection && - (cpu->interrupt_request & CPU_INTERRUPT_HARD)) { + (cpu_interrupt_request(cpu) & CPU_INTERRUPT_HARD)) { int irq; irq = cpu_get_pic_interrupt(env); @@ -446,7 +446,7 @@ static int hax_vcpu_interrupt(CPUArchState *env) * interrupt, request an interrupt window exit. This will * cause a return to userspace as soon as the guest is ready to * receive interrupts. */ - if ((cpu->interrupt_request & CPU_INTERRUPT_HARD)) { + if ((cpu_interrupt_request(cpu) & CPU_INTERRUPT_HARD)) { ht->request_interrupt_window = 1; } else { ht->request_interrupt_window = 0; @@ -485,7 +485,7 @@ static int hax_vcpu_hax_exec(CPUArchState *env) return 0; } - if (cpu->interrupt_request & CPU_INTERRUPT_POLL) { + if (cpu_interrupt_request(cpu) & CPU_INTERRUPT_POLL) { cpu_reset_interrupt(cpu, CPU_INTERRUPT_POLL); apic_poll_irq(x86_cpu->apic_state); } @@ -508,20 +508,20 @@ static int hax_vcpu_hax_exec(CPUArchState *env) * c) INIT signal; * d) SIPI signal. */ - if (((cpu->interrupt_request & CPU_INTERRUPT_HARD) && + if (((cpu_interrupt_request(cpu) & CPU_INTERRUPT_HARD) && (env->eflags & IF_MASK)) || - (cpu->interrupt_request & CPU_INTERRUPT_NMI)) { + (cpu_interrupt_request(cpu) & CPU_INTERRUPT_NMI)) { cpu_halted_set(cpu, 0); } - if (cpu->interrupt_request & CPU_INTERRUPT_INIT) { + if (cpu_interrupt_request(cpu) & CPU_INTERRUPT_INIT) { DPRINTF("\nhax_vcpu_hax_exec: handling INIT for %d\n", cpu->cpu_index); do_cpu_init(x86_cpu); hax_vcpu_sync_state(env, 1); } - if (cpu->interrupt_request & CPU_INTERRUPT_SIPI) { + if (cpu_interrupt_request(cpu) & CPU_INTERRUPT_SIPI) { DPRINTF("hax_vcpu_hax_exec: handling SIPI for %d\n", cpu->cpu_index); hax_vcpu_sync_state(env, 0); @@ -590,13 +590,17 @@ static int hax_vcpu_hax_exec(CPUArchState *env) ret = -1; break; case HAX_EXIT_HLT: - if (!(cpu->interrupt_request & CPU_INTERRUPT_HARD) && - !(cpu->interrupt_request & CPU_INTERRUPT_NMI)) { - /* hlt instruction with interrupt disabled is shutdown */ - env->eflags |= IF_MASK; - cpu_halted_set(cpu, 1); - cpu->exception_index = EXCP_HLT; - ret = 1; + { + uint32_t interrupt_request = cpu_interrupt_request(cpu); + + if (!(interrupt_request & CPU_INTERRUPT_HARD) && + !(interrupt_request & CPU_INTERRUPT_NMI)) { + /* hlt instruction with interrupt disabled is shutdown */ + env->eflags |= IF_MASK; + cpu_halted_set(cpu, 1); + cpu->exception_index = EXCP_HLT; + ret = 1; + } } break; /* these situations will continue to hax module */ From patchwork Wed Jun 17 21:02:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190942 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp813433ilo; Wed, 17 Jun 2020 14:26:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPCtx+LRQI6YrDO9xKfO2KEuxaxk9XyrM79C2u3jIUJA16+c+PT5ktEGbH4J8BJdB3PxyY X-Received: by 2002:a05:6902:1007:: with SMTP id w7mr1752409ybt.217.1592429218868; Wed, 17 Jun 2020 14:26:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592429218; cv=none; d=google.com; s=arc-20160816; b=YAvc9dqk4SrAbLjedQnfc5NO3rEAEl8mQ3oyvorjETY47iLkjXddKsNmEWQrNnl7W0 y6bS1SVp3p1h77C5pqT+lUSlONI+5GNxHcNiaVv/Jxe039rEr10NT4tbrOcBECkVVvzW N1FXfqySs+sGK4rWPL3wSMhzulNqoZOs4+TMktvxGXjeZcehxV/hgqqi3TyI1xAIqSZ/ gVLDBZERQbi+KIicWvpUc3nP0EU7HcL8ytOkjYueSgmwzWx5su2pOafk4Gj10TyyX1wN 7w3n9YiGgG5N5/BNyVAVpiJEs4SzCHlCgPs3ToOF2lDKP6aSwpIi5lHcVDLGP6JL0hYj jqBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=EcsY6TGhrUKNyVg3Ugjl3o+5XwjzyMO1Q9LTdSRFfVg=; b=L2xlOznESxaAMjpV38pf/SZWu9NvDpEVX9dcZk8WK0J+GsaKh4eb+8IlVrcYz4W9c6 /yTar9DkAg+a0nC+Uk5fgdawiRtU11tvL/VKjrLPt6JRkhOubHnBKlmIxEwVRRVWQoMB piH9NWzKimMU3nZq8nOLNkNpHh1vxz/WOmcTqwnRLV0hCLipqcVC6wJxcK0TLIZKBEWh pozxgudQJErgNjoRCKtAXUPdQO9ZBwPjamCDJpvGAKB7sK78fAu+VweFAVTpy+YX9UeT CHzheYUu9FBcia7J+pK48+V0ChZsnUBfiTFUmoGvnqz9UmPOSZBj6X4rv99sMH8YCA7E Rq3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Y0xaPLfr; 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=fail (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 v83si615762ybv.434.2020.06.17.14.26.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:26:58 -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=fail header.i=@linaro.org header.s=google header.b=Y0xaPLfr; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:37472 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfaE-0000Ba-9C for patch@linaro.org; Wed, 17 Jun 2020 17:26:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37688) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfEK-0003je-ON for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:20 -0400 Received: from mail-qv1-xf42.google.com ([2607:f8b0:4864:20::f42]:39820) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfEI-0000Er-Jf for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:20 -0400 Received: by mail-qv1-xf42.google.com with SMTP id r16so1761705qvm.6 for ; Wed, 17 Jun 2020 14:04:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=EcsY6TGhrUKNyVg3Ugjl3o+5XwjzyMO1Q9LTdSRFfVg=; b=Y0xaPLfr7H0xD9RlJzFNKFZAocI3yNY1KGVZm1Ak4h7JEqbfrNfBfVWEouHU6oHRAi Gn6pPKMFCGxuq3rqqa/Am/DVlBNsJCTXTB8ZPF0OM2Vsw2VvreoBkWVOeuE0g6/DYf6V 285nXjiwa8F7iFimgcYJQnEm58M6vlDm01M2ps4BIuTPhtrBVAsMTH5YaB6lKcYl6ufq lNHfCBbAqSRJBQBHd5qDfXpe4JYrb2SzBWQ0o6fd7JYJp3fjrbSIB20xAoOWGp2lpXPY eVK7f4Iuw0xcGV7HtZtCZYXfWtkIqfLoLIJnGpak6S8iy5rcF9H66vFkhXxpUtoXr1x1 eRKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=EcsY6TGhrUKNyVg3Ugjl3o+5XwjzyMO1Q9LTdSRFfVg=; b=j4U7pgPtCryxUikHYj40C70dJ8xWiHOJqZ5sHKfkzM7Hx2YzkPvRqFXfjYi+8FfkF6 Jhafb9DZyj6bH2/QOtQK8cjeqHktjnvjX4AH0vIsJH3/2jix4oaD3IuNZVZxrahxZ0lL RDKfzeKIx2bjdH0qcLIiT5fd3W3mZf1BdG7eErlY3pLVkqGxb0rtEDu1XzQrfxCQc61H 5LAGOSO0AajhmieNN5jA+BVq+W8hgw37j+YxRJdnVk117ZtLyqD8Qh5v47OQ5bHH5CKh 0G/ft4jxQwirfBgwH6ZqeoLVYBG14t+TTQwPQdxO/rZrBirUZuSCZtXudhsU6PG6X5hV vgjg== X-Gm-Message-State: AOAM531D9ZZH+KFvPb4L5fAPps4w92yONVFBDK7WaAgIzbt+S44fFnPt iRG+ycW7hOfJX4Ywfz6A0DIF/B+9ATArhQ== X-Received: by 2002:ad4:590d:: with SMTP id ez13mr558482qvb.177.1592427857405; Wed, 17 Jun 2020 14:04:17 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.04.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:04:16 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 42/73] i386/whpx-all: convert to cpu_interrupt_request Date: Wed, 17 Jun 2020 17:02:00 -0400 Message-Id: <20200617210231.4393-43-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::f42; envelope-from=robert.foley@linaro.org; helo=mail-qv1-xf42.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robert.foley@linaro.org, Eduardo Habkost , cota@braap.org, Paolo Bonzini , peter.puhov@linaro.org, Sunil Muthuswamy , alex.bennee@linaro.org, Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- target/i386/whpx-all.c | 41 ++++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 17 deletions(-) -- 2.17.1 diff --git a/target/i386/whpx-all.c b/target/i386/whpx-all.c index d5beb4a5e2..cb424f04a3 100644 --- a/target/i386/whpx-all.c +++ b/target/i386/whpx-all.c @@ -752,12 +752,14 @@ static int whpx_handle_portio(CPUState *cpu, static int whpx_handle_halt(CPUState *cpu) { struct CPUX86State *env = (CPUArchState *)(cpu->env_ptr); + uint32_t interrupt_request; int ret = 0; qemu_mutex_lock_iothread(); - if (!((cpu->interrupt_request & CPU_INTERRUPT_HARD) && + interrupt_request = cpu_interrupt_request(cpu); + if (!((interrupt_request & CPU_INTERRUPT_HARD) && (env->eflags & IF_MASK)) && - !(cpu->interrupt_request & CPU_INTERRUPT_NMI)) { + !(interrupt_request & CPU_INTERRUPT_NMI)) { cpu->exception_index = EXCP_HLT; cpu_halted_set(cpu, true); ret = 1; @@ -775,6 +777,7 @@ static void whpx_vcpu_pre_run(CPUState *cpu) struct CPUX86State *env = (CPUArchState *)(cpu->env_ptr); X86CPU *x86_cpu = X86_CPU(cpu); int irq; + uint32_t interrupt_request; uint8_t tpr; WHV_X64_PENDING_INTERRUPTION_REGISTER new_int; UINT32 reg_count = 0; @@ -786,17 +789,19 @@ static void whpx_vcpu_pre_run(CPUState *cpu) qemu_mutex_lock_iothread(); + interrupt_request = cpu_interrupt_request(cpu); + /* Inject NMI */ if (!vcpu->interruption_pending && - cpu->interrupt_request & (CPU_INTERRUPT_NMI | CPU_INTERRUPT_SMI)) { - if (cpu->interrupt_request & CPU_INTERRUPT_NMI) { + interrupt_request & (CPU_INTERRUPT_NMI | CPU_INTERRUPT_SMI)) { + if (interrupt_request & CPU_INTERRUPT_NMI) { cpu_reset_interrupt(cpu, CPU_INTERRUPT_NMI); vcpu->interruptable = false; new_int.InterruptionType = WHvX64PendingNmi; new_int.InterruptionPending = 1; new_int.InterruptionVector = 2; } - if (cpu->interrupt_request & CPU_INTERRUPT_SMI) { + if (interrupt_request & CPU_INTERRUPT_SMI) { cpu_reset_interrupt(cpu, CPU_INTERRUPT_SMI); } } @@ -805,12 +810,12 @@ static void whpx_vcpu_pre_run(CPUState *cpu) * Force the VCPU out of its inner loop to process any INIT requests or * commit pending TPR access. */ - if (cpu->interrupt_request & (CPU_INTERRUPT_INIT | CPU_INTERRUPT_TPR)) { - if ((cpu->interrupt_request & CPU_INTERRUPT_INIT) && + if (interrupt_request & (CPU_INTERRUPT_INIT | CPU_INTERRUPT_TPR)) { + if ((interrupt_request & CPU_INTERRUPT_INIT) && !(env->hflags & HF_SMM_MASK)) { cpu->exit_request = 1; } - if (cpu->interrupt_request & CPU_INTERRUPT_TPR) { + if (interrupt_request & CPU_INTERRUPT_TPR) { cpu->exit_request = 1; } } @@ -819,7 +824,7 @@ static void whpx_vcpu_pre_run(CPUState *cpu) if (!vcpu->interruption_pending && vcpu->interruptable && (env->eflags & IF_MASK)) { assert(!new_int.InterruptionPending); - if (cpu->interrupt_request & CPU_INTERRUPT_HARD) { + if (interrupt_request & CPU_INTERRUPT_HARD) { cpu_reset_interrupt(cpu, CPU_INTERRUPT_HARD); irq = cpu_get_pic_interrupt(env); if (irq >= 0) { @@ -849,7 +854,7 @@ static void whpx_vcpu_pre_run(CPUState *cpu) /* Update the state of the interrupt delivery notification */ if (!vcpu->window_registered && - cpu->interrupt_request & CPU_INTERRUPT_HARD) { + cpu_interrupt_request(cpu) & CPU_INTERRUPT_HARD) { reg_values[reg_count].DeliverabilityNotifications.InterruptNotification = 1; vcpu->window_registered = 1; @@ -902,31 +907,33 @@ static void whpx_vcpu_process_async_events(CPUState *cpu) struct CPUX86State *env = (CPUArchState *)(cpu->env_ptr); X86CPU *x86_cpu = X86_CPU(cpu); struct whpx_vcpu *vcpu = get_whpx_vcpu(cpu); + uint32_t interrupt_request; - if ((cpu->interrupt_request & CPU_INTERRUPT_INIT) && + if ((cpu_interrupt_request(cpu) & CPU_INTERRUPT_INIT) && !(env->hflags & HF_SMM_MASK)) { whpx_cpu_synchronize_state(cpu); do_cpu_init(x86_cpu); vcpu->interruptable = true; } - if (cpu->interrupt_request & CPU_INTERRUPT_POLL) { + if (cpu_interrupt_request(cpu) & CPU_INTERRUPT_POLL) { cpu_reset_interrupt(cpu, CPU_INTERRUPT_POLL); apic_poll_irq(x86_cpu->apic_state); } - if (((cpu->interrupt_request & CPU_INTERRUPT_HARD) && + interrupt_request = cpu_interrupt_request(cpu); + if (((interrupt_request & CPU_INTERRUPT_HARD) && (env->eflags & IF_MASK)) || - (cpu->interrupt_request & CPU_INTERRUPT_NMI)) { + (interrupt_request & CPU_INTERRUPT_NMI)) { cpu_halted_set(cpu, false); } - if (cpu->interrupt_request & CPU_INTERRUPT_SIPI) { + if (interrupt_request & CPU_INTERRUPT_SIPI) { whpx_cpu_synchronize_state(cpu); do_cpu_sipi(x86_cpu); } - if (cpu->interrupt_request & CPU_INTERRUPT_TPR) { + if (cpu_interrupt_request(cpu) & CPU_INTERRUPT_TPR) { cpu_reset_interrupt(cpu, CPU_INTERRUPT_TPR); whpx_cpu_synchronize_state(cpu); apic_handle_tpr_access_report(x86_cpu->apic_state, env->eip, @@ -1413,7 +1420,7 @@ static void whpx_memory_init(void) static void whpx_handle_interrupt(CPUState *cpu, int mask) { - cpu->interrupt_request |= mask; + cpu_interrupt_request_or(cpu, mask); if (!qemu_cpu_is_self(cpu)) { qemu_cpu_kick(cpu); From patchwork Wed Jun 17 21:02:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190949 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp817520ilo; Wed, 17 Jun 2020 14:33:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwx8wzZa4J6UaHCzQ3SKwcFUsf4unF+Ket7LmCARXJ6ekIeiS6Jwi6N1w8hc9GQXmo7DeY1 X-Received: by 2002:a25:dcd1:: with SMTP id y200mr1464157ybe.263.1592429606026; Wed, 17 Jun 2020 14:33:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592429606; cv=none; d=google.com; s=arc-20160816; b=y6N6XIpAY8ViCf+0NIv+A5RVCWS8b77Ytx+xlO6hXjbImg/tNr9gHeET+6ZXHy7wDG aommlU2ZeyWukVzFX2kz5MMlw/R/uE/C8JeuF3qXacNvpWeFY0rkU9Worhz+4d3SFuFa 5B/jdmPOElL56q6NejvMZCGpHRNJ/VITd5+0A8IrAEYNE8E5Rjsy5wjVAK0YF1jfLWsh Vhu6bicQYfZG6buB0/cSki7UOK5dp+mKkUaeMW0QildaBZZRHmv3MJ9wTSOVcO9UBKX2 kv3bpi1GS6TNPu3DXY5DF7jz7O+3+HMtlzJoG+25GDntCb7Cx74gsLW7bRi9n94YNyOK w6OQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=wUXpbIr+0XemeXbqwPqj4NV/3r6BPUZk1p9TVsxJgTg=; b=sNalaod9Cr8LNIGyuxH0aOykBf0oLAhfrWgZRcemKTB28fZci6mAyFFlIczzPAgb7c XUdIUNIZooPlzE+UFwInzXzWXCSYAAFZldOe7oa7pBLgTq2gVLoTgRQeqvs9USWAbivP 30B6mDQb1bG1hqAc91qd5tOzKOR6DVY91sCq72OaVflmTZGPAfECDtKK45xAZe9J0aZq CFSeAF9QTegQEz2jE/QuyySxr53MoKE4So6S+0ysl3tfe/I9MbAX+K/sq1ZKnsDTbHhj pxaFRvUCxib9DGSbAIgDMgfRCb1jgsxRY9eXxGkEAWSR8807UTwTgNr2DaaMbHXRIvKM nQOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=IIdMlYj5; 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=fail (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 y3si658138ybq.160.2020.06.17.14.33.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:33:26 -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=fail header.i=@linaro.org header.s=google header.b=IIdMlYj5; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:57256 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfgT-0000qK-Cz for patch@linaro.org; Wed, 17 Jun 2020 17:33:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37706) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfEL-0003m7-Qt for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:21 -0400 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]:40510) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfEJ-0000Fo-Ux for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:21 -0400 Received: by mail-qk1-x743.google.com with SMTP id c185so3483114qke.7 for ; Wed, 17 Jun 2020 14:04:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=wUXpbIr+0XemeXbqwPqj4NV/3r6BPUZk1p9TVsxJgTg=; b=IIdMlYj5yz2hWu4Xu65YBgLkXmLNVn53G+Psk1HqPR8Xtmbp8BKjaVRLHHypSUisy0 uYX5S8/EIT7N3R/bSAmiOtHIeTD9ziTNjrHil/DKIr3Cf2JoxSKAINsrVS907rcVf7Oe iRJ6Sx3RZBkmYlblx77/Vgw9TT2BzwDKOfEolv90yQpzyQKhtRfmLMav5SgBQ6mNHHTn kY3EiNTOmi7pwTe9P/SQfl6Q0vPG7yLVVoIq+9vNTg8/dlUSholu7XIKu7eLB/X2imrx 7o2dmoi9NQl/AsHqRJYbMRnbdz0ouHLvTwzoCIkLNWEQXHP+uxarEJGTfEwokGqaDWRT 11xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=wUXpbIr+0XemeXbqwPqj4NV/3r6BPUZk1p9TVsxJgTg=; b=Pjy7bF4tK7ljaLz5AiMdUY9dGQ37WBvqvw8P9AfKgTaL++miAxtbJR6lsVfuuTeP2P 0ZuiKRxQaW70rBK/hn2+RYPFNiikVL23fXAfK4CCOaRCCo/J6nKBItpzWWS9G4U2Hnmg n76evqWDno55ZI3FsO735ou2sHLkxWPFq0JAuDAxBkl4cag9jMSjugyu5tVmY07j0vvR Vga0MAolwIX0u2cjrZaXoctRQMKIcsD4jy2LuAZtdGBrCaabIYovLuAsur358aax9NXF +PB5kVVr6Qn3mqkckyE/A2WnNVgKeDh+wmOkFoPTM5PMnwsxwGydx7pjkP3VMI7KXPz+ 3mkA== X-Gm-Message-State: AOAM532CpO3QWfAUfBhLH0OrBB+LuVnv9bNGRacD5iOgTgpfCsfxEDmO B1oLnCU3mEjBUTW7DDtqDguKSUbdo9dqFQ== X-Received: by 2002:a05:620a:14b8:: with SMTP id x24mr534431qkj.284.1592427858837; Wed, 17 Jun 2020 14:04:18 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.04.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:04:18 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 43/73] i386/hvf: convert to cpu_request_interrupt Date: Wed, 17 Jun 2020 17:02:01 -0400 Message-Id: <20200617210231.4393-44-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::743; envelope-from=robert.foley@linaro.org; helo=mail-qk1-x743.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robert.foley@linaro.org, Eduardo Habkost , Roman Bolshakov , cota@braap.org, Paolo Bonzini , peter.puhov@linaro.org, alex.bennee@linaro.org, Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- target/i386/hvf/hvf.c | 8 +++++--- target/i386/hvf/x86hvf.c | 26 +++++++++++++++----------- 2 files changed, 20 insertions(+), 14 deletions(-) -- 2.17.1 diff --git a/target/i386/hvf/hvf.c b/target/i386/hvf/hvf.c index b3bd2285fa..01ee420185 100644 --- a/target/i386/hvf/hvf.c +++ b/target/i386/hvf/hvf.c @@ -262,7 +262,7 @@ static void update_apic_tpr(CPUState *cpu) static void hvf_handle_interrupt(CPUState * cpu, int mask) { - cpu->interrupt_request |= mask; + cpu_interrupt_request_or(cpu, mask); if (!qemu_cpu_is_self(cpu)) { qemu_cpu_kick(cpu); } @@ -737,10 +737,12 @@ int hvf_vcpu_exec(CPUState *cpu) ret = 0; switch (exit_reason) { case EXIT_REASON_HLT: { + uint32_t interrupt_request = cpu_interrupt_request(cpu); + macvm_set_rip(cpu, rip + ins_len); - if (!((cpu->interrupt_request & CPU_INTERRUPT_HARD) && + if (!((interrupt_request & CPU_INTERRUPT_HARD) && (env->eflags & IF_MASK)) - && !(cpu->interrupt_request & CPU_INTERRUPT_NMI) && + && !(interrupt_request & CPU_INTERRUPT_NMI) && !(idtvec_info & VMCS_IDT_VEC_VALID)) { cpu_halted_set(cpu, 1); ret = EXCP_HLT; diff --git a/target/i386/hvf/x86hvf.c b/target/i386/hvf/x86hvf.c index 8e9b60d0a7..565594bc10 100644 --- a/target/i386/hvf/x86hvf.c +++ b/target/i386/hvf/x86hvf.c @@ -352,6 +352,7 @@ bool hvf_inject_interrupts(CPUState *cpu_state) uint8_t vector; uint64_t intr_type; + uint32_t interrupt_request; bool have_event = true; if (env->interrupt_injected != -1) { vector = env->interrupt_injected; @@ -400,7 +401,7 @@ bool hvf_inject_interrupts(CPUState *cpu_state) }; } - if (cpu_state->interrupt_request & CPU_INTERRUPT_NMI) { + if (cpu_interrupt_request(cpu_state) & CPU_INTERRUPT_NMI) { if (!(env->hflags2 & HF2_NMI_MASK) && !(info & VMCS_INTR_VALID)) { cpu_reset_interrupt(cpu_state, CPU_INTERRUPT_NMI); info = VMCS_INTR_VALID | VMCS_INTR_T_NMI | EXCP02_NMI; @@ -411,7 +412,7 @@ bool hvf_inject_interrupts(CPUState *cpu_state) } if (!(env->hflags & HF_INHIBIT_IRQ_MASK) && - (cpu_state->interrupt_request & CPU_INTERRUPT_HARD) && + (cpu_interrupt_request(cpu_state) & CPU_INTERRUPT_HARD) && (env->eflags & IF_MASK) && !(info & VMCS_INTR_VALID)) { int line = cpu_get_pic_interrupt(&x86cpu->env); cpu_reset_interrupt(cpu_state, CPU_INTERRUPT_HARD); @@ -420,39 +421,42 @@ bool hvf_inject_interrupts(CPUState *cpu_state) VMCS_INTR_VALID | VMCS_INTR_T_HWINTR); } } - if (cpu_state->interrupt_request & CPU_INTERRUPT_HARD) { + if (cpu_interrupt_request(cpu_state) & CPU_INTERRUPT_HARD) { vmx_set_int_window_exiting(cpu_state); } - return (cpu_state->interrupt_request - & (CPU_INTERRUPT_INIT | CPU_INTERRUPT_TPR)); + return cpu_interrupt_request(cpu_state) & (CPU_INTERRUPT_INIT | + CPU_INTERRUPT_TPR); } int hvf_process_events(CPUState *cpu_state) { X86CPU *cpu = X86_CPU(cpu_state); CPUX86State *env = &cpu->env; + uint32_t interrupt_request; env->eflags = rreg(cpu_state->hvf_fd, HV_X86_RFLAGS); - if (cpu_state->interrupt_request & CPU_INTERRUPT_INIT) { + if (cpu_interrupt_request(cpu_state) & CPU_INTERRUPT_INIT) { hvf_cpu_synchronize_state(cpu_state); do_cpu_init(cpu); } - if (cpu_state->interrupt_request & CPU_INTERRUPT_POLL) { + if (cpu_interrupt_request(cpu_state) & CPU_INTERRUPT_POLL) { cpu_reset_interrupt(cpu_state, CPU_INTERRUPT_POLL); apic_poll_irq(cpu->apic_state); } - if (((cpu_state->interrupt_request & CPU_INTERRUPT_HARD) && + + interrupt_request = cpu_interrupt_request(cpu_state); + if (((interrupt_request & CPU_INTERRUPT_HARD) && (env->eflags & IF_MASK)) || - (cpu_state->interrupt_request & CPU_INTERRUPT_NMI)) { + (interrupt_request & CPU_INTERRUPT_NMI)) { cpu_halted_set(cpu_state, 0); } - if (cpu_state->interrupt_request & CPU_INTERRUPT_SIPI) { + if (interrupt_request & CPU_INTERRUPT_SIPI) { hvf_cpu_synchronize_state(cpu_state); do_cpu_sipi(cpu); } - if (cpu_state->interrupt_request & CPU_INTERRUPT_TPR) { + if (cpu_interrupt_request(cpu_state) & CPU_INTERRUPT_TPR) { cpu_reset_interrupt(cpu_state, CPU_INTERRUPT_TPR); hvf_cpu_synchronize_state(cpu_state); apic_handle_tpr_access_report(cpu->apic_state, env->eip, From patchwork Wed Jun 17 21:02:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190948 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp817133ilo; Wed, 17 Jun 2020 14:32:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJygz6m6GtQ4uHXhrRLkCwww1exAzTO8vyWyHNOOUTNhfwdP+P7UfZoWD5VBuG1r2uoQ4KG5 X-Received: by 2002:a25:8601:: with SMTP id y1mr1505625ybk.161.1592429572454; Wed, 17 Jun 2020 14:32:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592429572; cv=none; d=google.com; s=arc-20160816; b=VRnbQf2VRg3mfJWKun7V5Q7FjSEbVcGlzV7zMDEx0jBITfiI/bF5wOlha1sT5pVZKN b6Mcgk0BMWPTzs7SG0ZqPe3cQIDysuIiB7oVC5VT38qwmLmAXuRgnwhshaA9QF4J2uQi A4iXH6PX4MFyNf2V6E+TPApzA5QCF1H/ulSzurIIK7Yb9oyE1RGXZfdKQyYyZ9yz4RMG aJOaAu1Y1t8n4cx9PmDOR4W9U3a1SpN7mMRSVpQWyToMgbMCaeix25+DeribetqB+Lbd wFBw1RmOrt4BbxyLRacBQyAEieL66IIMdSalucbqdE3udpPMIbIdLYr8rL0VfzHy/EqT Y8pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=otzI+vAMFZo6kJ+xiIJJ7YKSc6bvWOvFds+iAtOJpdU=; b=i8wVAOUsLvJOsh+xNyeSp0KtjNPPbh58DYlJp/RQ10gA19Y7qYA/OZULV3Kc9Ssf5G DT6WgTMXPUieoHaZNmbgmT9PsR1Kp1utwgKOBpZVM/kJ6ZI92sz6jS+yrmERdewKXWds 0xd/glgeXtZiEcQ/gndyZR6bVT0+sPRMhibX8NJNimzUy1XuBULfbFxBs7JsRkoIeIwq 5+AnPZeEkcvPbwFVwbFNG10D5A3nRZN7mk9gS1IZ/XOgx3UBpEL6L/34jlWjxe8YrhcV k9mrlzZEb0xjs8OMILJiu5iE6ziGf28azZdY2atAUr6DdiJ/NcnBQ7ZINOVXS9nlOTpa viEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=S8T0vdim; 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=fail (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 f186si688654ybg.303.2020.06.17.14.32.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:32:52 -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=fail header.i=@linaro.org header.s=google header.b=S8T0vdim; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:54944 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlffv-0008G1-RU for patch@linaro.org; Wed, 17 Jun 2020 17:32:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37750) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfEO-0003sy-JJ for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:24 -0400 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]:45364) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfEL-0000I2-LR for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:24 -0400 Received: by mail-qk1-x743.google.com with SMTP id q8so3451448qkm.12 for ; Wed, 17 Jun 2020 14:04:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=otzI+vAMFZo6kJ+xiIJJ7YKSc6bvWOvFds+iAtOJpdU=; b=S8T0vdim/sT9wr1S5Vdr7TX0r1CXRya8L+qIoKGAskCjcFuyN1of8xNkjvDSanleBb p+8m3n3GQ9LKqAn5Rg7ZZUXhe89Jrlqlnu1ir2QSoH+oFHY4TheQigQUMzjuE5kgG1AQ zjrFI2eMvIQ5tFZJ4PQ2rTcOLnr6el8s3iYTdKwlPR3BtFVbM6yXg6iT0Bnh7lQ30eTV 0RZ4bmJvkT/BOD0bBUKmOtD/UCtE4Kmvdc+RkwAMtEN+DIl6Uo2/z8K0SOW9lW3a1+yD hkdEhzyb4eQXjzI25Me8swEawHHYYdsFFYuu9UWqp8D/NO2RWRprqTEkltdOhh/3/RWr 7vgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=otzI+vAMFZo6kJ+xiIJJ7YKSc6bvWOvFds+iAtOJpdU=; b=ZgUt0F0/50ddJYq/GwDRA6tMIHXz7WL8c9lrds+9CXnbaILzMhBc4J7fhCfDc1+8VY SLZG1DRGQQc2lHpdVaws/AsoEPM31YjqID4TwHMdItZ1rkoaVaEhNbdZ0wiX84vEENPR AwL97kLH1pcjqIdGFcOtLgvfdFEXRuJdGNYi64Ztbky+vEZj0bMeiry92UCzqLEUlaIs XxyM5pWkNKBIgrLNWvBzhJpDhlKyf34ov8RSA7Duc4CKE0UKOjBcYUfBt3pJ6aUvsHdY uxga3/v0KUOsWdcPK4OVM+DfQGPxPgJocsIgtqdUfycUP2TuzaxePV5bU1IU/YhpQnhw vS8Q== X-Gm-Message-State: AOAM533Nq79T5ssop9AI2ky82qiXtyg5Gg5exPAmJe8kiVoIDz8vcYMr mphqWAz9oBx7heL4Ue/tsG39CzxibU+p+Q== X-Received: by 2002:a37:d246:: with SMTP id f67mr575324qkj.300.1592427860391; Wed, 17 Jun 2020 14:04:20 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.04.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:04:19 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 44/73] ppc: convert to cpu_interrupt_request Date: Wed, 17 Jun 2020 17:02:02 -0400 Message-Id: <20200617210231.4393-45-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::743; envelope-from=robert.foley@linaro.org; helo=mail-qk1-x743.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robert.foley@linaro.org, Eduardo Habkost , Roman Bolshakov , cota@braap.org, qemu-ppc@nongnu.org, Paolo Bonzini , peter.puhov@linaro.org, Richard Henderson , alex.bennee@linaro.org, David Gibson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Cc: qemu-ppc@nongnu.org Reviewed-by: Richard Henderson Acked-by: David Gibson Signed-off-by: Emilio G. Cota [RF: Minor adjustment for new code in hvf_inject_interrupts] Signed-off-by: Robert Foley --- hw/ppc/ppc.c | 2 +- target/i386/hvf/x86hvf.c | 1 - target/ppc/kvm.c | 2 +- target/ppc/translate_init.inc.c | 14 +++++++------- 4 files changed, 9 insertions(+), 10 deletions(-) -- 2.17.1 diff --git a/hw/ppc/ppc.c b/hw/ppc/ppc.c index 0e7386ff88..89f92c4a88 100644 --- a/hw/ppc/ppc.c +++ b/hw/ppc/ppc.c @@ -89,7 +89,7 @@ void ppc_set_irq(PowerPCCPU *cpu, int n_IRQ, int level) LOG_IRQ("%s: %p n_IRQ %d level %d => pending %08" PRIx32 "req %08x\n", __func__, env, n_IRQ, level, - env->pending_interrupts, CPU(cpu)->interrupt_request); + env->pending_interrupts, cpu_interrupt_request(CPU(cpu))); if (locked) { qemu_mutex_unlock_iothread(); diff --git a/target/i386/hvf/x86hvf.c b/target/i386/hvf/x86hvf.c index 565594bc10..53515d0f0e 100644 --- a/target/i386/hvf/x86hvf.c +++ b/target/i386/hvf/x86hvf.c @@ -352,7 +352,6 @@ bool hvf_inject_interrupts(CPUState *cpu_state) uint8_t vector; uint64_t intr_type; - uint32_t interrupt_request; bool have_event = true; if (env->interrupt_injected != -1) { vector = env->interrupt_injected; diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c index aae2ef0ad4..084e158c34 100644 --- a/target/ppc/kvm.c +++ b/target/ppc/kvm.c @@ -1350,7 +1350,7 @@ static int kvmppc_handle_halt(PowerPCCPU *cpu) CPUState *cs = CPU(cpu); CPUPPCState *env = &cpu->env; - if (!(cs->interrupt_request & CPU_INTERRUPT_HARD) && (msr_ee)) { + if (!(cpu_interrupt_request(cs) & CPU_INTERRUPT_HARD) && (msr_ee)) { cpu_halted_set(cs, 1); cs->exception_index = EXCP_HLT; } diff --git a/target/ppc/translate_init.inc.c b/target/ppc/translate_init.inc.c index ac59648541..d06d9ff204 100644 --- a/target/ppc/translate_init.inc.c +++ b/target/ppc/translate_init.inc.c @@ -8541,7 +8541,7 @@ static bool cpu_has_work_POWER7(CPUState *cs) CPUPPCState *env = &cpu->env; if (cpu_halted(cs)) { - if (!(cs->interrupt_request & CPU_INTERRUPT_HARD)) { + if (!(cpu_interrupt_request(cs) & CPU_INTERRUPT_HARD)) { return false; } if ((env->pending_interrupts & (1u << PPC_INTERRUPT_EXT)) && @@ -8565,7 +8565,7 @@ static bool cpu_has_work_POWER7(CPUState *cs) } return false; } else { - return msr_ee && (cs->interrupt_request & CPU_INTERRUPT_HARD); + return msr_ee && (cpu_interrupt_request(cs) & CPU_INTERRUPT_HARD); } } @@ -8703,7 +8703,7 @@ static bool cpu_has_work_POWER8(CPUState *cs) CPUPPCState *env = &cpu->env; if (cpu_halted(cs)) { - if (!(cs->interrupt_request & CPU_INTERRUPT_HARD)) { + if (!(cpu_interrupt_request(cs) & CPU_INTERRUPT_HARD)) { return false; } if ((env->pending_interrupts & (1u << PPC_INTERRUPT_EXT)) && @@ -8735,7 +8735,7 @@ static bool cpu_has_work_POWER8(CPUState *cs) } return false; } else { - return msr_ee && (cs->interrupt_request & CPU_INTERRUPT_HARD); + return msr_ee && (cpu_interrupt_request(cs) & CPU_INTERRUPT_HARD); } } @@ -8905,7 +8905,7 @@ static bool cpu_has_work_POWER9(CPUState *cs) if (cpu_halted(cs)) { uint64_t psscr = env->spr[SPR_PSSCR]; - if (!(cs->interrupt_request & CPU_INTERRUPT_HARD)) { + if (!(cpu_interrupt_request(cs) & CPU_INTERRUPT_HARD)) { return false; } @@ -8951,7 +8951,7 @@ static bool cpu_has_work_POWER9(CPUState *cs) } return false; } else { - return msr_ee && (cs->interrupt_request & CPU_INTERRUPT_HARD); + return msr_ee && (cpu_interrupt_request(cs) & CPU_INTERRUPT_HARD); } } @@ -10656,7 +10656,7 @@ static bool ppc_cpu_has_work(CPUState *cs) PowerPCCPU *cpu = POWERPC_CPU(cs); CPUPPCState *env = &cpu->env; - return msr_ee && (cs->interrupt_request & CPU_INTERRUPT_HARD); + return msr_ee && (cpu_interrupt_request(cs) & CPU_INTERRUPT_HARD); } static void ppc_cpu_reset(DeviceState *dev) From patchwork Wed Jun 17 21:02:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190953 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp819253ilo; Wed, 17 Jun 2020 14:35:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwk9mbtSAEJkOvIyBA8dX78AGn3D6yRITQbObH4drryDVsioosWdmW3g8Hek2w/5GyU/mok X-Received: by 2002:a5b:58e:: with SMTP id l14mr1633299ybp.352.1592429759844; Wed, 17 Jun 2020 14:35:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592429759; cv=none; d=google.com; s=arc-20160816; b=l5OW/V2c9AWBr7hJYzDHVV2DK6m6FVc+lUQ4pMFKFukl72kGG8zJQGXQE8yqZqo1bs xkFgewQ2ZfilWC/L6VI+UZwYdKBf8m1nK6GFAt97XoVfVcnc8zC52CkfTXg7EVqT7al7 HlHFaUevN+tuWsGcMxPBoSh3ZdAMxhGT+vY/lNxy9vdwQAbxs/ZQEClE5u6Q0pN8lVQe 03JOhMrnhBCjMiBASQ8J2LC6UuF3NpB3VMhWtQ0Qm8gF+OvuNoK+eeT92Yme+s1WAgfy igpFsOgZt6loUDCgpeWNMeAeuHFBXbYpXM9EWgLjiBgUAoS12LH51i5xH//qjOZ9dU6E nJuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=cJAv+EbsefdW66yr8LjRtj+7g6Sr3jeK6hHxTVUkhJA=; b=keqTL39m6ioemjbNPCbYRt2907ufVUZ8YggbDdJE/rbOpsnXnpNzZFyesPqmXbOdFB lqQTcfog0DMbWiUUPmv43uom84S0CTFeFBOcEC/UwrK64POJf6J7l6b3+aetQMiWtuwH RDLFymD0P6fB05OUs/khLWrXGkSkrm8ezzPwFdYXHfW3gfXBlMxvp7IzL7acCgLFlKvd 2kzp+Ck85HelMpQYvcv53XrD4HcAUALwbhfcU0ppPYGjAm8ML52CY4aBi6EBmt8WVilM C8pQKXSsISlbvrMyTRevZJPWcoLU7G1M8lgOGqBiyvIHTl4aRHPeBuW4TnWVm+jWkUMB VdDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Z7nPbxN9; 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=fail (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 i205si621570yba.151.2020.06.17.14.35.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:35:59 -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=fail header.i=@linaro.org header.s=google header.b=Z7nPbxN9; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:35290 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfix-0003Wb-Af for patch@linaro.org; Wed, 17 Jun 2020 17:35:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37756) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfEO-0003to-Ts for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:24 -0400 Received: from mail-qv1-xf44.google.com ([2607:f8b0:4864:20::f44]:34515) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfEN-0000J1-2z for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:24 -0400 Received: by mail-qv1-xf44.google.com with SMTP id fc4so1776123qvb.1 for ; Wed, 17 Jun 2020 14:04:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cJAv+EbsefdW66yr8LjRtj+7g6Sr3jeK6hHxTVUkhJA=; b=Z7nPbxN9nrVvlMAqzjDNaj7kD9CZdQv9dyywyXt+Ph1BM/q33gxGtkIo2dCblV9zOU G+TubiU7MZCinD1HWYpJ0N0L/1R8N0wgimpk/H4fy1yW8XvPn9Ak3dUE0nCK5Hpmwb3V KAem1secs41VxsXUxefQL1BK/uVozQXpFefh1v3rLB1VcpNsrfo6qKACtcVbe5NoCSxD Qrou6/svXhi8H8xvbkKMl5XRi8b3ga6tU8OhHQ+5tPgWlEVYabuzcEFFaGoyVDGZTCd0 zG/Ce1+Gy3nKaR8YeF77hG5ktujcKP4+w+bSzIWUpESXwB3YZ/csxKc3OJj9c1ZqqMjz gagg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cJAv+EbsefdW66yr8LjRtj+7g6Sr3jeK6hHxTVUkhJA=; b=IegCyd8PKhDNZVOl+JjlAuwjhj9BIvH0yUn/4pqxj++J65Nz+Mu7BdGf7rDYQ1sjw4 brWjN2FnoS73Z0BQwMLENOR3KoRnw1igpPzQWQ2sTkky95q8xcZR5NjvQ1ykCuYQVcKo /Zp3xkA7yrmJPUCLSDEPh2nY501Ciw4OzwO2VS4nHdmsPaNCbkRMo3tv4TIetIHPNHab ba/x/PCMQSLiL3ziYAO/NxIRjgk/UuWiN1wy5voavNlA3neMDU/ogjiGOojgVJQsYhBl bnhWyijspdqKGFfUHlX75qBxl/OkkTDvNBW8DNJ+arAijrtf7Co+qi77NdO1h9SusfPv O3YQ== X-Gm-Message-State: AOAM531DdqLoZJiBmhzEUD7LZ7z3vruqBGCjKQUxt3GL67i8ILLPPRRh D2yD3IyN7is7CxEWOCLGquASom3O/pfgMQ== X-Received: by 2002:a0c:9ae2:: with SMTP id k34mr519566qvf.247.1592427861880; Wed, 17 Jun 2020 14:04:21 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.04.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:04:21 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 45/73] sh4: convert to cpu_interrupt_request Date: Wed, 17 Jun 2020 17:02:03 -0400 Message-Id: <20200617210231.4393-46-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::f44; envelope-from=robert.foley@linaro.org; helo=mail-qv1-xf44.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robert.foley@linaro.org, Yoshinori Sato , cota@braap.org, peter.puhov@linaro.org, alex.bennee@linaro.org, Aurelien Jarno Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Cc: Aurelien Jarno Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- target/sh4/cpu.c | 2 +- target/sh4/helper.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c index 3c68021c56..18f3448183 100644 --- a/target/sh4/cpu.c +++ b/target/sh4/cpu.c @@ -44,7 +44,7 @@ static void superh_cpu_synchronize_from_tb(CPUState *cs, TranslationBlock *tb) static bool superh_cpu_has_work(CPUState *cs) { - return cs->interrupt_request & CPU_INTERRUPT_HARD; + return cpu_interrupt_request(cs) & CPU_INTERRUPT_HARD; } static void superh_cpu_reset(DeviceState *dev) diff --git a/target/sh4/helper.c b/target/sh4/helper.c index 408478ce5d..1e32365c75 100644 --- a/target/sh4/helper.c +++ b/target/sh4/helper.c @@ -62,7 +62,7 @@ void superh_cpu_do_interrupt(CPUState *cs) { SuperHCPU *cpu = SUPERH_CPU(cs); CPUSH4State *env = &cpu->env; - int do_irq = cs->interrupt_request & CPU_INTERRUPT_HARD; + int do_irq = cpu_interrupt_request(cs) & CPU_INTERRUPT_HARD; int do_exp, irq_vector = cs->exception_index; /* prioritize exceptions over interrupts */ From patchwork Wed Jun 17 21:02:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190933 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp810713ilo; Wed, 17 Jun 2020 14:22:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyF2IMrTyjVGcef1iOiQmA6Di974RdiLQXc8FNxAybvTYyF7OXTFtp2UKXvikAT+Y/t+khS X-Received: by 2002:a25:da96:: with SMTP id n144mr1366517ybf.291.1592428954724; Wed, 17 Jun 2020 14:22:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592428954; cv=none; d=google.com; s=arc-20160816; b=Tu98fYmw+YG+9Ea/T5BT0TzmBH7p9yPAwgddiH4pSxyQhBBb0I2ZwWeqEcKE45ZwKv OrQ3GVQTdUGjDruOJQKTLw83ERHW8+YnctdEXSW0ijt0w1cZIXCCSH+MHGpMrlOeQmHl TCQ0RrQOA14oWVDW5XnfdqKPvS34MGtMkW5CrVcDJEGH2oVx/kV1vD5xkKLQqLd0f4hk BaEDWq9FzT0zLp99c5u/cFzs7Rn2/J0Tz/u4PgG6h5Al09/kGago6Uf6KB4R/858zdSg 8dRF+iFycOq2IOx55i32OwSJBHUsF9XAWNsA1dnO/WVFHWS9kTBDrS+jiMAKkHlo3N8N y0vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=UmLKvFwmPDwDSuHmbH2s4seTobiEOYrK5RpLD5v7Faw=; b=EOQ8qpHyPZ0UoBOgojNOUodXZu8NRV4nQkN+3ANs+DetRWgu9c154a5o3dfE2hlnuJ 3P8EVaiA/zU4qmYnCm9KBqSRb6QKpZrm2jrPIWh+AkBiuCWVDEFqpyNO5rtL47NbADox BeOV7PHYX7jAj6K2dV75g2exiuP9vUsCcr9HQqFE4+2ums7wBLPEqRqcndHpYmLiSprn jWYRt51vfGa8VIdudbSoTfI2cQA+FNgYEp1LS00zYsAtBEqPhiz+4cE56u6P+W7gc1u6 geHmXMLpAngMuDcm6X6XO2EPj6l3iOswUICkJyPYlB1qkBhRS44P13mFMMqOcBiw1F5C TXEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=wQf05jCF; 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=fail (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 b14si652759ybr.60.2020.06.17.14.22.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:22:34 -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=fail header.i=@linaro.org header.s=google header.b=wQf05jCF; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:45902 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfVy-00009E-5N for patch@linaro.org; Wed, 17 Jun 2020 17:22:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37764) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfEQ-0003xI-5T for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:26 -0400 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]:44356) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfEO-0000L1-C0 for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:25 -0400 Received: by mail-qt1-x843.google.com with SMTP id c12so2731224qtq.11 for ; Wed, 17 Jun 2020 14:04:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UmLKvFwmPDwDSuHmbH2s4seTobiEOYrK5RpLD5v7Faw=; b=wQf05jCFx79dmRxlxL1PmGqqSKLC9c6eW/LaqnWK1CEeBjBeKAVylzLKyCNhPWuqr9 WQEb2HOvQXd4R1qzMd4+51sszktA5wNJ+Pwm5ziHlQWacWZPvHUwXOkFWt6soOtXQOqa M41I9N459JII+PpvLLlGfIunnmSgnzSlgEKEeDnx8t/dq7Y75l7/rvGHJJY/bdGilZ4k Znilb63gDiZEsnrLkrkuSltwcNbX13z7KTrc2wLWKMi2lF3bGV3Z2ULhZUPmPOp822Wn paMdRH++xtms45qrLN1p3ulJlrWyC+stAf7ckC9rR3FbhwJqWmQuhCEdzOO1h0UvV4X6 3/Mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UmLKvFwmPDwDSuHmbH2s4seTobiEOYrK5RpLD5v7Faw=; b=fVahgagzvFlXyZVlSrfwAgVBV8J1jK8gWzBvqqk5B68McmiN2AXNgNcWAkgxqgKbcU oEfhgzScDxfjMGhnndgzVZ7Z58+q5jTO8c8OCpP0WsGPbKPBQkYNR616D7yZNK+u51sl lJdIiMV+RcO9P1Jk6iXdYH7uX58VIti38JT6+LuJt2WMSBZ08RiO5pK6xLRv38kC2PCc sHZRdInFlSV4bVEggO/TDjxa4zXUanhtdHA1NgUqZwU4FwiMlru33FXGmDM5Ih753l+s LAvIXpuoMgTK2SLwj1E+LOzxJia2GI8zqtnoloVBbEsgTOE8vhEO1qGsIDkkL9HgGwRT eAdg== X-Gm-Message-State: AOAM531zn+v7HWgxcgTj1hgmIuT5YQLCA6okFB35Sk9OwreFHE1R0vO4 wY6vg/4lL7Lo7OqN6faR3OrdsfNO03GTyA== X-Received: by 2002:aed:33e2:: with SMTP id v89mr1126320qtd.129.1592427863196; Wed, 17 Jun 2020 14:04:23 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.04.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:04:22 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 46/73] cris: convert to cpu_interrupt_request Date: Wed, 17 Jun 2020 17:02:04 -0400 Message-Id: <20200617210231.4393-47-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::843; envelope-from=robert.foley@linaro.org; helo=mail-qt1-x843.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.puhov@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, "Edgar E. Iglesias" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Reviewed-by: Edgar E. Iglesias Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- target/cris/cpu.c | 2 +- target/cris/helper.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) -- 2.17.1 diff --git a/target/cris/cpu.c b/target/cris/cpu.c index cff6b9eabf..6d7e266042 100644 --- a/target/cris/cpu.c +++ b/target/cris/cpu.c @@ -37,7 +37,7 @@ static void cris_cpu_set_pc(CPUState *cs, vaddr value) static bool cris_cpu_has_work(CPUState *cs) { - return cs->interrupt_request & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_NMI); + return cpu_interrupt_request(cs) & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_NMI); } static void cris_cpu_reset(DeviceState *dev) diff --git a/target/cris/helper.c b/target/cris/helper.c index b5159b8357..67946d9246 100644 --- a/target/cris/helper.c +++ b/target/cris/helper.c @@ -131,7 +131,7 @@ void crisv10_cpu_do_interrupt(CPUState *cs) D_LOG("exception index=%d interrupt_req=%d\n", cs->exception_index, - cs->interrupt_request); + cpu_interrupt_request(cs)); if (env->dslot) { /* CRISv10 never takes interrupts while in a delay-slot. */ @@ -193,7 +193,7 @@ void cris_cpu_do_interrupt(CPUState *cs) D_LOG("exception index=%d interrupt_req=%d\n", cs->exception_index, - cs->interrupt_request); + cpu_interrupt_request(cs)); switch (cs->exception_index) { case EXCP_BREAK: From patchwork Wed Jun 17 21:02:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190956 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp820075ilo; Wed, 17 Jun 2020 14:37:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxzspv0xvlQFopApHUbBVzEHCWUiKf0EAVqD0ORKIJPP+8gCXlyObi9MAoyE2ZAmqSi/OW X-Received: by 2002:a25:2f94:: with SMTP id v142mr1605097ybv.459.1592429845181; Wed, 17 Jun 2020 14:37:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592429845; cv=none; d=google.com; s=arc-20160816; b=P3o2CUN54dWarUlli3b64O6xbiYGTFeGaoVlkwCZJ3pYIDgBZca35KkQwSPCOpIuP6 XKACGKVMp8P9BgQZw9MJgVyIXcs4aUzd2BF36MUCZ1bvMeJkt7JJlSe1gI9qF6iI8eBH kuLsvZsviALOY3pGyGeP3uP+CPb2JFYscCNoAaUzrU56jFMVHcZywocnqQ2+An25FcRF mgob7s+wcEnsfFPGjSWOHKUbBZA/2oXtwtxDr2kGahZ1v7sDOepJcOy5ydFUUUcPcaj0 ZYTSpm6FQb1q1TS71Ag0Ql+Z68F+0eD6A5b5dTT0e+DbNoEfmtHohsaadol0IT2DXo+7 bw4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=oS4OFCHOXLNPVShms1TjWbnrC15wr+ouKwB5TcDXaeE=; b=LxYnbieX4yVPXmQ9tfzzNOqqDQRjk2GjBcMO+WYHq63WWajy8wdpzdc+LhnSBCYZzX xdreTv2glj/rAnyh02ulElf/2jH1ytEo5JunZEaLrRPs4g1tYkZXku1YePbBD5ToFHk/ 92a3hMYvlK7O09SSrqfkyXp8f7skgMxzJjMo7dYcKmPTb1omGZk6fVOzi41zI1PUi2JY rJUU3vjCxwWMGqliLTNaHH3L7h8CWHSoQHRxer8IGeAQgHaXeZGei80A4c9Mb9q2qTRF 0jH4z5BlMiGllUHZ95NKVs90R4qLsuXNVZIo6cFNKfW1/L2lGlp+bbglr8VHdhxcppt6 UH8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=GE0AA6F0; 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=fail (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 x2si868749ybt.253.2020.06.17.14.37.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:37:25 -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=fail header.i=@linaro.org header.s=google header.b=GE0AA6F0; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:43962 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfkK-0007qh-JM for patch@linaro.org; Wed, 17 Jun 2020 17:37:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37790) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfES-00041j-B1 for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:28 -0400 Received: from mail-qv1-xf42.google.com ([2607:f8b0:4864:20::f42]:33709) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfEQ-0000LR-Hu for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:27 -0400 Received: by mail-qv1-xf42.google.com with SMTP id d12so1775865qvn.0 for ; Wed, 17 Jun 2020 14:04:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oS4OFCHOXLNPVShms1TjWbnrC15wr+ouKwB5TcDXaeE=; b=GE0AA6F0qghZkTHfPxeGxcc04dzhmoqfZtJMXikX8yoIn+CxuNQ9j94pEpjoZ8fMBx IBSDa8D0i9ekrXE+rJP+qNDmVFN/MLpPNG4EETYPdc6TJpbyqEQg8tXRV3qQeTc+QhtD WAIyLdjtp0HZ+czVWcizdGrk5825Y1Ze/MIeWuSZuHLqYH2A7G0RIW+9Pu+g1svJNNxm y4r3wdr+f/WLp7gqW2z2+xeKXC19oLV3tJTr6/6/V4IukBqzPJ9f/md5wgb1xq1OJoKT kNxX7iwjE8PwLyFYSD2Hh6AqqXTwZnefhQTmg4ymy5RcFhQ3R+UpFnNY1UTKKPCRYbMI 7CVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oS4OFCHOXLNPVShms1TjWbnrC15wr+ouKwB5TcDXaeE=; b=ZSmm7x55lxeLlRJixHDcMK8E4sRvPrjxl1KWCUZpCs0rIDAoU/2zK8WueQzo7348IU jHAC4xl4Bfg6TEtSQ8NcGQKx//cnyFIUbCskLhC0X9Oqgb3+x1Ju7Axa3IcG6NHtlR6j 6JbdGVxT2tICLCJNX+eVPw+efrLQF63C32nZeYgkGxwcCoU5Ec0F24ffxb6ii7OffQbV dW6XTL0I+U3CDwWpllJIcDIdUef4EspmH3c247x5SLHSNlo6kP6Kz30IvMabs3ammkzr mWHlRCk3DMv2dwIpxZXg2U/f1Kqtx2BpCyfBPQ4ss0wbjFceGnL+3apDlYzJr72AtqRF gYsA== X-Gm-Message-State: AOAM531jNa/tqcGbpqUs7CzMxWhozpEuE8rWKjvC/Ed1E0yXDw3MUydC T5Gb2iucIQ1jwfo9d51xp5F/dB5MkfQjLQ== X-Received: by 2002:ad4:4851:: with SMTP id t17mr599131qvy.160.1592427864494; Wed, 17 Jun 2020 14:04:24 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.04.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:04:23 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 47/73] hppa: convert to cpu_interrupt_request Date: Wed, 17 Jun 2020 17:02:05 -0400 Message-Id: <20200617210231.4393-48-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::f42; envelope-from=robert.foley@linaro.org; helo=mail-qv1-xf42.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.puhov@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- target/hppa/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index 71b6aca45d..287055f96e 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -61,7 +61,7 @@ static void hppa_cpu_synchronize_from_tb(CPUState *cs, TranslationBlock *tb) static bool hppa_cpu_has_work(CPUState *cs) { - return cs->interrupt_request & CPU_INTERRUPT_HARD; + return cpu_interrupt_request(cs) & CPU_INTERRUPT_HARD; } static void hppa_cpu_disas_set_info(CPUState *cs, disassemble_info *info) From patchwork Wed Jun 17 21:02:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190935 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp811492ilo; Wed, 17 Jun 2020 14:23:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvvihaSRJOojghkzsOA9SN/sqPbr6h2GHMTwaTB8G6OcMgg5sgL9UNJUAZfJ0nVHLtoqPK X-Received: by 2002:a25:50d5:: with SMTP id e204mr1452208ybb.72.1592429023775; Wed, 17 Jun 2020 14:23:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592429023; cv=none; d=google.com; s=arc-20160816; b=tcVOqpog2HZLmAaEr7priW9wNZNCbCi8AO81rIMUqNmEnORKBpPEX89fJUxWe9FWgo Xjy3s1HMnFhLFftDmP0v8h/LkM7tGNFWefw1lLALkybVpzBQrT8fNbf12nWyhgTy09VV bOhH0IT4LfEVCLetzxa0LB0tfmETdt2CBETJJ7+Xolq34PnQ9y/TeeXc2y9GTUo4F4/y R1giNhhoI32tjOGOlMwdlLnmlrs6Y0QRBFP/biMbx/0agv03pSX0XKiKcPszrxIC76gI SPpmoLGm783d+UXYXihLeiX8L8NM2PEx3ms6m1grGVmjnt/b+i1KNQvxPWGlG8R9mglY f7LA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=leGMjXpK2HH4jKgWKo9xRsuJr3HkPgiK0233yCfpGgs=; b=iqXXK5hf+GFr8d+OIA6nipryi3uXcs+RTUa0VlApOhMEciK//4wwUeA/kJZYVYNcWi u86lXFfFOFi3DLPW7aCwWdmRl9oyRLX1wnnRKYHeBmYIH4Lds0WjbOQ0pZouLHz1Zwl+ WmvUPg5BH6r7o6VNH9OVaE7HgV1dnKnaL2jC50OAf38CSlZct/ambOuygJ/bzoFQgC30 1bfTY2eT2Rre7P2fWQQT1PiQ9F0hBwoQNwr0u3q8m46J6DZMZ82LMXCeHyOknplqhAqk KsynOp3lyiDaYFZxBsp6F2J7aKaaHQmZkArA9ksfYJVbYU3pB0ezZIwwsPPuClNIe34P QjCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=oudhz65T; 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=fail (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 z2si664736ybj.179.2020.06.17.14.23.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:23:43 -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=fail header.i=@linaro.org header.s=google header.b=oudhz65T; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:54372 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfX5-0003Zz-6k for patch@linaro.org; Wed, 17 Jun 2020 17:23:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37800) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfES-00042s-Sq for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:28 -0400 Received: from mail-qv1-xf43.google.com ([2607:f8b0:4864:20::f43]:43611) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfER-0000LW-2B for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:28 -0400 Received: by mail-qv1-xf43.google.com with SMTP id dp10so1743591qvb.10 for ; Wed, 17 Jun 2020 14:04:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=leGMjXpK2HH4jKgWKo9xRsuJr3HkPgiK0233yCfpGgs=; b=oudhz65TfyHpYuLR9i4rIICUzB0r5nPw7a9UiTrsDIbg+PrX1eHmJ9g2FxhATNfFXq 1l0oiP4J4+NJYjM/niXRgp3M1TDttJ0zA1iy3uoVls2Vr+ZfE2p7+fIlY9Luq6z6EW1h 09mFs1yuIMJ5CUCy/HnQz1NmgoNKXqFVKE9d4K9FSJKbX6Fm1P77ls4jACovft/oz0/2 TfI3ahHzDeTEMqhCfthIWak7OXZpHKzsFXQdp1LqUb6QoQY61ph3hJGxmH43H1x/pgky QVzlTCA41LVzHIVOhk41BkYTp/if87Z5DJSlt3elJSwUGjKZgSi/c0WcupUwNX/BLJjx TOBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=leGMjXpK2HH4jKgWKo9xRsuJr3HkPgiK0233yCfpGgs=; b=K7qiQ32SPaUHofLeqgqpIdt9rD+9/DGWQnpCaWOrVzWMFVd18cZyEyFHxqVuxCJT7X gYngDmtIbGkNS2F4qHFjn/OnExWJ6/B37EyNU14W/G+0o72sMx4ZHyAxOPWEbcacark5 5sJ6SRrsPoSC+XRKXXwSBTIZmXSChzQq7RGQPITm7mBTHc7qx2hOm8OtPxIpm9BpVbSj aAIDVo20cghmb26x+81TbSrhILO45UUdJTHqGxUrNX4HFnx3M8oYuIt3csOukSb/Gf8Q 2ofCtof/yLPoLeD62anr4fnD+EEnQO+iI5EWDtMJPcCs23wcfT7kUFOwrOuhc6pOPesc CPAA== X-Gm-Message-State: AOAM533k76+nd8y3I50KnmwpAA3clpdKPRw/qsNBPC+MekObHUn5U6N2 PbQcGVXgrzK0mqYgrPg9ayvtMQohY0nYQg== X-Received: by 2002:a05:6214:713:: with SMTP id b19mr536025qvz.199.1592427865845; Wed, 17 Jun 2020 14:04:25 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.04.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:04:25 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 48/73] lm32: convert to cpu_interrupt_request Date: Wed, 17 Jun 2020 17:02:06 -0400 Message-Id: <20200617210231.4393-49-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::f43; envelope-from=robert.foley@linaro.org; helo=mail-qv1-xf43.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.puhov@linaro.org, Michael Walle , cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Cc: Michael Walle Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- target/lm32/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/target/lm32/cpu.c b/target/lm32/cpu.c index c50ad5fa15..9e7d8ca929 100644 --- a/target/lm32/cpu.c +++ b/target/lm32/cpu.c @@ -96,7 +96,7 @@ static void lm32_cpu_init_cfg_reg(LM32CPU *cpu) static bool lm32_cpu_has_work(CPUState *cs) { - return cs->interrupt_request & CPU_INTERRUPT_HARD; + return cpu_interrupt_request(cs) & CPU_INTERRUPT_HARD; } static void lm32_cpu_reset(DeviceState *dev) From patchwork Wed Jun 17 21:02:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190954 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp819614ilo; Wed, 17 Jun 2020 14:36:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNFNSNXLZWuCGQ3AjyyYp+zCi77ZaFsvsGZthybkKtcoURrS6Ko+p4CXlgvOSaZDWqo5il X-Received: by 2002:a25:5d04:: with SMTP id r4mr1440007ybb.290.1592429797834; Wed, 17 Jun 2020 14:36:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592429797; cv=none; d=google.com; s=arc-20160816; b=xgigPRM3s8OLJErJRGKg6QVBts1vhNjiGhwkl54HV6Rf64Z0lVbg2QIHwmeR2Yir8c 9hn0dx1DggEeWCT3Q7jojKjQj9T2O6aXrmV2WJz4czHlS1v/zs14A3cFvnzaS1wX4431 m7Gav9OuXqvWXcmxZOpZw3+IZrMkZilp5ueUcuTkDZ50cW0zZOldgTYgk24/hzKxNhuU aj+LEkJd2yvWUtK00PYFq9rX4S0kCWlj3AqGTAtfuI2kqN+IAGZKRSiaZpO5wSCs0d1c /RbTX3NHrB4TrRRKr+0ZzWdnozfoxhwPokxcgxvYmg9HFjkJ1VZw9vPCVkWbJhxsBdpr /xyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=lvs+qOX6bs/iZi7N2ZR8e7cxDlqBQWqbjCB2CJTYkPk=; b=u6PCvUuSBRvvo+Pdh3j2hlAcZlxuHY91G7xwK9XChRodSTMUhDbU4SMxtpNQJtMZUn CTeG1kcRDp8JLxpOKkHmpwHFVc6wZND4m1iVOOdNlktL2uVZqJRKlsQGHsRauVf/eypY wEoHSEiUa9SpyruG+7hV2/CqklSxQmIZ8Mb8qcJX4k9fq6ed7YTUnjtn2htsqJslCU+H /cB0Z2y69CmcqWFQ03Qx8tbCJfuyAWgFgwE4ZYAhcEwjEJPbogmbiQF8vfxPAinEyCxQ 3OzOzo3H1FQw1RDzF2r8s23nc7E7IQ9r9jmUKBNPd3tfULQXttIrUqFac3mK2AHTI4BN BGGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=F6FxaP1V; 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=fail (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 81si659487ybc.41.2020.06.17.14.36.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:36:37 -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=fail header.i=@linaro.org header.s=google header.b=F6FxaP1V; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:37750 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfjZ-0004cP-8D for patch@linaro.org; Wed, 17 Jun 2020 17:36:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37810) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfEU-00045D-1K for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:30 -0400 Received: from mail-qv1-xf42.google.com ([2607:f8b0:4864:20::f42]:41389) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfES-0000Ld-7C for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:29 -0400 Received: by mail-qv1-xf42.google.com with SMTP id er17so1756650qvb.8 for ; Wed, 17 Jun 2020 14:04:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=lvs+qOX6bs/iZi7N2ZR8e7cxDlqBQWqbjCB2CJTYkPk=; b=F6FxaP1VKb0Gp1RxkTSgeFU7z5xnH3WLU9yvrvrXFeftFMOjWOT6axOqQviQ1F6OHs 9ROzfE9VvuQUivb+EWC4tzJ08Iy56H54YmMZQt4s6tMoW5Y59eKORw0xTJg2xgXQnrTg 9LajHXVdIlB6e+cj8UMyC3VIwpAKMDBQDFtmdA8zKGWvWoYjOn89xd17JEfYQ1UB/7Ox pZR8j1Ngp1YcyR2DUCy8q3Q/BUP3ZL8DOkSry8GyUeL/hv5zbljxe8WGNuLy6lGc8gYr kefE0wPQOPrLkepve5JkKtgB6utrxmgFhtC3LgfzkYyhsESYQJjcNVjZ+uetAO7pAKKM 6FyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=lvs+qOX6bs/iZi7N2ZR8e7cxDlqBQWqbjCB2CJTYkPk=; b=F4gDC2cPD4JewJcVqvREGZgnQYA8pknrY5QIYt3OSKaLqH93chu+XJXEcvpE5mmSSf i8kfTnhv0crXN6Nr7EOYSpbcyq0DoZ87atDFNUpk6fFQdGJ/BgkvcNfePkcuQjm+V1P0 yJH+vTD6diOC2xB6GLg5VDQPRA8of/jiMXbUm7hpNOpEbX3IVY6VGu0pojwVZxGHUXWB SwQKyRdahN7Or0/IltDg/hAXEq8YWsvt4sB5BtZDp7FXmsR9dXhFeRIsv+10772VW8lW +tFoa9viusYy5aKZUQ0lHUtI2spw1rt6fbrU5O7n0Ohvi+XrfQB9yfw2XsqdptHWKKzz buTQ== X-Gm-Message-State: AOAM530A4vNwvKoxly/AEo6VaZbjRV3fD26wSERrL26QcBgm6NPgux1g adpEA9zT68OgVKcsd8jyzsenFMtV9TEJPw== X-Received: by 2002:ad4:46a9:: with SMTP id br9mr557202qvb.246.1592427867100; Wed, 17 Jun 2020 14:04:27 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.04.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:04:26 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 49/73] m68k: convert to cpu_interrupt_request Date: Wed, 17 Jun 2020 17:02:07 -0400 Message-Id: <20200617210231.4393-50-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::f42; envelope-from=robert.foley@linaro.org; helo=mail-qv1-xf42.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.puhov@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, Laurent Vivier Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Reviewed-by: Richard Henderson Reviewed-by: Laurent Vivier Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- target/m68k/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/target/m68k/cpu.c b/target/m68k/cpu.c index 72c545149e..f2585154f5 100644 --- a/target/m68k/cpu.c +++ b/target/m68k/cpu.c @@ -33,7 +33,7 @@ static void m68k_cpu_set_pc(CPUState *cs, vaddr value) static bool m68k_cpu_has_work(CPUState *cs) { - return cs->interrupt_request & CPU_INTERRUPT_HARD; + return cpu_interrupt_request(cs) & CPU_INTERRUPT_HARD; } static void m68k_set_feature(CPUM68KState *env, int feature) From patchwork Wed Jun 17 21:02:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190961 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp821945ilo; Wed, 17 Jun 2020 14:40:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZGyJ+3LkSfx0Du6mnnfgBiHkvFJF9lOStrJKjQhK4y1k79RS2zeXBplDnk4WPk162I1DC X-Received: by 2002:a25:694d:: with SMTP id e74mr1592535ybc.195.1592430037690; Wed, 17 Jun 2020 14:40:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592430037; cv=none; d=google.com; s=arc-20160816; b=dWwqPdzr/yln0KM7vi8GkDlWvK1vy8lvlpvyz533zJmc+1f0qLU5uUsGHUJjgnoq05 78V0WitqNlfAC28fc8Q3axu+7fe/qFH6k1fRlKa8Koq8r92rOC4YMieHDkosXgfoVuRQ vnHf96j9QEbzvb8IaMECYQkmKocsL93ZOULevqu9PObPshXnfVbbsoV6HBcU7VPOW5IU mBxSQ1BjBZcBkG8Bnr5ZjY4yh8lL0dsl99DZe4aWC9VZWFbLSoI1r5UTOYmbrHDj5SVV N++Kcj2VCHDBdjkRCBruJQ47hkRoHZuYRwCbCP8MmwIzzDD8toyUHRVb3pkv6zjF3PMG +c3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=8Q2sL8ohmf8wunp2u0YbDC2Iqv7PQMpqvb2Mr0aPlxc=; b=z8anRZu+ZN7l4TyOms6lHi9xWQIdI+kxMH16tnBbA4aM1nS1tQc5dmJ8QRIh7suijh GLnzHHrrIsx3SLOR+uTwsYMunWy9wQLnMZUS7O6EI5n2EWWf3Hp3KbKo1CiDXzVPPZyh sMxc+zFejMMKSERIJHQPMvbEqdk5dJhRfjqa02x38mRXKk/9qFIrZ8udna8xN3vgrdjT YqJwCusyqxYSHPlCiU7am860lko04NJoJNjUl6jdDMQIFBm2Yovv3i+5MhKa1YaOsCpJ dvkmdWcA1HPD/EPaf2px6uvLH+qQ6pwvzknTZxpy8G/4ORxFrgEUK+zO8YuumMDYOVNU oe4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=gNYKdFfH; 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=fail (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 s88si838898ybi.345.2020.06.17.14.40.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:40:37 -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=fail header.i=@linaro.org header.s=google header.b=gNYKdFfH; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:55628 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfnR-0005EV-1n for patch@linaro.org; Wed, 17 Jun 2020 17:40:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37824) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfEV-00048Z-Ih for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:31 -0400 Received: from mail-qt1-x841.google.com ([2607:f8b0:4864:20::841]:34438) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfET-0000Lq-NS for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:31 -0400 Received: by mail-qt1-x841.google.com with SMTP id u17so2787124qtq.1 for ; Wed, 17 Jun 2020 14:04:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=8Q2sL8ohmf8wunp2u0YbDC2Iqv7PQMpqvb2Mr0aPlxc=; b=gNYKdFfHfp3hprbcJcWx41N94LYYAkf3UbpgGT651vSBkXvSLCyegKbcfSdCvI5B6H 8V1qZPe2JIxzxZOFKRF8vqk9h6aLJtWXYLnDeu8qFKzReZb9l7IUZbkT1c5wcWGZMpSi pYK6TRseneD8eztvJOmVmxEenNRly046sp7Feo/N8jjbR1vo7JWyBwB5VCxuvxAgOtEx RhHRkuG/qgFA7CVapVJ5X3Zx7JUMiOlwGdQ5DUqSekapIdwoh36N6owZWY01KW2PZxC5 S4VJ4EgCaTKNTK9P9dBtQeTxgy5OnrOc4EVwYV/Vjx00SJR9q9S+WuQKYYe507vEDcuo vZwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=8Q2sL8ohmf8wunp2u0YbDC2Iqv7PQMpqvb2Mr0aPlxc=; b=LGne6plKbc7Nb2Nmwgj1f9tNCoT2EcLbT3hvpnukaZyC7adh3W05WFtjt5twSZfX2S cn2eQaer47U0ijdU0dBLT2Mlup0PJcXcqcSqaZpli9lUwKjXhjqTT4ZQcgGBvUWk9EB3 5nRDimBL1vrW/VB4esb1SKi4ogwpM59ad5GZnAELcUWi2tQviEEGPCtVxpE09x+tlgB+ spj/fVJ1ZryHtvR3K//7qcfzc6hwg6oEfF/BgvzADaHrI5DpOLrYQVdKAD9Uy8zss8FV JoS4ePqhXMl7M/fJ+QaU+VdJ2Z0K/FWl+9o+3IryBpEUOTv9E0M/UwCSbxDV45W+iV1r jHgw== X-Gm-Message-State: AOAM532Zu4taQvIigJPZM5lGrSzBHgX1OiZ3ZoxaZ2y927n/9Sx78LH0 l++KiNG7zJWkmtLQP8MbPVIl/vvJPAkgRw== X-Received: by 2002:ac8:5354:: with SMTP id d20mr1106683qto.363.1592427868582; Wed, 17 Jun 2020 14:04:28 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.04.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:04:27 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 50/73] mips: convert to cpu_interrupt_request Date: Wed, 17 Jun 2020 17:02:08 -0400 Message-Id: <20200617210231.4393-51-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::841; envelope-from=robert.foley@linaro.org; helo=mail-qt1-x841.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aleksandar Rikalo , robert.foley@linaro.org, Aleksandar Markovic , cota@braap.org, peter.puhov@linaro.org, alex.bennee@linaro.org, Aurelien Jarno Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Cc: Aurelien Jarno Cc: Aleksandar Markovic Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- target/mips/cpu.c | 7 ++++--- target/mips/kvm.c | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) -- 2.17.1 diff --git a/target/mips/cpu.c b/target/mips/cpu.c index e86cd06548..761d8aaa54 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -56,13 +56,14 @@ static bool mips_cpu_has_work(CPUState *cs) MIPSCPU *cpu = MIPS_CPU(cs); CPUMIPSState *env = &cpu->env; bool has_work = false; + uint32_t interrupt_request = cpu_interrupt_request(cs); /* * Prior to MIPS Release 6 it is implementation dependent if non-enabled * interrupts wake-up the CPU, however most of the implementations only * check for interrupts that can be taken. */ - if ((cs->interrupt_request & CPU_INTERRUPT_HARD) && + if ((interrupt_request & CPU_INTERRUPT_HARD) && cpu_mips_hw_interrupts_pending(env)) { if (cpu_mips_hw_interrupts_enabled(env) || (env->insn_flags & ISA_MIPS32R6)) { @@ -76,7 +77,7 @@ static bool mips_cpu_has_work(CPUState *cs) * The QEMU model will issue an _WAKE request whenever the CPUs * should be woken up. */ - if (cs->interrupt_request & CPU_INTERRUPT_WAKE) { + if (interrupt_request & CPU_INTERRUPT_WAKE) { has_work = true; } @@ -86,7 +87,7 @@ static bool mips_cpu_has_work(CPUState *cs) } /* MIPS Release 6 has the ability to halt the CPU. */ if (env->CP0_Config5 & (1 << CP0C5_VP)) { - if (cs->interrupt_request & CPU_INTERRUPT_WAKE) { + if (interrupt_request & CPU_INTERRUPT_WAKE) { has_work = true; } if (!mips_vp_active(env)) { diff --git a/target/mips/kvm.c b/target/mips/kvm.c index 92608cfe15..682b969579 100644 --- a/target/mips/kvm.c +++ b/target/mips/kvm.c @@ -141,7 +141,7 @@ void kvm_arch_pre_run(CPUState *cs, struct kvm_run *run) qemu_mutex_lock_iothread(); - if ((cs->interrupt_request & CPU_INTERRUPT_HARD) && + if ((cpu_interrupt_request(cs) & CPU_INTERRUPT_HARD) && cpu_mips_io_interrupts_pending(cpu)) { intr.cpu = -1; intr.irq = 2; From patchwork Wed Jun 17 21:02:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190964 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp823702ilo; Wed, 17 Jun 2020 14:43:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz6JJ5+qtvvM9ef3jNOYeZCqfXh/zj9ktLEaRIupdoIjoWG6t8Wr8udtkm+sDeh7ENpRgli X-Received: by 2002:a25:50d5:: with SMTP id e204mr1563286ybb.72.1592430215204; Wed, 17 Jun 2020 14:43:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592430215; cv=none; d=google.com; s=arc-20160816; b=PQAqQFokdjidYUrDRQyxj8fjS8Fzjs4WhxG54IR8gA+IV7JV6q0nWSJm5pgN74+svb kHzDzY8xIO5A2zj4JFnclTNGOmzGLgc4NHHLEenqSE42qkuaW91jGUot1HcCcJrSp+kR faOoTHzA6p2FBpayxbCtp1Y+TQ1RCUcWxwRU094EM5HKBElWV38N6j8DaZ46ZU8PHYxt XKVM4Cs67x2YOTrdiMle8U+nZynZ8tZr3ckJe/gWJaRvjSixNGSR4MNODyAmOkbCQjbj XE9AgciMBZ0olakdRojQCGR7NY5SXAo4v7Ds70DgR5RkY5q/cWTuSqEIl9yS7pdbUHNz /d3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=1YbnvmhNqAhmF66BGNb4cMj4pII5ByUEQJWinpDd9pc=; b=ofP/6DRLLTlnFlywfD1hxv8JBTVmrSs8t4QwkH4d1CKq5aPyzSJiHPiR3wBhzoxlkP nk042wEYWrLT8ySV8KNgMKvSYINhgRKu5CyAjzFX1wj1q6+pd0qnMfb5i98n4V3w0fZY L9t9owLuOZWOK3zW5ECrmwX52DcuZ6GG1V5uQbLdv6ddFqkw4h6pDquKcG329k8ToPmz haqIi+Zjan9jfFQTw4DhpMhSYvH3fo2caTFATsef0eUPPW6ANPUhuP2i37xInwc3vn1l uf4kuvnda+FVD1Vx1WXDez56alIthqYM6l4wTtzw2pLk5jdTA6/neBUBQehU4ZLjooTw ELYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=e+GjfbsE; 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=fail (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 m81si731162ybm.248.2020.06.17.14.43.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:43:35 -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=fail header.i=@linaro.org header.s=google header.b=e+GjfbsE; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:36034 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfqI-0000SV-M6 for patch@linaro.org; Wed, 17 Jun 2020 17:43:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37838) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfEW-0004BO-Uf for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:33 -0400 Received: from mail-qt1-x842.google.com ([2607:f8b0:4864:20::842]:40079) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfEV-0000M0-88 for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:32 -0400 Received: by mail-qt1-x842.google.com with SMTP id i16so2751709qtr.7 for ; Wed, 17 Jun 2020 14:04:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1YbnvmhNqAhmF66BGNb4cMj4pII5ByUEQJWinpDd9pc=; b=e+GjfbsEEWzjau9GWD7/LJJe6jl/qjLCZqkpLJHYyjzsJqyO3f0cixECvSSGzqp9Fv G9IinPhQwS/UGqE+pQNKPLAgGDSAEJ+pDK/DHc3spOuTophvZqca4C44wKfjsF1CjywB VOBMRFuzDPOX4aEShCVrzdu/a9VFEZrsnwnwYZFq16sjd1rV7/+Yfz6r4Dl9CGkT/PAK g4xvZ0CiO1EV1pfahapwcAg9A5Y4WwW8fUlGEv8trydWXXjvr+Attir7XyGruwCdg6dR u5C1G8PlTKVwLMc9W8UCdXUXPopc0Ri+EtPAXl+i87HdBDJvxFU4z2OiwbaFsaT/v9f4 kL6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1YbnvmhNqAhmF66BGNb4cMj4pII5ByUEQJWinpDd9pc=; b=S90qeuMzjgy/W3Fp2fwM1DeUQmNguefCJafxp9ItBgr8SPsmBGpzL526L0ZbwxS/BI EutJVrtzU8arG0pdfF/cukaB/DllQEbAHqpeIkLDEVOzf3x4sgUbvmCXyyVRMbr2QrAx lwb4JNUttR1PEsb6cFTR4Kb9Mc330tRAR/Vd6L94/kYQM+J7ylawseyqRy6OI/8JugNK SUmTkGNyiTHfbZET00KQeYLZJlZh821l5u25ica9vVLrrx5BgqA86wROSDKUqzsMH2Fq 2cc/AYyOkqMZ7L8qTZ8D379EMkzHl86LMQQti4YLSw4B9WLFR6hLb90tY5b5Cdqx2f45 g0Gw== X-Gm-Message-State: AOAM530D1LbObdl0nw/2H4Mourj1grhV2g+Cd4bFdQJSIh/+aWCxgmT9 xHVWqW2+1Ci2yxqD6MFKs/YGa+IDJ6UC3g== X-Received: by 2002:ac8:40dc:: with SMTP id f28mr1094990qtm.63.1592427870017; Wed, 17 Jun 2020 14:04:30 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.04.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:04:29 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 51/73] nios: convert to cpu_interrupt_request Date: Wed, 17 Jun 2020 17:02:09 -0400 Message-Id: <20200617210231.4393-52-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::842; envelope-from=robert.foley@linaro.org; helo=mail-qt1-x842.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marek Vasut , robert.foley@linaro.org, Chris Wulff , cota@braap.org, peter.puhov@linaro.org, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Cc: Chris Wulff Cc: Marek Vasut Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- target/nios2/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/target/nios2/cpu.c b/target/nios2/cpu.c index 8f7011fcb9..fe5fd9adfd 100644 --- a/target/nios2/cpu.c +++ b/target/nios2/cpu.c @@ -36,7 +36,7 @@ static void nios2_cpu_set_pc(CPUState *cs, vaddr value) static bool nios2_cpu_has_work(CPUState *cs) { - return cs->interrupt_request & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_NMI); + return cpu_interrupt_request(cs) & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_NMI); } static void nios2_cpu_reset(DeviceState *dev) From patchwork Wed Jun 17 21:02:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190944 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp814802ilo; Wed, 17 Jun 2020 14:29:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZICbJ8G8fy3jvYdPmbvKF7GeMPJW4Y33tAhUmHIGRxr/2unmqz6Dh74bMSco/Syuu98KW X-Received: by 2002:a25:5307:: with SMTP id h7mr1407878ybb.464.1592429355933; Wed, 17 Jun 2020 14:29:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592429355; cv=none; d=google.com; s=arc-20160816; b=MPCOzbbjKGBQmTViLm4NP9eTI4QcPj35Eh4R7eQPCmhfgdi+HpEIyl9OMJ8hMX9lUh OE5cG3gmGLxXe2TO8rZpECWaWRLBkWx7nascLvOPX0GYTucE3UgrUw0RlIxIC0Jrf5sY ArhRz8R4igLKAXSDnDeT521wq4iV6E0gx2diKZAcQWuNFRmyTUYUVScPwm4i1+USZYBZ eEFqnT5EY5/ODt1xSGvtjGqNsFSIwo+i0SWyQOJXVW86mqCSBjyBqFaKSYObJJqJbyoR u9wLk3PTK9gXDwfApFSXDBio5nmUYlT9RHVILUY00+/bAYVCOGgouG6TRc/2IAz/anyg OSOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=ljUyAp0qqYElrS8vzQ49pxqGCe+fOWSwI5BjIxDRmqQ=; b=AIRL1HB5RMzbVt+0s+Eu0mAw6fTCJdBnYgcYCQT8gCkB0T8bkUr9uTIvxQbofZrZfp 78Gbk8v1QMGhV87MOx+CRSjwTZMFO8DrdryAy2M9wcWzRwGHOGhzpsrj0ixPzpTmgTbs quL8EH/BZd+5DeW7TU9mjzJsCkXlHpV5f2OtmSKx5zDvSWO6iI/NKwiaKOpqsyzIsOfa C7Im3kvpmTN3Sv5MUt1dlOFCUOz/Pp0hm3HA3QLiXW5FX8hx0u2ePwFftRVobarCWj24 uwqQABp+Wbq0/aeqDS9Wjfwa5x1mbgnkpwGyAvqTKaQQw4Lw/CsVgWvzaiHKGaxxOyOy /TZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=tmQ+zuW2; 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=fail (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 o77si650187ybg.332.2020.06.17.14.29.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:29:15 -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=fail header.i=@linaro.org header.s=google header.b=tmQ+zuW2; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:46292 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfcR-0004Ne-CO for patch@linaro.org; Wed, 17 Jun 2020 17:29:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37866) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfEY-0004EO-D3 for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:34 -0400 Received: from mail-qt1-x842.google.com ([2607:f8b0:4864:20::842]:41177) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfEW-0000MG-QV for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:34 -0400 Received: by mail-qt1-x842.google.com with SMTP id w90so2750781qtd.8 for ; Wed, 17 Jun 2020 14:04:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ljUyAp0qqYElrS8vzQ49pxqGCe+fOWSwI5BjIxDRmqQ=; b=tmQ+zuW2eIVChtJ/OEnskHJxF3k9ShXoaMhKG9DVleoTY8AIwCy/Vn0caSyLKfWerP mRH0n0/uYybOYJVOvCwQTIKX8l39KMEr15B7loh/wkwXaiArqt152Tjxh3utng+J8zdt CGMfyvNZFGCSmsS7QsAZi+zxOcIFLqKKhPQhpAqz8yzzvjyaFmLurXfCQmgElH+vhZeb p8tmWYJNU4n8yrMx/zy/d/z3Nz8FQefdOrkRxsG/SWJBZKn/cJ2u80RGdrstMzojix7n gwyl2Q9RVpErRixBXV2eEl+n6nUqBn7CpgaMMbPTXEpVX2zpSAycKgja3R3YPKPF505r clIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ljUyAp0qqYElrS8vzQ49pxqGCe+fOWSwI5BjIxDRmqQ=; b=TbokHBMiS51AC2ZQmvavrtPbljkM3T2kU6ZkXDNCP8S4G8WtTpVWr5VMDGdReVIJGi LZZ29U+fT5l7Pul2SGiW8Ge12zlVxgdTp5+08HsANfmM5DdjKOQptiBHo7cuy68Mwov3 x+vbMXWRwa/Fbwn+gHbgJ6/7jm2iJCPZoVOU7kZ9mEoSG3U/dNkiSMDa+lLvwo/PEt5/ GDk5lk7EewCORtdfI0RoOAmhPEpvCPt/p9oZ5VVg0uX9StgdhUyYy4+7feOGqxU1obni +n6WhD1kDUS6HHQT3ULv98+3xVufG8l4t6D7FyUc8OG6lHGWv3A5WwyR1hGKDR1fFyv9 KXhQ== X-Gm-Message-State: AOAM533Q1u+hRuARgX1JuPyzVFZ+f9qMq4+GU/KYvmPbvDTdB53r/4Qc gLUvaAetTmABtMMIwOX2rtqr4PQTTR5LJA== X-Received: by 2002:ac8:6bc1:: with SMTP id b1mr1116070qtt.65.1592427871693; Wed, 17 Jun 2020 14:04:31 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.04.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:04:31 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 52/73] s390x: convert to cpu_interrupt_request Date: Wed, 17 Jun 2020 17:02:10 -0400 Message-Id: <20200617210231.4393-53-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::842; envelope-from=robert.foley@linaro.org; helo=mail-qt1-x842.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , robert.foley@linaro.org, David Hildenbrand , Cornelia Huck , Halil Pasic , Christian Borntraeger , qemu-s390x@nongnu.org, cota@braap.org, peter.puhov@linaro.org, alex.bennee@linaro.org, Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Cc: Christian Borntraeger Cc: David Hildenbrand Cc: qemu-s390x@nongnu.org Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Reviewed-by: Cornelia Huck Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- hw/intc/s390_flic.c | 2 +- target/s390x/cpu.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/hw/intc/s390_flic.c b/hw/intc/s390_flic.c index 46ec8272c0..964cb41b4c 100644 --- a/hw/intc/s390_flic.c +++ b/hw/intc/s390_flic.c @@ -191,7 +191,7 @@ static void qemu_s390_flic_notify(uint32_t type) CPU_FOREACH(cs) { S390CPU *cpu = S390_CPU(cs); - cs->interrupt_request |= CPU_INTERRUPT_HARD; + cpu_interrupt_request_or(cs, CPU_INTERRUPT_HARD); /* ignore CPUs that are not sleeping */ if (s390_cpu_get_state(cpu) != S390_CPU_STATE_OPERATING && diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index d7a98bd52b..d157dbb7a9 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -65,7 +65,7 @@ static bool s390_cpu_has_work(CPUState *cs) return false; } - if (!(cs->interrupt_request & CPU_INTERRUPT_HARD)) { + if (!(cpu_interrupt_request(cs) & CPU_INTERRUPT_HARD)) { return false; } From patchwork Wed Jun 17 21:02:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190939 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp812814ilo; Wed, 17 Jun 2020 14:25:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqmKkuI6t4oX6E2+OKsFHPY3jsHUoq3xdo1pFvwehNiFcOeJ2rD5Xr5vTw2zp7Nf/wJ/Ae X-Received: by 2002:a25:be11:: with SMTP id h17mr1409532ybk.179.1592429154901; Wed, 17 Jun 2020 14:25:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592429154; cv=none; d=google.com; s=arc-20160816; b=XA8sXKX6moxDIm9TY+OwHI9/LVapjfTdDwD1EZkd4oc6BCo6chlmREL/hF8jeGg+LH 5+UUYZEAP6MS/A/6Qffx0MI3tQEYnb0xkm7QdMKYTPx5rrTp5ZEr1xSdOaN9zU7J0+zO FEaj+VgNpYvWQFUr94AVDzHZPgTG2rx7W66g7tEuCk3RCoRqnzwv+YBFVR9Pqfr0brex yHZednukQawS3v3rrUOm41giUNJ3fTb0YMCRNm5a5KKzNjBpExyGtetKzgBVtAStxTxR bRIj+hxkmrFgKbT08dKmOW7ZN+xyq869Mi8szYg7qiWqG9CZyum/pgg+ihxbUy56NFW8 P+AQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=E/tQbITHc97dgORFyK3tE34tNsNJB0LGdPZMzeOAZ2A=; b=WogLxwlDpwBsYRc2su/FFjxFjrNmtjPDzrbtWIdWmd2TD7aXDezVr+fq7BQoABm2yo AxzdynlQ+lsHDZdhfgJ6j391T2zqEdzrYIJNYlHItbDG+cNEd1N2WuGMrBtsozfnK878 AY6+bdb15l42jOOGjYSxgSL4cbOrpwhqjS7G+IUP2k7g3YYQRWnJDhLduLmQ6jGly2kf L6wYyuTHvIrj3oWQ54WJF4HVS6u6Mc6OvNeHkw9pkAqMpjzunmimNk+/NcAl2RCjrq94 Oh1GfjrY63VLi3taXr3cACDhn86MU+orwWW3GPqgxKyp1O8sg7N6OIDIjLW/6ZrvDtgF llRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=gjGWNyK1; 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=fail (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 k74si673372ybk.384.2020.06.17.14.25.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:25:54 -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=fail header.i=@linaro.org header.s=google header.b=gjGWNyK1; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:34646 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfZC-0007EB-8U for patch@linaro.org; Wed, 17 Jun 2020 17:25:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37902) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfEd-0004IZ-Q5 for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:41 -0400 Received: from mail-qk1-x741.google.com ([2607:f8b0:4864:20::741]:36374) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfEY-0000MT-78 for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:39 -0400 Received: by mail-qk1-x741.google.com with SMTP id 205so3521153qkg.3 for ; Wed, 17 Jun 2020 14:04:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=E/tQbITHc97dgORFyK3tE34tNsNJB0LGdPZMzeOAZ2A=; b=gjGWNyK1fJl5+QdDcTtGkUHu0bKZupTYgIu+ikmiZPdtkwH1bKpmzZMkekHfQOqcyp j6iTEhdp4xVVerBTq6iuPTwCNjRVTkX9kkrFWnklf5AhvoU+PSlfMRuaeNZCJdObue4J rDMKy4yeH1BSyTEBqEVx9/0u6l2UcRkl1xVXG4U/yZ3a1FNwPiV1oshvaEuxn9RKCpR1 o6wBIxf1pmtmQS3jLQBLgp3a2PITVnVJCpXl6NWjnCgiujBnlahisTEGpqOpvcCXAhlB GGd06yOrXzXNLBgbvFarwTz773YM9k7IpsMSSxeggM7MpD+rE+1vUauIuUv3gHPwEuzK FsoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=E/tQbITHc97dgORFyK3tE34tNsNJB0LGdPZMzeOAZ2A=; b=tHvKO3iyVC1WPUEI5z2oCQeYbDzVuIuWMN7u7tOTVkibB4lLAoxIqEs704u2rm32bg ZG/cMKb+UHdJKVqGb9rBBHJkTUFkPmnWYqdtKs/ZkJ2BllhoMopnjr61+PKF2SnTGmWL I4zRDeWF/2J6CiP+MNcrATCR+DisqOFuOMmS6ibZvqqRLPcqBuPOX9sbrtdlIgeeK9Dn T2Ix/tQMySktzJOdwSGZ9g//+XTzbu0aGjtiBzsp4+aBSTRu4DYUfk1AiB4UmdSpKo6L VEm+MRCDoH1VKCKDLFIgd8JFu8dFsbdG5EN/rddZ3kjDHp/qyFKCX7/nat3g6iFJKpjr cdHg== X-Gm-Message-State: AOAM532AX38n954tASMmrXsumE5R0e5DqzEjPT3Z3/vgWciVb1Pp5WUt OMderKbsZQQNxv/nem9SOrLB05flI96EMw== X-Received: by 2002:a37:4ed2:: with SMTP id c201mr607695qkb.138.1592427873025; Wed, 17 Jun 2020 14:04:33 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.04.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:04:32 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 53/73] alpha: convert to cpu_interrupt_request Date: Wed, 17 Jun 2020 17:02:11 -0400 Message-Id: <20200617210231.4393-54-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::741; envelope-from=robert.foley@linaro.org; helo=mail-qk1-x741.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.puhov@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- target/alpha/cpu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.17.1 diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c index b3fd6643e8..09677c6c44 100644 --- a/target/alpha/cpu.c +++ b/target/alpha/cpu.c @@ -42,10 +42,10 @@ static bool alpha_cpu_has_work(CPUState *cs) assume that if a CPU really wants to stay asleep, it will mask interrupts at the chipset level, which will prevent these bits from being set in the first place. */ - return cs->interrupt_request & (CPU_INTERRUPT_HARD - | CPU_INTERRUPT_TIMER - | CPU_INTERRUPT_SMP - | CPU_INTERRUPT_MCHK); + return cpu_interrupt_request(cs) & (CPU_INTERRUPT_HARD + | CPU_INTERRUPT_TIMER + | CPU_INTERRUPT_SMP + | CPU_INTERRUPT_MCHK); } static void alpha_cpu_disas_set_info(CPUState *cpu, disassemble_info *info) From patchwork Wed Jun 17 21:02:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190958 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp820423ilo; Wed, 17 Jun 2020 14:38:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjCBHm5Qrp3oJ7HpZEbu7nYegyUG5L9/3yQ5JjXH4iVXqVTVoLUtdNJVSfDUNFvCcBjtGB X-Received: by 2002:a25:1e0b:: with SMTP id e11mr1603034ybe.440.1592429880739; Wed, 17 Jun 2020 14:38:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592429880; cv=none; d=google.com; s=arc-20160816; b=l5qBmZNhdYhfYJv715NvWSfbeLPTmFDxzN+T+zuAIRtaVf2fVyf1N7ghDXHfRTF6kZ cCFkmNF2m2Ac6binqPimuECASJvdnvYtxWmv+2ZFBIVjAGTsE42gQT9dmAPOOdvQ1e12 83/N3N11PrqOp84xC67hSoqF8AZRpzeioTnQsY94XLnpR5cwviZm+wkl/Y/5t7DJfph1 SCLdgeZuei3QO+6LA4ke6fRlpuCLl9jfuJdov8S8Jcujuwl4gEAPiiQDOgz0k48PyTbW liYq6p1zBYdg2zcLdZvZ34pkPhhoaz4cDiCBMobxwbqbjnDerJ4Xoel3jCJqPVLrsVx5 AxeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=TvYnAkjAppdRPxTCTiIdH7gnvDHcZXb4SiVpZ+2G8IY=; b=wKT1V3ydxH5UMiuYNV3NRFMvCxP5FFsb/Sy/JYgfA8KMEATU0eHSwrdU5vnlfJGSJi JTDgnJZ64dgvj4OLAWZhHCQJKV90zG7f41e7BYBUfEbsiQR7un5Eh2Ne7i1KAFVzAN79 GXHB3AUbpGTdHB70PrFarquhT1Js5290nkw/QgWjPJx9qdfQVB9M3BW7FUPxCrnzxznp jElR41+wo98y2vyNBA637OC4DVC5Oc3q39lsBNOnI+w70nMosGTvNyyJY6LotMCTTsnA 3cLs+CKqB2znzjJSFqSZBHdjCm3eUIwGCdD3IxsPo1xBEMRPyb7rsKrKmi8hQDsmYd+v lDXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ecIVUAfI; 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=fail (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 p8si715486ybl.187.2020.06.17.14.38.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:38:00 -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=fail header.i=@linaro.org header.s=google header.b=ecIVUAfI; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:46332 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfku-0000NA-5Z for patch@linaro.org; Wed, 17 Jun 2020 17:38:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37924) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfEf-0004Iu-JS for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:41 -0400 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]:42453) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfEZ-0000Mg-DK for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:41 -0400 Received: by mail-qt1-x843.google.com with SMTP id q14so2744537qtr.9 for ; Wed, 17 Jun 2020 14:04:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TvYnAkjAppdRPxTCTiIdH7gnvDHcZXb4SiVpZ+2G8IY=; b=ecIVUAfIhsVG8DNL0q88t8bJ1XhdEQ3El8SmKRGwLxu/MxLAocT2DAhvIbtuh1KwPG 45knDavjQm1HSsPs6XX4eU6+IGVn/JdmsvoLmRtzNxO4zEkqT5IzUs0Qx2gt91EoL4Y1 aA2U9HVif14sh1NCIKoUqSRS1jgvNrRdKFuUcZNhNM7YY9jwfI6nEIRUlFR8JVf4fgdp N1YYOBHIkKAxo0gWZ+lP60bKfhhS4MpqVlE60LmXMm5CZSDySJGzttW+v/tG5D0serqU 3QZVVXvIk+616xsejbi6ep35XMvsBrslfragTlkHCY6quxhW5PxWupnf4qielcy8sLd/ wrgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TvYnAkjAppdRPxTCTiIdH7gnvDHcZXb4SiVpZ+2G8IY=; b=I+QMFii7Mm+1vwpucnUE4tyNEZyFqIrzLOORdQeYcKIIXMbzZE1mJV4vwXXZG8zegK TBSaKzCuKzCkc2X3axABNrbZxKHHDlZW0dZsY86XBO3fQCldVyZJmJDd7sXzEgoyr8Ja 9Ju47IXvERz/4uVgskJ1ITD/0SAP8IuX08HbnKBrqEaHhc8f1KG4bGXp0HYrRFl87mkk A7kE8c723zhqaenprtMdj524eEm/LSly1KF2EVP+YrxfLyuyquzFnIysYuMymtd9nBeZ YtZLyw60ev96lJBmWttXhHRK6viyRKfohWN1myS4B8+CNTQlulClolIt0H8MCau+i5sP GUjg== X-Gm-Message-State: AOAM532A37Scuw5TOUsj4mvCj99noLQyf3DaeRAsNaDgRwwoWOmNK5Jr VVz0CqfX8MFl6OAyfMdf4pgOLvKsCc8aaA== X-Received: by 2002:ac8:6b85:: with SMTP id z5mr1092175qts.191.1592427874319; Wed, 17 Jun 2020 14:04:34 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.04.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:04:33 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 54/73] moxie: convert to cpu_interrupt_request Date: Wed, 17 Jun 2020 17:02:12 -0400 Message-Id: <20200617210231.4393-55-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::843; envelope-from=robert.foley@linaro.org; helo=mail-qt1-x843.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.puhov@linaro.org, Anthony Green , cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Cc: Anthony Green Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- target/moxie/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/target/moxie/cpu.c b/target/moxie/cpu.c index 6e0443ccb7..f823eb234d 100644 --- a/target/moxie/cpu.c +++ b/target/moxie/cpu.c @@ -32,7 +32,7 @@ static void moxie_cpu_set_pc(CPUState *cs, vaddr value) static bool moxie_cpu_has_work(CPUState *cs) { - return cs->interrupt_request & CPU_INTERRUPT_HARD; + return cpu_interrupt_request(cs) & CPU_INTERRUPT_HARD; } static void moxie_cpu_reset(DeviceState *dev) From patchwork Wed Jun 17 21:02:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190950 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp817584ilo; Wed, 17 Jun 2020 14:33:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwG+lLFNGT6tR1B96h/Y9mlaB+/0+2klBV7hEbrE0Ve/ig1LECd7ZFiWVZxzKPWiim39s5G X-Received: by 2002:a25:69c3:: with SMTP id e186mr1548966ybc.445.1592429610712; Wed, 17 Jun 2020 14:33:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592429610; cv=none; d=google.com; s=arc-20160816; b=BHfV4VnfGqa7SHO46NpPMRIG512Ur362paq8uu4ThD+JN6OKYt3EXjlqehjVNQ5Sbx ZhJc06RAF3JK5aeEriT53B1R/WSESDtcF9G8dtMHtB59x+lHyVHQi3OiRVYJN19M2lCd 0jJJliihH5ELLCKsJChdOywVUFHp7vPTSR5Ex1TfFgycpGEnBros000gzPaUdvbrLPk+ 7agHmSHKc6pU08mAiVak2ln+oep5DDsv/Kf2wnM2G8FFqs5vbnqTE9Wc1J0R0mlVtl9y /O1Z3+JZk0NoPiuqNOIquK5dhWq0FCFxjEqxeWFsYhU6l40dIjsdhlBvUYnhOnHqtfPb wQNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=cWfP+0MUzrrNImWYZpz2KO/NSgj5qKMFSKUqs77s2xU=; b=Pa5b+ySgPlTBh50ng4iu9hcffNq6ljeDRWO8V38vG9WP85r2iIERxueaoXDeGkLzGt S13DTixvk/HrL+yGA5app42r5XPUQ/7+NzP6q7RETLFq7OFpY8gzEEqkc3gxzZ6SzlaX bkyxJcQ7Uz/RC8rUO+TBF5K9l0VMQtysFu9L/Aan+NtmzNziuYFPOBxx7MNCZ2rQN1xN Bj1TrsvxQuKb/v3Ckg0bRyGZvpFuvpFMfYKIFh8QfyVRQtMM6/Fylz/k1N0NZDzPG+X6 G7bwfQPwz2X40PJNdI/KszitXEud5T66VVEzpdHJOlTgOryQjmL8qyUBTBf9UfOoQq6l +ZAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=q2dc5j9L; 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=fail (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 y4si767281ybk.397.2020.06.17.14.33.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:33:30 -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=fail header.i=@linaro.org header.s=google header.b=q2dc5j9L; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:54942 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfgY-0008Fu-3D for patch@linaro.org; Wed, 17 Jun 2020 17:33:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37946) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfEh-0004Jt-FS for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:43 -0400 Received: from mail-qv1-xf41.google.com ([2607:f8b0:4864:20::f41]:40746) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfEb-0000Ml-JM for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:42 -0400 Received: by mail-qv1-xf41.google.com with SMTP id e2so1757636qvw.7 for ; Wed, 17 Jun 2020 14:04:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cWfP+0MUzrrNImWYZpz2KO/NSgj5qKMFSKUqs77s2xU=; b=q2dc5j9LGIKDmehInfKJjEb6jmYURGpk8RoLvw8cVtWLlWYhcWg2N9AmUjEN5UUJHm 2qfB9d7mVmnA4uh1TEKszpydB3ltf0YnJKZGU8y134vcwpanL/bO7N6UXCMMhFrmrPVL dPVkE6LfZmA/hvCdbl46rYkmTbgcgsyxlhnYgeeA3fjo3za5KMKYmOwsGB7ZxCng9uZk +qyMy3IX9BbjGGXcvizgB418I+XUJU/mb/sQ8+rrc54qvEkqr2UtzW47Ot7cPbLbfOl2 tvFkpxKRdbA1uhB75Pi8ePAKEc1sO7uCi2/58VA2CgplS1Z/tKPz3krJb3My8FE6slBt uI5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cWfP+0MUzrrNImWYZpz2KO/NSgj5qKMFSKUqs77s2xU=; b=Ib3+2JyJtPVnwAuhrmFtlAETOuIzNwakhzjL/j53WgbHpqkyrFnkpOesjEdH0WpaXi eKyALDhndu9MDPFssjkooH7a495VgQ4tSZwGeTvWnpAOQzlHxs449xeKNxLvtChJijTR TNFGR+D+uNsPixRebezOaSbk5oxxp0+gfyveVSksZ6pgeOJCfpf0VwgT1UPfvO/yQzQU 7iR2xOQ3poJ8yZYTqh2Oc1imUuzh1GclSuIPx/flcsssy0fREmJsMb4Gy08AcQlK82iO yCSnDdLAtEIK4xDJd2gYE3ZjZmuQaN9Z0yu0LYKE+F6MukT5dutjplkSnwr8xjMtoIFr RaEg== X-Gm-Message-State: AOAM531Y8R80E7msI7x4ZGkBDIv6H7micpN5kg+dUeG3jGIXL5TTFuw4 4uSbN/1aTwVXYo9V6+H0j2ie/v76JrXM2g== X-Received: by 2002:a0c:806e:: with SMTP id 101mr524860qva.173.1592427875727; Wed, 17 Jun 2020 14:04:35 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.04.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:04:35 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 55/73] sparc: convert to cpu_interrupt_request Date: Wed, 17 Jun 2020 17:02:13 -0400 Message-Id: <20200617210231.4393-56-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::f41; envelope-from=robert.foley@linaro.org; helo=mail-qv1-xf41.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robert.foley@linaro.org, Mark Cave-Ayland , cota@braap.org, peter.puhov@linaro.org, alex.bennee@linaro.org, Artyom Tarasenko Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Cc: Artyom Tarasenko Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Reviewed-by: Mark Cave-Ayland Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- hw/sparc64/sparc64.c | 4 ++-- target/sparc/cpu.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) -- 2.17.1 diff --git a/hw/sparc64/sparc64.c b/hw/sparc64/sparc64.c index fe9c678459..191ebfbb93 100644 --- a/hw/sparc64/sparc64.c +++ b/hw/sparc64/sparc64.c @@ -57,7 +57,7 @@ void cpu_check_irqs(CPUSPARCState *env) /* The bit corresponding to psrpil is (1<< psrpil), the next bit is (2 << psrpil). */ if (pil < (2 << env->psrpil)) { - if (cs->interrupt_request & CPU_INTERRUPT_HARD) { + if (cpu_interrupt_request(cs) & CPU_INTERRUPT_HARD) { trace_sparc64_cpu_check_irqs_reset_irq(env->interrupt_index); env->interrupt_index = 0; cpu_reset_interrupt(cs, CPU_INTERRUPT_HARD); @@ -88,7 +88,7 @@ void cpu_check_irqs(CPUSPARCState *env) break; } } - } else if (cs->interrupt_request & CPU_INTERRUPT_HARD) { + } else if (cpu_interrupt_request(cs) & CPU_INTERRUPT_HARD) { trace_sparc64_cpu_check_irqs_disabled(pil, env->pil_in, env->softint, env->interrupt_index); env->interrupt_index = 0; diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index 3f05aba9d6..cef25238a5 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -704,7 +704,7 @@ static bool sparc_cpu_has_work(CPUState *cs) SPARCCPU *cpu = SPARC_CPU(cs); CPUSPARCState *env = &cpu->env; - return (cs->interrupt_request & CPU_INTERRUPT_HARD) && + return (cpu_interrupt_request(cs) & CPU_INTERRUPT_HARD) && cpu_interrupts_enabled(env); } From patchwork Wed Jun 17 21:02:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190960 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp821742ilo; Wed, 17 Jun 2020 14:40:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwz949TfDlWCm25VJ19H7KgG6CCqh50NSJegoVq59aSE5WweV7KeMCiyKF30gVboAGDK1K2 X-Received: by 2002:a25:bb90:: with SMTP id y16mr1491207ybg.231.1592430015891; Wed, 17 Jun 2020 14:40:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592430015; cv=none; d=google.com; s=arc-20160816; b=dVvTK4PBBGNwN8WyB/AGnozGQY1bczyn1nsbaBYZMH9UMkPT2EgkcOHAa3Yx0TqvIb K3z5n1PaIz/9GNdz9sjzfks1kgkldS8WwmKvHVwJ/cAAXt50qetyiht+ZD1zM8gwRpln V7FgnuvF+MNAHJynBAwqUMID57/vk42Suw3l92IvL2EqUfkXTJsrqTLQ+ZfQ+/UMJ2IF 29rlzSyhwjzzHJZSdENi68Krh6RBdAY6FAXIAFWPDyxBSz3JS6BAq2EMoEPzpeWd0CNb bErFGmoMZ/HluH5TLKkg0OPYmtYzTB6g++AXt5gUBoc5DM5uytlY6bLLClYSrEH3/ZfN bcnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=1b+dD7RxLqaUPVVNgXTFGKKstOqQ+qP/ZFHAKJHyCiE=; b=KhhLXpYvT/o30/78VpvSmUBVwQH2KGvPnIi9MZPxiDouicsHr8GGnIUczhKVbcxmtt PVdIN1zo5rm32zc+7B8F2tTwUHUNJ0GNCmdJoDxczGKYhqdqad5gmRFX5BYWTWZRZ+AM CHAHe5NkMgkDfifMslTqLN+lu32dbhlDvFo88GYKv9QNppl1Z2kdKN++flcKF9nBsHmf d/59AR+Q7AE+mly0PcW/0J/7KNpUQdoiLInUyQbvGTyqZQaBJwJETXPCzzLcnisf2/5Y meqOSMK6EN7/1Ok2BJdXLkjr3vizH0km0urTDewjM9Ztq/UFhccrb1iZDSZjodNxc7jA YAwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=bJZ9AnyH; 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=fail (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 u185si669913ybb.15.2020.06.17.14.40.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:40:15 -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=fail header.i=@linaro.org header.s=google header.b=bJZ9AnyH; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:54782 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfn5-0004OL-A0 for patch@linaro.org; Wed, 17 Jun 2020 17:40:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37958) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfEi-0004Ka-6p for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:45 -0400 Received: from mail-qv1-xf41.google.com ([2607:f8b0:4864:20::f41]:36007) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfEd-0000Mp-Ek for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:43 -0400 Received: by mail-qv1-xf41.google.com with SMTP id x16so1776244qvr.3 for ; Wed, 17 Jun 2020 14:04:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1b+dD7RxLqaUPVVNgXTFGKKstOqQ+qP/ZFHAKJHyCiE=; b=bJZ9AnyH38/u9FenAZJOw32x7nXAE3c11H3UA9e01D6LcFVkzh4ioqYu144nKCXVdF BxD+8cKCbFSDCU4yOxEWObt9rju8aW6aEX6X0gjikj3LhAjdtXr2iX9GFZKrQrJSZs1k r5oAMM8Q5RamzzyyeALQEzu5uzrcXmrgF/iPgE/jB8lixwmZOBIe8XnHlMnyj3XwSq5i PfaztLFruop8N0rCUpUgINYCWyGgxhXGkSO4zjaEuv3K+PXc276ZN4EFE9Qv7sOikx1V vx/6tOfp9M1+OnZGsjIwGBQRMeICZKZEcQ5o15sw8ncbFmRBuFk1FutnQoe2zAa/HhmF 7AUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1b+dD7RxLqaUPVVNgXTFGKKstOqQ+qP/ZFHAKJHyCiE=; b=KaGzK9nqja7xYdxpSYkDIZ8hfc0oMHXfq+IvRZR6mj+b2stHDdgEmpUlHiOXsTs4Ov 1vZw8Kf6JQL6vxqd4KvYKEzL0mFgAnHYNyJio+WLG5emGRe3Z4p9mVVl1WmeADW7CLTh yk0v1ogUBTyZ4HCBttFSkbRD6nVPsKHoJwIL2GCIpaR12oywd5wnoao1kLw2fqdcVBYx 8OYHF7hdmAvQhmIQIVoWlA3qusrnd50PLM3FnrptTLC+Wk0z/toG6VlaUuX/mWQ2UdBR zdMzAHYfXbY6UCGY9qyzjVIBkev+VrOdD/T9rY0GQQDbe912UcgFr4cNmIOk/xQk1xYM fi+w== X-Gm-Message-State: AOAM530NoBAi/atJ0vej/w2u0KFGGxOnOvSjR36o0sD+b2XRtXZMAHyA aQUDx5NlmetEpAMVq/h/3smUlseiAwfCPg== X-Received: by 2002:a05:6214:6b2:: with SMTP id s18mr523072qvz.135.1592427877097; Wed, 17 Jun 2020 14:04:37 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.04.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:04:36 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 56/73] openrisc: convert to cpu_interrupt_request Date: Wed, 17 Jun 2020 17:02:14 -0400 Message-Id: <20200617210231.4393-57-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::f41; envelope-from=robert.foley@linaro.org; helo=mail-qv1-xf41.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.puhov@linaro.org, Stafford Horne , cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Cc: Stafford Horne Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- hw/openrisc/cputimer.c | 2 +- target/openrisc/cpu.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) -- 2.17.1 diff --git a/hw/openrisc/cputimer.c b/hw/openrisc/cputimer.c index 93268815d8..9475b77d0a 100644 --- a/hw/openrisc/cputimer.c +++ b/hw/openrisc/cputimer.c @@ -102,7 +102,7 @@ static void openrisc_timer_cb(void *opaque) CPUState *cs = CPU(cpu); cpu->env.ttmr |= TTMR_IP; - cs->interrupt_request |= CPU_INTERRUPT_TIMER; + cpu_interrupt_request_or(cs, CPU_INTERRUPT_TIMER); } switch (cpu->env.ttmr & TTMR_M) { diff --git a/target/openrisc/cpu.c b/target/openrisc/cpu.c index 5528c0918f..fd2da39124 100644 --- a/target/openrisc/cpu.c +++ b/target/openrisc/cpu.c @@ -32,8 +32,8 @@ static void openrisc_cpu_set_pc(CPUState *cs, vaddr value) static bool openrisc_cpu_has_work(CPUState *cs) { - return cs->interrupt_request & (CPU_INTERRUPT_HARD | - CPU_INTERRUPT_TIMER); + return cpu_interrupt_request(cs) & (CPU_INTERRUPT_HARD | + CPU_INTERRUPT_TIMER); } static void openrisc_disas_set_info(CPUState *cpu, disassemble_info *info) From patchwork Wed Jun 17 21:02:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190963 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp823342ilo; Wed, 17 Jun 2020 14:43:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyOchmtR18tDMuDF+ZXxKwhyq/U2BFKV157F/H650K+6acw/a/ZeLfsOMD50lmdYBa0bA/4 X-Received: by 2002:a5b:707:: with SMTP id g7mr1544342ybq.136.1592430179915; Wed, 17 Jun 2020 14:42:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592430179; cv=none; d=google.com; s=arc-20160816; b=FE6g3JlR3hty62f6AuJgQ6A/hyZ/pweyLUxkhn2pr8xdOWSSwPcL65nAilgz5r9YDm KjMDZ4n0eBnUCTeD6DmPxGLyVaTV4ZRcpqYDFcy2tN2MrLzsU6/eI0OAaG4adR1GlhP/ Mft+xvGY5mLdhlU+fdL8wf27AksKa30cxG/iryuvRFMWuWEGTu7TVrHFMwQNk03z+VYr jPbT/T28pcgyhj3ihcnz6qbsqT6X9Wwfyby5rHHxgcnfvN1fwdreWmOZymWR9LqaDcuF XtOTgY0tYVl0246dFZi8PRsBrbHLKIGJIydaz7XoCjgcDS0x+Gp2VQZUpwb+fKLt2zVo VuOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=NQ/BbjaNmbkm5KQOy7Vv4O17R/NYOg7qZF+hAsl6NgU=; b=sf+SlSIsfKaX5lu5Z4oY3MT/jwV+2XEz1m3rCfZ43LmcM7LxeGKtgyGWmw8YTAo47Z HWnPnpk6dvHCGDzh0S9djplFfW4HZ4qrPrxFVpjRFNuJVCzmyIck2c6i97abV2FOWcDs Pf/LrQnuwwoVFZkpaRPEqT68yTj017OQYDmtWAhB6mZiX/O7rPexcOKjPlmV0yw0sEoM trmG/x2a6LD5z3r0iGhBrjI8cawsqsWabghrC8D33xERNLityh+Kd2MFVluTn1rcW2Qq +zFPWy6IBKrVFNa1GYlvNMYmUaO3gM2g9Ru2C4OeE1CC3vsZDsqHIYEcsJPwXm2d1Vmv iGIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=nbqe93r9; 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=fail (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 e2si742202ybn.178.2020.06.17.14.42.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:42:59 -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=fail header.i=@linaro.org header.s=google header.b=nbqe93r9; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:35100 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfpj-0008W9-Bp for patch@linaro.org; Wed, 17 Jun 2020 17:42:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37978) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfEk-0004Oo-8w for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:46 -0400 Received: from mail-qt1-x842.google.com ([2607:f8b0:4864:20::842]:42453) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfEd-0000Mu-F9 for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:45 -0400 Received: by mail-qt1-x842.google.com with SMTP id q14so2744727qtr.9 for ; Wed, 17 Jun 2020 14:04:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NQ/BbjaNmbkm5KQOy7Vv4O17R/NYOg7qZF+hAsl6NgU=; b=nbqe93r9K4U8lYPXg4i1bJG9LdCn/l8r2IMJNiRx8Jo2MrIeaa7KCf6eUKyjziJAUy iM4JsruncRAxUF0U9DVKp0vwdwlty8EHiiMWthQVW85QP9/AtlvCe5n+SKgQlbwCLGHm Ge5UPlXyvV9K6vIDCsPXRZZD//DzigbXygtmg/o2F7gKNkCvty/aInxu3r046SANPoG+ Jj4Cy7BEB9XK+j5E+1jd8vFEEwHc9T27+lNyhOUGkGigbrnQxM3bZiNgbmNnzAiemW4z JC1nePJWOxnXi/AOZHXdZRY0cJs7BcZZzP/d/rDzhP+9HFqkAcfqR0E3g3Bo1kPxinGI kvZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NQ/BbjaNmbkm5KQOy7Vv4O17R/NYOg7qZF+hAsl6NgU=; b=EEzbYXvWn2mpcPl6l5z39TjiXQv+kPfRJ+aOLiWRTyvDBygr8OKW5MaDgry9F4ujjD cOBwUnsXMJGaYqrdHKnWYQaXAk+bbVcAXctWUSBTT36zgO4HiA8VW14m0kQbUVKjeevj 3u83BtxWaOOmEcrkfSoHY+9BW+bPNal+31RxrlbLq3tWMCnOo+XFW24Dy1zW637TblJg snRhGYibwlucull8Y6d7nicSltT0VvZUvFDGZWxRfIDMu1qRD4eM1iGZwq2FRyguxOdy GAid5MYd3K/H6eOsNoIeONCO7yBVegxqfrHa7zGgsYpMaoIXTQR4HfsSqboZKQUMypKH mA4g== X-Gm-Message-State: AOAM533LPy01p2tqibWjDe/mllC6Zkl0LQ2Y6VfuUFk5gBjPNODmDRNt D7uQpydQTM6bEWaBB8jlde2O3w9qn7C1fA== X-Received: by 2002:ac8:7a90:: with SMTP id x16mr1084555qtr.233.1592427878391; Wed, 17 Jun 2020 14:04:38 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.04.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:04:37 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 57/73] unicore32: convert to cpu_interrupt_request Date: Wed, 17 Jun 2020 17:02:15 -0400 Message-Id: <20200617210231.4393-58-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::842; envelope-from=robert.foley@linaro.org; helo=mail-qt1-x842.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Guan Xuetao , peter.puhov@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Cc: Guan Xuetao Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- target/unicore32/cpu.c | 2 +- target/unicore32/softmmu.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/target/unicore32/cpu.c b/target/unicore32/cpu.c index b27fb9689f..06bf4b4b63 100644 --- a/target/unicore32/cpu.c +++ b/target/unicore32/cpu.c @@ -27,7 +27,7 @@ static void uc32_cpu_set_pc(CPUState *cs, vaddr value) static bool uc32_cpu_has_work(CPUState *cs) { - return cs->interrupt_request & + return cpu_interrupt_request(cs) & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_EXITTB); } diff --git a/target/unicore32/softmmu.c b/target/unicore32/softmmu.c index cbdaa500b7..9660bd2a27 100644 --- a/target/unicore32/softmmu.c +++ b/target/unicore32/softmmu.c @@ -117,7 +117,7 @@ void uc32_cpu_do_interrupt(CPUState *cs) /* The PC already points to the proper instruction. */ env->regs[30] = env->regs[31]; env->regs[31] = addr; - cs->interrupt_request |= CPU_INTERRUPT_EXITTB; + cpu_interrupt_request_or(cs, CPU_INTERRUPT_EXITTB); } static int get_phys_addr_ucv2(CPUUniCore32State *env, uint32_t address, From patchwork Wed Jun 17 21:02:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190943 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp814215ilo; Wed, 17 Jun 2020 14:28:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJweY3p3aWC10lcIQzPRZrifhMT8VItO4CMlRXdMlHxPGj9U2sxybFQyeDMSZNUsnM5ymDTy X-Received: by 2002:a25:cb48:: with SMTP id b69mr1518110ybg.252.1592429294824; Wed, 17 Jun 2020 14:28:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592429294; cv=none; d=google.com; s=arc-20160816; b=S8OzZaB5rTOC+2yJcLF0iCk4/olKjvmcM4bO8gHKRBMqDf1hRoO8NM4scP2pUavBwR kX/7Ow2Gjaf5T+OC6uwbxDhG/laUXc17WFrBfECb8iIbnxKaDWoqD0VknEXoDllR1i/R cPxoLgISmg6tsTaLz4GrDMiY6V/wVG6KFaUkH2gSsQRhxifVgAkfa9VVutb5YzxU007f 4nG024E3lC1p9lnowHm0wcEOG7Y+b6AtfW69ZVDDD5YFFLplUHgRlzn6HsaHG/7jdS17 daPUUJo2cP704EDSzorVZMxNxJTxswwiv2QfBNVPYv5YmNxvrAdxwDyszr9hfUe3WrTX oCww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=3gel5qcjCCdr1MutUEbekB9AJ+USfjviG0mT0qyFu6k=; b=SX8BjYe9WscQP9kE81HJmHBgPKIn5t+PtNCV+AFftD+PWFYieOKrb7OV1J1ospCrfO LCT9VdO2QdIZwUVrTmeyZaPtjscHtxMsgEB83+oV619bRHTjOC1w/ooK54dbViALqAlN NhfTmJb+o/pDKe9s6ZAckRPAVHCdvHWH8juXsxIGuFKz94zYqdFPDDHxI3pRq2DTRM6B sir7MMEzaCQuFpjNR1i9NC9QRXWaTFfHxw+AwQuP47f7WU/e+8RbXcm/FXVlZygv1Wll Dy6N/usO+N7RUikUSDqvzvJR+e2lKbf/oNGR0fUZDDKN+eDz0zRG6U92cKAzSJzbh6mp VT7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=t24d0x6B; 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=fail (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 184si639173ybc.322.2020.06.17.14.28.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:28:14 -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=fail header.i=@linaro.org header.s=google header.b=t24d0x6B; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:43056 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfbS-0002ss-8M for patch@linaro.org; Wed, 17 Jun 2020 17:28:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37998) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfEk-0004QX-SP for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:46 -0400 Received: from mail-qv1-xf42.google.com ([2607:f8b0:4864:20::f42]:42312) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfEf-0000N2-8V for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:46 -0400 Received: by mail-qv1-xf42.google.com with SMTP id p15so1751102qvr.9 for ; Wed, 17 Jun 2020 14:04:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3gel5qcjCCdr1MutUEbekB9AJ+USfjviG0mT0qyFu6k=; b=t24d0x6BQM7S8qLKgPPOpQYxItr1MVKjih5JCkiDdhZ7wDMdfAIpFm6Dt7ExJsSdZB VhCe+A6aQDsKrg5Ze6A6fP0OxwuxxhtPvTJYafSmT1dZR+Sr37sgalHf3Soao3apwpXg F6lLWIROdhfdQjE1OWBra31oKhq+Oqt4LQK7X5Wv6o14oe37CuiI9G0k/WgeYmzCsSOs Vmx3/fhEs1be5bcenmdY1/1eSREBk1mORtbukOJ05e9lh1/A2C0/WS9ZCxq5jng/mI0s HMJRz/I7CIl9lhZPA2FWcadarjQ9vkC4KYNDFydydjURY87oNPxVzyF9JfmcycG2WJpy cL0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3gel5qcjCCdr1MutUEbekB9AJ+USfjviG0mT0qyFu6k=; b=gzd4sf/H+yC7k9iZ2OLBMIQoQyoAaF8gCbmLRsJIW7YI2nv1IQU6/ggsYZ+0wGTAsP j4vjsFLb4yXgD6boCcgMDI3Z3H1NrZGgpb00h4EHuugzFZ0N1KFMNi+MZ52GcJlvbZqQ IZ8wH8wzM80ISGoEN1tgha1ZdXT8iNvjg2tr6TuYdPYFqBgsJvVG+kxkQNM6zeQl8ES4 KlTS6OxRQix5/hKUohiVEvP2slMQztlbuljeZJLSOd4BMn2R/hBPCLdjVrYT33X5nyyE 1+QbGsDjTC6abPD6AJnzB6hnsT8375djYiSbDm7FcqR9XkPHAthLcpfwsImrQpyXZxIq UmXg== X-Gm-Message-State: AOAM533hx3POsuHAHCdh+hnIFV677uB2QYRjiQX3ZqAT2E+nRt6iKAlT XRnzH86Z4exuKQXGbrpy1pYKlQqpOnS7hQ== X-Received: by 2002:a0c:f949:: with SMTP id i9mr556056qvo.75.1592427879628; Wed, 17 Jun 2020 14:04:39 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.04.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:04:39 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 58/73] microblaze: convert to cpu_interrupt_request Date: Wed, 17 Jun 2020 17:02:16 -0400 Message-Id: <20200617210231.4393-59-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::f42; envelope-from=robert.foley@linaro.org; helo=mail-qv1-xf42.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.puhov@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, "Edgar E. Iglesias" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Reviewed-by: Edgar E. Iglesias Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- target/microblaze/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index 51e5c85b10..ce70f7d281 100644 --- a/target/microblaze/cpu.c +++ b/target/microblaze/cpu.c @@ -84,7 +84,7 @@ static void mb_cpu_set_pc(CPUState *cs, vaddr value) static bool mb_cpu_has_work(CPUState *cs) { - return cs->interrupt_request & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_NMI); + return cpu_interrupt_request(cs) & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_NMI); } #ifndef CONFIG_USER_ONLY From patchwork Wed Jun 17 21:02:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190965 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp824281ilo; Wed, 17 Jun 2020 14:44:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6BFO4PM8LY/jU8ix9bd8MltGMdZ9CUvacSbxl0OkF0Y3zt+Q66wbfrFFV3ur/cukbVd0Z X-Received: by 2002:a25:10d4:: with SMTP id 203mr1693615ybq.250.1592430277367; Wed, 17 Jun 2020 14:44:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592430277; cv=none; d=google.com; s=arc-20160816; b=wa6iaNv2gpqUDbxVj84uiZb1ApGDmQqN1qpYQoFQdJnNxQK9Edrfqdq0thXyLy87dz 92hs2Am8t8U8AWfkZZ3AH5cbwDbAfcASs+9mnMR2VWRHtsngM2qqf2E/1W51Mdee+V0z cnFE06y/s07mV25+NTvaQP9mLLmEZrgQyRDbJU2IM5PC9iHU/Wd1lfgu4ZziGEUcCUll 2D7MMuZ3BRNDgv94Cn9ndPc2OK5TtfZmEgTAjFLBOQ9BbgW96r+tZ36d4VLQ8lv6Mr77 ruKtxMomUNIjtYEd1Nr7vt/YZiqVG9E+BYyrfuj9CZoI3UA4fcw5D8Yvm6RSrKBWZR1D lOkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=km3WZi1TaIpmNQhmf1v8PVX4fpTySmyjj8uA+abKwoo=; b=vMdPbO+aS8YhzOyzgt5XYT7tbtOIw2dzaN3gf1vwh4O1kWFp7QU+4BA0yzBN/AuNzP n/t+OwA4jrCWxnOZ1zyEW3uBAoqfat7NEpNDj5pAn1k9MZIeiWuiLVt/JqFzg4a6GQiC DSEu3RLe+WhmYkfDTPmByKZHQOU1dV0YCbRFSN6DagEJr74Dk0YIrC6Do6Z4n9GRdQ4H s829BTTVzb6qOjejTaU5/7a6LWMv0ZsaDgYyuQyqsayXyADsF9AfuyX3Fgs/3kGX2Vwd sArH80ko17b3DyDLBDSrAYRUkz3UZzn9f4xcN0Hy8UVzGAdbtYNqMeq5pvJQDoMarqsZ VM1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=HAIEtFIs; 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=fail (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 v184si730923ybc.129.2020.06.17.14.44.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:44:37 -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=fail header.i=@linaro.org header.s=google header.b=HAIEtFIs; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:44430 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfrI-0003me-IW for patch@linaro.org; Wed, 17 Jun 2020 17:44:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37974) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfEk-0004OQ-3E for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:46 -0400 Received: from mail-qt1-x835.google.com ([2607:f8b0:4864:20::835]:42810) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfEh-0000ND-7C for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:45 -0400 Received: by mail-qt1-x835.google.com with SMTP id q14so2744834qtr.9 for ; Wed, 17 Jun 2020 14:04:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=km3WZi1TaIpmNQhmf1v8PVX4fpTySmyjj8uA+abKwoo=; b=HAIEtFIsWsNy2Ng+eP2vfYLwDDRwem0GOYxVU8SnQNr9aqvT9MAhd2dbeP76mo81wJ MxDF7dRV5MIX6iSgoRV+DnsY0DGOvIqG+aUUEfV5+8QcXj7wX3YUOSpxYhSRPjCQZUEJ um0sr8OCx3pP5my3tl18cwklpTjM6DdYXwQGqPwIbkzZQwJcdBvOh3oHB3f61SpQ0W+s 05BQXr/MekCuM50w/BdcSmH3Q8m0shZVjHK5TjCqahO5NwkVo+Kp/hHkwggc2iNX8QEw TnI7Dsf0AdFP5RmiavaikcFt4Y568FGqOp1m3f2dDbuY7BVhcfO4EbhoLOseGKbUpLrc xhBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=km3WZi1TaIpmNQhmf1v8PVX4fpTySmyjj8uA+abKwoo=; b=FT9ajWnLa2MvJAkfKaNJuNTlSroRCzw2lUsQPQJGhAy+f6cWNBqBWwZZUcEzcdNxEB 9DBLLQUFW29Lp6S0cPXgnlmiZO9wGKIy+8Jm49a+VIoGy+jLt0jcVMiY5LjKCED1faX4 Qa3FvzEcHwMHz5e4ckun+Y9sj5fUiC4mT6soVL5Csrltqjv8TgzSQg6V5bdm/wGA92/z bCWt/Ti5BxXzD+87bIWNiS7UrF/olA58O+mlmz1BCh78wGq1aGbBs2nAuAjU9uwT2so6 5kkm88X5NzK6G+sKXKaF4GGm8QgBGR3X7aMO/mUig2kV6nM12SPG7O88MrIcIObbHrkd wMfA== X-Gm-Message-State: AOAM533BbbNu75NpBS8atvsuXR6Yav80fHT3v+s1GjOfZWBWnEoycPLf 0osCE2DyNrnWP1W2oNyTqauuoflTFmWgeA== X-Received: by 2002:ac8:40dc:: with SMTP id f28mr1095809qtm.63.1592427880932; Wed, 17 Jun 2020 14:04:40 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.04.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:04:40 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 59/73] accel/tcg: convert to cpu_interrupt_request Date: Wed, 17 Jun 2020 17:02:17 -0400 Message-Id: <20200617210231.4393-60-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::835; envelope-from=robert.foley@linaro.org; helo=mail-qt1-x835.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robert.foley@linaro.org, cota@braap.org, Paolo Bonzini , peter.puhov@linaro.org, alex.bennee@linaro.org, Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- accel/tcg/cpu-exec.c | 15 ++++++++------- accel/tcg/tcg-all.c | 12 +++++++++--- accel/tcg/translate-all.c | 2 +- 3 files changed, 18 insertions(+), 11 deletions(-) -- 2.17.1 diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 099dd83ee0..b549a37847 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -431,7 +431,7 @@ static inline bool cpu_handle_halt_locked(CPUState *cpu) if (cpu_halted(cpu)) { #if defined(TARGET_I386) && !defined(CONFIG_USER_ONLY) - if ((cpu->interrupt_request & CPU_INTERRUPT_POLL) + if ((cpu_interrupt_request(cpu) & CPU_INTERRUPT_POLL) && replay_interrupt()) { X86CPU *x86_cpu = X86_CPU(cpu); @@ -544,16 +544,17 @@ static inline bool cpu_handle_interrupt(CPUState *cpu, */ atomic_mb_set(&cpu_neg(cpu)->icount_decr.u16.high, 0); - if (unlikely(atomic_read(&cpu->interrupt_request))) { + if (unlikely(cpu_interrupt_request(cpu))) { int interrupt_request; + qemu_mutex_lock_iothread(); - interrupt_request = cpu->interrupt_request; + interrupt_request = cpu_interrupt_request(cpu); if (unlikely(cpu->singlestep_enabled & SSTEP_NOIRQ)) { /* Mask out external interrupts for this step. */ interrupt_request &= ~CPU_INTERRUPT_SSTEP_MASK; } if (interrupt_request & CPU_INTERRUPT_DEBUG) { - cpu->interrupt_request &= ~CPU_INTERRUPT_DEBUG; + cpu_reset_interrupt(cpu, CPU_INTERRUPT_DEBUG); cpu->exception_index = EXCP_DEBUG; qemu_mutex_unlock_iothread(); return true; @@ -562,7 +563,7 @@ static inline bool cpu_handle_interrupt(CPUState *cpu, /* Do nothing */ } else if (interrupt_request & CPU_INTERRUPT_HALT) { replay_interrupt(); - cpu->interrupt_request &= ~CPU_INTERRUPT_HALT; + cpu_reset_interrupt(cpu, CPU_INTERRUPT_HALT); cpu_halted_set(cpu, 1); cpu->exception_index = EXCP_HLT; qemu_mutex_unlock_iothread(); @@ -599,10 +600,10 @@ static inline bool cpu_handle_interrupt(CPUState *cpu, } /* The target hook may have updated the 'cpu->interrupt_request'; * reload the 'interrupt_request' value */ - interrupt_request = cpu->interrupt_request; + interrupt_request = cpu_interrupt_request(cpu); } if (interrupt_request & CPU_INTERRUPT_EXITTB) { - cpu->interrupt_request &= ~CPU_INTERRUPT_EXITTB; + cpu_reset_interrupt(cpu, CPU_INTERRUPT_EXITTB); /* ensure that no TB jump will be modified as the program flow was changed */ *last_tb = NULL; diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c index 3b4fda5640..5eda24d87b 100644 --- a/accel/tcg/tcg-all.c +++ b/accel/tcg/tcg-all.c @@ -52,10 +52,16 @@ typedef struct TCGState { static void tcg_handle_interrupt(CPUState *cpu, int mask) { int old_mask; - g_assert(qemu_mutex_iothread_locked()); - old_mask = cpu->interrupt_request; - cpu->interrupt_request |= mask; + if (!cpu_mutex_locked(cpu)) { + cpu_mutex_lock(cpu); + old_mask = cpu_interrupt_request(cpu); + cpu_interrupt_request_or(cpu, mask); + cpu_mutex_unlock(cpu); + } else { + old_mask = cpu_interrupt_request(cpu); + cpu_interrupt_request_or(cpu, mask); + } /* * If called from iothread context, wake the target cpu in diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index c3d37058a1..23007570f6 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -2409,7 +2409,7 @@ void dump_opcount_info(void) void cpu_interrupt(CPUState *cpu, int mask) { g_assert(qemu_mutex_iothread_locked()); - cpu->interrupt_request |= mask; + cpu_interrupt_request_or(cpu, mask); atomic_set(&cpu_neg(cpu)->icount_decr.u16.high, -1); } From patchwork Wed Jun 17 21:02:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190966 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp824460ilo; Wed, 17 Jun 2020 14:44:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzN4C4kqIfLvYHo62Qq4XhIKOTawq7Gn6ExtqInxNxvJq4YD/PoFMmy8ECtSPyiRjsOKLRP X-Received: by 2002:a25:c052:: with SMTP id c79mr1606706ybf.23.1592430294625; Wed, 17 Jun 2020 14:44:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592430294; cv=none; d=google.com; s=arc-20160816; b=b5Woi8/9xw6wmA66jVHNDWrsnYYQRixPC5yH0BmrdW3oUbR78E9Eh1tLqLhQVu6LUD br4HftvRTKjA+x5hZaZG+xhcHUHkg371eRAx6Y3m0setElc2Fkf5ohGQXOSFTSj/lsgw ZMs84pbMPrUFuw7XRfaXgrZcyTTSNsRp6TNFuEXNF4LAJJHkKtXby0X1TES2bvhYTVJR FOhvEq+pHz9xTKMcMexcsy4PlG9KKqtDPR0c7wBEceGi1OkpkosRBYliLXviy23G75uL mSRg6YZuivWfTawq2ZGiTeP4bxgvjTovkk821NR9gdIuec431fYdoa9MTZIuazADTR4f gp7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=E2rKLqGPhEt5KLMSHY+b9yS/ljZbSYYEkJSY3sQ9lfk=; b=d8+mhG+usNoqBkmoeZjwlg+gj4+l8L9MT2AHRkazOQW5RQ7nonhEHVBauLbIHmRyPJ hZpHhhX1O7nGeZpuPhNHhkeyoGb+TGL/jr/64bOV+lHTUEHnLasxULfghfKaeTW3Ufj1 ziH0hiKbiOTgYzOazeFXnryScONiVEIJkq75pcHeH+1fjLSwX2QWzV/x7CNLV6Qa3k1O u3AsPBvwyp3Lf4YRl4DV/Gec2AX9n3Shj44A3/ktut+9wCw4OZGZYhFtiVw0xtOY6HuW SSzmXi5jrGAukhPlynqmEGiOnFJ8agFXEg+4A2iAmUsmS4bUemDg2FoWgf6PrWYeEh54 5hrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=FSHBi39k; 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=fail (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 j7si681047ybj.428.2020.06.17.14.44.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:44:54 -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=fail header.i=@linaro.org header.s=google header.b=FSHBi39k; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:43652 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfra-0003Sr-3P for patch@linaro.org; Wed, 17 Jun 2020 17:44:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38028) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfEl-0004S4-IF for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:47 -0400 Received: from mail-qv1-xf43.google.com ([2607:f8b0:4864:20::f43]:41391) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfEh-0000NJ-QR for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:47 -0400 Received: by mail-qv1-xf43.google.com with SMTP id er17so1756991qvb.8 for ; Wed, 17 Jun 2020 14:04:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=E2rKLqGPhEt5KLMSHY+b9yS/ljZbSYYEkJSY3sQ9lfk=; b=FSHBi39kWjJXbvfD+LjWVR+egqIhudII4Eiv+X3PtmHKMB/5fA96rUFM7ElEP3NpI0 +dF6oTriVZpfDZXmu7dHfhcLQ1ZLv6oA7+6PBbAY3P67/PILpMs7cS8ID4g4WF5ar92C aZQPZifbTDs0muaferUZR4YgSGSl+xXUZJLMcl4TmDX/f7AgmZVotbWaYcRnu0SsYHnW 4G4elB34Y893JR3oePpDqkbP8sjZ8dk4GPCRSEsYjSKbJP0zEmstNu91fdCBYXlBFQVw ABCICIyaDo13RX517oCP4EsLUTIs4eCr/U4hR/8XjDVMZzgtVjkYFpTCMlPse2EozqNg am3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=E2rKLqGPhEt5KLMSHY+b9yS/ljZbSYYEkJSY3sQ9lfk=; b=D4iyly/0HSuoLneic4llFbIdamYrQzXbi+mBA+E8khNzYr47DDzXA1+U07f8f7rK3O wj+MrXbRP8a5clwdgaFu39StmJOBughZCH7BQAqqzOr1avqjVOp8R4nkD2i7mXr01VQN trYUame4TpNupihmz/yFtPnP2aE+VGEKE3dfhUJ9jZ7eY6pIi6slPCI8I3efPcKf+JRV up1FScExszeD+9Zhxy1LWV8wzoBJkqXWpfHuq6DxW2JmxKwaVqL9rrDc/INph//+0/Dw MW0s2uPovlwvaIYKhlkWaK038mtNobmoFYpMhiBUWv97011dAGCdlMkj0RfWRC9mJQfD I+cw== X-Gm-Message-State: AOAM531b3xyyRheKTqiPEUgT6xhi/o9ZPRV3OhnO4CzJTSUXPYYQt2pA lo0OpgdPLomSYPStS1nmpDZjp76c/sVFfw== X-Received: by 2002:a05:6214:1432:: with SMTP id o18mr551765qvx.57.1592427882239; Wed, 17 Jun 2020 14:04:42 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.04.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:04:41 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 60/73] cpu: convert to interrupt_request Date: Wed, 17 Jun 2020 17:02:18 -0400 Message-Id: <20200617210231.4393-61-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::f43; envelope-from=robert.foley@linaro.org; helo=mail-qv1-xf43.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robert.foley@linaro.org, cota@braap.org, peter.puhov@linaro.org, alex.bennee@linaro.org, Eduardo Habkost Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" This finishes the conversion to interrupt_request. Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- hw/core/cpu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/hw/core/cpu.c b/hw/core/cpu.c index d3223f6d42..59f02594a3 100644 --- a/hw/core/cpu.c +++ b/hw/core/cpu.c @@ -273,7 +273,7 @@ static void cpu_common_reset(DeviceState *dev) log_cpu_state(cpu, cc->reset_dump_flags); } - cpu->interrupt_request = 0; + cpu_interrupt_request_set(cpu, 0); cpu_halted_set(cpu, 0); cpu->mem_io_pc = 0; cpu->icount_extra = 0; @@ -413,7 +413,7 @@ static vaddr cpu_adjust_watchpoint_address(CPUState *cpu, vaddr addr, int len) static void generic_handle_interrupt(CPUState *cpu, int mask) { - cpu->interrupt_request |= mask; + cpu_interrupt_request_or(cpu, mask); if (!qemu_cpu_is_self(cpu)) { qemu_cpu_kick(cpu); From patchwork Wed Jun 17 21:02:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190967 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp825497ilo; Wed, 17 Jun 2020 14:46:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxq5kXOeiRSodroPrSsgZz1Uhcp542XtP/6r45NX+gYl8Su/7XqiJ6UtxzU+5e4VhKiJhkF X-Received: by 2002:a25:ba49:: with SMTP id z9mr1450234ybj.391.1592430392396; Wed, 17 Jun 2020 14:46:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592430392; cv=none; d=google.com; s=arc-20160816; b=buFa5t+KgU1tYfdoSQxRtu4s38n3FqkpWo7NitpXGgRjoEtAVF561/Wv21o+dQrgR9 2h2YSS4uXUgXUc8Anuk8falUlZ6v5rlaZAStRw0Tumu+J8+ybIamTksMRWYmS5X96VAa 0BVoyxQRV7o/9l/vjgtMMYUbYHdSoJRoOGxlRXItn5IWVpVmw6+EDaHDprIkR2ZGj6zg /LzBca8dwrivsJOo91IzbMm7dqRkbg0FfVfzYkdEhmkXaCNbvfg/2MHV86u2EV1cIa38 u5wkHypR/8UTIhwXgaQW+szwxh+fE0OVJZ5A+Vnmo1M8GhCUOyybTcVCk4BucJnmhobN Quig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=b2xeW1FaDB2PR1E4Ymub3nePuzIlXe65/BuJe3DDIkY=; b=BGh3ywJap22S02fFhPIfgt/1RdJguhLX0+rJzq9Z1QR2/kw1a1nobz1QNhFE/0WeYu u+nSiLwcGCbHbS7NBKlkXmr3T51kyCwzvxqFHkhAWSUxgWrWj/4WHt2oOFhvLDjwQtDF /ETCK5XkrFdCmJxw56+ml4R8d4flSFTFuNiAzZN/L3D7HaMkkb228d6sTLe4eljJBJZD lPQmoUQAbBwNuGvTFGuibuBjpL4m8NCqRbab6/2n78o2EL8mwl4o8+VTJaxRmKpUEQy4 NznherteZuYWLz3EQE7X88CyKeT5/LUdLE5kVexwDuK5i5QK89ECzxbBFAZxD5x99HQi JuIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ZIQSD87L; 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=fail (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 6si723069ybu.119.2020.06.17.14.46.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:46:32 -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=fail header.i=@linaro.org header.s=google header.b=ZIQSD87L; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:52180 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlft9-0007I1-SF for patch@linaro.org; Wed, 17 Jun 2020 17:46:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38066) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfEn-0004VF-1D for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:50 -0400 Received: from mail-qk1-x741.google.com ([2607:f8b0:4864:20::741]:44478) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfEj-0000Nh-PI for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:48 -0400 Received: by mail-qk1-x741.google.com with SMTP id b4so3459387qkn.11 for ; Wed, 17 Jun 2020 14:04:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=b2xeW1FaDB2PR1E4Ymub3nePuzIlXe65/BuJe3DDIkY=; b=ZIQSD87LAmmPZtdpcbAKBzJo9w6PtLrbHTREwy1cFiP4Qsx+hehp85X/ycyuslgWDN 6rXGwKkZwl96xGeM2jx9HRl25o1ItzEHTgPMrq+JnMmNQWOs0yeQPZrt8P9+z7u80CkK mkwDC7P3yXeHXv1ESDwb9EWZT2y87P7DnKqdZxgXBSWLlt7+rfWZQAwjPdVuZPhHXSlt BbzmtXBQja8eyG2BEDC+087dOrYgvtJBEHe8ulbwlJrF7LP0tuAcZxsLUYzDq1S1mmmI UjYmNXQl6blnmJ+iNcr2vylLs9jqFnyFk34JY/tweuw92dMLTWKZhIxZ9tiUOn5/AGhC TZoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=b2xeW1FaDB2PR1E4Ymub3nePuzIlXe65/BuJe3DDIkY=; b=DQnvI6o3r0mYkT4XBvaWAn5Qg2jqhYc94fEBxaXg57+3Wwhp2bD62mJ3XChIkDj1Ok reNzxZO9s4FVlC5oEi5Tp9dBLq8Shk1cre+BRWsCzZGY+/JOIyaGGLIq5RtN1qS5Mh6N 9heEzax1XeI8gntOxCLTw5G8TLm9GqZidXx+94QSoELb1t5RSsEzcjqlb0pfwL7/mFN0 sBrmVAjZb23YX5Xzc/fWASL7MLypDu0fW4reZldDLaTcK/FmbCOa0GXr/W1HlxZvjy+m KrdwJx1A887EuHn8J5Gmuufln1kxAnDM/zOu3WSBBXDmtDWjwvSB+GogjGzIBY1W+7Ky kvwQ== X-Gm-Message-State: AOAM532S8Te4LUFJb/mOhy23S6lMQFBNdnykpLRylAUNRwk8iU1eUm2+ Mm0gf/5BdhXkT6h7J8pj4r89zAq96/yYkw== X-Received: by 2002:a37:9ad5:: with SMTP id c204mr550641qke.413.1592427883491; Wed, 17 Jun 2020 14:04:43 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.04.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:04:43 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 61/73] cpu: call .cpu_has_work with the CPU lock held Date: Wed, 17 Jun 2020 17:02:19 -0400 Message-Id: <20200617210231.4393-62-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::741; envelope-from=robert.foley@linaro.org; helo=mail-qk1-x741.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robert.foley@linaro.org, cota@braap.org, peter.puhov@linaro.org, alex.bennee@linaro.org, Eduardo Habkost Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- include/hw/core/cpu.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 6f2c005171..79da78cd10 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -80,7 +80,8 @@ struct TranslationBlock; * instantiatable CPU type. * @parse_features: Callback to parse command line arguments. * @reset_dump_flags: #CPUDumpFlags to use for reset logging. - * @has_work: Callback for checking if there is work to do. + * @has_work: Callback for checking if there is work to do. Called with the + * CPU lock held. * @do_interrupt: Callback for interrupt handling. * @do_unaligned_access: Callback for unaligned access handling, if * the target defines #TARGET_ALIGNED_ONLY. @@ -804,9 +805,16 @@ const char *parse_cpu_option(const char *cpu_option); static inline bool cpu_has_work(CPUState *cpu) { CPUClass *cc = CPU_GET_CLASS(cpu); + bool ret; g_assert(cc->has_work); - return cc->has_work(cpu); + if (cpu_mutex_locked(cpu)) { + return cc->has_work(cpu); + } + cpu_mutex_lock(cpu); + ret = cc->has_work(cpu); + cpu_mutex_unlock(cpu); + return ret; } /** From patchwork Wed Jun 17 21:02:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190952 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp818462ilo; Wed, 17 Jun 2020 14:34:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxp+ZdtZDwaeEtAbpXGY8qXZPT0RVCaN8pSjH/sET9fPR/Q1a0X5DH2YWblgWdm5x8VzAqS X-Received: by 2002:a25:56:: with SMTP id 83mr1666478yba.149.1592429690528; Wed, 17 Jun 2020 14:34:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592429690; cv=none; d=google.com; s=arc-20160816; b=k2e0/jRdmCCxzt2yTAAVH55tI464UGyEu8ZSa1Lu08314HseWGeiNemkzrfbyIOilC gMf5Hn79oCQkai7PJ06cIt/J7q3VUenqvpUv72nKERBc9JCOw0Xj7UtwC8VsULnC3iDl ai6A3GP0pY/R/WOGsDpr0vsesGPEM5fdMo3cLIbBJmS4w2fNzQx9zT6ItgyhZ+0Maqbl sQK88f7X5IpZuY1uAOh+YbCGcd8X5RKZ6ARP/I089cayMXTsoJdsDblE3MBuB8jYCCi6 KRoQ1MNJLYIfyuEMXEsQZnElX7TPr4gX4LsbwU+cyaBnA1zLVEwK4Y9IJKuwneV6vZNa Mt9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=2fC2p4q7EXMT22jmjpJyi2yYnEcYk9REFP3VTNIoqTk=; b=loEVuzvPq0ftETFkS+x/rV6tPD/RgC/81f2zG/adAB3xAolz65Dr/tsPG6ugqfpnAe D9oKFQaBmE/0LFjHmSkT3HPGQle99/sjrCVcv3OWqU12Vb38+Zx5jTTD7uFjL9w8YQby pMfe3b1iNVwkEmNlSm9EkJOhNeW3q6wYjvy2i0aaD1hRehiaFDfNT+AP6118EZdtvXqH v2eL4uqb5LLVSX2OGJD6CmE7vKv0eOzzUQRyZusZhzXdptZmwI8lE1KwlLbQu1RQJP7S 7ugBew4nAokXOYKqvw6TBVzxVqDeZN9dFVCX1NCpaBMLL9QyRkXPN2IkRSzpkiCyH+hq F34A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=jsBY4oHC; 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=fail (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 q6si729297ybc.212.2020.06.17.14.34.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:34:50 -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=fail header.i=@linaro.org header.s=google header.b=jsBY4oHC; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:35418 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfhp-0003ZZ-SQ for patch@linaro.org; Wed, 17 Jun 2020 17:34:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38044) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfEm-0004Tx-Dr for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:48 -0400 Received: from mail-qk1-x744.google.com ([2607:f8b0:4864:20::744]:34524) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfEk-0000Np-53 for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:48 -0400 Received: by mail-qk1-x744.google.com with SMTP id f18so3524898qkh.1 for ; Wed, 17 Jun 2020 14:04:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2fC2p4q7EXMT22jmjpJyi2yYnEcYk9REFP3VTNIoqTk=; b=jsBY4oHCFsO3VZPpm5UPbNXmnE7ZOy0NoqalWszny0h/zWNqlLNEOPiLpOw3HWaljV ymmlyJ9kqHsZdj9V2W0+LPPm9Hno71HpFkxyHgmCOjoYS8t+SY3zKYK8k9bz00r7ZMVF dQt+Gd+YgR4ROEUgHBJHhmAoCPNomgrHm5yDwdO2F+LKBUw+fp4Nmc1Phw+Kuucj3z/o fP61PUBL91eHaQ65dXzI0fp2IGNus7maKC8eAwwSqeZ/j1PT3/XQJj1Wzq6AOlbdc5QP BOdeEtfV5LtFJnEt1JQ7djZYdLKYUkOFuw/2fEBVmmhqWd4wlzqN6B0fM3GLaFkj/eTZ hQhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2fC2p4q7EXMT22jmjpJyi2yYnEcYk9REFP3VTNIoqTk=; b=ThdhzRcf3hsKsyF556Wy9fWAUaHPVXcijuFVmink1MJfStpxz6N2awWSi6ERB6xRSa jSL5sMbX4Y82TC3REv6zTruJDnT6FOtqFpJchAsmgAYdgqP2GGo2uKJRbSiFNhxnS8YH SlEQWoXBN1jrJWRrr60qukp+5LT8EEYgw9Hn7IWjo2dZ3kkF9rR5FroO9i3NAr1PTAP8 6jUeoYBN3imMvTn9Iw+gaUo2q4zjtsu71D/6IXe5KL1PFb7Gus8QFEVq8XGsgz65P1cQ ok9X/w67DPNPKKSp8cHtyecv6/yJh2Edm15B+p33cQuz3P3Cn2Ef3FIlBEl9Z/nwswJA v9hw== X-Gm-Message-State: AOAM532lOpeTbl318b+I1Fl5eDYVmnB22i2fFI0aB6nMR5gwFg+z/5Uw D4goji25fheBYRoc1t0sM5pAK30aQVO8qw== X-Received: by 2002:a05:620a:1524:: with SMTP id n4mr541319qkk.295.1592427884939; Wed, 17 Jun 2020 14:04:44 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.04.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:04:44 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 62/73] cpu: introduce cpu_has_work_with_iothread_lock Date: Wed, 17 Jun 2020 17:02:20 -0400 Message-Id: <20200617210231.4393-63-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::744; envelope-from=robert.foley@linaro.org; helo=mail-qk1-x744.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robert.foley@linaro.org, cota@braap.org, peter.puhov@linaro.org, alex.bennee@linaro.org, Eduardo Habkost Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" It will gain some users soon. Suggested-by: Paolo Bonzini Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- include/hw/core/cpu.h | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) -- 2.17.1 diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 79da78cd10..720bc85a84 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -26,6 +26,7 @@ #include "exec/memattrs.h" #include "qapi/qapi-types-run-state.h" #include "qemu/bitmap.h" +#include "qemu/main-loop.h" #include "qemu/rcu_queue.h" #include "qemu/queue.h" #include "qemu/thread.h" @@ -82,6 +83,8 @@ struct TranslationBlock; * @reset_dump_flags: #CPUDumpFlags to use for reset logging. * @has_work: Callback for checking if there is work to do. Called with the * CPU lock held. + * @has_work_with_iothread_lock: Callback for checking if there is work to do. + * Called with both the BQL and the CPU lock held. * @do_interrupt: Callback for interrupt handling. * @do_unaligned_access: Callback for unaligned access handling, if * the target defines #TARGET_ALIGNED_ONLY. @@ -167,6 +170,7 @@ typedef struct CPUClass { int reset_dump_flags; bool (*has_work)(CPUState *cpu); + bool (*has_work_with_iothread_lock)(CPUState *cpu); void (*do_interrupt)(CPUState *cpu); void (*do_unaligned_access)(CPUState *cpu, vaddr addr, MMUAccessType access_type, @@ -805,14 +809,41 @@ const char *parse_cpu_option(const char *cpu_option); static inline bool cpu_has_work(CPUState *cpu) { CPUClass *cc = CPU_GET_CLASS(cpu); + bool has_cpu_lock = cpu_mutex_locked(cpu); + bool (*func)(CPUState *cpu); bool ret; + /* some targets require us to hold the BQL when checking for work */ + if (cc->has_work_with_iothread_lock) { + if (qemu_mutex_iothread_locked()) { + func = cc->has_work_with_iothread_lock; + goto call_func; + } + + if (has_cpu_lock) { + /* avoid deadlock by acquiring the locks in order */ + cpu_mutex_unlock(cpu); + } + qemu_mutex_lock_iothread(); + cpu_mutex_lock(cpu); + + ret = cc->has_work_with_iothread_lock(cpu); + + qemu_mutex_unlock_iothread(); + if (!has_cpu_lock) { + cpu_mutex_unlock(cpu); + } + return ret; + } + g_assert(cc->has_work); - if (cpu_mutex_locked(cpu)) { - return cc->has_work(cpu); + func = cc->has_work; + call_func: + if (has_cpu_lock) { + return func(cpu); } cpu_mutex_lock(cpu); - ret = cc->has_work(cpu); + ret = func(cpu); cpu_mutex_unlock(cpu); return ret; } From patchwork Wed Jun 17 21:02:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190968 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp827033ilo; Wed, 17 Jun 2020 14:49:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIwRMsb6fT+27Hsw3kLclaKl2G3i6vo75ly0Ke+26LeXoaBeLEYZ4Qb6U5P8DMJI6ATt0T X-Received: by 2002:a25:2d4c:: with SMTP id s12mr1501293ybe.307.1592430562171; Wed, 17 Jun 2020 14:49:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592430562; cv=none; d=google.com; s=arc-20160816; b=0vEhfbZI3Wv1oFTua8xI0hUwn0iLXy4z7Kfe86yKWyFTsThNfSHnzFDyLn8vA0nN3A icsmQegUkKNHjTEEtHwma71k/jHI078uSaYgfUyj3wmZC84VhKN8zbi3E5PYRI0sBPbN JRnsQziO/93D+t2ZJy1+X0LhO6SDOffVtxq2vwUybrKuPO8tNz2CeMJQeqou6k897l+0 g+4tv2Ykk7BMHOvOQDF4+v7kUHOxhNUgr+z+bRCm2t/yt+GNlgOpzJe+CXJPoL9KuWKu Bb6J3pNpt5GxJH+hLRL3urBWD8IltxDB7+Yq8uhOnQo8vACjSAeTM82moggkVJGLdX0T n14Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=Wzz0etTpNkLIVhXKsaNrdHJF+FQFmmiKYteH+ClsJ3Y=; b=gCAHA96TQnj9lIOgvwphxn8OgGkNq4kHxEgEWFPwjz/NafrTqHpIeHu9U/IOXw2oN9 z4yE/tKfm6A2NAiS/cs9QOkEUMc3Dspul3nYIDHjpIlVkFbBC+NS8rtR46Tpm9bqo/Uv L70psXmhetiEMETdzKLpSU0I1WXH0al90d9uMpJy3D03IymcY+33SuVOmRPImt6XYHmP ja158mYIsDarnM9aSt5CDiur+JHUW2+Ib8oNJynIg7IvTH1LhmSIESHEempx/AAi+7Z7 5xCcrCJTNVKfLbRnZWssqjVkFXY9kt+Exd46hrr7EO9bTxx+PLfld8SEh42u2BurVlFw Bfow== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=VaZgkRbq; 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=fail (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 o9si831061ybe.224.2020.06.17.14.49.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:49:22 -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=fail header.i=@linaro.org header.s=google header.b=VaZgkRbq; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:60664 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfvt-0003Ch-Kt for patch@linaro.org; Wed, 17 Jun 2020 17:49:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38098) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfEo-0004a8-Uf for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:51 -0400 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]:35411) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfEl-0000OE-JT for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:50 -0400 Received: by mail-qk1-x743.google.com with SMTP id q2so3530862qkb.2 for ; Wed, 17 Jun 2020 14:04:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Wzz0etTpNkLIVhXKsaNrdHJF+FQFmmiKYteH+ClsJ3Y=; b=VaZgkRbqExWZmfHzCi1ylCk2OTlGq4vZUGFz8454JcjhQz7U8XsVLAJhEjS86oc7YI aIT2qvw6nlnhOTcxuk8SVnV44NBHZzePlYGJAX5TdIbJgkpx1moTYkZcOXQDKXG9XHjC L3JiZMZxBV7VBqGv/oOqwgGOYBR1xEBX6MT/PF6hpHn1Z/XJCS4JkHOGgPebZezzmg9U KBk5TzEZoIvwdR54MhA0oPcnVdXjmR/MyaMitLvtcUbGlU9+4f0cRB5nMhGfQEuBFmdV i2wPNQO0YBZ4IrOqlXXFaiZFjONytjH3ilx2BIXW/O2jGYmlg3dqQaxLXZXtzeDA5kJ9 x+qA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Wzz0etTpNkLIVhXKsaNrdHJF+FQFmmiKYteH+ClsJ3Y=; b=WFdl5v8aXNWQSwbqhMSjsopFyq8Fc8oUsYcJ3gVmg7OWdjJxon4VeXFBWDNCYozXs8 2xWriMgpKrlmhr75C3V/yt73NIFw9rjJTqDxgLMluPRjFKx6Ryj3l0rgC9lY3tXdy+js UcMJB/lP4sEp23LUWz2qdJIkSB6TetIvMhhaS5C1TITvMp7mlmAqmbYt5mRvmhe6q84U nYP5i71l6WuxBK66GKNmJVZUcd1OFRdQszoWUZ4gqa14cNMfbKSsMZdfvTeGjBEOTRA3 Dwgy1yQCyP0x4TzQGFlRRr8i+1JuD3hTursbgneL7kjP01QRWIuCn88ij45XzQDx3eOL PFig== X-Gm-Message-State: AOAM533igE9RhEvZExxQxYALLN2IOs7VgvcjTbVOvXaIw4JQKbpLaToW xfG4Et5YeBD+o+dnRRgB9jgf7u5rBctUMg== X-Received: by 2002:a37:9684:: with SMTP id y126mr593877qkd.348.1592427886325; Wed, 17 Jun 2020 14:04:46 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.04.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:04:45 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 63/73] ppc: convert to cpu_has_work_with_iothread_lock Date: Wed, 17 Jun 2020 17:02:21 -0400 Message-Id: <20200617210231.4393-64-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::743; envelope-from=robert.foley@linaro.org; helo=mail-qk1-x743.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robert.foley@linaro.org, cota@braap.org, qemu-ppc@nongnu.org, peter.puhov@linaro.org, alex.bennee@linaro.org, David Gibson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Soon we will call cpu_has_work without the BQL. Cc: qemu-ppc@nongnu.org Reviewed-by: Richard Henderson Acked-by: David Gibson Signed-off-by: Emilio G. Cota [RF: Converted new code related to POWER10] Signed-off-by: Robert Foley --- target/ppc/translate_init.inc.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) -- 2.17.1 diff --git a/target/ppc/translate_init.inc.c b/target/ppc/translate_init.inc.c index d06d9ff204..60ee51c105 100644 --- a/target/ppc/translate_init.inc.c +++ b/target/ppc/translate_init.inc.c @@ -8540,6 +8540,8 @@ static bool cpu_has_work_POWER7(CPUState *cs) PowerPCCPU *cpu = POWERPC_CPU(cs); CPUPPCState *env = &cpu->env; + g_assert(qemu_mutex_iothread_locked()); + if (cpu_halted(cs)) { if (!(cpu_interrupt_request(cs) & CPU_INTERRUPT_HARD)) { return false; @@ -8582,7 +8584,7 @@ POWERPC_FAMILY(POWER7)(ObjectClass *oc, void *data) pcc->pcr_supported = PCR_COMPAT_2_06 | PCR_COMPAT_2_05; pcc->init_proc = init_proc_POWER7; pcc->check_pow = check_pow_nocheck; - cc->has_work = cpu_has_work_POWER7; + cc->has_work_with_iothread_lock = cpu_has_work_POWER7; pcc->insns_flags = PPC_INSNS_BASE | PPC_ISEL | PPC_STRING | PPC_MFTB | PPC_FLOAT | PPC_FLOAT_FSEL | PPC_FLOAT_FRES | PPC_FLOAT_FSQRT | PPC_FLOAT_FRSQRTE | @@ -8702,6 +8704,8 @@ static bool cpu_has_work_POWER8(CPUState *cs) PowerPCCPU *cpu = POWERPC_CPU(cs); CPUPPCState *env = &cpu->env; + g_assert(qemu_mutex_iothread_locked()); + if (cpu_halted(cs)) { if (!(cpu_interrupt_request(cs) & CPU_INTERRUPT_HARD)) { return false; @@ -8752,7 +8756,7 @@ POWERPC_FAMILY(POWER8)(ObjectClass *oc, void *data) pcc->pcr_supported = PCR_COMPAT_2_07 | PCR_COMPAT_2_06 | PCR_COMPAT_2_05; pcc->init_proc = init_proc_POWER8; pcc->check_pow = check_pow_nocheck; - cc->has_work = cpu_has_work_POWER8; + cc->has_work_with_iothread_lock = cpu_has_work_POWER8; pcc->insns_flags = PPC_INSNS_BASE | PPC_ISEL | PPC_STRING | PPC_MFTB | PPC_FLOAT | PPC_FLOAT_FSEL | PPC_FLOAT_FRES | PPC_FLOAT_FSQRT | PPC_FLOAT_FRSQRTE | @@ -8902,6 +8906,8 @@ static bool cpu_has_work_POWER9(CPUState *cs) PowerPCCPU *cpu = POWERPC_CPU(cs); CPUPPCState *env = &cpu->env; + g_assert(qemu_mutex_iothread_locked()); + if (cpu_halted(cs)) { uint64_t psscr = env->spr[SPR_PSSCR]; @@ -8969,7 +8975,7 @@ POWERPC_FAMILY(POWER9)(ObjectClass *oc, void *data) PCR_COMPAT_2_05; pcc->init_proc = init_proc_POWER9; pcc->check_pow = check_pow_nocheck; - cc->has_work = cpu_has_work_POWER9; + cc->has_work_with_iothread_lock = cpu_has_work_POWER9; pcc->insns_flags = PPC_INSNS_BASE | PPC_ISEL | PPC_STRING | PPC_MFTB | PPC_FLOAT | PPC_FLOAT_FSEL | PPC_FLOAT_FRES | PPC_FLOAT_FSQRT | PPC_FLOAT_FRSQRTE | @@ -9118,6 +9124,7 @@ static bool cpu_has_work_POWER10(CPUState *cs) PowerPCCPU *cpu = POWERPC_CPU(cs); CPUPPCState *env = &cpu->env; + g_assert(qemu_mutex_iothread_locked()); if (cpu_halted(cs)) { uint64_t psscr = env->spr[SPR_PSSCR]; @@ -9186,7 +9193,7 @@ POWERPC_FAMILY(POWER10)(ObjectClass *oc, void *data) PCR_COMPAT_2_06 | PCR_COMPAT_2_05; pcc->init_proc = init_proc_POWER10; pcc->check_pow = check_pow_nocheck; - cc->has_work = cpu_has_work_POWER10; + cc->has_work_with_iothread_lock = cpu_has_work_POWER10; pcc->insns_flags = PPC_INSNS_BASE | PPC_ISEL | PPC_STRING | PPC_MFTB | PPC_FLOAT | PPC_FLOAT_FSEL | PPC_FLOAT_FRES | PPC_FLOAT_FSQRT | PPC_FLOAT_FRSQRTE | @@ -10656,6 +10663,8 @@ static bool ppc_cpu_has_work(CPUState *cs) PowerPCCPU *cpu = POWERPC_CPU(cs); CPUPPCState *env = &cpu->env; + g_assert(qemu_mutex_iothread_locked()); + return msr_ee && (cpu_interrupt_request(cs) & CPU_INTERRUPT_HARD); } @@ -10880,7 +10889,7 @@ static void ppc_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = ppc_cpu_class_by_name; pcc->parent_parse_features = cc->parse_features; cc->parse_features = ppc_cpu_parse_featurestr; - cc->has_work = ppc_cpu_has_work; + cc->has_work_with_iothread_lock = ppc_cpu_has_work; cc->do_interrupt = ppc_cpu_do_interrupt; cc->cpu_exec_interrupt = ppc_cpu_exec_interrupt; cc->dump_state = ppc_cpu_dump_state; From patchwork Wed Jun 17 21:02:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190947 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp816332ilo; Wed, 17 Jun 2020 14:31:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9z6RFP8H7sjFEOkK7NUhcHuOj74tI4n0PiqGXwx9GULYFva+Su0l7f1NGduM6ZlkbPZh8 X-Received: by 2002:a25:d652:: with SMTP id n79mr1634159ybg.406.1592429500829; Wed, 17 Jun 2020 14:31:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592429500; cv=none; d=google.com; s=arc-20160816; b=JeGHIGBva3JdbJPijd1Id5g6Pn08lTsAZvycmC1YhRL0qpulSABPhBCSWl/5Yt0Dtt Ukhjwi4BZxdEZmYstBIjflr3YaOsYKc2GEOKs80M+Ec3zLOsBGjJmPqzHrgtYKL+JmIw TNTelUD5ZNYFphnOdIbukbl/8sDXe+D0BNJLL7jxITFpDkJyJsP62qUdbui+a0g8JZry csn9kE0K8qtFvfZF6jQbBHHnZrfaN8Fqh7anZiSlYu3hrvIqZ6nK49mguGUvsuYJZoP5 e+nSO5oRrGltnBZR1o8Zq2p0SIwCNjQPVI8AMQx0Drm53EO9Q0QOly+pv3FlvG7coihQ OYuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=Gn2vKDOISxQzKy44RYpzzeOAg/5NGEBTOA6wtcYZvN4=; b=SIthW+hxTQcR4Mw5YMjW5dXBNR8X0Lh7x7Khv4zGMhTHMOIQCh1Xn1/LQ3q385eFzf WsaHoYF93iRt47IcSx7iHDwiy+7k3u1uR7uwKHyqOR/8Kju2jvV3xJNGlKXTjk+34FdV d21RZ8Kfxc0Ev0PyivFO4qmrvozEjsWaK4CoKQVe7ZfebqSnQNy04sxlWf1MwlaNpdX2 LRyvYhfTpjMHtawlyNUEP7hC4aRwfheKGJz4P1o6noHRmvEHzgQ6j1940G5omgi7dxQx t55PzrQDSx58cNWz5+JrkrLWiPVHfPAiP+46IdDJxViPSzV9WD2ISSvAP/nIt+L8Ar18 15iA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Thm2aHey; 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=fail (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 b7si668030ybo.295.2020.06.17.14.31.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:31:40 -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=fail header.i=@linaro.org header.s=google header.b=Thm2aHey; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51846 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfem-0006o3-5y for patch@linaro.org; Wed, 17 Jun 2020 17:31:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38160) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfEs-0004d9-Ll for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:54 -0400 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]:46918) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfEm-0000OY-VU for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:54 -0400 Received: by mail-qt1-x844.google.com with SMTP id g18so2725211qtu.13 for ; Wed, 17 Jun 2020 14:04:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Gn2vKDOISxQzKy44RYpzzeOAg/5NGEBTOA6wtcYZvN4=; b=Thm2aHeyJvMESgiuasvN/HjzFdRSeqqVQq4LmqV7D6GB6694ajgYvGe/9WpkcXcr7F H6koOjMcYHMlU58jiBD/na7kpp3MbsoTyX0KplAxlwrt2ZmSeI/rh5fM8TdZticOuv0p Z1vjrEEY1KGN1jCiWJwqToxP+qrfb2n72GLHYu9mJqEYeG3CUlJzq4Eky3Kx2UvuHPHN aMlcJ1moeBFKEZ07hjG6Nhi29ltknA7u72gd+Wrac+8dyTBBsAfs1wIVelDyGhrH+pG+ PPsjFOGYYUXi0b4Dv6yGb227Q5Ef2PKsuQMeOhRBSfupxxYGQECJ0uMoPk4M83egmmQx rsew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Gn2vKDOISxQzKy44RYpzzeOAg/5NGEBTOA6wtcYZvN4=; b=eK+bamCd/z262bhZrdAt9o1bJRpRneSS+H1nOJqtmyNSaC6hbb+uaKBxEAAbDv3Lmb IWFDcC1ucWfvAXg2J0zoFksB/58J7NpNkqVF3m08mplZDVZdoNp9t14uZpOWIfBRJUmf PsEH7PcmefK05FG9QBP6+T69O9kHBBaBYk79fMqs2E3gO9oN2wfI10DkNj7XC5UVPa8Q pcj1rm6Ov43tH0VHH4Wst1pJ5jsWjdp5wz241rXZm1AxZy7+FW/Ew+l90n2nNWhPWx0/ D6Wmwbnr083jaVTWuAURHM+Xczvw5sHyHHJYhS+H7phe1xAUCHn1bI264mHR8ry01QHP n9Gw== X-Gm-Message-State: AOAM531hWh/5SWwtiDRLiLha723myIuM73+b4DGDrBbiWIry9QQY4/jb snnozBt+aYlfCBtWt42P/BkNLu/09ol46w== X-Received: by 2002:ac8:51d5:: with SMTP id d21mr1141796qtn.154.1592427887822; Wed, 17 Jun 2020 14:04:47 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.04.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:04:47 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 64/73] mips: convert to cpu_has_work_with_iothread_lock Date: Wed, 17 Jun 2020 17:02:22 -0400 Message-Id: <20200617210231.4393-65-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::844; envelope-from=robert.foley@linaro.org; helo=mail-qt1-x844.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aleksandar Rikalo , robert.foley@linaro.org, Aleksandar Markovic , cota@braap.org, peter.puhov@linaro.org, alex.bennee@linaro.org, Aurelien Jarno Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Soon we will call cpu_has_work without the BQL. Cc: Aurelien Jarno Cc: Aleksandar Markovic Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- target/mips/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/target/mips/cpu.c b/target/mips/cpu.c index 761d8aaa54..ec9dde5100 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -58,6 +58,8 @@ static bool mips_cpu_has_work(CPUState *cs) bool has_work = false; uint32_t interrupt_request = cpu_interrupt_request(cs); + g_assert(qemu_mutex_iothread_locked()); + /* * Prior to MIPS Release 6 it is implementation dependent if non-enabled * interrupts wake-up the CPU, however most of the implementations only @@ -193,7 +195,7 @@ static void mips_cpu_class_init(ObjectClass *c, void *data) device_class_set_parent_reset(dc, mips_cpu_reset, &mcc->parent_reset); cc->class_by_name = mips_cpu_class_by_name; - cc->has_work = mips_cpu_has_work; + cc->has_work_with_iothread_lock = mips_cpu_has_work; cc->do_interrupt = mips_cpu_do_interrupt; cc->cpu_exec_interrupt = mips_cpu_exec_interrupt; cc->dump_state = mips_cpu_dump_state; From patchwork Wed Jun 17 21:02:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190969 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp828269ilo; Wed, 17 Jun 2020 14:51:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzmX21VTMjAafWCluqnseiu3lg/0T+7dkHUfCIfW94/9LTYrO/0surelUW9gl7dnMYU+jxq X-Received: by 2002:a25:941:: with SMTP id u1mr1762625ybm.274.1592430682838; Wed, 17 Jun 2020 14:51:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592430682; cv=none; d=google.com; s=arc-20160816; b=iZNFHm7PMegMhwe1QRX+jE1WcopApwDxMuATYy1zXzLcl3Bmjmn3d3LpVlgIJbabXS vJIjUnEBP8WwPCSFpj3et15ILmE0HmgEoXf2wHx43iloz/IXPmH3Phdcy/Rw6f3NX/xa CxXNJTeKgzOsKxZCZL6jZK8DiDw4mhp4jboUio/0MVuJjT5OD5SL46OPn1gI3T6VcfLb nNo4JrdHKogNpW13Rvbfg1J7wK8RWpIg8Ps2XUSLW1zkuIdwROS+xwK3yJRs9ubid5TP HP90zGAFJjS1iIYM6hTQaWyftKunq66XMRyyXxgfZZA78ef4a9s3gOr3xkn77ppZ9uxv yYkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=9h9/kdng7d5/XyPKaeEfDSBMXGQEDWBnIMh8jIPDb5s=; b=H/vgNi5EtXgOx8ck3TJtz8S2sQSQvVWjmRDs3pabqsbMc/r2CXjhsWt3yZAitTcI7q 1xXr3kDZzdV/1bBAQTXx/bix4EIzWWSatzNyJ5ksZ7PKJdIGeA5AIlZg8tYvo86NdjIZ Sd6h0hom2eAOF3d59VnnDCSHgptZ6d5rFDIK4JWZrv4l+SEwdm1zmfDPHmAOSqfr2HKK +HlPdxfNQnOUm+afl2F1RFsod8WTTwawgbScf8kuTiXnEcYYFra8ca2W8MbnbQoRmnrT GTsPbQH4Y+w8PpaAp7eg7nxabahPAYwy/TroUInPzUOFtyRsnA6NwfLkitiOHvXW1Y8L uYfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=EOHgITnT; 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=fail (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 d34si819722ybe.472.2020.06.17.14.51.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:51:22 -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=fail header.i=@linaro.org header.s=google header.b=EOHgITnT; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:40912 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfxq-0006dS-7P for patch@linaro.org; Wed, 17 Jun 2020 17:51:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38190) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfEt-0004ge-VY for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:56 -0400 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]:41180) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfEo-0000Ou-E7 for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:55 -0400 Received: by mail-qt1-x843.google.com with SMTP id w90so2751525qtd.8 for ; Wed, 17 Jun 2020 14:04:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=9h9/kdng7d5/XyPKaeEfDSBMXGQEDWBnIMh8jIPDb5s=; b=EOHgITnTlH58unySKZbtDoTPHEK2dDpC/Gtmrde6cCSG6qN91j/e6Wc8xugGiyMW0Y aWbVM6z1y7CLV6VkMIKEuYpr4xJXFKN+WNdu6UmpyfyoR027BeM1+giuAFsGReSzuHFm 25DEXXNX4cC/PYZn+8JECZlnzGb1fkr7Hebi10zYnGZC5kBUmnAWMTnkE5KXMYL0aqXt 0TqTsv+crkoS3h+WhA4i6zkayEDU7y/ON+3maOBj7OwABKtPBdRX3OlFLizYRyU52cB1 KUnOn5AwjGGXU/D/K/lRgigLztlsb0gCdyqyfGvmtMRuUpGB2dZIrMUnjxD/itry2i/X qciw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=9h9/kdng7d5/XyPKaeEfDSBMXGQEDWBnIMh8jIPDb5s=; b=g5fhUQ05rBk00UMICRQ/HhRmRIQnr3wHN4t8oEYlQYIr/AJ+HlmaFdnB/MBQ4sSLz/ RDwb1buTLStZlMGJqlDp7NQoLkR7IcoqZ+YHwcXnmGJStnSvKQzFSkdbESHnChIC3uJp a2A3Xu+h92qOE/S5/Z9il0xF+jRoyXmtjN81pr7XgNT1QxkHF2OrlzD4DM/Uwq468RTE 20O7YeFXtoA2hmTYPV6ppPwIl1dSM4Pz4vuPzeUZaCxYFWnkAw60F3Ik2mflAcgfUGGS zDVqI+odoCuyyiAEBq4bRTFNvE6U28YsA58jKcKPEys7LwnVEnpQGRXLFfbAft66hMpm IccQ== X-Gm-Message-State: AOAM530OlAIrCn+2tRkSIGBatBS5YjgIz+S4sENdawBHngi6XHvG9sp3 EO4UHbLsWdiQvWV2iqV7ptQFBdogozmbjw== X-Received: by 2002:ac8:341a:: with SMTP id u26mr1167704qtb.36.1592427889282; Wed, 17 Jun 2020 14:04:49 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.04.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:04:48 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 65/73] s390x: convert to cpu_has_work_with_iothread_lock Date: Wed, 17 Jun 2020 17:02:23 -0400 Message-Id: <20200617210231.4393-66-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::843; envelope-from=robert.foley@linaro.org; helo=mail-qt1-x843.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , robert.foley@linaro.org, David Hildenbrand , Cornelia Huck , qemu-s390x@nongnu.org, cota@braap.org, peter.puhov@linaro.org, alex.bennee@linaro.org, Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Soon we will call cpu_has_work without the BQL. Cc: David Hildenbrand Cc: qemu-s390x@nongnu.org Reviewed-by: Richard Henderson Reviewed-by: Cornelia Huck Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- target/s390x/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index d157dbb7a9..4d0d323cf9 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -59,6 +59,8 @@ static bool s390_cpu_has_work(CPUState *cs) { S390CPU *cpu = S390_CPU(cs); + g_assert(qemu_mutex_iothread_locked()); + /* STOPPED cpus can never wake up */ if (s390_cpu_get_state(cpu) != S390_CPU_STATE_LOAD && s390_cpu_get_state(cpu) != S390_CPU_STATE_OPERATING) { @@ -489,7 +491,7 @@ static void s390_cpu_class_init(ObjectClass *oc, void *data) #endif scc->reset = s390_cpu_reset; cc->class_by_name = s390_cpu_class_by_name, - cc->has_work = s390_cpu_has_work; + cc->has_work_with_iothread_lock = s390_cpu_has_work; #ifdef CONFIG_TCG cc->do_interrupt = s390_cpu_do_interrupt; #endif From patchwork Wed Jun 17 21:02:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190957 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp820079ilo; Wed, 17 Jun 2020 14:37:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+hY3xVd/DMNVowcK/aFtr+CMLi4ZegarBF0DFFCDVerirBIlly9B4cpFjPW+WiXxV64yX X-Received: by 2002:a25:941:: with SMTP id u1mr1680136ybm.274.1592429845462; Wed, 17 Jun 2020 14:37:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592429845; cv=none; d=google.com; s=arc-20160816; b=DfYHKgNnKap33bSzDsuVQk5DxPjhF55iwnWkvzGZOjIldm1z+ScuhV5xEyNNNaKo9l 3f5PzxRAl62Kfi820fovYz0+f2SJgDbyWrF8soap/qCnWATq1/y1qxhu8lR+ITe38uEF HF8CYliwR3LEt/CBtEv9V1b3OwVpy7eUowTI4KYTV2/gJn255HB7ZIg2E8MUxT7Yt51E wQ0hnTBgvm1bF2QXlYVsA2JqlZz0c5T1dWsWtsMI9RyhUfKJKIzA/bYvmw3fqNn14wwd q3Ses94+X7PNPmJ90vu7sbP9f2uTsvNKFUmiLvzYOBLnkGTW1hCoAUWFQPBWdC4kslUZ 59qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=YTz6vFHmZFyC4ACE7F4vHqeFTUJV7CWjdiB6P/9KC+w=; b=sPP/1CdoCRBBdJSj9DccWSzYOusdzliH5EsQDjn5L73PYeD8vB8xkoFyWc1SO4Qzs7 9OWQDAu9dOhW5JcRV0BSNeOywkeqm8LEwfQ9V7A761j0uGy4INTNYaR9AJALs1sd2vU6 9dT61jGhB9vtobHI1GH13NqokU8UhMVXsD6+DbzDWt3j0StzeP1L+fVpac637rGtMBEf nkT/aXl3ETpSWHZLBe5JhLTU1JAFxa0BpS5bWwPV9nS6ahYhKtHFnwcTDrwFxWhoLjqT SVHedSlTr/O8P+T/K5crt/qXfCwJf7tOstsbcTC6v1hQzzGtfkJfk17o/wS2TUb91YLh Rb5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="hC/Pejzb"; 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=fail (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 o127si786065ybc.387.2020.06.17.14.37.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:37:25 -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=fail header.i=@linaro.org header.s=google header.b="hC/Pejzb"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:43988 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfkK-0007rI-UX for patch@linaro.org; Wed, 17 Jun 2020 17:37:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38168) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfEt-0004eO-3b for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:55 -0400 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]:37446) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfEq-0000PG-0P for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:54 -0400 Received: by mail-qk1-x742.google.com with SMTP id b27so3512081qka.4 for ; Wed, 17 Jun 2020 14:04:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=YTz6vFHmZFyC4ACE7F4vHqeFTUJV7CWjdiB6P/9KC+w=; b=hC/Pejzb8BghSmFgUSR+yU/UxhcdgiOuTZg5ww8qnQVSJ+j0wrUDItnixZfav82TfF u9kU66OoyEgjPZ2wUSfOqEsbfjJYkaDJ0dNgeGhQneC3JAAgYSs7plS52Yt19W5ddJTy 6C2yFaWdcV9IS/gbbkfo6pmL6uhUpVpWCr7PiaaTIg1XVCOu5X2LN9WHmajL3OOhrHZQ e6eNPGdU1F5ipFHlNs8CflvhyLr97YoWavUT7BOHfwWtmTjjDN7p0uUCq22NqqtzmSsi g1CNKMY7eAld89KE83NMt0dQ9aGc/ytAjuDNkV7kAaekVPgFyRCEGH/4V418+uzQArls hu2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=YTz6vFHmZFyC4ACE7F4vHqeFTUJV7CWjdiB6P/9KC+w=; b=spbTNvYcbRumoO9hByYwa6TESeXORS8rPrGEFMnjDk4X9pGzdPC+hZKqSkFNHJA4HQ /5P6gtnwDmdTsiBgflXqBWy2TqTJZUYqi9GHx8aEvaZTdR4FBqc9S3KBPdn1pZhW6vZH gVm6M1TfNDMrV5lXGD8BQ4rHsG99YUI/hK6eBdLQaJnRJWyPKlqfZqMoz5gdiQi6CH45 Ody46F9LM6D0ct+z5NV99DEtVujbI7nLdbJtDFw/Tv8zEbj7yBBQwf/G3jtNnEQKNQlo T0t1K3NIPqK3JeT/W8VH5c3BPmlylnFV+1dUCYH9F3uORJoLh6E3Fqt50/INvxqrgMWM 0Gmg== X-Gm-Message-State: AOAM533W+7x67U+ekzsYpRIZWjXLzm/pqmVsBs5A/dNp8NohdY5ysLfr j0hY4/C2ExFq0llYXeP/dG2PWf6ToEV1rA== X-Received: by 2002:a37:5e07:: with SMTP id s7mr628501qkb.20.1592427890822; Wed, 17 Jun 2020 14:04:50 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.04.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:04:50 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 66/73] riscv: convert to cpu_has_work_with_iothread_lock Date: Wed, 17 Jun 2020 17:02:24 -0400 Message-Id: <20200617210231.4393-67-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::742; envelope-from=robert.foley@linaro.org; helo=mail-qk1-x742.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alistair Francis , "open list:RISC-V TCG CPUs" , robert.foley@linaro.org, Sagar Karandikar , Bastian Koppelmann , cota@braap.org, Palmer Dabbelt , peter.puhov@linaro.org, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Soon we will call cpu_has_work without the BQL. Cc: Sagar Karandikar Cc: Bastian Koppelmann Reviewed-by: Palmer Dabbelt Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- target/riscv/cpu.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 3a6d202d03..d56ba65b32 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -310,6 +310,9 @@ static bool riscv_cpu_has_work(CPUState *cs) #ifndef CONFIG_USER_ONLY RISCVCPU *cpu = RISCV_CPU(cs); CPURISCVState *env = &cpu->env; + + g_assert(qemu_mutex_iothread_locked()); + /* * Definition of the WFI instruction requires it to ignore the privilege * mode and delegation registers, but respect individual enables @@ -510,7 +513,7 @@ static void riscv_cpu_class_init(ObjectClass *c, void *data) device_class_set_parent_reset(dc, riscv_cpu_reset, &mcc->parent_reset); cc->class_by_name = riscv_cpu_class_by_name; - cc->has_work = riscv_cpu_has_work; + cc->has_work_with_iothread_lock = riscv_cpu_has_work; cc->do_interrupt = riscv_cpu_do_interrupt; cc->cpu_exec_interrupt = riscv_cpu_exec_interrupt; cc->dump_state = riscv_cpu_dump_state; From patchwork Wed Jun 17 21:02:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190959 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp821316ilo; Wed, 17 Jun 2020 14:39:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzfMXG69MJhHkA3+WQNDYHy/vV7gECNST8trVH/eBRU+TQupfu4iyVlk5DUR2WNZ2gFyAf+ X-Received: by 2002:a25:d684:: with SMTP id n126mr1667486ybg.476.1592429970268; Wed, 17 Jun 2020 14:39:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592429970; cv=none; d=google.com; s=arc-20160816; b=YExs+rvFHgQ7wJi/xfit12wG6PLutxvlOtBrQGZAjiFWvrUVlSUu11M0SOLiH+GLh9 rr4VY7+9LEE+aU6MFFkd7iraEVYpGrC5+S6+CAFoLbzX5hkVIuD7AoxJ73hOByhitjap tBR1MGl0bFDvHBaDSQX2aR0T5v2WUhzxzHebukoSHhoHkkJM2z5/tUsp4kKrfSG63SE0 /3ZILStFXeg2r+h0Hy12NHuNBfj51jKASGnEGsQJPa7NyHsQIBwjmk5EmMs7uHm8J8+0 jV0VvBel6rh63ajietgqNO3s0AZD5XgY4HM1hKYPaBMdlGJvx6d2pBt5ctpX9B9CqHyW zJug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=xM5F5VKH4+4sC5/UG8rh4cawXyjUH8jNOSP42/FFGNs=; b=VTyMOlLsN4H0uE8CMCvwnK1oI30nDOpi82NNLBvFGWqwHT2TJd8QRUKWYqunQftCCc 7fj2t2oHdnvxcSvJs3UM2oilRvEf4HkVYS19ewo0Iu2EobpshJaR6Ge66Cl0li27L/ly POXuXoX0fAVaDf02NTUKYXEieX6sVXJMdyyv2PoSSdL6hi+oqY8NX2cNPfXVM0EekrBK EvvkFY+msigJPvGHY+X6B0BrLwrWRMYcXROI4EFGdDW1xr8nSm5O3NoRLjsg7e9GRmAz uzUeId0V/hpAoUdaYgSmU61El1C3uaPLbCeMkRvfwXM+f0MJKh1j8FB0lq944klmpwbH 1buw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=OFm64wZN; 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=fail (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 e1si686159ybp.19.2020.06.17.14.39.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:39:30 -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=fail header.i=@linaro.org header.s=google header.b=OFm64wZN; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:52576 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfmL-0003Ox-KJ for patch@linaro.org; Wed, 17 Jun 2020 17:39:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38208) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfEv-0004hR-27 for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:58 -0400 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]:40085) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfEr-0000PX-Ed for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:56 -0400 Received: by mail-qt1-x844.google.com with SMTP id i16so2752568qtr.7 for ; Wed, 17 Jun 2020 14:04:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=xM5F5VKH4+4sC5/UG8rh4cawXyjUH8jNOSP42/FFGNs=; b=OFm64wZNBrpW0k2TGETE/NApPmVP1ss5RBk7onAJHsQ7hcEsI6yN1SgiNrUrxHWD6J jYFFXroxefK9j4U+Fe0l9sR5wKekFRc1sW23R2+58zenplFK0YRODgS2w9pMy27xk8jL ZGNIfJtGlMGRN4N8U0x3cijwymopup+N2W6/P8Qlx92y4bqIKCYW2PBAvilqLXBP07AG XDSi0RMEblKmIye1sOOu4k1vm5jBSrRWE0B+8TIV1nUgqEEt4tRxIwd0tdrFCUmXpJPr wNkoEtWWW5e2K1Cj9S9JDFQXqNjygPb1PG18bNZjNHJTojEq5DVtfdDwlcC/pVEdNwOa B6ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=xM5F5VKH4+4sC5/UG8rh4cawXyjUH8jNOSP42/FFGNs=; b=sMO6d1kdjRw5JmbZ/jiISflmicjHDTt9vqbM+J+O4efsoW4Bo2JNDcsBc0ASvujYw0 sFtidjbe1rPt74iLxX8kDxk1DKABf71yCBa/oBwr3K/rpfFfVcdsetgqTMppgqOH8ol/ yqDuDD3RQvsr7ppqm6frC1TGlKNOsjqF/f8l+/Yu546oYHK6Zs0/fQEdyl75xXOk0HpX G1aMQWwcN2kFRazCpuUnUCG+XqTqfX79bWh4urckPehcdb2sxREhiL7V147B2Nx8QCVF IKriTQKo5U4nYxzdyp7a48t1K7UG5QlEZzUpluUyq/XebY8XF6VuTQN8NYnzUOFfxenm Ju6Q== X-Gm-Message-State: AOAM530yOPZ2ZB7KUFqS41YdfbCO53Wx/8ZRBU6RKoxJvNR1YdzRRinm DNM2sm0HHdjlhkSdov/DFPY2PgvJbZVntw== X-Received: by 2002:ac8:7a90:: with SMTP id x16mr1085647qtr.233.1592427892159; Wed, 17 Jun 2020 14:04:52 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.04.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:04:51 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 67/73] sparc: convert to cpu_has_work_with_iothread_lock Date: Wed, 17 Jun 2020 17:02:25 -0400 Message-Id: <20200617210231.4393-68-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::844; envelope-from=robert.foley@linaro.org; helo=mail-qt1-x844.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robert.foley@linaro.org, Mark Cave-Ayland , cota@braap.org, peter.puhov@linaro.org, alex.bennee@linaro.org, Artyom Tarasenko Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Soon we will call cpu_has_work without the BQL. Cc: Artyom Tarasenko Reviewed-by: Richard Henderson Acked-by: Mark Cave-Ayland Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- target/sparc/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index cef25238a5..3fa1a535d9 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -704,6 +704,8 @@ static bool sparc_cpu_has_work(CPUState *cs) SPARCCPU *cpu = SPARC_CPU(cs); CPUSPARCState *env = &cpu->env; + g_assert(qemu_mutex_iothread_locked()); + return (cpu_interrupt_request(cs) & CPU_INTERRUPT_HARD) && cpu_interrupts_enabled(env); } @@ -863,7 +865,7 @@ static void sparc_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = sparc_cpu_class_by_name; cc->parse_features = sparc_cpu_parse_features; - cc->has_work = sparc_cpu_has_work; + cc->has_work_with_iothread_lock = sparc_cpu_has_work; cc->do_interrupt = sparc_cpu_do_interrupt; cc->cpu_exec_interrupt = sparc_cpu_exec_interrupt; cc->dump_state = sparc_cpu_dump_state; From patchwork Wed Jun 17 21:02:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190970 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp829050ilo; Wed, 17 Jun 2020 14:52:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz6GA6b0mCrxJ7OnhChakKnWKatPQqik76TorBviMxOcw7cxnleSVXlQ34fgmhj/5q8SFZj X-Received: by 2002:a25:354:: with SMTP id 81mr1730342ybd.257.1592430773454; Wed, 17 Jun 2020 14:52:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592430773; cv=none; d=google.com; s=arc-20160816; b=auZ2M7NttzcRrXptXzAtXwIhPldj4TM64M0YtOyh/N2VgoZZ5plIgrO9FVs78HHgNu vHbmE1+VjCUoZtdtRJDIOk8DtI1tVgAFwQyjFm+2gYmkOWRPadnz8vX2cOi3u0cKErZU WLE4h6y3YsEg8KzETIZbGNxdlZW55aCV8NKRNrlwUmRCLtV4qt5Y7tQYrm1j9IDa+q9w XP5xZT5BNsHixGYAUO14UMqP16PrTR/sAHBYrU8FLxvm80hVKbn3yiagGKqTqJaD/QNw ngU43FUsAGplIC8PQzTsOcHFpQkjuk/9RAn8x2DCdP8/QINMOKvzmTJJMVjOLJgOU61F 55ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=FcchR0Kiy3cS07PsythDlOBOqbmqT9MEDX8/TYIcoYY=; b=Mo/sn7p+3PZS8ifrs48Al6WSx8h0y1f2VJ6Ykhv0b/ES+LJtfjl7wV5Ec6E2AMFmr0 1fNHM6w16fGdegXCPCccnQ4fvSheQkDL0L88LP00CMayS7PnwNBHD688JbzRpoyUWY6j RGEvJZ/ps/pBubaSrbloKOqr+1+E73oXO2cKMtDQDNyW7C/elfAOUxeX9rPaeJIVd40p 2QvrG/2/dKjm28Vquaa4WW96XC0VnnYDcOQwhw3S5SctR2fFAy9LiNBQdIwW+YHZzagk 7dqYuJzlEZJVNfvx0nWt2tyQsUihNLa63Tz8bMU9vT9Hl11zxz/gU7PDQplDeiy2bOEn bYNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=b7NNgrZr; 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=fail (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 e7si709951ybf.291.2020.06.17.14.52.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:52:53 -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=fail header.i=@linaro.org header.s=google header.b=b7NNgrZr; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:49356 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfzI-0002O0-Sx for patch@linaro.org; Wed, 17 Jun 2020 17:52:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38220) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfEw-0004hb-0b for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:58 -0400 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]:41381) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfEs-0000Pj-JN for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:57 -0400 Received: by mail-qk1-x743.google.com with SMTP id n11so3491772qkn.8 for ; Wed, 17 Jun 2020 14:04:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=FcchR0Kiy3cS07PsythDlOBOqbmqT9MEDX8/TYIcoYY=; b=b7NNgrZrFNuqVFOfuDQ849a9QCbO8DRNYzIhM0lVUGYEd5ZmLEzBXc9iDl2xxSdRNX wyvClhDSJmiqfoawmvHf63Ivq9hJxSUryarsthN6PgF0Hj7roHiy7732Pgu2AVqtU/lk vD8P9EvZtlR5KoVsJgd3YqI6z0Q+alrUH6ZazunfyvHsYdPmBtk7k6CQuMCPhFPtgBR5 s5Ygr9YbIarzbNs3cTe6gAMyptKJNna9j30UF3Mm6ORtQqqKGkbRYd95Q4G2jxOxJUTY sElUgc1sLzdzOWctyz+lGbsc9YsLVV7/bCZ/URBv4iSO9rYAJOMRz+nfIuxbA00d6K/b IWaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=FcchR0Kiy3cS07PsythDlOBOqbmqT9MEDX8/TYIcoYY=; b=THiEuTHk/drK9Xbdq6dnf4R57thrWQCC3KDn838q8h4JUlUigTn7K7JYU/fKuTYbT8 cXnihemOaeID1NiFmRXGhwrJolEWn5Bx+jGABibUX5yAGsKtyDTRN3nLfXisF8izR5zR 2D8m29Q1HSZEQF7rQL+2dAKzIFafqiBOHoK11B/bijLhOquWqKUA+KcXtseYCRTDio8c gnj7K02VDmJY33PCEfHvFfUL98O0CVilC44sIEP9GFqEbFK0swgptWeGLq96jDIDCxrr Thn16YWnyWK9e/NqyARexWlQagyYs5hGGgbEJBF3TpLhE8zhikqwdESi415G6uf4tpoQ ppsQ== X-Gm-Message-State: AOAM533fmG1MZi7GqIBsjISbnBczfdF3pbC0XxuDdbCtEkUAiqOJ5Uog K6npnLfcbx0jnCixXdpC7cU1IX/aSW+qzw== X-Received: by 2002:a37:a84c:: with SMTP id r73mr336144qke.0.1592427893463; Wed, 17 Jun 2020 14:04:53 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.04.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:04:52 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 68/73] xtensa: convert to cpu_has_work_with_iothread_lock Date: Wed, 17 Jun 2020 17:02:26 -0400 Message-Id: <20200617210231.4393-69-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::743; envelope-from=robert.foley@linaro.org; helo=mail-qk1-x743.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.puhov@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, Max Filippov Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Soon we will call cpu_has_work without the BQL. Cc: Max Filippov Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- target/xtensa/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c index fda4a73722..0f96483563 100644 --- a/target/xtensa/cpu.c +++ b/target/xtensa/cpu.c @@ -47,6 +47,8 @@ static bool xtensa_cpu_has_work(CPUState *cs) #ifndef CONFIG_USER_ONLY XtensaCPU *cpu = XTENSA_CPU(cs); + g_assert(qemu_mutex_iothread_locked()); + return !cpu->env.runstall && cpu->env.pending_irq_level; #else return true; @@ -187,7 +189,7 @@ static void xtensa_cpu_class_init(ObjectClass *oc, void *data) device_class_set_parent_reset(dc, xtensa_cpu_reset, &xcc->parent_reset); cc->class_by_name = xtensa_cpu_class_by_name; - cc->has_work = xtensa_cpu_has_work; + cc->has_work_with_iothread_lock = xtensa_cpu_has_work; cc->do_interrupt = xtensa_cpu_do_interrupt; cc->cpu_exec_interrupt = xtensa_cpu_exec_interrupt; cc->dump_state = xtensa_cpu_dump_state; From patchwork Wed Jun 17 21:02:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190962 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp822909ilo; Wed, 17 Jun 2020 14:42:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzpzlB0fRR+zPrv22SK1gxfQ0XLhr75TGroMO1CuDVMVginIBldlO0maXoXmC/USugt4QkY X-Received: by 2002:a25:3586:: with SMTP id c128mr1564066yba.494.1592430139878; Wed, 17 Jun 2020 14:42:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592430139; cv=none; d=google.com; s=arc-20160816; b=MWOtD4eN+w7CoO1vNyYDquS1tt+bxO8btGI5iuyFJvMkU5kXLoIWWXSHhu2drvuezX VCStOA84DZS6KwNeZ/CChlPykpmz7Orw6rc7hWkWw1nP0nW89RbI33JwnjsDUiPRro9s 5LqxtXfdLkDOntcEcBGCqdjQuU5bEVxtOPvjsOwMpLAQqq2miM5p0d4NEqBIUCwCrFAL AAGd5FMVozirwSOxkEoLc9epjdtJ4sDoZ9t+Zkjjfym7btr4nFHYCqrv9mYxesFB6wQQ IEzfRX16hkJexVT2Ki4ZKrkVbmtDnHGbbN99j7bs64Kv7w6Bsm0hrDUuEzCmlATzUN8S beEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=E8xOKg6zl9lpl0+sHu1MbBAzWMqSY0gf0lTzZwybF5o=; b=X9NyHFNLfwlUC2nxDjlNRD4ZYvlua3qwQ755w08ifUWLDMjr3iOwuatEOH/ZRwGvi4 EywW1/P17vj0wXGclfFPRlQ5ooWSszN+B5EcFjmVUBgmuqFnHvJRvjKji7Gpn/HKUQKQ kaXBq8OqFccc5xzz5SJl9M7hL90oZ2HDIHXmRFWsclk9r7aGofEoVEHK0uLhrx9w79kv WZTxPvCbM3FItNGJId/DjvXE05/nLiiRy0JMEnxJ0QaiSHubNv07fI+RF2NlSn5yomQg LG/uAZiLR8mUWSzkEMU9vVS3sQAt4ANzoxODI5P7q64CDKiObNsWLk3/Ye8CDVXlZO9I iguw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=eeIjDad8; 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=fail (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 n4si749715ybn.165.2020.06.17.14.42.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:42:19 -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=fail header.i=@linaro.org header.s=google header.b=eeIjDad8; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:32796 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfp5-0007aa-8F for patch@linaro.org; Wed, 17 Jun 2020 17:42:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38262) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfEz-0004kL-11 for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:05:01 -0400 Received: from mail-qt1-x842.google.com ([2607:f8b0:4864:20::842]:44362) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfEu-0000Pw-Gg for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:04:59 -0400 Received: by mail-qt1-x842.google.com with SMTP id c12so2732467qtq.11 for ; Wed, 17 Jun 2020 14:04:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=E8xOKg6zl9lpl0+sHu1MbBAzWMqSY0gf0lTzZwybF5o=; b=eeIjDad8QZZSwiPDJPlhK/CUYY5xjxWhWsCKEVDRwD3prmDhbP4OuHsTXGFXpyrqcq fgL/59sa1tTdZYAx6uk1lLa5Q+Se/972AnxrO01Cr8/UbSGVL7bn9NSGDkTMTMbicdhQ aH/doqCOF3vW6zSGP+7cYoR2f1igNxpmw1+vimHRxx+divzGubxR3ypvQNKYjIj+oXwa 48NS/Hj43H6dv3L/tKAC9jBK21DOMfFZlfHZ4LAGuFfFQdKm6EdjWN7e2YQTkxIee/fu vOU7ri095drXYoDMfOlLhttYnZPJTQZHypybF08Lqdh60s/NBK+ZJVNp/n6DyPSKPbae PvPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=E8xOKg6zl9lpl0+sHu1MbBAzWMqSY0gf0lTzZwybF5o=; b=sK5Gk8ZWfHUjZaOIMN5+6k6nwzG3NAmRgUnZJdh+omn0cPJxYsflrqjKUxytgBWIqc n090WGK/hOT3DTGCzMVyu4yQzfzOyI/Ref6/5wNfuuBdByS/6NAFL5VoaLMSA56hQms/ JfnMUYRjmCl1dkZ+s0OYdfRXViqX6AuVXnkEgEawo1PMSzuL5SDky5+uvCwIwY81MeHk XXCo+JNaK39KXtTKcGOO2oAduPEK5Pj8jwyNFaFRodU2cBVhheT9a0cfmQsnyJFCap/s 9E+syn7r6E390Y09vM3cP8Gedxz9/BZMjjCWHc3OGOTKDh0nGcahLErK5o+Zz9IzU0bF AeOw== X-Gm-Message-State: AOAM533Jfeu8PiAaqTpp248VUgzbsJY8qiZiCFa5s0mVqlej560yD1Gj +IbCxTG3ri1EGhuiK4CKo/t3f8jsWJMQkQ== X-Received: by 2002:ac8:4281:: with SMTP id o1mr1113527qtl.322.1592427894841; Wed, 17 Jun 2020 14:04:54 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.04.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:04:54 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 69/73] cpu: rename all_cpu_threads_idle to qemu_tcg_rr_all_cpu_threads_idle Date: Wed, 17 Jun 2020 17:02:27 -0400 Message-Id: <20200617210231.4393-70-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::842; envelope-from=robert.foley@linaro.org; helo=mail-qt1-x842.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robert.foley@linaro.org, cota@braap.org, Paolo Bonzini , peter.puhov@linaro.org, alex.bennee@linaro.org, Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" This function is only called from TCG rr mode, so add a prefix to mark this as well as an assertion. Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- cpus.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) -- 2.17.1 diff --git a/cpus.c b/cpus.c index e070bffbff..2e9c19ae36 100644 --- a/cpus.c +++ b/cpus.c @@ -230,10 +230,12 @@ static bool cpu_thread_is_idle(CPUState *cpu) return true; } -static bool all_cpu_threads_idle(void) +static bool qemu_tcg_rr_all_cpu_threads_idle(void) { CPUState *cpu; + g_assert(qemu_is_tcg_rr()); + CPU_FOREACH(cpu) { if (!cpu_thread_is_idle(cpu)) { return false; @@ -642,7 +644,7 @@ void qemu_start_warp_timer(void) } if (replay_mode != REPLAY_MODE_PLAY) { - if (!all_cpu_threads_idle()) { + if (!qemu_tcg_rr_all_cpu_threads_idle()) { return; } @@ -1320,7 +1322,7 @@ static void qemu_tcg_rr_wait_io_event(void) { CPUState *cpu; - while (all_cpu_threads_idle()) { + while (qemu_tcg_rr_all_cpu_threads_idle()) { stop_tcg_kick_timer(); qemu_cond_wait(first_cpu->halt_cond, &qemu_global_mutex); } @@ -1676,7 +1678,7 @@ static void *qemu_tcg_rr_cpu_thread_fn(void *arg) atomic_mb_set(&cpu->exit_request, 0); } - if (use_icount && all_cpu_threads_idle()) { + if (use_icount && qemu_tcg_rr_all_cpu_threads_idle()) { /* * When all cpus are sleeping (e.g in WFI), to avoid a deadlock * in the main_loop, wake it up in order to start the warp timer. From patchwork Wed Jun 17 21:02:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190972 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp830790ilo; Wed, 17 Jun 2020 14:56:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwN7PAEYhy1TJb85dvvnzRC29BmEKHPGF8b7q5KAZUmZyHc2AY7ac9z8iNIo3NLOS0ujIex X-Received: by 2002:a25:4cc8:: with SMTP id z191mr1562828yba.211.1592430983816; Wed, 17 Jun 2020 14:56:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592430983; cv=none; d=google.com; s=arc-20160816; b=HqpOiuLBPenBUlpJyoRdmesr2TFZpdkESU539hJ0dHnthqFNo+ZpX1QveVmxmGq6tL gq3jheufIKDBrPlZzlB+6KYDaiVYp5u/sV32RRgCr+M0j+8WjcLAnjqiwpJxU91QPnDG 6TPbb3Fz0KRv68Ysh8nlROH67PYgeoR1M+PIy/4oIBf0lQ9gXMWg0RBfw11lmGS/YPiF Yhts2OR9unRO2Z0WDji8Bw6RPHOZhPt2d5nvpYzDG/574t9BJXfQfex9VRjuqVGR0Uoo dCfmoJCBSOvwKsRBK23khAy8Ejn/CdgsOvlGABd4Ptv3AIPDiDHS6UXOv80R33QCXzxp d1Hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=somM3qjZe4+by7maEgxb8iMXH+nc+Oo/EsRQ641wFQQ=; b=bbnSHKDLAQ9dYbdrPYoESSG9sloE8FJTz5FYhf632L/lyQMYeUMLZEaitxleO2HW78 +jFC3wqeq+sLPaQxhkvItuoyMrlVlfHXIstpoMBfYbMIJe5L3e+2QU72CAnCSjvUETpX wsSFfntoOzR/IohkLv3piGEU69qky1QlON7OwFLxD/+5lsGfbZhMkzUML8OFQhllSR0k VqSqzhuJ50rH+D7Vlf40TIz1T4ElQe46KiBxhwrroyB1IE6A02siRqVw5FeFG/S5H2af ZXT/tUQss6MP4OTiOpbAzP7EF09Fvz5gmCpfZNbpmd0xVifHgLkm+MwUYwYan0SLHOek NC8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Q7iL6Pzi; 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=fail (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 j11si717814ybt.84.2020.06.17.14.56.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:56:23 -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=fail header.i=@linaro.org header.s=google header.b=Q7iL6Pzi; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:37770 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlg2h-00015j-6Z for patch@linaro.org; Wed, 17 Jun 2020 17:56:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38310) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfF1-0004nA-Nw for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:05:04 -0400 Received: from mail-qk1-x729.google.com ([2607:f8b0:4864:20::729]:42240) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfEw-0000QR-UP for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:05:03 -0400 Received: by mail-qk1-x729.google.com with SMTP id l17so3474983qki.9 for ; Wed, 17 Jun 2020 14:04:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=somM3qjZe4+by7maEgxb8iMXH+nc+Oo/EsRQ641wFQQ=; b=Q7iL6PziRJHNj5UdpvXQaBPkofmTiZO+q+U6VHpTWjdhCZe74NLRKmipvbU8qifmr4 iPE/aT98AutiUsVlBKOwe+JKOBt9oYn2skWIKONTpDm0GGp1txaBtqV/xsDvzpLpeSoE Vlm59gZR9RPWls3L0gEPUI72V3jwMpBVy0YoFdylK5zT6GZpPaqIwTYPiCtZ4muPom3I nxdX//UPyGjZX1myffWKbjRAyId5GpLSGyAEr+/AbRIVH8sTfTp5vEw12XvQ80CsVOs+ PnZWtcTQbh55CCpXQ3PfBsh3VLdCKLV5JXKFOdNQuvaqucHTkNqNlH++UP1fqnrnQZFd IltA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=somM3qjZe4+by7maEgxb8iMXH+nc+Oo/EsRQ641wFQQ=; b=ot3w8xSfvaecBCf+j4ihDUv1EtZy9yOsCYqWME5nXnRL2hP2P3zzKPC2CElPLGPrV6 S6cxUv05nbrpqchKqQf6B4xUrNRdVL3+Lj6cLSTuLS2gkS3WRZk5ulwL/8FTazNJPcIy G5C5TVhrGsGTLpe2kMRKEO8lnP/sfcILbDDbEZgs/yHjOJl/o8r9XLoS2fwMgdtVuzLc 9jWjXgn/lIe0Zidkl8SWitztq8UMmMpnd/OEprQPPgCJUy54f6o2fqOPIQWL0Ms7p6uO xiE5zRww3Vo8cxTf6ugnmCzFv1bN1Xxu13eZ4dTsAJCbDvvPtED1Vgdg0T6SJT3sgjRE XlTg== X-Gm-Message-State: AOAM533i3shK5CdeNNtwwgyM/850SMBjv5kTt7i9xlil/Ua+SINfL/bx 6QpNcm4tYNOD2DUIWlwxmlsZuEkjYfVvKQ== X-Received: by 2002:a05:620a:14b8:: with SMTP id x24mr536947qkj.284.1592427896538; Wed, 17 Jun 2020 14:04:56 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.04.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:04:55 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 70/73] cpu: protect CPU state with cpu->lock instead of the BQL Date: Wed, 17 Jun 2020 17:02:28 -0400 Message-Id: <20200617210231.4393-71-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::729; envelope-from=robert.foley@linaro.org; helo=mail-qk1-x729.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robert.foley@linaro.org, Eduardo Habkost , cota@braap.org, Paolo Bonzini , peter.puhov@linaro.org, alex.bennee@linaro.org, Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Use the per-CPU locks to protect the CPUs' state, instead of using the BQL. These locks are uncontended (they are mostly acquired by the corresponding vCPU thread), so acquiring them is cheaper than acquiring the BQL, which particularly in MTTCG can be contended at high core counts. In this conversion we drop qemu_cpu_cond and qemu_pause_cond, and use cpu->cond instead. In qom/cpu.c we can finally remove the ugliness that results from having to hold both the BQL and the CPU lock; now we just have to grab the CPU lock. Removed g_assert(qemu_mutex_iothread_locked()) from qemu_tcg_rr_all_cpu_threads_idle(). There is an existing case where we call qemu_tcg_rr_all_cpu_threads_idle() without the BQL held. Also changed qemu_cond_wait() to qemu_cond_timed_wait() in qemu_tcg_rr_cpu_thread_fn() to fix issue where we might miss the broadcast wakeup. Also changed to obtain cpu lock in qemu_cpu_kick() prior to broadcast to avoid missing notification. Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota [RF: Adjusted assert, added timed_wait, obtain cpu lock] Signed-off-by: Robert Foley --- cpus.c | 307 ++++++++++++++++++++++++++++++++---------- hw/core/cpu.c | 29 +--- include/hw/core/cpu.h | 20 +-- 3 files changed, 248 insertions(+), 108 deletions(-) -- 2.17.1 diff --git a/cpus.c b/cpus.c index 2e9c19ae36..4a1056aab0 100644 --- a/cpus.c +++ b/cpus.c @@ -200,24 +200,30 @@ void cpu_mutex_destroy(CPUState *cpu) } } -bool cpu_is_stopped(CPUState *cpu) +/* Called with the CPU's lock held */ +static bool cpu_is_stopped_locked(CPUState *cpu) { return cpu->stopped || !runstate_is_running(); } -static inline bool cpu_work_list_empty(CPUState *cpu) +bool cpu_is_stopped(CPUState *cpu) { - bool ret; + if (!cpu_mutex_locked(cpu)) { + bool ret; - cpu_mutex_lock(cpu); - ret = QSIMPLEQ_EMPTY(&cpu->work_list); - cpu_mutex_unlock(cpu); - return ret; + cpu_mutex_lock(cpu); + ret = cpu_is_stopped_locked(cpu); + cpu_mutex_unlock(cpu); + return ret; + } + return cpu_is_stopped_locked(cpu); } static bool cpu_thread_is_idle(CPUState *cpu) { - if (cpu->stop || !cpu_work_list_empty(cpu)) { + g_assert(cpu_mutex_locked(cpu)); + + if (cpu->stop || !QSIMPLEQ_EMPTY(&cpu->work_list)) { return false; } if (cpu_is_stopped(cpu)) { @@ -235,9 +241,16 @@ static bool qemu_tcg_rr_all_cpu_threads_idle(void) CPUState *cpu; g_assert(qemu_is_tcg_rr()); + g_assert(no_cpu_mutex_locked()); CPU_FOREACH(cpu) { - if (!cpu_thread_is_idle(cpu)) { + bool is_idle; + + cpu_mutex_lock(cpu); + is_idle = cpu_thread_is_idle(cpu); + cpu_mutex_unlock(cpu); + + if (!is_idle) { return false; } } @@ -731,6 +744,8 @@ void qemu_start_warp_timer(void) static void qemu_account_warp_timer(void) { + g_assert(qemu_mutex_iothread_locked()); + if (!use_icount || !icount_sleep) { return; } @@ -865,8 +880,15 @@ static void cpu_throttle_thread(CPUState *cpu, run_on_cpu_data opaque) endtime_ns = qemu_clock_get_ns(QEMU_CLOCK_REALTIME) + sleeptime_ns; while (sleeptime_ns > 0 && !cpu->stop) { if (sleeptime_ns > SCALE_MS) { - qemu_cond_timedwait(cpu->halt_cond, &qemu_global_mutex, - sleeptime_ns / SCALE_MS); + if (!cpu_mutex_locked(cpu)) { + cpu_mutex_lock(cpu); + qemu_cond_timedwait(cpu->halt_cond, cpu->lock, + sleeptime_ns / SCALE_MS); + cpu_mutex_unlock(cpu); + } else { + qemu_cond_timedwait(cpu->halt_cond, cpu->lock, + sleeptime_ns / SCALE_MS); + } } else { qemu_mutex_unlock_iothread(); g_usleep(sleeptime_ns / SCALE_US); @@ -1086,6 +1108,7 @@ static void kick_tcg_thread(void *opaque) static void start_tcg_kick_timer(void) { assert(!mttcg_enabled); + g_assert(qemu_mutex_iothread_locked()); if (!tcg_kick_vcpu_timer && CPU_NEXT(first_cpu)) { tcg_kick_vcpu_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, kick_tcg_thread, NULL); @@ -1098,6 +1121,7 @@ static void start_tcg_kick_timer(void) static void stop_tcg_kick_timer(void) { assert(!mttcg_enabled); + g_assert(qemu_mutex_iothread_locked()); if (tcg_kick_vcpu_timer && timer_pending(tcg_kick_vcpu_timer)) { timer_del(tcg_kick_vcpu_timer); } @@ -1199,6 +1223,8 @@ int vm_shutdown(void) static bool cpu_can_run(CPUState *cpu) { + g_assert(cpu_mutex_locked(cpu)); + if (cpu->stop) { return false; } @@ -1271,16 +1297,9 @@ static void qemu_init_sigbus(void) static QemuThread io_thread; -/* cpu creation */ -static QemuCond qemu_cpu_cond; -/* system init */ -static QemuCond qemu_pause_cond; - void qemu_init_cpu_loop(void) { qemu_init_sigbus(); - qemu_cond_init(&qemu_cpu_cond); - qemu_cond_init(&qemu_pause_cond); qemu_mutex_init(&qemu_global_mutex); qemu_thread_get_self(&io_thread); @@ -1298,39 +1317,60 @@ static void qemu_tcg_destroy_vcpu(CPUState *cpu) { } -static void qemu_cpu_stop(CPUState *cpu, bool exit) +static void qemu_cpu_stop_locked(CPUState *cpu, bool exit) { + g_assert(cpu_mutex_locked(cpu)); g_assert(qemu_cpu_is_self(cpu)); cpu->stop = false; cpu->stopped = true; if (exit) { cpu_exit(cpu); } - qemu_cond_broadcast(&qemu_pause_cond); + qemu_cond_broadcast(&cpu->cond); +} + +static void qemu_cpu_stop(CPUState *cpu, bool exit) +{ + cpu_mutex_lock(cpu); + qemu_cpu_stop_locked(cpu, exit); + cpu_mutex_unlock(cpu); } static void qemu_wait_io_event_common(CPUState *cpu) { + g_assert(cpu_mutex_locked(cpu)); + atomic_mb_set(&cpu->thread_kicked, false); if (cpu->stop) { - qemu_cpu_stop(cpu, false); + qemu_cpu_stop_locked(cpu, false); } + /* + * unlock+lock cpu_mutex, so that other vCPUs have a chance to grab the + * lock and queue some work for this vCPU. + */ + cpu_mutex_unlock(cpu); process_queued_cpu_work(cpu); + cpu_mutex_lock(cpu); } static void qemu_tcg_rr_wait_io_event(void) { CPUState *cpu; + g_assert(qemu_mutex_iothread_locked()); + g_assert(no_cpu_mutex_locked()); + while (qemu_tcg_rr_all_cpu_threads_idle()) { stop_tcg_kick_timer(); - qemu_cond_wait(first_cpu->halt_cond, &qemu_global_mutex); + qemu_cond_wait(first_cpu->halt_cond, first_cpu->lock); } start_tcg_kick_timer(); CPU_FOREACH(cpu) { + cpu_mutex_lock(cpu); qemu_wait_io_event_common(cpu); + cpu_mutex_unlock(cpu); } } @@ -1338,12 +1378,15 @@ static void qemu_wait_io_event(CPUState *cpu) { bool slept = false; + g_assert(cpu_mutex_locked(cpu)); + g_assert(!qemu_mutex_iothread_locked()); + while (cpu_thread_is_idle(cpu)) { if (!slept) { slept = true; qemu_plugin_vcpu_idle_cb(cpu); } - qemu_cond_wait(cpu->halt_cond, &qemu_global_mutex); + qemu_cond_wait(cpu->halt_cond, cpu->lock); } if (slept) { qemu_plugin_vcpu_resume_cb(cpu); @@ -1366,6 +1409,7 @@ static void *qemu_kvm_cpu_thread_fn(void *arg) rcu_register_thread(); qemu_mutex_lock_iothread(); + cpu_mutex_lock(cpu); qemu_thread_get_self(cpu->thread); cpu->thread_id = qemu_get_thread_id(); cpu->can_do_io = 1; @@ -1378,15 +1422,21 @@ static void *qemu_kvm_cpu_thread_fn(void *arg) } kvm_init_cpu_signals(cpu); + qemu_mutex_unlock_iothread(); /* signal CPU creation */ cpu->created = true; - qemu_cond_signal(&qemu_cpu_cond); + qemu_cond_signal(&cpu->cond); qemu_guest_random_seed_thread_part2(cpu->random_seed); do { if (cpu_can_run(cpu)) { + cpu_mutex_unlock(cpu); + qemu_mutex_lock_iothread(); r = kvm_cpu_exec(cpu); + qemu_mutex_unlock_iothread(); + cpu_mutex_lock(cpu); + if (r == EXCP_DEBUG) { cpu_handle_guest_debug(cpu); } @@ -1394,10 +1444,16 @@ static void *qemu_kvm_cpu_thread_fn(void *arg) qemu_wait_io_event(cpu); } while (!cpu->unplug || cpu_can_run(cpu)); + cpu_mutex_unlock(cpu); + qemu_mutex_lock_iothread(); qemu_kvm_destroy_vcpu(cpu); - cpu->created = false; - qemu_cond_signal(&qemu_cpu_cond); qemu_mutex_unlock_iothread(); + + cpu_mutex_lock(cpu); + cpu->created = false; + qemu_cond_signal(&cpu->cond); + cpu_mutex_unlock(cpu); + rcu_unregister_thread(); return NULL; } @@ -1414,7 +1470,7 @@ static void *qemu_dummy_cpu_thread_fn(void *arg) rcu_register_thread(); - qemu_mutex_lock_iothread(); + cpu_mutex_lock(cpu); qemu_thread_get_self(cpu->thread); cpu->thread_id = qemu_get_thread_id(); cpu->can_do_io = 1; @@ -1425,11 +1481,11 @@ static void *qemu_dummy_cpu_thread_fn(void *arg) /* signal CPU creation */ cpu->created = true; - qemu_cond_signal(&qemu_cpu_cond); + qemu_cond_signal(&cpu->cond); qemu_guest_random_seed_thread_part2(cpu->random_seed); do { - qemu_mutex_unlock_iothread(); + cpu_mutex_unlock(cpu); do { int sig; r = sigwait(&waitset, &sig); @@ -1438,11 +1494,11 @@ static void *qemu_dummy_cpu_thread_fn(void *arg) perror("sigwait"); exit(1); } - qemu_mutex_lock_iothread(); + cpu_mutex_lock(cpu); qemu_wait_io_event(cpu); } while (!cpu->unplug); - qemu_mutex_unlock_iothread(); + cpu_mutex_unlock(cpu); rcu_unregister_thread(); return NULL; #endif @@ -1482,6 +1538,8 @@ static int64_t tcg_get_icount_limit(void) static void handle_icount_deadline(void) { assert(qemu_in_vcpu_thread()); + g_assert(qemu_mutex_iothread_locked()); + if (use_icount) { int64_t deadline = qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL, QEMU_TIMER_ATTR_ALL); @@ -1562,12 +1620,15 @@ static void deal_with_unplugged_cpus(void) CPUState *cpu; CPU_FOREACH(cpu) { + cpu_mutex_lock(cpu); if (cpu->unplug && !cpu_can_run(cpu)) { qemu_tcg_destroy_vcpu(cpu); cpu->created = false; - qemu_cond_signal(&qemu_cpu_cond); + qemu_cond_signal(&cpu->cond); + cpu_mutex_unlock(cpu); break; } + cpu_mutex_unlock(cpu); } } @@ -1588,25 +1649,45 @@ static void *qemu_tcg_rr_cpu_thread_fn(void *arg) rcu_register_thread(); tcg_register_thread(); + /* + * We call cpu_mutex_lock/unlock just to please the assertions in common + * code, since here cpu->lock is an alias to the BQL. + */ qemu_mutex_lock_iothread(); + cpu_mutex_lock(cpu); qemu_thread_get_self(cpu->thread); - cpu->thread_id = qemu_get_thread_id(); cpu->created = true; cpu->can_do_io = 1; - qemu_cond_signal(&qemu_cpu_cond); + qemu_cond_signal(&cpu->cond); + cpu_mutex_unlock(cpu); qemu_guest_random_seed_thread_part2(cpu->random_seed); /* wait for initial kick-off after machine start */ + cpu_mutex_lock(first_cpu); while (first_cpu->stopped) { - qemu_cond_wait(first_cpu->halt_cond, &qemu_global_mutex); + /* + * a timedwait is needed since this gets kicked off + * by a cond_broadcast, and it is possible + * to not be woken up by the broadcast if we are + * not waiting when the broadcast is sent. + */ + qemu_cond_timedwait(first_cpu->halt_cond, + first_cpu->lock, + 100); + cpu_mutex_unlock(first_cpu); /* process any pending work */ CPU_FOREACH(cpu) { current_cpu = cpu; + cpu_mutex_lock(cpu); qemu_wait_io_event_common(cpu); + cpu_mutex_unlock(cpu); } + + cpu_mutex_lock(first_cpu); } + cpu_mutex_unlock(first_cpu); start_tcg_kick_timer(); @@ -1633,7 +1714,12 @@ static void *qemu_tcg_rr_cpu_thread_fn(void *arg) cpu = first_cpu; } - while (cpu && cpu_work_list_empty(cpu) && !cpu->exit_request) { + while (cpu) { + cpu_mutex_lock(cpu); + if (!QSIMPLEQ_EMPTY(&cpu->work_list) || cpu->exit_request) { + cpu_mutex_unlock(cpu); + break; + } atomic_mb_set(&tcg_current_rr_cpu, cpu); current_cpu = cpu; @@ -1644,6 +1730,7 @@ static void *qemu_tcg_rr_cpu_thread_fn(void *arg) if (cpu_can_run(cpu)) { int r; + cpu_mutex_unlock(cpu); qemu_mutex_unlock_iothread(); prepare_icount_for_run(cpu); @@ -1651,11 +1738,14 @@ static void *qemu_tcg_rr_cpu_thread_fn(void *arg) process_icount_data(cpu); qemu_mutex_lock_iothread(); + cpu_mutex_lock(cpu); if (r == EXCP_DEBUG) { cpu_handle_guest_debug(cpu); + cpu_mutex_unlock(cpu); break; } else if (r == EXCP_ATOMIC) { + cpu_mutex_unlock(cpu); qemu_mutex_unlock_iothread(); cpu_exec_step_atomic(cpu); qemu_mutex_lock_iothread(); @@ -1665,11 +1755,15 @@ static void *qemu_tcg_rr_cpu_thread_fn(void *arg) if (cpu->unplug) { cpu = CPU_NEXT(cpu); } + cpu_mutex_unlock(current_cpu); break; } + cpu_mutex_unlock(cpu); cpu = CPU_NEXT(cpu); - } /* while (cpu && !cpu->exit_request).. */ + } /* for (;;) .. */ + + g_assert(no_cpu_mutex_locked()); /* Does not need atomic_mb_set because a spurious wakeup is okay. */ atomic_set(&tcg_current_rr_cpu, NULL); @@ -1701,6 +1795,7 @@ static void *qemu_hax_cpu_thread_fn(void *arg) rcu_register_thread(); qemu_mutex_lock_iothread(); + cpu_mutex_lock(cpu); qemu_thread_get_self(cpu->thread); cpu->thread_id = qemu_get_thread_id(); @@ -1708,12 +1803,18 @@ static void *qemu_hax_cpu_thread_fn(void *arg) current_cpu = cpu; hax_init_vcpu(cpu); - qemu_cond_signal(&qemu_cpu_cond); + qemu_mutex_unlock_iothread(); + qemu_cond_signal(&cpu->cond); qemu_guest_random_seed_thread_part2(cpu->random_seed); do { if (cpu_can_run(cpu)) { + cpu_mutex_unlock(cpu); + qemu_mutex_lock_iothread(); r = hax_smp_cpu_exec(cpu); + qemu_mutex_unlock_iothread(); + cpu_mutex_lock(cpu); + if (r == EXCP_DEBUG) { cpu_handle_guest_debug(cpu); } @@ -1721,6 +1822,8 @@ static void *qemu_hax_cpu_thread_fn(void *arg) qemu_wait_io_event(cpu); } while (!cpu->unplug || cpu_can_run(cpu)); + + cpu_mutex_unlock(cpu); rcu_unregister_thread(); return NULL; } @@ -1738,6 +1841,7 @@ static void *qemu_hvf_cpu_thread_fn(void *arg) rcu_register_thread(); qemu_mutex_lock_iothread(); + cpu_mutex_lock(cpu); qemu_thread_get_self(cpu->thread); cpu->thread_id = qemu_get_thread_id(); @@ -1745,15 +1849,21 @@ static void *qemu_hvf_cpu_thread_fn(void *arg) current_cpu = cpu; hvf_init_vcpu(cpu); + qemu_mutex_unlock_iothread(); /* signal CPU creation */ cpu->created = true; - qemu_cond_signal(&qemu_cpu_cond); + qemu_cond_signal(&cpu->cond); qemu_guest_random_seed_thread_part2(cpu->random_seed); do { if (cpu_can_run(cpu)) { + cpu_mutex_unlock(cpu); + qemu_mutex_lock_iothread(); r = hvf_vcpu_exec(cpu); + qemu_mutex_unlock_iothread(); + cpu_mutex_lock(cpu); + if (r == EXCP_DEBUG) { cpu_handle_guest_debug(cpu); } @@ -1761,10 +1871,16 @@ static void *qemu_hvf_cpu_thread_fn(void *arg) qemu_wait_io_event(cpu); } while (!cpu->unplug || cpu_can_run(cpu)); + cpu_mutex_unlock(cpu); + qemu_mutex_lock_iothread(); hvf_vcpu_destroy(cpu); - cpu->created = false; - qemu_cond_signal(&qemu_cpu_cond); qemu_mutex_unlock_iothread(); + + cpu_mutex_lock(cpu); + cpu->created = false; + qemu_cond_signal(&cpu->cond); + cpu_mutex_unlock(cpu); + rcu_unregister_thread(); return NULL; } @@ -1777,6 +1893,7 @@ static void *qemu_whpx_cpu_thread_fn(void *arg) rcu_register_thread(); qemu_mutex_lock_iothread(); + cpu_mutex_lock(cpu); qemu_thread_get_self(cpu->thread); cpu->thread_id = qemu_get_thread_id(); current_cpu = cpu; @@ -1786,29 +1903,41 @@ static void *qemu_whpx_cpu_thread_fn(void *arg) fprintf(stderr, "whpx_init_vcpu failed: %s\n", strerror(-r)); exit(1); } + qemu_mutex_unlock_iothread(); /* signal CPU creation */ cpu->created = true; - qemu_cond_signal(&qemu_cpu_cond); + qemu_cond_signal(&cpu->cond); qemu_guest_random_seed_thread_part2(cpu->random_seed); do { if (cpu_can_run(cpu)) { + cpu_mutex_unlock(cpu); + qemu_mutex_lock_iothread(); r = whpx_vcpu_exec(cpu); + qemu_mutex_unlock_iothread(); + cpu_mutex_lock(cpu); + if (r == EXCP_DEBUG) { cpu_handle_guest_debug(cpu); } } while (cpu_thread_is_idle(cpu)) { - qemu_cond_wait(cpu->halt_cond, &qemu_global_mutex); + qemu_cond_wait(cpu->halt_cond, cpu->lock); } qemu_wait_io_event_common(cpu); } while (!cpu->unplug || cpu_can_run(cpu)); + cpu_mutex_unlock(cpu); + qemu_mutex_lock_iothread(); whpx_destroy_vcpu(cpu); - cpu->created = false; - qemu_cond_signal(&qemu_cpu_cond); qemu_mutex_unlock_iothread(); + + cpu_mutex_lock(cpu); + cpu->created = false; + qemu_cond_signal(&cpu->cond); + cpu_mutex_unlock(cpu); + rcu_unregister_thread(); return NULL; } @@ -1836,14 +1965,14 @@ static void *qemu_tcg_cpu_thread_fn(void *arg) rcu_register_thread(); tcg_register_thread(); - qemu_mutex_lock_iothread(); + cpu_mutex_lock(cpu); qemu_thread_get_self(cpu->thread); cpu->thread_id = qemu_get_thread_id(); cpu->created = true; cpu->can_do_io = 1; current_cpu = cpu; - qemu_cond_signal(&qemu_cpu_cond); + qemu_cond_signal(&cpu->cond); qemu_guest_random_seed_thread_part2(cpu->random_seed); /* process any pending work */ @@ -1852,9 +1981,9 @@ static void *qemu_tcg_cpu_thread_fn(void *arg) do { if (cpu_can_run(cpu)) { int r; - qemu_mutex_unlock_iothread(); + cpu_mutex_unlock(cpu); r = tcg_cpu_exec(cpu); - qemu_mutex_lock_iothread(); + cpu_mutex_lock(cpu); switch (r) { case EXCP_DEBUG: cpu_handle_guest_debug(cpu); @@ -1870,9 +1999,9 @@ static void *qemu_tcg_cpu_thread_fn(void *arg) g_assert(cpu_halted(cpu)); break; case EXCP_ATOMIC: - qemu_mutex_unlock_iothread(); + cpu_mutex_unlock(cpu); cpu_exec_step_atomic(cpu); - qemu_mutex_lock_iothread(); + cpu_mutex_lock(cpu); default: /* Ignore everything else? */ break; @@ -1885,8 +2014,8 @@ static void *qemu_tcg_cpu_thread_fn(void *arg) qemu_tcg_destroy_vcpu(cpu); cpu->created = false; - qemu_cond_signal(&qemu_cpu_cond); - qemu_mutex_unlock_iothread(); + qemu_cond_signal(&cpu->cond); + cpu_mutex_unlock(cpu); rcu_unregister_thread(); return NULL; } @@ -1920,7 +2049,13 @@ static void qemu_cpu_kick_thread(CPUState *cpu) void qemu_cpu_kick(CPUState *cpu) { - qemu_cond_broadcast(cpu->halt_cond); + if (!cpu_mutex_locked(cpu)) { + cpu_mutex_lock(cpu); + qemu_cond_broadcast(cpu->halt_cond); + cpu_mutex_unlock(cpu); + } else { + qemu_cond_broadcast(cpu->halt_cond); + } if (tcg_enabled()) { if (qemu_tcg_mttcg_enabled()) { cpu_exit(cpu); @@ -1993,54 +2128,69 @@ void qemu_cond_wait_iothread(QemuCond *cond) qemu_cond_wait(cond, &qemu_global_mutex); } -static bool all_vcpus_paused(void) -{ - CPUState *cpu; - - CPU_FOREACH(cpu) { - if (!cpu->stopped) { - return false; - } - } - - return true; -} - void pause_all_vcpus(void) { CPUState *cpu; + g_assert(no_cpu_mutex_locked()); + qemu_clock_enable(QEMU_CLOCK_VIRTUAL, false); CPU_FOREACH(cpu) { + cpu_mutex_lock(cpu); if (qemu_cpu_is_self(cpu)) { qemu_cpu_stop(cpu, true); } else { cpu->stop = true; qemu_cpu_kick(cpu); } + cpu_mutex_unlock(cpu); } + drop_locks_and_stop_all_vcpus: /* We need to drop the replay_lock so any vCPU threads woken up * can finish their replay tasks */ replay_mutex_unlock(); + qemu_mutex_unlock_iothread(); - while (!all_vcpus_paused()) { - qemu_cond_wait(&qemu_pause_cond, &qemu_global_mutex); - CPU_FOREACH(cpu) { + CPU_FOREACH(cpu) { + cpu_mutex_lock(cpu); + if (!cpu->stopped) { + cpu->stop = true; qemu_cpu_kick(cpu); + qemu_cond_wait(&cpu->cond, cpu->lock); } + cpu_mutex_unlock(cpu); } - qemu_mutex_unlock_iothread(); replay_mutex_lock(); qemu_mutex_lock_iothread(); + + /* a CPU might have been hot-plugged while we weren't holding the BQL */ + CPU_FOREACH(cpu) { + bool stopped; + + cpu_mutex_lock(cpu); + stopped = cpu->stopped; + cpu_mutex_unlock(cpu); + + if (!stopped) { + goto drop_locks_and_stop_all_vcpus; + } + } } void cpu_resume(CPUState *cpu) { - cpu->stop = false; - cpu->stopped = false; + if (cpu_mutex_locked(cpu)) { + cpu->stop = false; + cpu->stopped = false; + } else { + cpu_mutex_lock(cpu); + cpu->stop = false; + cpu->stopped = false; + cpu_mutex_unlock(cpu); + } qemu_cpu_kick(cpu); } @@ -2060,8 +2210,11 @@ void resume_all_vcpus(void) void cpu_remove_sync(CPUState *cpu) { + cpu_mutex_lock(cpu); cpu->stop = true; cpu->unplug = true; + cpu_mutex_unlock(cpu); + qemu_cpu_kick(cpu); qemu_mutex_unlock_iothread(); qemu_thread_join(cpu->thread); @@ -2245,9 +2398,15 @@ void qemu_init_vcpu(CPUState *cpu) qemu_dummy_start_vcpu(cpu); } + qemu_mutex_unlock_iothread(); + + cpu_mutex_lock(cpu); while (!cpu->created) { - qemu_cond_wait(&qemu_cpu_cond, &qemu_global_mutex); + qemu_cond_wait(&cpu->cond, cpu->lock); } + cpu_mutex_unlock(cpu); + + qemu_mutex_lock_iothread(); } void cpu_stop_current(void) diff --git a/hw/core/cpu.c b/hw/core/cpu.c index 59f02594a3..194734f16a 100644 --- a/hw/core/cpu.c +++ b/hw/core/cpu.c @@ -95,32 +95,13 @@ static void cpu_common_get_memory_mapping(CPUState *cpu, error_setg(errp, "Obtaining memory mappings is unsupported on this CPU."); } -/* Resetting the IRQ comes from across the code base so we take the - * BQL here if we need to. cpu_interrupt assumes it is held.*/ void cpu_reset_interrupt(CPUState *cpu, int mask) { - bool has_bql = qemu_mutex_iothread_locked(); - bool has_cpu_lock = cpu_mutex_locked(cpu); - - if (has_bql) { - if (has_cpu_lock) { - atomic_set(&cpu->interrupt_request, cpu->interrupt_request & ~mask); - } else { - cpu_mutex_lock(cpu); - atomic_set(&cpu->interrupt_request, cpu->interrupt_request & ~mask); - cpu_mutex_unlock(cpu); - } - return; - } - - if (has_cpu_lock) { - cpu_mutex_unlock(cpu); - } - qemu_mutex_lock_iothread(); - cpu_mutex_lock(cpu); - atomic_set(&cpu->interrupt_request, cpu->interrupt_request & ~mask); - qemu_mutex_unlock_iothread(); - if (!has_cpu_lock) { + if (cpu_mutex_locked(cpu)) { + atomic_set(&cpu->interrupt_request, cpu->interrupt_request & ~mask); + } else { + cpu_mutex_lock(cpu); + atomic_set(&cpu->interrupt_request, cpu->interrupt_request & ~mask); cpu_mutex_unlock(cpu); } } diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 720bc85a84..d5e4c339e1 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -312,10 +312,6 @@ struct qemu_work_item; * valid under cpu_list_lock. * @created: Indicates whether the CPU thread has been successfully created. * @interrupt_request: Indicates a pending interrupt request. - * @halted: Nonzero if the CPU is in suspended state. - * @stop: Indicates a pending stop request. - * @stopped: Indicates the CPU has been artificially stopped. - * @unplug: Indicates a pending CPU unplug request. * @crash_occurred: Indicates the OS reported a crash (panic) for this CPU * @singlestep_enabled: Flags for single-stepping. * @icount_extra: Instructions until next timer event. @@ -340,6 +336,10 @@ struct qemu_work_item; * after the BQL. * @cond: Condition variable for per-CPU events. * @work_list: List of pending asynchronous work. + * @halted: Nonzero if the CPU is in suspended state. + * @stop: Indicates a pending stop request. + * @stopped: Indicates the CPU has been artificially stopped. + * @unplug: Indicates a pending CPU unplug request. * @trace_dstate_delayed: Delayed changes to trace_dstate (includes all changes * to @trace_dstate). * @trace_dstate: Dynamic tracing state of events for this vCPU (bitmask). @@ -364,12 +364,7 @@ struct CPUState { #endif int thread_id; bool running, has_waiter; - struct QemuCond *halt_cond; bool thread_kicked; - bool created; - bool stop; - bool stopped; - bool unplug; bool crash_occurred; bool exit_request; bool in_exclusive_context; @@ -385,7 +380,13 @@ struct CPUState { QemuMutex *lock; /* fields below protected by @lock */ QemuCond cond; + QemuCond *halt_cond; QSIMPLEQ_HEAD(, qemu_work_item) work_list; + uint32_t halted; + bool created; + bool stop; + bool stopped; + bool unplug; CPUAddressSpace *cpu_ases; int num_ases; @@ -431,7 +432,6 @@ struct CPUState { /* TODO Move common fields from CPUArchState here. */ int cpu_index; int cluster_index; - uint32_t halted; uint32_t can_do_io; int32_t exception_index; From patchwork Wed Jun 17 21:02:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190971 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp830044ilo; Wed, 17 Jun 2020 14:54:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxC/kqVutQp4bBmtS6QG/mjbpsPKbS6NcEWWc7+kslER2x6plvC1aep1qe5I8TJYlAgAWCS X-Received: by 2002:a25:8284:: with SMTP id r4mr1490019ybk.351.1592430891664; Wed, 17 Jun 2020 14:54:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592430891; cv=none; d=google.com; s=arc-20160816; b=Ru+A4XCBWXtYuCURA+Ku883LlM1WOC3Pqplf4PrlTXSD4XlypVJE6ikaXt71DItIvD h4yURYJYmFIdlH7bg1r0Q+NeD2oroIou2pDSMGEbBg76XJiT9PbL14aXefPMOIbSWoN8 /MxfLAjvHp5qEkAggQ2xvYtM3u3ZLjTc0Ija4ofjKuCTwHLPiRo9nw/OAGaIyJXEiOCu +eT8D1/Ju98esm1C+wSNKBknPRBN5PtIHtx/iU47pw5G0B2z2BEOXPxrdx52Xw9nR3Y2 L8OWPmka+prgB86le/4AHIPxvp/w9PItt5K4Sdgoc9jGV4D3MoZuSLMkvPf+Ad9+eRF0 gxLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=kEALw3cb/snp1kLPThKHADdrwsKNjGM+CsHVn0z1BOY=; b=GCFLxKOTbGRv85BGQ8hkhsvsTPKiwamq963b/PmqURaM8J5EZRdl3VojpBAQ4i1cpO ADd/Ta2CSHVSn5w2CGcozZlVu86o/JkTQYBouRHPw3MKkv2VdmAjo3FiXF5EHWf5+n0a 0Z9YeYNRvISoDNTbZZNVy2jCWMNiUPotsxChHPVN2fD3+1xjGVKpIhe4mAxi/BMudswh BX1x+jX2TQ3h6fMC3aYZ5KSvwKJgc9h/OP7VsEEu889wZLjX2/5Z7ErUIqk+PdqLn1fL UOcOWPmm8YmnRhMUdK1IC4Kkhf2SgCSXgIedQ9itLOqynLtsARaaq0SBkpDwwDb2X8dc PX2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=bO9MuSq1; 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=fail (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 e4si756265ybp.143.2020.06.17.14.54.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:54:51 -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=fail header.i=@linaro.org header.s=google header.b=bO9MuSq1; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:57738 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlg1D-0005j3-1K for patch@linaro.org; Wed, 17 Jun 2020 17:54:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38298) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfF1-0004mC-BO for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:05:03 -0400 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]:34526) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfEx-0000Qd-99 for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:05:01 -0400 Received: by mail-qk1-x743.google.com with SMTP id f18so3525502qkh.1 for ; Wed, 17 Jun 2020 14:04:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kEALw3cb/snp1kLPThKHADdrwsKNjGM+CsHVn0z1BOY=; b=bO9MuSq1OMXIKKUrkq0Ed1xUAKaGJHYI3TUP8sVHeVVlXy8kYH34c8iZgMJ7FGnlqe LtFgPKywurlzQsVGxJ+n385Gxywl8qMKrJusr9swyNSfM3ix8tHpJMafEU+pLWKQI6iH sVjHNyiQd+vTndm/NIBFjdGdApsInLbwWq+1lIdmXpRff6HaHI5VmnqhejNxGBQNCpI3 GNpwgL8Zt05GSWMz2KJLeu9VCQbJ9U826hXuqgwsQM9KtnHQrZtRU5FCUohfbxYRBzC1 PNdle87wdF5h7jtxISc2tomBatJOEAFx1/oThnriGf/ZERfyrgcuLg8ymi0XmJw604ib irjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kEALw3cb/snp1kLPThKHADdrwsKNjGM+CsHVn0z1BOY=; b=OeTJPSthp0iRxitLyTqHbD5M/iqIBSnoczQpJizvzhgr29lwQHwbcN61hg+XOLkzXU 9jhvshn0mZC/Y7LMO9VyqWR5v31LbDTIkteyjGPGX0/t0c3WB8kYuA/zfXvE7XcrDfJO BiiwCwRd7GgXiW2fYL8sRb51aM8iGkmhHNl2bcd2I7GBAxGoguzzFk5MyWAbC9pxaVF/ d7S8FR1p6gGzkVZ73glcDiW6e68M/w36p7cPzhdsXaN4HtnnJTPWrvGrQPRx0rBOLjfK bo4MSiodYnkyg5a05ysSPgXWE/NzQi5afTHTrVnTstmoY8EnWOElrGANGPr9h/3eD3kF HTIw== X-Gm-Message-State: AOAM531B26OfLKMZWk+WZ7Abg75wgkFjTQQ+IhzUT5iZWoKeXkkJgBjP uBUki7tdWDM8WLvu968Y0sgIGQ/rPhX3xw== X-Received: by 2002:a37:d246:: with SMTP id f67mr578006qkj.300.1592427897910; Wed, 17 Jun 2020 14:04:57 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.04.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:04:57 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 71/73] cpus-common: release BQL earlier in run_on_cpu Date: Wed, 17 Jun 2020 17:02:29 -0400 Message-Id: <20200617210231.4393-72-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::743; envelope-from=robert.foley@linaro.org; helo=mail-qk1-x743.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robert.foley@linaro.org, cota@braap.org, Paolo Bonzini , peter.puhov@linaro.org, alex.bennee@linaro.org, Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" After completing the conversion to per-CPU locks, there is no need to release the BQL after having called cpu_kick. Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- cpus-common.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) -- 2.17.1 diff --git a/cpus-common.c b/cpus-common.c index 0287018dc4..eecd63029a 100644 --- a/cpus-common.c +++ b/cpus-common.c @@ -135,6 +135,11 @@ void run_on_cpu(CPUState *cpu, run_on_cpu_func func, run_on_cpu_data data) return; } + /* We are going to sleep on the CPU lock, so release the BQL */ + if (has_bql) { + qemu_mutex_unlock_iothread(); + } + wi.func = func; wi.data = data; wi.done = false; @@ -143,21 +148,6 @@ void run_on_cpu(CPUState *cpu, run_on_cpu_func func, run_on_cpu_data data) cpu_mutex_lock(cpu); queue_work_on_cpu_locked(cpu, &wi); - - /* - * We are going to sleep on the CPU lock, so release the BQL. - * - * During the transition to per-CPU locks, we release the BQL _after_ - * having kicked the destination CPU (from queue_work_on_cpu_locked above). - * This makes sure that the enqueued work will be seen by the CPU - * after being woken up from the kick, since the CPU sleeps on the BQL. - * Once we complete the transition to per-CPU locks, we will release - * the BQL earlier in this function. - */ - if (has_bql) { - qemu_mutex_unlock_iothread(); - } - while (!atomic_mb_read(&wi.done)) { CPUState *self_cpu = current_cpu; From patchwork Wed Jun 17 21:02:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190951 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp818459ilo; Wed, 17 Jun 2020 14:34:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwfZX+YUQnx/ysXQV/2qjvqvQnqDE9eHsOZsfRxC+dU5OHRKhljNLY04x1me56aSVke0Igp X-Received: by 2002:a25:bb01:: with SMTP id z1mr1544675ybg.140.1592429690212; Wed, 17 Jun 2020 14:34:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592429690; cv=none; d=google.com; s=arc-20160816; b=A1xBUwWD8aib28gflKqb9lcovxyryD/DqFi4DSF42DFtjbTcOw8iCm1YUKGtDR6X6p UhvtgC4B8JnZ7D2P08253BIrQW8+5YUugm+9Z6yUyejEZqMtlU6KrhlNSrDD5HDYRWsD /6zd4523ydIkFs2ozL3Ly86cLVOyxHGTBZkFHKMubEo/uj0h0i3oU7WN4EzO+wIF5tHo 45eC4QrhPilYREIB7hJ2eUtsdayWI3Mat75xIvRml+sQzjHbd4aFLZ8L7jpfLZywJw6z 0Vbl4zlNUMqwD6UtkItufcjqUAIIgqwhZbNWhN2c3mEm0PKiLWQM+c6/dQ2ZScOaFuuf SZ+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=mMSK5jG93ccRv0iEW+yiTm1N/o9bSTPpnWnCySDcIBA=; b=ASLmYkKNEsgF5XS59xKkQrete04z2vpUd/HCHgdgHqFLwgFtwX3AhFhGhhIZeUwC/R aGqffWBxmIQozXBOdW4vGV2ieov+f9tDOT4AgMRFrVNX1pRGYqY8yifsrg4ocTcPlnRK YIDS1ru/nnoRIult/k5DyvWB7CNKXozK69kqIX8Ld1iA3wRQKuV2zs/TVIL1u/5MXb6v grD5+pb+SDTE5y7VqqAO88yTTDYLWo/1SO9LX33HZlDnSY3eBoC2l3MuXyn8SoEAYUNG 39rsUFxmPda9cxDkVoPDCyXSitGQb2XkPTTFwgi72tg53H494yoz4/adK/iYLa9pUalc l7Vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=l9e2iGt6; 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=fail (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 b5si649275yba.152.2020.06.17.14.34.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:34:50 -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=fail header.i=@linaro.org header.s=google header.b=l9e2iGt6; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:60980 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfhp-0002O6-GU for patch@linaro.org; Wed, 17 Jun 2020 17:34:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38330) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfF2-0004ns-Rv for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:05:05 -0400 Received: from mail-qv1-xf41.google.com ([2607:f8b0:4864:20::f41]:42314) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfEz-0000Qm-JY for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:05:04 -0400 Received: by mail-qv1-xf41.google.com with SMTP id p15so1751615qvr.9 for ; Wed, 17 Jun 2020 14:05:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mMSK5jG93ccRv0iEW+yiTm1N/o9bSTPpnWnCySDcIBA=; b=l9e2iGt6X9bkA7GiikT3IzyDF6HuI1DQNYrztcTjfl8hAnrUokmdoS8PMcQrkKIeGi i2IydSAEhYYwj/gw+8kng65TMrgpptccie9kfRrkNpJoJJsIAG7Brc5J43IvQcqv+4wc sTvV2gKAKN1ujjKiyRmaPZqFuOdUqTPMQFFBsqh93Ep91TrKKvZWkPDfrUr3oIq5Ae7H ynlk5QG4s4RGMZZpg3fWGGqcMbCY2qRWXVuo0k2m7RHRvapYoFTSMkC1R0z2ve9YiNr+ XQyrCXHy6LBJL6EuDBEeTybBZiaVUPCoMjIXrDvdE+vj4lERk1t1xyT2duLOklQ4oCt5 KAzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mMSK5jG93ccRv0iEW+yiTm1N/o9bSTPpnWnCySDcIBA=; b=YpLrGFpnacXPWzgGq5gZUQTYNW+XEriamxf22/N8xzd5T5x/VdCVg34rER9aZwAEK9 vQuHnhUeKn8enesw9VIt5daMlEY9NHjVJw/QIsWNSQ+CtlDWcsPmSCg+0RiPcDFyy8fN v9y5yGV1DaTRD5WYdcgvl66F/wbhAmScJwJ0d0sWlXn2MkRLZmHIqhGWUBCVQ5fR9iaQ +lBNRM9J797RYmjEskNvch2CiVQS5FGRaAlosUNZGzN1MHJH0uV4hL8+cr9QGqH4TVFl LNtbVIsBKFmpbNVPE+81m2VBZqUIe0ZDEnf+93vTIxF/QrGGTiaoKVhj7kjcoZiXJ0Ck Lgyw== X-Gm-Message-State: AOAM532brwhKB05+o+zcP+hFdKUOASXiyrix5fVMnxW4eIL3vVXLnSrg Kl3tdjmSDt3f92MCG0bFF3J2Hei/Dqk8rA== X-Received: by 2002:a0c:9ba0:: with SMTP id o32mr553544qve.129.1592427899987; Wed, 17 Jun 2020 14:04:59 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.04.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:04:58 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 72/73] cpu: add async_run_on_cpu_no_bql Date: Wed, 17 Jun 2020 17:02:30 -0400 Message-Id: <20200617210231.4393-73-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::f41; envelope-from=robert.foley@linaro.org; helo=mail-qv1-xf41.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robert.foley@linaro.org, Eduardo Habkost , cota@braap.org, Paolo Bonzini , peter.puhov@linaro.org, alex.bennee@linaro.org, Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Some async jobs do not need the BQL. Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- cpus-common.c | 39 ++++++++++++++++++++++++++++++++++----- include/hw/core/cpu.h | 14 ++++++++++++++ 2 files changed, 48 insertions(+), 5 deletions(-) -- 2.17.1 diff --git a/cpus-common.c b/cpus-common.c index eecd63029a..923371a997 100644 --- a/cpus-common.c +++ b/cpus-common.c @@ -99,6 +99,7 @@ struct qemu_work_item { run_on_cpu_func func; run_on_cpu_data data; bool free, exclusive, done; + bool bql; }; /* Called with the CPU's lock held */ @@ -145,6 +146,7 @@ void run_on_cpu(CPUState *cpu, run_on_cpu_func func, run_on_cpu_data data) wi.done = false; wi.free = false; wi.exclusive = false; + wi.bql = true; cpu_mutex_lock(cpu); queue_work_on_cpu_locked(cpu, &wi); @@ -169,6 +171,21 @@ void async_run_on_cpu(CPUState *cpu, run_on_cpu_func func, run_on_cpu_data data) wi->func = func; wi->data = data; wi->free = true; + wi->bql = true; + + queue_work_on_cpu(cpu, wi); +} + +void async_run_on_cpu_no_bql(CPUState *cpu, run_on_cpu_func func, + run_on_cpu_data data) +{ + struct qemu_work_item *wi; + + wi = g_malloc0(sizeof(struct qemu_work_item)); + wi->func = func; + wi->data = data; + wi->free = true; + /* wi->bql initialized to false */ queue_work_on_cpu(cpu, wi); } @@ -315,6 +332,7 @@ void async_safe_run_on_cpu(CPUState *cpu, run_on_cpu_func func, wi->data = data; wi->free = true; wi->exclusive = true; + /* wi->bql initialized to false */ queue_work_on_cpu(cpu, wi); } @@ -339,6 +357,7 @@ static void process_queued_cpu_work_locked(CPUState *cpu) * BQL, so it goes to sleep; start_exclusive() is sleeping too, so * neither CPU can proceed. */ + g_assert(!wi->bql); if (has_bql) { qemu_mutex_unlock_iothread(); } @@ -349,12 +368,22 @@ static void process_queued_cpu_work_locked(CPUState *cpu) qemu_mutex_lock_iothread(); } } else { - if (has_bql) { - wi->func(cpu, wi->data); + if (wi->bql) { + if (has_bql) { + wi->func(cpu, wi->data); + } else { + qemu_mutex_lock_iothread(); + wi->func(cpu, wi->data); + qemu_mutex_unlock_iothread(); + } } else { - qemu_mutex_lock_iothread(); - wi->func(cpu, wi->data); - qemu_mutex_unlock_iothread(); + if (has_bql) { + qemu_mutex_unlock_iothread(); + wi->func(cpu, wi->data); + qemu_mutex_lock_iothread(); + } else { + wi->func(cpu, wi->data); + } } } cpu_mutex_lock(cpu); diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index d5e4c339e1..e37f64b57a 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -894,9 +894,23 @@ void run_on_cpu(CPUState *cpu, run_on_cpu_func func, run_on_cpu_data data); * @data: Data to pass to the function. * * Schedules the function @func for execution on the vCPU @cpu asynchronously. + * See also: async_run_on_cpu_no_bql() */ void async_run_on_cpu(CPUState *cpu, run_on_cpu_func func, run_on_cpu_data data); +/** + * async_run_on_cpu_no_bql: + * @cpu: The vCPU to run on. + * @func: The function to be executed. + * @data: Data to pass to the function. + * + * Schedules the function @func for execution on the vCPU @cpu asynchronously. + * This function is run outside the BQL. + * See also: async_run_on_cpu() + */ +void async_run_on_cpu_no_bql(CPUState *cpu, run_on_cpu_func func, + run_on_cpu_data data); + /** * async_safe_run_on_cpu: * @cpu: The vCPU to run on. From patchwork Wed Jun 17 21:02:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 190955 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp819747ilo; Wed, 17 Jun 2020 14:36:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxLcy5CvFO5bOaHNXSumi985reriyxz4X2DhikkVz7E65iIy4t7+Q9c1ywRme9c88X8+rK X-Received: by 2002:a25:af4a:: with SMTP id c10mr1722562ybj.270.1592429811467; Wed, 17 Jun 2020 14:36:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592429811; cv=none; d=google.com; s=arc-20160816; b=0gJLA5rGmLS2Et8IOlK67aAMC1h3hOYw4PSYZPBH8QxqqFpupV5fqlSSyoLM+XWUaE kiLKwczC5ry2EV0xMN0vQf5B+1HqioCymTGIN0gaxiTwjzzxJxemsty/LyipbCrXl7UW KyoH897pZsyq63ZTizS2diTcUu5Tb5pnEQEYoWnk/L25PSUfKvyZKtksnqAojtL8t5U/ rpx324dIj+Pen2i4GQDfmcyIthMvzwNAMfevtwrKXiSZ66WlBasasl+u0n2pE00memra wibodvOo6mJmLQWLNLqdQLuDKDf5/ruJtv+H2/bS0O80QeKbPKmxWgOjBUA18KOMh+AE 4Mrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=47Bm+ilUjsoqQoc0Msg5H7tt6ZAFbVXOlvVANVjxWdA=; b=Z7JywCcVleeGI2bF33UrhcxONigEe18oKXar01TYe3OiZ8rzeCMkcIMOAVCKYP+48Q BWs+3XuOKDZc0aayeEAUCtFSUmBdqBRujlkchlunKX++3erM3SMbajtmk28aYVfXgr3h Glb0sdQENtSRTSe8tnLUVJlQtjQVA0+MtcafCxDwE3fsoKyaeDro3tATEeAWeGAFaoqA wAdcmIzVF0MC6kEFoCZ6dHlux8LnL6eCbe/fNZnH1Wt2Ip4bQhtK/vJe2bEv1AKvYtvf bvSgE3ncNRIgJt60ntRcm4ql9KoDlpo6WX30POulIdr5uF1lrQft39jE3yNYmHT4HpKn 7O+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Gc6M8yD2; 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=fail (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 k21si629398ybk.116.2020.06.17.14.36.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 14:36:51 -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=fail header.i=@linaro.org header.s=google header.b=Gc6M8yD2; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:41630 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlfjm-0006mS-QL for patch@linaro.org; Wed, 17 Jun 2020 17:36:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38340) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfF4-0004p6-V4 for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:05:06 -0400 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]:43949) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlfF1-0000R9-8H for qemu-devel@nongnu.org; Wed, 17 Jun 2020 17:05:05 -0400 Received: by mail-qk1-x742.google.com with SMTP id j68so142460qkb.10 for ; Wed, 17 Jun 2020 14:05:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=47Bm+ilUjsoqQoc0Msg5H7tt6ZAFbVXOlvVANVjxWdA=; b=Gc6M8yD2PJf+m4eJQn/d9k5M5bF7YfbYtb14NoW536wuiAoo+dXW3ZBDn1/7DaX/xD wWSNbu0aiTUfBQXtFSKfy/s0o3LbEYwSMRKh91MReJaPxx4HpdIX1bDoeCrQY64WHaqX AV1PRhuchKh+lf8Gkqwj8TArkBvxOnMF0v3QF9234LlToVzhm6B39EmAzyniQhWg1yDO PzoHtpmJskKHhKADgbh7tcPg4o+wO8S08xySwvTSOPkj6bbxveDDJiqEeXVPhVmioGj+ wlM6JIN+dPBop+VXHI8V/uid2htTKct6d7aMW7iJwI0zzFSXtJ8slA6YOtrOc6CqoaUh iBJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=47Bm+ilUjsoqQoc0Msg5H7tt6ZAFbVXOlvVANVjxWdA=; b=PnmEglxs0panLFS277ix4vG1RsKNEVS9kekmHdySBvwmzkgmmiZ7wfn+PlseiHf6en o7AdCPu0IShisWDF7MMiYVwxN3in3/nm/YFs3b/8JIsbs0P8SD9lw9vN5x6i6o7kZwCl 0Mx9NpqmEYYtuhGObAw8NAXDdjXOlAffjzhkmltBJGqVGOd9AIaCcThf0cMNlbI8goAa fTwtfJ3+PnPn30vIMbTPO1rfCKL0kneM6gYTV1kISyirTL2njJmhFxXoqdMPx/Xiq4Cv t8o10YOt61ZpbDAIKIZV7hrEDbhrPtI6bk9ruRtB9C0zl78hVjN8dN5ghgN0Dlnt/Ppi ZTLA== X-Gm-Message-State: AOAM531+PEDtHEIrMjZczQeNZ557bkAlDC7SFF38cvbjkq8S644dZk7x hElCM256VUlAgKOOfkctZ6RwpNlmMeqZpw== X-Received: by 2002:a37:4ed2:: with SMTP id c201mr609785qkb.138.1592427901325; Wed, 17 Jun 2020 14:05:01 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fc79:714c:9711:2e9c]) by smtp.gmail.com with ESMTPSA id w13sm997245qkb.91.2020.06.17.14.05.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:05:00 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v10 73/73] cputlb: queue async flush jobs without the BQL Date: Wed, 17 Jun 2020 17:02:31 -0400 Message-Id: <20200617210231.4393-74-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617210231.4393-1-robert.foley@linaro.org> References: <20200617210231.4393-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::742; envelope-from=robert.foley@linaro.org; helo=mail-qk1-x742.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robert.foley@linaro.org, cota@braap.org, Paolo Bonzini , peter.puhov@linaro.org, alex.bennee@linaro.org, Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" This yields sizable scalability improvements, as the below results show. Host: Two Intel Xeon Silver 4114 20-core CPUs at 2.20 GHz VM: Ubuntu 18.04 ppc64 Speedup vs a single thread for kernel build                                                                                                     7 +-----------------------------------------------------------------------+       |         +          +         +         +         +          +         |       |                                    ###########       baseline ******* |       |                               #####           ####   cpu lock ####### |       |                             ##                    ####                |     6 |-+                         ##                          ##            +-|       |                         ##                              ####          |       |                       ##                                    ###       |       |                     ##        *****                            #      |       |                   ##      ****     ***                          #     |       |                 ##     ***            *                               |     5 |-+             ##    ***                ****                         +-|       |              #  ****                       **                         |       |             # **                             **                       |       |             #*                                 **                     |       |          #*                                          **               |       |         #*                                             *              |       |         #                                               ******        |       |        #                                                      **      |       |       #                                                         *     |     3 |-+     #                                                             +-|       |      #                                                                |       |      #                                                                |       |     #                                                                 |       |     #                                                                 |     2 |-+  #                                                                +-|       |    #                                                                  |       |   #                                                                   |       |   #                                                                   |       |  #                                                                    |       |  #      +          +         +         +         +          +         |     1 +-----------------------------------------------------------------------+       0         5          10        15        20        25         30        35                                      Guest vCPUs   Pictures are also here: https://drive.google.com/file/d/1ASg5XyP9hNfN9VysXC3qe5s9QSJlwFAt/view?usp=sharing Some notes: - baseline corresponds to the commit before this series - cpu-lock is this series Single-threaded performance is affected very lightly. Results below for debian aarch64 bootup+test for the entire series on an Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz host: - Before: Performance counter stats for 'taskset -c 0 ../img/aarch64/die.sh' (10 runs): 7269.033478 task-clock (msec) # 0.998 CPUs utilized ( +- 0.06% ) 30,659,870,302 cycles # 4.218 GHz ( +- 0.06% ) 54,790,540,051 instructions # 1.79 insns per cycle ( +- 0.05% ) 9,796,441,380 branches # 1347.695 M/sec ( +- 0.05% ) 165,132,201 branch-misses # 1.69% of all branches ( +- 0.12% ) 7.287011656 seconds time elapsed ( +- 0.10% ) - After: 7375.924053 task-clock (msec) # 0.998 CPUs utilized ( +- 0.13% ) 31,107,548,846 cycles # 4.217 GHz ( +- 0.12% ) 55,355,668,947 instructions # 1.78 insns per cycle ( +- 0.05% ) 9,929,917,664 branches # 1346.261 M/sec ( +- 0.04% ) 166,547,442 branch-misses # 1.68% of all branches ( +- 0.09% ) 7.389068145 seconds time elapsed ( +- 0.13% ) That is, a 1.37% slowdown. Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson Tested-by: Alex Bennée Signed-off-by: Emilio G. Cota [Updated the speedup chart results for re-based series.] Signed-off-by: Robert Foley --- accel/tcg/cputlb.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- 2.17.1 diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index 1e815357c7..7f75054643 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -299,7 +299,7 @@ static void flush_all_helper(CPUState *src, run_on_cpu_func fn, CPU_FOREACH(cpu) { if (cpu != src) { - async_run_on_cpu(cpu, fn, d); + async_run_on_cpu_no_bql(cpu, fn, d); } } } @@ -367,8 +367,8 @@ void tlb_flush_by_mmuidx(CPUState *cpu, uint16_t idxmap) tlb_debug("mmu_idx: 0x%" PRIx16 "\n", idxmap); if (cpu->created && !qemu_cpu_is_self(cpu)) { - async_run_on_cpu(cpu, tlb_flush_by_mmuidx_async_work, - RUN_ON_CPU_HOST_INT(idxmap)); + async_run_on_cpu_no_bql(cpu, tlb_flush_by_mmuidx_async_work, + RUN_ON_CPU_HOST_INT(idxmap)); } else { tlb_flush_by_mmuidx_async_work(cpu, RUN_ON_CPU_HOST_INT(idxmap)); } @@ -562,7 +562,7 @@ void tlb_flush_page_by_mmuidx(CPUState *cpu, target_ulong addr, uint16_t idxmap) * we can stuff idxmap into the low TARGET_PAGE_BITS, avoid * allocating memory for this operation. */ - async_run_on_cpu(cpu, tlb_flush_page_by_mmuidx_async_1, + async_run_on_cpu_no_bql(cpu, tlb_flush_page_by_mmuidx_async_1, RUN_ON_CPU_TARGET_PTR(addr | idxmap)); } else { TLBFlushPageByMMUIdxData *d = g_new(TLBFlushPageByMMUIdxData, 1); @@ -570,7 +570,7 @@ void tlb_flush_page_by_mmuidx(CPUState *cpu, target_ulong addr, uint16_t idxmap) /* Otherwise allocate a structure, freed by the worker. */ d->addr = addr; d->idxmap = idxmap; - async_run_on_cpu(cpu, tlb_flush_page_by_mmuidx_async_2, + async_run_on_cpu_no_bql(cpu, tlb_flush_page_by_mmuidx_async_2, RUN_ON_CPU_HOST_PTR(d)); } }