From patchwork Thu May 21 16:38: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: 187008 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1711308ilb; Thu, 21 May 2020 09:43:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqY6/cCLWY+pxdJ05ufrTUMI/WWDqWJC+wmyMM5PF7vmAnhewAyc2qO3fHJwEZhSwivdDJ X-Received: by 2002:a05:620a:211d:: with SMTP id l29mr10760492qkl.310.1590079412302; Thu, 21 May 2020 09:43:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590079412; cv=none; d=google.com; s=arc-20160816; b=p9Fm7K0SBAH7zUZchBxVmnQVvhzGPJ3HjFpcs8DXSUfEwdNe6J1a5Z6WdWxQFuLmaD 7iryxMdhj6atT/Ydph+LdgGBhkqYCkffD5pK+HZBstYD4MlBJtQ78qLdBOPATrqaSAlD vK7TVjxO8e0gksuJZtDho1pbosDJOZt1ib7mUjeiCSvgRU9rJNAHrGi2TbhHC83X8QTS 0uLP8gEA2z9Zia5TotBsQ/eb63BHc9DD58VJGWT3gtx8RoGZ7MA1DFKtMehfUdxbxavP V+AFYeGQDD4cqmFMPp2DvFhwTT6yPlYjDLhujHsfLfIgTJgp4bc+KCBEohq76QbrPVCg eqIg== 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=gyX/K3LZb5/HWyZyTqUsQNfRcZPtWqUo2ougwCy84HA=; b=l6/AhrFMLFDzG8DQZxIbgyt4d+oDzc/RoIVfvrR+BENerxth8aLexg3P1n+yUL0DAE KuST9c2yVDYdtBgpRIgdo/PEBI1TlG+D+x7JtAqoHPbu5UWeehsNOS43pHDmTUlFRa2G 1TeDQBStveAMuS1HrJP7iNyr32//V81z908uUt02lCdsFj7/9uq/PhHqcBpSqi7o11sj HWG1ilCGDsBpgSPVUsbysk4hxE91/ak/LL7CU/4h1bYyGgwttKfF12GpD+JtnoOsbmds ZzFAgzC7FH/Gmdka0CRZt+CD66ZAG605MngdOtxBuu2NlLU5rQtiOBTOL38Woz8w27S/ Nbbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=JVQoXxuE; 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 o6si3742634qtt.275.2020.05.21.09.43.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 09:43: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=JVQoXxuE; 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]:49898 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jboI7-0001c7-Mm for patch@linaro.org; Thu, 21 May 2020 12:43:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49634) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboHt-0001bI-Ea for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:17 -0400 Received: from mail-qv1-xf41.google.com ([2607:f8b0:4864:20::f41]:33114) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboHs-0006Sv-Cx for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:17 -0400 Received: by mail-qv1-xf41.google.com with SMTP id er16so3384169qvb.0 for ; Thu, 21 May 2020 09:43: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=gyX/K3LZb5/HWyZyTqUsQNfRcZPtWqUo2ougwCy84HA=; b=JVQoXxuEkUhrInGqG7dGcf9ha9WeUZ+vQrLz4RZGpRZsQG4UTuiMWud6rxRiVvIfu/ 8ss8QVhh5EUkN0NLcLg0CmK3LhPLJmsDmoBKE3XjVx1m9QnIEC3yFAT5uJmBTIQ6rMgR UdrcjlYGW26pJBhUrA7Rkmfq9ddPUFl5r+H808WZa1HSctuNgJhl9TqVReXBha89EblV txvSx50s+lCRmMT1sqsUK5MN+MPSbrVv4ipjQ1cYTRgwpqQci92nvv+S4RKvadcXmOWk 985qknzYF3XLq9k5HjjJoPwtINYTPGDm7p6e8kjwd+R5lxtuYpu66nFHfTOc3/yXjUOy DCeQ== 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=gyX/K3LZb5/HWyZyTqUsQNfRcZPtWqUo2ougwCy84HA=; b=RdWCBe03j1mcOQ2vdD6P/T5slnz42hPXMq0AyC4kR8NyIcsrPRQjQ2aZpPlW5tOtHK GlHV/EauoO9NihuH8dn1TL03G+YVuIvYkufX6q2MH92GtUAE4PpETgHOAibXfv2YG1z4 xOYUujHV3t3tRuHhNQDWed9ekAUjzlmUk2O27BWr2z67oeqllJE04iTUnXlrWSAIGozr fmIoucTn3RbOhgppkCF/fCto9u5uBoR10cJJVtilSVfaT3IvDgp3xeZWXqANL9FRH+ny x+Xx/P3Y/hAWcnVu3uyIcSlS4+eYWtsVX5+AuoBhlG32Xhbb5CImMtb9rqxeWmVZrXkv LBcg== X-Gm-Message-State: AOAM530Ss88WPYRi1J7PCd3DOCKRk9isYR+Pb1O9HFX4UBaoQHy+VFzb 7TceZXSwbE+xrGdUdVnQWtZ10HDgZsOpdA== X-Received: by 2002:a0c:f286:: with SMTP id k6mr3207941qvl.72.1590079394965; Thu, 21 May 2020 09:43:14 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.43.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:43:14 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 01/74] cpu: convert queued work to a QSIMPLEQ Date: Thu, 21 May 2020 12:38:58 -0400 Message-Id: <20200521164011.638-2-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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: richard.henderson@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, peter.puhov@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Instead of open-coding it. While at it, make sure that all accesses to the list are performed while holding the list's lock. Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- cpus-common.c | 25 ++++++++----------------- cpus.c | 14 ++++++++++++-- hw/core/cpu.c | 1 + include/hw/core/cpu.h | 6 +++--- 4 files changed, 24 insertions(+), 22 deletions(-) -- 2.17.1 diff --git a/cpus-common.c b/cpus-common.c index 55d5df8923..210fc7fc39 100644 --- a/cpus-common.c +++ b/cpus-common.c @@ -97,7 +97,7 @@ void cpu_list_remove(CPUState *cpu) } struct qemu_work_item { - struct qemu_work_item *next; + QSIMPLEQ_ENTRY(qemu_work_item) node; run_on_cpu_func func; run_on_cpu_data data; bool free, exclusive, done; @@ -106,13 +106,7 @@ struct qemu_work_item { static void queue_work_on_cpu(CPUState *cpu, struct qemu_work_item *wi) { qemu_mutex_lock(&cpu->work_mutex); - if (cpu->queued_work_first == NULL) { - cpu->queued_work_first = wi; - } else { - cpu->queued_work_last->next = wi; - } - cpu->queued_work_last = wi; - wi->next = NULL; + QSIMPLEQ_INSERT_TAIL(&cpu->work_list, wi, node); wi->done = false; qemu_mutex_unlock(&cpu->work_mutex); @@ -306,17 +300,14 @@ void process_queued_cpu_work(CPUState *cpu) { struct qemu_work_item *wi; - if (cpu->queued_work_first == NULL) { + qemu_mutex_lock(&cpu->work_mutex); + if (QSIMPLEQ_EMPTY(&cpu->work_list)) { + qemu_mutex_unlock(&cpu->work_mutex); return; } - - qemu_mutex_lock(&cpu->work_mutex); - while (cpu->queued_work_first != NULL) { - wi = cpu->queued_work_first; - cpu->queued_work_first = wi->next; - if (!cpu->queued_work_first) { - cpu->queued_work_last = NULL; - } + 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); if (wi->exclusive) { /* Running work items outside the BQL avoids the following deadlock: diff --git a/cpus.c b/cpus.c index 5670c96bcf..af44027549 100644 --- a/cpus.c +++ b/cpus.c @@ -97,9 +97,19 @@ bool cpu_is_stopped(CPUState *cpu) return cpu->stopped || !runstate_is_running(); } +static inline bool cpu_work_list_empty(CPUState *cpu) +{ + bool ret; + + qemu_mutex_lock(&cpu->work_mutex); + ret = QSIMPLEQ_EMPTY(&cpu->work_list); + qemu_mutex_unlock(&cpu->work_mutex); + return ret; +} + static bool cpu_thread_is_idle(CPUState *cpu) { - if (cpu->stop || cpu->queued_work_first) { + if (cpu->stop || !cpu_work_list_empty(cpu)) { return false; } if (cpu_is_stopped(cpu)) { @@ -1498,7 +1508,7 @@ static void *qemu_tcg_rr_cpu_thread_fn(void *arg) cpu = first_cpu; } - while (cpu && !cpu->queued_work_first && !cpu->exit_request) { + while (cpu && cpu_work_list_empty(cpu) && !cpu->exit_request) { atomic_mb_set(&tcg_current_rr_cpu, cpu); current_cpu = cpu; diff --git a/hw/core/cpu.c b/hw/core/cpu.c index 5284d384fb..77703d62b7 100644 --- a/hw/core/cpu.c +++ b/hw/core/cpu.c @@ -368,6 +368,7 @@ static void cpu_common_initfn(Object *obj) cpu->nr_threads = 1; qemu_mutex_init(&cpu->work_mutex); + 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 07f7698155..d78ff1d165 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -331,8 +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 queued_work_*. - * @queued_work_first: First asynchronous work pending. + * @work_mutex: Lock to prevent multiple access to @work_list. + * @work_list: List of pending asynchronous work. * @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). @@ -376,7 +376,7 @@ struct CPUState { sigjmp_buf jmp_env; QemuMutex work_mutex; - struct qemu_work_item *queued_work_first, *queued_work_last; + QSIMPLEQ_HEAD(, qemu_work_item) work_list; CPUAddressSpace *cpu_ases; int num_ases; From patchwork Thu May 21 16:38: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: 187009 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1711327ilb; Thu, 21 May 2020 09:43:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOcZWi7mRGZ58BwvLwsMczIxtwUr2KUldGIkpRnGFMJExxdOTXStxIV8H4TTTHUVF2Xun6 X-Received: by 2002:a05:620a:1c:: with SMTP id j28mr10740030qki.52.1590079413217; Thu, 21 May 2020 09:43:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590079413; cv=none; d=google.com; s=arc-20160816; b=klKY4ganntZLidXsLZ1d7qca0fiWDHhN9o00iUaKwSgHwzUhmm66U81W1+Y9iNvTUb PL1OFsFcoWnSKjXi2YfiYDCqdblILs4S/eQBpbtTufPUjp/xi+/K+UylDiLtkhBexJ37 DPTVup/XrUetWtjrRiS//GYAypHGBadky408cPYGyHubNwMtsCA3hJBTn5bkSW826ZEy aQRQjG9LXnDFwbFuHJhL5CA2qSjdNcsJmCVWHXm70oNDyLnMHkdWjq9qNdZntg7ZU7qr Trp+fXbbVF1KEB49bR+13aqrG62QIR9lr+iMhZSA36Bnd/gGBeFj1I3GLH2ZM6EoX+j7 FzKA== 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=bON7YUxlhwgscX2SUVnZ4d6zlp9keY1L8USoWVcvoFg=; b=yjQy+mo+WlPZwACHMFtFOiqmT80GTP+Q3yVjn/kOFulaQ1LhbUNGFKYX9vtsienE23 cySBCgP2c0YNJh+HzRpSRU5hBwZMyHys7C+B8wVKOEOx8myPnLA/SH+BEgafaoXPnTcV lf92TjSLm6PXO/nLjO/3dtOS5fy6SY/hGkip5zpuNdyEL1BlUETOHcbLSqK515xZ52hy cPCUZTlvxIwHKi32Tx55o+uH/E0axTOOeoj1dYmsNa0K8fpbAIp+dHtxWTmRZIiKSHUV 6ZNYxtHgPRAwj33+ukWl3xm4L2pv1FNcjvjbvn8bsTqniPRKLOLWUhHmkRFmhCWWTAk5 T2pA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=kZidtQ0X; 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 a15si3864504qko.24.2020.05.21.09.43.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 09:43: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=kZidtQ0X; 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]:49944 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jboI8-0001dY-N9 for patch@linaro.org; Thu, 21 May 2020 12:43:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49640) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboHu-0001bi-JE for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:18 -0400 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]:45672) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboHt-0006T4-IM for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:18 -0400 Received: by mail-qk1-x742.google.com with SMTP id i5so7786049qkl.12 for ; Thu, 21 May 2020 09:43:17 -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=bON7YUxlhwgscX2SUVnZ4d6zlp9keY1L8USoWVcvoFg=; b=kZidtQ0XENdeengyKKW4whn3w3BbFo8YAwMqvx5iCkzwRhHySJ6WNbeEEBV9SLiM4p 3dY/l1Ix/L/OzICp0SH2GNfc0SNqx9sQqfAIEskmmRYjLuhpIw9LaoRzKzT+ND8r/n2k Guf3KKhTPDlCkaJOq/7rjUWwnCocoDCYuJ8NKvXwzftHxSmJ3V83qqtQ59xC8B+Haf7s 3DRP1EyOLMI9cm7883IuuRcxAqtVgxZWQU4YEJ7u7EO//cS3LKnxFMOr+9QX60/wSC5m h9TUbFzLloi9gzijPehgfrd385Ztj298vJn/RuNZhgRV9l9J2G9Jc5a8hrk1WAygY6Wf DNKw== 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=bON7YUxlhwgscX2SUVnZ4d6zlp9keY1L8USoWVcvoFg=; b=Bh2mZbArXLa2ypSOe3RXVkDSf6wgfBLpG7eNxyH7gKYy9bspvYob96cKxBO5pk4g7N dzdPCN4U1sj8e9lSpQ1LyUmLUqbBL5aem4sMzdbr1Fp2yTgastzUpmGCwtJz6T/pPxWN LsIeKyg5T2mH5YCMyIIRVfx11Za+kNPMss3aOvN7bVtZzuZugYwscaraUUH9fPk9pus0 feffF9gbjSNlTNaDv9zXBolYt3IpT+RpUlVgvXYuliZ53B8wrDxnxnnCwincd/wDyoKQ 5FYrQHW/nEpq5wyGWaQ7yzQ7SlFDIJaJnciqUU15r5yvVDwBC7B8T2AjaF+iCRIHMBvD BD6A== X-Gm-Message-State: AOAM533p8wdi2n+CH1joqmqr9GY0jK8t1KZbt/Njyq97sFmeqJCxZ0rJ s7QMF7sbz3d+8FCBmz/VrBaQ7FTgbSuKMA== X-Received: by 2002:a37:f517:: with SMTP id l23mr10957493qkk.475.1590079396278; Thu, 21 May 2020 09:43:16 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.43.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:43:15 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 02/74] cpu: rename cpu->work_mutex to cpu->lock Date: Thu, 21 May 2020 12:38:59 -0400 Message-Id: <20200521164011.638-3-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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: richard.henderson@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, peter.puhov@linaro.org 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 210fc7fc39..34025923e3 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 af44027549..77a2d7b7cf 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 77703d62b7..4d58399cfc 100644 --- a/hw/core/cpu.c +++ b/hw/core/cpu.c @@ -367,7 +367,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); @@ -379,7 +379,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 d78ff1d165..873bf23a39 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 Thu May 21 16:39: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: 187012 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1712557ilb; Thu, 21 May 2020 09:45:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzW5zGk2gg1FzlUi4bksuMLS0RyLFjCUP1axdafwKD3xBwFjxc+2DvchEAUDJLRHubLJNjk X-Received: by 2002:a25:c010:: with SMTP id c16mr1639023ybf.506.1590079514300; Thu, 21 May 2020 09:45:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590079514; cv=none; d=google.com; s=arc-20160816; b=dddyVuLxhIemdxOwU89BceIcbZNgj8cH81VP555cePqJ83RtBOveenYkjRm3hh/Jar ZaW6TWJzcAALgkse1XIIiiocCB4OztEKTwkyM+Kdf41MYreKPdEy2lo/47RgRARoBiZL c7qjsQLliEf13x2y7n8gw7c2oge1skp2HFbs2uCXeW8+dqBlHvBzG7z8huqMOKgYXjrs 0Uxjtu69vCEpvIH97UV+LlraTsy4ijRVgnlEExH2e3lIIzhmS331clGk7X6B523kjRvV zutn/CsKhtOgex2VTEGh3H8vzCXudPFzXuBqR0LmvPXsQKIGRLvwtkwA2OXIBkhbm6/D vGBg== 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=XkuJ6MkZisGtrqNcI/WmjmrJib8LTmp/yxFiG3GQPeA=; b=ZkPQoufEEg47qEetyhK9hg9D/DaHHby/EiW9JVkcJPjO7EfFM1H3QYyL9WocWSNnvv PdN31BE5M9eRlXIxdAh8F7OeYVxwbBf+5Z6JecO+RgJPswKsCd+w0YpseHJt3yYNsTJi 0nM+7dkqMckIoV6lCWpa2/dFzyVdAierYCfuh609XlTTvb2k+ZpT32eARogMRulDxepm +LPsbupJrskn53MEFOhhvkFfQs4vLd+JZHyCRslRBZYClZWm6m6xUyHXeVU+VWosb5yg 1Q3t1puROrTqFE4HkmEoSWSxDyV7SIXL+3gEBI8W5gKOpTS+EsIp8hiQDKtDONre6i8G s1CA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="q3/we0bW"; 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 g188si5435882ybg.340.2020.05.21.09.45.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 09:45: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="q3/we0bW"; 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]:58562 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jboJl-0005RI-QH for patch@linaro.org; Thu, 21 May 2020 12:45:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49652) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboHx-0001cv-Gb for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:21 -0400 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]:41268) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboHv-0006TF-6E for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:21 -0400 Received: by mail-qt1-x844.google.com with SMTP id m44so5980524qtm.8 for ; Thu, 21 May 2020 09:43: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=XkuJ6MkZisGtrqNcI/WmjmrJib8LTmp/yxFiG3GQPeA=; b=q3/we0bWpMx2wZYtvNo7PDfKbGGLd1MU7T2yd8K3VQCepk6ILUxIUVlKeYd2TKHYva DbwPOgaKDfpYeqFy87uJ8NBd4ZgWHpIdY/rxr86qceO5fF/VDPKhTwiNOkQja8pToIJR LKRaH+xnVRWTbkKVo0auD2RtPpg6ieznb3DND5XPHt3B5VVyG7orv749L3IbxCqMeN70 LyddUZe5/Kdlwx6zjb06cj0xynwcGt2M4rIzRbk21X6zTM5bd1AvROjJU/9TC0C1HAhm YK75CqBOoyNlZ7/T9SK6StIPnjh+st4UVAoQVseT7REkwtVe2V7s/whfWdHqIJP0CgDI u2XA== 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=XkuJ6MkZisGtrqNcI/WmjmrJib8LTmp/yxFiG3GQPeA=; b=TFAgyS112mauIQPte9gKJCT+FtYnmALU290UWrg2EzXtdRlJVI+J4cHhSQQKPLNiUq mWeVKijaOWK1t98HcNvQnU5Yqu7rwkka5modmxARGSb85XVtKKO5oEt16YDqkFEf/keG oX80YcXYQFH/Zc2vuBSpghI0M0Jy6pCKhFzzVFHqUgfRgSkroEsOCmNmhWZPbhy0Oh0x xSBIJff1Q/h4syiWcb9vW9ZKztsrSLRVaZkveS6bVUQT1RVvcObhqm5vvQN+hoEmV4QS wpWcwDOxdwiLDbdJhBMIGcDRMtnenH/DCe/Opr07lzj5YbkWd1R02jP1FpE5WFoVuk1F LN4w== X-Gm-Message-State: AOAM5314x4TDST4nTLTkYQ4bFK4l9bdXSWWRB79TWTHYc+RYI0c1Y/uq 4U+BmmVSYkhaTzLnsD9FqZCFYgG+f28HBA== X-Received: by 2002:ac8:4f4e:: with SMTP id i14mr11835684qtw.167.1590079397651; Thu, 21 May 2020 09:43:17 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.43.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:43:17 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 03/74] cpu: introduce cpu_mutex_lock/unlock Date: Thu, 21 May 2020 12:39:00 -0400 Message-Id: <20200521164011.638-4-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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: richard.henderson@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, peter.puhov@linaro.org 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 77a2d7b7cf..c2da430221 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; } @@ -1845,6 +1883,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 bb3a7b18b1..03a9081f55 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -763,6 +763,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 873bf23a39..2912d9a7c1 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; @@ -1179,4 +1212,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 45be5dc0ed..d2dd6c94cc 100644 --- a/stubs/Makefile.objs +++ b/stubs/Makefile.objs @@ -5,6 +5,7 @@ stub-obj-y += blockdev-close-all-bdrv-states.o stub-obj-y += clock-warp.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 Thu May 21 16:39:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 187014 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1712831ilb; Thu, 21 May 2020 09:45:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKH2VkYIdyow3R4S1mhUORyjvhoox41FuuyQw7oOMFGtbME2TREAR3AfUIHznlaWP8yXAj X-Received: by 2002:a25:9ac5:: with SMTP id t5mr16533149ybo.198.1590079533638; Thu, 21 May 2020 09:45:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590079533; cv=none; d=google.com; s=arc-20160816; b=TB5rXqrE7Blq761XbzyACK3ULbVK5jVOY4kmDMCkc9hVbAKzSpHrv9OIZbHA+OEw9W nUzr/Lmc38c1WtkXWkczxwPBbdE+wME/nW30y8VfmeT//U/ERLSA51qSgFK4HG5bk9hK rm3IXDXYawle2Re2M9LcfdcZb2vSJHKZ3uRUH7DqU4woamFgaJxjx5mWBWb8+yfFl90B VxFznh7XMZhcOZw5AL77MGpOcCZv06u7vzYeCXd8U6QEXdophK+AyiifsE3Lwy5AuWJ0 Ymfe02SND9Wx9oZSHRR42TxtlbPQgX8KYP05Q1jIDLscsM8eQDh8jqsR7GBcbmB2cnKQ J8cg== 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=niJOK+gFFfbZ7oCXJZeMjKiL+kdF4g0cKXPQfbfeKkw=; b=z4ns4CTH6c1YO3NKHevhMzzfwBTwOYw3XnTofueKzg3a89rZkCfxlSe7D/ooMwG4fS nxI+USgPAxDJf/hCIN7Rs29caOUp8nZ3XY+ERN6/Eeh1pxbuXg1NCtREBHMOwi90rxSn 2uEo6j4Zi/mUZq2/LMBfqYnVStWIw8dqWWdyq90xQH1ErCXIU9u9gsoklrGlJl/pdxiw 5wSXHfTSu9e0H1sqxKXsnF88p0x5pA3a7owUOKR8yYJNfSF5pdIr83XJBscjUjaFYWdy OLc8DqOdR7RjF7g0gOzJoQVR9OJcYLODSN4Lj4ugZf08BSJ0wpkrzxxivuVz2Qqkh/Pl TOAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=kPI6r7a1; 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 p67si5571868ybc.465.2020.05.21.09.45.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 09:45: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=kPI6r7a1; 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]:60252 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jboK4-0006Ds-WD for patch@linaro.org; Thu, 21 May 2020 12:45:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49658) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboHy-0001f3-FU for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:22 -0400 Received: from mail-qk1-x741.google.com ([2607:f8b0:4864:20::741]:42228) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboHx-0006TM-8T for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:22 -0400 Received: by mail-qk1-x741.google.com with SMTP id s1so7834227qkf.9 for ; Thu, 21 May 2020 09:43: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=niJOK+gFFfbZ7oCXJZeMjKiL+kdF4g0cKXPQfbfeKkw=; b=kPI6r7a1lED6MVSPk87IsVqLAyD+RsId94FvTDU/9QyaYz8Y3xeWXMwZ9d25hxxXVm +huCpNnk0o+4g9JQkz7BL2OZHUtA/cCYh2M/rFPE3XTA1VjML9PWwMKsdhRV8o5/ksly GSZTIdTMumJUsG3qWvHeVTvNXGSMrSBr+HM5AJvKyrk7uYWULo9jzntROdWk6+4mXnJa 68R2LkkGvspHQdB6nLFpP6/Vw3X9+H//aRQ7wYsFDRxFdu9+2JverfL1eCDG4Yt8Gjcb qmHLMCAw+o7Fu7sa3QUY+BrG9u5VAWBkpxGSh1u4ULivdaSMuZAYMa0AP3VPwPaAZdc7 SRkQ== 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=niJOK+gFFfbZ7oCXJZeMjKiL+kdF4g0cKXPQfbfeKkw=; b=M4CN5eJUpykNwmekLPEEtRZqZeoNZxJI6nEaaEQUC2W8HDGIHA6p0iiOzWqi8qQqDe bxjbW68M2QdVv1ADlovuu/W7CZVdmO0BtAs74HpJ5vlo7gj2vX52fKxDQ5IYtD5SgmLA Q9k8MhBJKGcKmAFw2b1jtw2T3wTdYWlSTU2A453eOmILLvxmKAW1RJjoZfq429hsFtMC wZdKVX2nyMjhqT6QDrGXhbarEu4HvQiPyX9id3ydwF3hVg43vHshU2lvwg9YX683Nr7p 0HCtnYZtBDzVOT0K+PQtBlKrsTwDFtfFNYwyO62U3oXYMiUzbVYi2XAwpLEGsMk5PTQC dAxg== X-Gm-Message-State: AOAM532rUxEuylgWzTpUTTaVkJ81iVkjmgkBuGFNr5bL64itumqn+i0N BP8GEqmKWve+/bJEyOpBhN2B1oxBBkAMtA== X-Received: by 2002:a37:b144:: with SMTP id a65mr10554942qkf.462.1590079399077; Thu, 21 May 2020 09:43:19 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.43.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:43:18 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 04/74] cpu: make qemu_work_cond per-cpu Date: Thu, 21 May 2020 12:39:01 -0400 Message-Id: <20200521164011.638-5-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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: richard.henderson@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, peter.puhov@linaro.org 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 34025923e3..4db4e0026f 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 c2da430221..e57e8fe669 100644 --- a/cpus.c +++ b/cpus.c @@ -1196,7 +1196,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 4d58399cfc..9b9d4296f9 100644 --- a/hw/core/cpu.c +++ b/hw/core/cpu.c @@ -368,6 +368,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 2912d9a7c1..d8b81db262 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; @@ -769,12 +771,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 Thu May 21 16:39:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 187011 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1712558ilb; Thu, 21 May 2020 09:45:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwdR3rA0v62X0ruz+aARCFSxc+Hk+W7nZdGy458SxqkjWC/dKlw/0lEGgvW3+4XJty9pGBl X-Received: by 2002:a5b:ed1:: with SMTP id a17mr6524386ybs.467.1590079514411; Thu, 21 May 2020 09:45:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590079514; cv=none; d=google.com; s=arc-20160816; b=0Q3ku3py1eYTx6Xhy2HwBAkWzPAm6mERQVrFWQK5utZ2AKYBNi7vtfq/FHASHhPHgS 2y7TOpf0qbs0fue6EDcL/pVPPGmD4nLvma+cy3VT9iMMv/QxvZjevPT9UeIX1OiG6AWj hkJtzqQo6HG2yv468cWggmAwVwyMIdwOoncfErmcNIdBP9GFab1kFQJjKWVjyDhu6//b Pt4fUMPVFsxPsiGsc9ySXEFL/9NPWLrVzomU3IyxPJalKEZghnxPR3jGeqfLGKzKvvuj NRRHVWRAq0aRZc3xso/QtjuDwvHfcwiS/zzDIHC1Lpy5S5BKsV3/ipmg8H13PzRuOPID i0Wg== 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=q6fMxoKgDixMx1XBFW+F7YxZyPOAUqVrYpURuluogyg=; b=emYFcSYFrXnz4Yc14ZgiJZSBgF1zcLZcSRaBxOS8KB5IocmFkgNryiAtpeeWjVILz9 sBkd3fiCEUTRcpcj9EoePJt5OdXbI20ACFLw/Q146fA4dVhH6ihJHTm+7NKLeAMSEChS lLiGO6Z1+FV/3IsIcUzl1KWaqlUoOAuODnX7sNkcDNdfg1DgmhFoA2Z7FebGzS/WkMOH hrQ+M1deFW21sq8MGD56af8im6Oy1lRWemGEGSVcZhQEvyJUHWBZ7XhD3kr2LOQyiwPA WMk7oxC0PQtoNjqGcDLQl62tomWMg7v8sFzN8w4iG2dS7juOy4DovDzrokoImZl1KsDD k4Jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=X0ujbNXS; 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 j205si4994376ybb.151.2020.05.21.09.45.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 09:45: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=X0ujbNXS; 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]:58540 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jboJl-0005Qr-RX for patch@linaro.org; Thu, 21 May 2020 12:45:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49664) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboHz-0001iq-TT for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:23 -0400 Received: from mail-qk1-x741.google.com ([2607:f8b0:4864:20::741]:38174) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboHx-0006TU-Ks for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:23 -0400 Received: by mail-qk1-x741.google.com with SMTP id f189so7856412qkd.5 for ; Thu, 21 May 2020 09:43: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=q6fMxoKgDixMx1XBFW+F7YxZyPOAUqVrYpURuluogyg=; b=X0ujbNXSPVo7DCGMqSjhfqLy6GAse5zA/TKx3Ulkrfa5IGvWh8i8xK8we8rT+D5U2u g+S8MH5sRjctxd9LEthtBwssjJQtwNChyQ/zJBRsygHy9EVtXPI8K7ms4LulAEK7lAQQ 3ehBR/1meWP9AEKRFRuloBsb8ydQ2XcXD4bSGzBgfUZ7CQVRfZ+IjZ1NMVs7QR4bMh5s Bo1a/51mpUpK06ihM4Ps/M1m2YiExoAprUEp+/Tm3E7MGzMqWWrbqZby6W6YiWuY7MU+ SPw2OLByuZ0i6m/etP5OhK1yom6/VZoe/lt0H0OhQOsAPY6Knfkilf9bAo/490rQBdFD 3FMg== 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=q6fMxoKgDixMx1XBFW+F7YxZyPOAUqVrYpURuluogyg=; b=ldSufmvJpDac1DiK5FqTXfnn+u5mQ/hDEfldaV9g2nqj57mfsn1SF55mSnk6//FEP5 PSYX1zjhA/DOyzR4Leu2hYdqjaOgjytu9jieFLYlGRWbUnF2i7FxMOVXzG5z6ni43Mvv 3zBFQfJ3hHMbF54APkxX5ui/Z+yehrgD3X56LGjgyVgudFAvOcSyFSF6rlsUPuhN7PmX rMl4WAc344CMKAgkDXdl8W91vwOKXQLl9n/URrjUTF25QxA87IXpr/WuG/kIH7R+sL0z WPgn56EF6+rR5qirbxLzotVjn87pnjhRYSwNxBFDXvns/GMfgqC+NOnLsXVzhwJCtdhP nKuw== X-Gm-Message-State: AOAM5329rhb8/gRePlSYajC0Z8TnMnxF9tU0kSQQtDKkEd1Mw/vrRbuC 5XIsbppSW19JCrbD1Me3siy46Cp+JbMjvg== X-Received: by 2002:a37:4897:: with SMTP id v145mr10689935qka.26.1590079400310; Thu, 21 May 2020 09:43:20 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.43.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:43:19 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 05/74] cpu: move run_on_cpu to cpus-common Date: Thu, 21 May 2020 12:39:02 -0400 Message-Id: <20200521164011.638-6-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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: richard.henderson@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, peter.puhov@linaro.org 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 4db4e0026f..907ba5f0fc 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 e57e8fe669..935fff6e4e 100644 --- a/cpus.c +++ b/cpus.c @@ -1194,11 +1194,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 d8b81db262..fe79777502 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -766,16 +766,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 Thu May 21 16:39: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: 187010 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1711684ilb; Thu, 21 May 2020 09:44:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyO1NgDZXhsGk2HZp0MbL8GKRwvJSKkCd8/Tt9QTj9oYQ7lUQi4cIxobWJE5YE0o43RrW9j X-Received: by 2002:aed:2762:: with SMTP id n89mr11511790qtd.26.1590079444060; Thu, 21 May 2020 09:44:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590079444; cv=none; d=google.com; s=arc-20160816; b=jAv1Wv3EHHp8biYjIytXmewjq6MNp9arCpASQLb7Zg8S5pQO2FTalSuLbLzbvRpY+w 6Nt/c9CN7B26UgN71FairNb3UmdV0Fqio+tUgCnz9B6oysDx19t/w1tVRM8u3IlKG+N5 SyVul8vhBZ2aSMGigsNY0YoM7GGgSVad2J+pUx9PMcHAZFbly7u/nfWyAWhfkpHCzGzY FQLmKkXc500Y4ZHbrU0Ze3MaDy6Zeg8QuVfKTuqpdCxiNztUZcuv2rXq0yxuQA/Az++R 1+LGWPgO7nlpH8R4eP8q014bhBO7uU7NFzUNyIQLqgeIURCoAVR8VhPAHs3s9X3rv7mw vJiQ== 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=HfcAo2caqwFqp8BpPOPBnSoEMj4Sv7hELhtAr2WNKok=; b=Mdc5LPTO7vbW1M8nrJmPlmRU2yqZ2weAi65W4RE28bUI48p95YjGLeILIo8A9svLOk cBZhvFzw3Nz83rKYm+pLsY+7vt93nHHew9Vg2H07KeeXTmuATjqwjQZXBqYbNCW/Qpld QuPAz3mbSCEMWX91pWxYLPnptQNWYprsLUw/YcrycVrwpkVZOjIbyUhAnl8Kx+HtLaOe BiEsP08YG5qaqW6nE39YOwOljexFG688SZYhd6ImIt0/63sl1W6Ysvbhksd7Gic0cF3y mwuYLD5lG6JOgKvi+vFYqKtwlZlPGfjkdp56NbWU8I81NiWIywBelhelRMzOhyR04c4T wmgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=SFnHTXzS; 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 i7si3699084qvz.203.2020.05.21.09.44.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 09:44:04 -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=SFnHTXzS; 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]:50330 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jboId-0001nT-H0 for patch@linaro.org; Thu, 21 May 2020 12:44:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49666) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboI0-0001kD-EY for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:24 -0400 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]:43413) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboHz-0006Un-Gb for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:24 -0400 Received: by mail-qk1-x742.google.com with SMTP id i14so7812530qka.10 for ; Thu, 21 May 2020 09:43: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=HfcAo2caqwFqp8BpPOPBnSoEMj4Sv7hELhtAr2WNKok=; b=SFnHTXzSh2ag6jIBf0pEydEZ6td6e1OCXQWpaRBK5Z25C14+eNLrsTjzuMwcWjaeZV XFm7hX2k6nPMHxLdiD1aRFtsHYOKDkAG4ReAiP9Xg20iMlHHFxdg4PbmSlDCrMN70d8k jk2GidJ3/O1yjPuRNt0tCazvwcUohnPS6DeG+PwbPYHpEjjnnW8/c2bZ0Uq7ZgEZtMBJ cfIowcnah10R7q/0J2eJY83Fv9DtxyvewE4gAfR2/AUgNLM80HjJN+Jd1x8bWTt8k+4k 9t1tQpxhNFyEWype+wcQ10lv2vO205UjVu0mrqlHccR407AgUANYXUnnaEoO0bD6a3Wn oAfQ== 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=HfcAo2caqwFqp8BpPOPBnSoEMj4Sv7hELhtAr2WNKok=; b=SwSiaf2mEYfsM0N222XHUGLigR5cDCX3n5L8rbt+7QV7UjU3fgAFLhl8sCcTDJSLFY VOnpb2xyawU+1UTDihKsquRMqYUvcAn6rvt3yvSPz+T70Ef557SgmnHqMZmoWFDB2nES /4+0cAB/LudDCdUKbnpghPXL2qL1lCOxrROImT0MEON8ED7Jj3j0DqcG9HQhFMT1FZae vFZE43oBOAUI5/VH7BAHQs4lkd44TghZ9tZKfuspqTjALaLvfecexip6Z0+H5pd9bTHd K/V6Bmvpw0mZuChwR+g+1PTBC6UjpGhoy/wB3ZUV0gLC7c9NY7fTF1ULbgy59NaPu15G HUAQ== X-Gm-Message-State: AOAM530YC8VT48RluHUN8KSpCgBY2Rhfn6bmBoWqzAb1RI9BOG0xvDfU OSjR6q67xI9+zye3Iaal0yQPLeKAnlk+zA== X-Received: by 2002:a37:9d09:: with SMTP id g9mr10904604qke.154.1590079401889; Thu, 21 May 2020 09:43:21 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.43.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:43:21 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 06/74] cpu: introduce process_queued_cpu_work_locked Date: Thu, 21 May 2020 12:39:03 -0400 Message-Id: <20200521164011.638-7-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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: richard.henderson@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, peter.puhov@linaro.org 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 907ba5f0fc..e2f609c8e2 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 Thu May 21 16:39: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: 187013 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1712642ilb; Thu, 21 May 2020 09:45:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwDjdLdP05/67YBvUuCdwWWGLGAd/I5TK+PEiMc50eNJTEVbegGjkHLkxHyNnurZB31zofq X-Received: by 2002:a25:5284:: with SMTP id g126mr17937746ybb.245.1590079520114; Thu, 21 May 2020 09:45:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590079520; cv=none; d=google.com; s=arc-20160816; b=0BeYIXxzHuPClgLGnnOpyqrYpcXIE7OL4A8M6y6R+DeUXngHbsrRfG8i2bWbMCiMwK stsK+/SHpBSf01ml7QyLpGRNRPKymBbfvRLygnH/U2+u9d4iAZ40H32rP2xcf+78gmyz 84jzJAWOdxgF2uznRxa5XPrvvVXCl4PY8zMs+Yol02KE/J3GBl4X86qtGNWxsUXGB64E AYdxU1ltCtNs9l3c+Ci4QFQp5r1dBbQbK+sw3XTsa+w3OQuwdCCWo2+0JuJZuAv8SLG/ nNlARbkb1scalFru4wzFS5AME/cVJR9uNjpmZBM2fAyHnrAi3a3fJEHvPXQTEzBaSnOV ttSw== 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=gOAJ9vmaNi5fhkFh/LZcc0lHcqZy9RW0PLEEr1p6jHs=; b=W5mxE3vjcdsnkUt46tmE/V5W49PWxAXpmtRFZxZImHB7Yl+agioV+S34aL1n8YB/T9 M9NaOtKvm4vAh7vUEiQCIGDEEeoyo/27EfRE18iNpslzpue8Y8ckXLgHw567I/giRkzt 9HFp5WGTBVtYAbYBsE0LDEQznB6QyhV7IpS90kdF2H7Rw/6jUEX7zOrtXpCRPvU0uoO8 wTfv1hwJeOHiwdZejQp48rO1yEIGN7UhuAwTuYE9FUIMcS32m47wPqQcioDxwWUYYY2l mmFC1amHezuQIlqMpW60s+iNoGg5yYdGdeIfUvpAL9GBJfY/50XnscSbYFT2VUi+NaLa HF4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="jYOcTp/y"; 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 m11si3872663ybt.69.2020.05.21.09.45.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 09:45: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="jYOcTp/y"; 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]:59078 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jboJr-0005eF-Gu for patch@linaro.org; Thu, 21 May 2020 12:45:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49678) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboI3-0001p5-Af for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:27 -0400 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]:38340) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboI2-0006V5-2H for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:26 -0400 Received: by mail-qt1-x844.google.com with SMTP id i68so6005551qtb.5 for ; Thu, 21 May 2020 09:43: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=gOAJ9vmaNi5fhkFh/LZcc0lHcqZy9RW0PLEEr1p6jHs=; b=jYOcTp/ysJNDBzbDlyACVOmNRDGTCVjvL82LZgV0iG4BZR+6Uh+yzSJBhnNR88Q65a 3u009ARfPOiYF+VbBnFPXEoR2p3HwamfqM4p7ao8G8E0FxZ7QR8Nm/4GrXUfHM15fUX7 XBFbtWu+jaX9WR9ol1atYmM5M+Uj8llNs4h4h6nsKn+fY68dEz/SAas1yUwU6QvVAz3N GVg91Rmn7+sHYH5wUllg+gRYmF/2/LN+c+1rp/fyo3nE4uKeKQj6cE5U8VdMr4spCtD9 QKdkEGjTfKKIoJ3GlAZgCL5329Zz0/J9tIe50Ew+0hWzmTlaBbcpv9hCy73ogJ7UstNA eMvQ== 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=gOAJ9vmaNi5fhkFh/LZcc0lHcqZy9RW0PLEEr1p6jHs=; b=LHqlmVABwXrwkCGKlidmEDowhd9TDqc/2WGmK0ODYP+oCoRMoSfLB0ZIBtcDADg696 dKAM1Lv0CrHd2ptAvfqf/SqfxMTVCAczDrh78elqgcdt10CIFbGMt3RLPJ4zt6XfcFQn CT0Tfhh34/FXtL3pq+W10KSVnWCvmSkJYe7hoTBY0cVoV9FOtJwiScunUGQ2M6HBtIiB 91uB+ImvfRvhBJe1ie8ZyvGLKbzC1A1qzrpwgdGyGt+34R8I5Q6jgZnlqJWRL8ypUtWl 2PyIq69LPS7LGZddOc4+/F8VcLZx0Q8dNIWfvfTtD4oKdkI+lpjdh5IqeakO4KYLsWwj HteA== X-Gm-Message-State: AOAM533Z9Ou7u9t14B3MpkhV0VTOWDxWaF9ExUp41HGF8yN6VhAX1APn AKvs+4Mcg/oD3mfFOtxZ5GyxTN2bG5PzOA== X-Received: by 2002:ac8:393a:: with SMTP id s55mr11521271qtb.48.1590079403681; Thu, 21 May 2020 09:43:23 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.43.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:43:23 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 07/74] cpu: make per-CPU locks an alias of the BQL in TCG rr mode Date: Thu, 21 May 2020 12:39:04 -0400 Message-Id: <20200521164011.638-8-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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: richard.henderson@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, peter.puhov@linaro.org 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 e2f609c8e2..d418eb5aef 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 935fff6e4e..9cc5f4767e 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(); @@ -1863,8 +1933,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; @@ -1883,6 +1951,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; } @@ -1890,7 +1960,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) @@ -2126,6 +2199,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 9b9d4296f9..620feed3e9 100644 --- a/hw/core/cpu.c +++ b/hw/core/cpu.c @@ -367,7 +367,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); @@ -380,7 +381,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 fe79777502..2959ed1b49 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 Thu May 21 16:39: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: 187018 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1714443ilb; Thu, 21 May 2020 09:47:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHv/D5SMLKArI65Ac6v234cGUz9KfB6nxjaRncaMkvCTGkmpR6p8DPL9wv7bPvUNIrXzuD X-Received: by 2002:a37:384:: with SMTP id 126mr3044203qkd.325.1590079665423; Thu, 21 May 2020 09:47:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590079665; cv=none; d=google.com; s=arc-20160816; b=QOGxS+ps55KsTFoqbvfSeeVxFW6DemnqEAPt5zOShtDYrU5sm2DrvByxrUpDTRXZ9d dyAtqW//WuelTeL+SxAHQWSf4/G3tYK9gVJeL3QAi7/QDRlXNZlL6t4uLeW/ZeKQOSJJ XpB3uXk5dUC2nDLYNp+EAQGIG6+0qu6AF9+I/5gliV12wZ/BvHTmqDVw9HDIN6oJlbCH 0O+exkTztBbJjRQTcZMZqpcjx/uTShK9+P83XQ5EVnh/IbiqIhYS9gA3h8L/pVMmKp+N V7LDp+UBzEIewWocssyYuV+RpaGFA9yBkVflfLX5dxYM8LBrviK3vMwPSyd7HJyfhgc2 Sbcw== 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=wu18ytPvx1d0kVanWp/H7LPvrM4VUoBEe+P8kb9ryLo=; b=qFFOItR7wj9q83plD7VRB3yCLm/CnlELWqw57w/xiyE4yv93ay+NKFFP+aYIeKnVxa 2b8DbmGXlvqa7YDQ/GbwKefFCj95LctROT6PBPNDeDJ7z69/ek2g3ZjB4BGvTN62HJqC OdAHs87odYsxz8Dp/msckRuwNw8nCd7HlerpTWWts86Z8hPjGfuk/aAsQWYmCJTlUxTw jfnU0eaebz4si21hA6c/rFN1+Cg6J1YD3Ln356yuOhYxLzojT/gyZ/FlT6pJkWOQLYmA DtZmBsKzQX+d6z0EzVZUSdYbGpo2emIHtq7LjANuhKVvGChAkdHJxVJKYWyFNnYNy/mj OcFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=JKWYumNg; 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 92si3539546qtf.197.2020.05.21.09.47.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 09:47:45 -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=JKWYumNg; 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]:38790 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jboMC-0001Qj-U2 for patch@linaro.org; Thu, 21 May 2020 12:47:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49680) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboI4-0001r2-2O for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:28 -0400 Received: from mail-qv1-xf41.google.com ([2607:f8b0:4864:20::f41]:33116) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboI3-0006VA-6w for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:27 -0400 Received: by mail-qv1-xf41.google.com with SMTP id er16so3384491qvb.0 for ; Thu, 21 May 2020 09:43: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=wu18ytPvx1d0kVanWp/H7LPvrM4VUoBEe+P8kb9ryLo=; b=JKWYumNgzhW4YWWh51l2xT87Y/KrKNY/g0igIh8o1RXUyE+545PwZLb/F/v2KvFITA OfcQqBSgqfS/Z9C61MytBrdvjuIv2iBwtLC1ugLtlRvz1i/UfK+EONslmQ7t8NmlVuB5 MTmGextuwll52y4oK5AT+UyUhBfBplzYbp8FbAxdVi00ZkUrA18nXRJeburhR/lGwkbj XVh2MNHDOT92mTPyj22/ioJMYYOs55PpxCm0O6gmsURMxXFU3kUssB8m/zIz+5uYmOuf 0OmS/yv9bYoTv8jbqTJtX9jbk4y6x/PXHVh4CCWzi3TLHS3wE46/rehwhl/iIltuHsia YobA== 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=wu18ytPvx1d0kVanWp/H7LPvrM4VUoBEe+P8kb9ryLo=; b=ZFwTpY17lAoYp9lYEUxPk8oe65FfNG2l9vlZqIHs7AUxMjELKZzgIWdZ3Csw91j6Ri +8COceEB5H0uAcofDphrX7I/B3ulh9UYhZ0vvcd9e9Gt/bcw4Lih/ZTH3zTVeCPjwgg7 lSLHhvg0HrA5eZGps6sBlEQqGyDvK8OrQGt3r2XrB41e3TjtcEb7TVMKMyzxtVFAk5g2 MlZJt7sIKWLFHsG8hcgMi6c2a3GEVEOFrhVsoQhvGFAzizIY2mprQTned+DstydsvgNf 9gRcZhslExgOpHtcKelmpmatCZJKhjRssJRh+BpA+BBh0+MdD1MLwvKT+dzjquLyxEqq GpVQ== X-Gm-Message-State: AOAM5332NqsnDPy+KVFK1U7LYinAc/e216/HHNXaLzkUHzpFkCi9hI3g 6nuzLhxK9U1DzgAWl0Mer6ZqAwhdrvxr+g== X-Received: by 2002:a05:6214:6a7:: with SMTP id s7mr11097903qvz.142.1590079406050; Thu, 21 May 2020 09:43:26 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.43.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:43:25 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 08/74] tcg-runtime: define helper_cpu_halted_set Date: Thu, 21 May 2020 12:39:05 -0400 Message-Id: <20200521164011.638-9-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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: richard.henderson@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, peter.puhov@linaro.org 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 4fa61b49b4..433b6bc88e 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 Thu May 21 16:39: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: 187021 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1715723ilb; Thu, 21 May 2020 09:49:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy0MyjkifbFBfNr0tGXVHDcwu24WJUM9sj3YpWkrCwYsS4/RsWlCpER4Zf1ypR+49B2B3ic X-Received: by 2002:a37:8c45:: with SMTP id o66mr10616627qkd.392.1590079771128; Thu, 21 May 2020 09:49:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590079771; cv=none; d=google.com; s=arc-20160816; b=EAeSbe/pO65qV3H2i1A4TOKInEr9y8DnvOa0zYbYMk3ZAA0niEpCCovDSpeMvwR6ZZ caClcBz753JsuEbP+8qFM+i6P5lGyJN8RHxO4J81uHXxTC+IzTxPiaFa5cw/BXqs1OiE 2lmpDma9IGbI6ReJ6F6mbhxIWpWRtKZH8vWM2JCbY9+aqk64N0JVrzjEoqUDpgRKTm9e 7CkLHJasG5TxLfNJLAGmrQfIV4TCTSbE9MY5YLqVdHHXPRqUg85+WuB50srq3eOpFqT8 JOJbxRtjBUE4GBOy49Sc4Zx9vV9UHTfPawFAlQ32cRaZRUCKrdUkxca1JTks62eJN08v Ek3Q== 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=UogW0SUaOY/ZfHuTV6t0YjkQtLB6wEDTJTvQMb1HiHQ=; b=nPa1Mo/To7TwS191z50X7Tf8fM17gnPNREp/YlJsMqnrO7JDeZKbNuaZqSqcZOANlO T5K6AQ8Y/OTVh3TPr16m6f0ezuQIBi/zZC/4VZs6BQxgGXheVt5Tb21r9OHgfZPf+7vU UZkU6+TMcEOBmB0myLUnd/fu/niU+UXCK83pX8v1XzjDMLFxNCru85WjXl7w15p2EuPj 0UriIXaQD/V0lASM6Wbtbl7K/WHvK5IMRLcxfzu4VxWSiPCnS/RZU5ZOv7olbJcORl7e oO6MiG5fk4ViZEqivKqIF8YgF8Z9km4JZI8DzwZIAKhgV92QqSgLjDZ1tcboI1u+H0SL a7Sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=oNiKM60+; 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 y4si3534866qvn.10.2020.05.21.09.49.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 09:49: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=oNiKM60+; 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]:48224 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jboNu-0005uF-KM for patch@linaro.org; Thu, 21 May 2020 12:49:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49700) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboI6-0001wQ-5g for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:30 -0400 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]:39750) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboI4-0006VN-Bm for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:29 -0400 Received: by mail-qt1-x843.google.com with SMTP id l1so5985322qtp.6 for ; Thu, 21 May 2020 09:43: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=UogW0SUaOY/ZfHuTV6t0YjkQtLB6wEDTJTvQMb1HiHQ=; b=oNiKM60+Anmbj1FdJ6ZU33dx7FSduqFtCvLR+oRYGW9s98jF0IX8Iclc9xgRh5sxGA 5QhhCDUB4nUkesjcq4e+zo1ITQvK30NfWUIWki1S8yWLvYtRgv1APWPey+4l/Wm9JiA6 1q7IXD7l/jjvtFUxY9Js22kXQBleP6KPtmHqDHVML4y5I1Eh+67VzVZqGFJnr96I6XGP lS8mLNjfqPkn593bpChb//oOOYTs5BNvaKopoRb2yLMRmagSQv+hOk0dstMtET7FT11H 1/43LwyDavULUs1X0whA52ZOZ/o/faA1v0G+nKgNXuDfvC0JxGIUDQdzBrqIBXlCvzJ1 m6lA== 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=UogW0SUaOY/ZfHuTV6t0YjkQtLB6wEDTJTvQMb1HiHQ=; b=ZchdqxtlIV7NPY/QzcPu+j3moI7GwwVF2ZIrd7X2osh4VH3hzezwKqVd+9wm7mfSEV Guc4xHDR2Oai88siKs8RVEr+7Nr3Fd+iYbfIrZDWcJb3MerMiHloVB9xQgC+K3msHnDe 8V/J+h7pB5qwp5fDNatvdHihQPm8g6s2lnHrQ7GlURf4k6LMnVrBmJTCD5i0nKcge9Wi w8LLRQF9ku6+tDXk2x7zuQnfsMiAfXK6eok4mR6V7FcLdOJqXwTKS4mqOhjJhkE8C8I6 e6Fz1FSvDQi+bXFNACMuK/U295YTlBAxbZC/JjIhOXvzImtpRZn0H9tGseLgp/K5nAvb 5SQQ== X-Gm-Message-State: AOAM533g/PhscqkhoMWFKkgwv9pe7lhunmOc0s9/EHPTFJe0r/CN7wje oXyIcsnEJGpUbhVuHU+46ANQAFaNL2eARQ== X-Received: by 2002:ac8:7941:: with SMTP id r1mr11640643qtt.290.1590079407270; Thu, 21 May 2020 09:43:27 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.43.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:43:26 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 09/74] ppc: convert to helper_cpu_halted_set Date: Thu, 21 May 2020 12:39:06 -0400 Message-Id: <20200521164011.638-10-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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, richard.henderson@linaro.org, cota@braap.org, qemu-ppc@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: 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 338529879f..c801bf915d 100644 --- a/target/ppc/translate.c +++ b/target/ppc/translate.c @@ -1595,8 +1595,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 */ @@ -3620,8 +3619,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 Thu May 21 16:39:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 187016 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1714180ilb; Thu, 21 May 2020 09:47:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZQkH/P3U8L4w6QEPJeK6MfY56HQdQIARwme2UCc2ImExhMhxAYpUKMDcBXisWjCvxShyF X-Received: by 2002:aed:2762:: with SMTP id n89mr11527977qtd.26.1590079642523; Thu, 21 May 2020 09:47:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590079642; cv=none; d=google.com; s=arc-20160816; b=obE5V24/MC/CEDjD+no0xylGPcAwNUB1HuAdA+gjqL4ISYRPyOcFkPiekVQW2Ior6o EEgP9d9wBUG8dHTzV0QvY88SN77RVmlSgX5ywNMKADm7CxVdskiPZFTNpRWJcVuXju1H QAizyX2qTod9iNY2gbgn93OJ1Q2HFyrlGL1D2uj14xcQZQ46K+4UsbSI9iPVNoibi0Cu NHyDcPSlzwc48oDI0UtQd9ZC+hh4zn0oSLAzfSCg4jc7Fnt1VtnaSrX6E91jzMQkP5z0 x2dpz9NuXCM7mGIvvWSLHWOuaxXMaTNDosYO7VHMtN7io58TVbzZ4d4HJFKCVDU2au4K vgiQ== 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=pu4aLcXEpuJ4ytDOMXC0XbbDo51phtIicVpeJSCDXFU=; b=RJ5w9PMNmcU5cWIGjHQP1zt89EXfwCS6oLNQpy/YZerAeGPyRD0W/ofuAI49dxwJ1n V4iyicmJHiEecuF3Ck/wcDbEhs9efQ8K8pFSoceB42oNgRcg21umwKWhwbJCH6/K+Ezk DcyY2CIbMoQ5XDJbkGFCj7MSp92TpeogJPgp3K4//FvF3WvTKozNFHbATcwtfO3KY9vw eoago+e1Zlp/J1c4eVLbhu/YBMeyoUcoVFr2+sOJAPnHk8XoKS/ohIT36vfx5xAU8eSp Prvdk8ZbFEt9419hmNSgm+twjlGGsbF4cBN4aB+6zKe88L8uL2dpernZYFg4SpBOXBNJ vgtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=DWDpQm8P; 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 s10si3742376qkg.328.2020.05.21.09.47.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 09:47: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=DWDpQm8P; 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]:39412 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jboLq-0001hc-0h for patch@linaro.org; Thu, 21 May 2020 12:47:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49708) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboI6-0001yk-TY for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:30 -0400 Received: from mail-qk1-x741.google.com ([2607:f8b0:4864:20::741]:41112) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboI5-0006Vh-TV for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:30 -0400 Received: by mail-qk1-x741.google.com with SMTP id n11so2376895qkn.8 for ; Thu, 21 May 2020 09:43: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=pu4aLcXEpuJ4ytDOMXC0XbbDo51phtIicVpeJSCDXFU=; b=DWDpQm8PSA5NEf/7AnwZEAKyU/pEgvd9hw5c4hyVd14yhfhx3oc5Eap2P06jV0j7RY 43uxoKGirTg1Sy94QGDtwfFHUQKQm2M25FA6PQQIKtvlGIdzbgRGqyL22+6DB2ocjnn2 GJZHE+HD+LExIHNXy//q0IxedEy6YznJ+Fb1PRH0srrobWnDiCu/y0kAGjH6vyHBiGg0 IkRO/u4OFIDs9/hbiMD52C5Or72nU68I+7/e7M43XAv7lFm+2PKMjC7LK/wS4DgZlW92 QQqBhO4KGTBFT/cnPbTKsIHQkfN8UWp69z3sSDBI+Lb51HlF7ImZsl+Lzwcu8N6z51sH JxWQ== 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=pu4aLcXEpuJ4ytDOMXC0XbbDo51phtIicVpeJSCDXFU=; b=gy/TLo4ygHWn3DLh1zIwAmTHMDaMTGTY9dozrUarWHvraDo85XhA9RQV6NHJP3iJDU ISBSYscQf4mfdx6zu5wdA8iBzFbVdZiXM3xJ9638SA4RxAWAu45gOAvNaBWRrKIkf4uG bt8+zRbQQgf0HOuE30lWv5jK0WV6to7VQHtl39YF7wX/kHeOAmVX6gNoR4HmkI7CYGxH woXUQyNNAFhd3b7RDXiAcU48erwclVJyUHSrLPfpHvfBamGSFvN5z8sDSfZVuiOtw9/3 KlJLkLE8c6Z489dGZbsxjeuNHkhrcfnL3n9AnqbwzWi19zde6Rvo5M+QuvxebuIQucTe itLw== X-Gm-Message-State: AOAM5306W6NUF1zvCj8tBGm42CALOuHsMIPj/DGFDNSzAg41mq00+OcU LKwLTk/rHo/TvnSYdhAfNmOFakBxTBN0lg== X-Received: by 2002:a05:620a:634:: with SMTP id 20mr10167516qkv.15.1590079408631; Thu, 21 May 2020 09:43:28 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.43.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:43:27 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 10/74] cris: convert to helper_cpu_halted_set Date: Thu, 21 May 2020 12:39:07 -0400 Message-Id: <20200521164011.638-11-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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, richard.henderson@linaro.org, cota@braap.org, peter.puhov@linaro.org, "Edgar E. Iglesias" , alex.bennee@linaro.org 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. Cc: "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 Reviewed-by: Edgar E. Iglesias 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 Thu May 21 16:39:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 187017 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1714337ilb; Thu, 21 May 2020 09:47:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQyBkq0AQQAcJL9EiOBUwz4T7ugsrtxD2Ib+RmaBSxrC1LPB0ODMHqFWDI/lgmGvw/4h/t X-Received: by 2002:a37:7246:: with SMTP id n67mr2189284qkc.303.1590079654355; Thu, 21 May 2020 09:47:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590079654; cv=none; d=google.com; s=arc-20160816; b=UjWUZ/r6e/LqIq/sXb4co1YeXaauxTHelMMaES5RXxKnR3U07utiJObxi5ZFyDzXuw cRDn49MpOfghC5ZIurVCjVIitBHTUWH13+n7YnbZdSCF7lMsWLdJasdllkl3koLbyKS2 D1hExHe8/Gm9BBcSu/bher+OxdCd8A9FLuvmi7E67tmhHDwBiDH1YGMsxWkYy5tzOCeX iL3ES3ZcmUVXQWongt1Pmr9slTN964eTAJ/cOXY/y3Do0yjSnbKsuFDR6H88299xptNc CrVgqq9OXisaEhKfeTbxFeQ9HjzCi3emwKV+b64LUdCgcOmJF4YRgQGnkpxKxyOhZKoF IVyw== 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=Fm/szqbW+65BiKxdVuN6oRVvg4d7vsnEKBfJSEJJ+bZi7SA6mKuESj4iZQpFLhAeUx rGe1DGYfqOHmvEZcZWhY0U9FvCUOhalDOLXF0usF6L4lxvLE12I3gIak+PdCqcVYtN7z 1sUylg+r9rJueCcGAkfdpJi2odE8HokDpRwlTMyVOO4BWgt9jkyirUdT0GExke7m1bPe Abj1587VkJoaOOQoR95agSkw7QIUMtFP4tbDM8nuCtxRjn35Evge83T1oGb0HM/436Ws KfVvFjZ7xtU1Pc+nvUIZk8YKDEwEP27/7WhEuLOv3nXmu0fdWVTUNjpwjpBVfSTDHYrh jsIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=YmuuoF5L; 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 d6si4030840qke.272.2020.05.21.09.47.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 09:47: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=YmuuoF5L; 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]:40626 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jboM1-0002Lw-Pw for patch@linaro.org; Thu, 21 May 2020 12:47:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49720) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboI8-000228-23 for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:32 -0400 Received: from mail-qt1-x841.google.com ([2607:f8b0:4864:20::841]:38339) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboI7-0006W2-4a for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:31 -0400 Received: by mail-qt1-x841.google.com with SMTP id i68so6005767qtb.5 for ; Thu, 21 May 2020 09:43: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=wrWqzZuurKLoDMN6QCL6bZgCudK/zrEU5r5KFbp+gtw=; b=YmuuoF5LDaLC9LPJFJ/OIGT/lFZhaggYW7guEd37vYOaxxRGX3CYGksjL+A29Pkhwf o++J4eNpgjnAUhOl/PaQW7sP2c4QlcHkcKOKf9A9CNQXmGssLOkqFR/dvVmq7KXJ9wup QjIkdJG8kC9o+aQOoMx1bZO3imXwxJk4lH5njtI8JcI32/ZiFccR03ksZeGTFBj5Xb3B W8TFGmLqGGjHpHZZvWJFTFD7+kN6u9EeakOrxTxTqPCiXP1IQP0uXGtW9L1s1K9yjZly TUcEiwNcTTkoK0Rl5gqWb5AnZS4D/HZbVDHT02fwfJt4Ep7F0seGmq1DTKfD/nue39FZ 6ooA== 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=tq6VNt8SG9J8jhpIANrlRmSt5Tmnyp5u7sHzdcsN4YvuTqXMxAnIbQ17A7F15yI0gz JzoJTS8gIfhZFV6IWyt1ZNnr2NRc4jQjixMdC/X35GXaqICeM2L/sOH4sofiyx2FvJrv 9WV040HBwHa26wXE9DscqVuuAkqdW/0CHNWXH9IAsskwGJ3zvNlpzdsKBNRHxHpd1bW9 AnopmcrIhj633rILObtQ33zTmpTB3kOxxBMDdauK+Lv1GC4eW2m6JCYY8C9Cie7nja1e nwuFW5z8lXMCUfcdlGjU4SDBkWMQ6MW77LHFW8vnTlC9Qt80rejB9U3OHKkWRjoZSaoW vEWg== X-Gm-Message-State: AOAM5310na1X6n0sKRG9PZKDXxmF7yDRzc0nzgVY2+J9TtZCnjZCXGpq +Ttgy4qTBoWcCF1X9A984C2QAOzXJMfjrA== X-Received: by 2002:aed:35a1:: with SMTP id c30mr11731970qte.228.1590079409933; Thu, 21 May 2020 09:43:29 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.43.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:43:29 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 11/74] hppa: convert to helper_cpu_halted_set Date: Thu, 21 May 2020 12:39:08 -0400 Message-Id: <20200521164011.638-12-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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: richard.henderson@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, peter.puhov@linaro.org 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 Thu May 21 16:39: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: 187020 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1715678ilb; Thu, 21 May 2020 09:49:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRV1Vm/NAHTy64OavJNb8hc3oxNM6K2lNEWN8nv22+nH3ZUHAygMdM6wHUAvvtkdgFt9bz X-Received: by 2002:a37:bd45:: with SMTP id n66mr11044772qkf.108.1590079767056; Thu, 21 May 2020 09:49:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590079767; cv=none; d=google.com; s=arc-20160816; b=YeZggsMGD2JEIgTGL1/9EmXtRL8bp2D7LxtqTazR6BlvgVyKUZAdXpoWwgT0Rua9Ww nB+cInz6JUw6hWzCjOI4lbIxOlnweyHbOdSSyc+IWXj/63EJPOg7UIRAwPNhrOWa8Bop 3wZz0+wcgqwBMr4ilO9PnIcsBil9H51HJn337wKYowaSkVVFBU90t6JWGiSRRvAPbsrj 62an4GGxaimNf1AGlU5wRQ3qbdFCoJVFINK9myE/4PufSUkvZmPWfbruyR8cNIQrpR79 GBJtuHMlvSKUsc2rXcTfv8s1bpSViBvOTMeYGng31Pke7Xw7xRiL25JaYtGcHwYh9M/P Y7Mg== 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=p1mJfQgUSajpR9lU6ZTURQdWL9DblhFREsfOMzR9p54=; b=dL/6zS0HFvurVddMawJvL+X3SMDB3rbsyESwRnw2wlDAyr0pc5cmJN/C2Vj3cce6ys /Qpf89LZtloR7hSrxPhfVpPzVm9UN2iiSAmz3zBx1w6HyLWJkRHi7JUu1xvHf78mI8KX 7RVxfcXPtsyKCz2DC3UO3Ey21LACPRnaekAkmO4aUitg/NqeiIegoa0e6DkOrHWf38In H+W/P89jXTdXZp1O2ybr357fB2uGmG0e0sfRHL75lyRqiorE3jxmuIwGH3r16Onx/9CI bmzBLI437xeBDe9lt/1T5GfUCfoIZLLndScujmTGm4wGRXkaoxkRCUG5MyRSzyyhsZkK swxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=G+4Hjh5d; 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 df13si3825930qvb.158.2020.05.21.09.49.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 09:49:27 -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=G+4Hjh5d; 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]:47926 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jboNq-0005nE-I9 for patch@linaro.org; Thu, 21 May 2020 12:49:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49728) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboI9-000258-6g for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:33 -0400 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]:38969) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboI8-0006WK-87 for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:32 -0400 Received: by mail-qk1-x742.google.com with SMTP id w3so2326442qkb.6 for ; Thu, 21 May 2020 09:43: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=p1mJfQgUSajpR9lU6ZTURQdWL9DblhFREsfOMzR9p54=; b=G+4Hjh5dHU44k3Vge8s7hwNhgmKXokOePkqdTPtL48+K/vVTjAEL6y82VbSToKpNNE +CSL+56UL7WLFmtnnRY19Fe27uhwgD82J+CvcG5nhCFZ54MKEiIfVPsskk62NmX/Vs8a Qw16zOpzbKM6722D08ldOTvFXU9Bz31xftGaI5d0RvayZZqpc6vYKS1Q62eeNdZs64NA ctkRHWL2CgHinSI8VBgcDouipdz4hJIL7tlhi+bT2NS5NW7NocZXYeAg7pc2H5QTrWdB vWSXH/Wpsj8Sr4OFa+tMD8PXKnGPsJJuqP92VXPP559eytNMMYTIM2UYVN8lzzGGPPev mKeA== 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=p1mJfQgUSajpR9lU6ZTURQdWL9DblhFREsfOMzR9p54=; b=N9N9NX3o3GGdvHgcSOH/vEyLSrtyO71TWSU6R1goo/+xjmGhKeejf+fCYhSrBMSOkX lC7uaLQmjUKAzUCySzHht8ZBGO+PfcLMnp0vM0ISlcXaH4Jgiba1bqSOzyuokJ7mN0Eu RLhZWGfwRi+yK+QbKHn68kYy21kD1iwrUW1WkdKyjkzE/ZJNN4d/2J5XBvztUA8m6g32 ufWND/zbyjWTH0HMof7jgQBUnP2pHnoeOK6BBTpP4cbU3DsvoT0gn+JxzRvNXfYg2iP1 Q6yHnMlJXFhoC5qd1oSVAHLQIgf3Hi6nmR0hUG002mBKxSsROW4O9u+7WZ1OnKcd87zy T6ng== X-Gm-Message-State: AOAM531MqieSlQS+4U6mGfZOcsHy9yZCxQ4a1DFADqS9mJdPc+dlO3FY AkyfHmGttWbgWVqhMmtpjdVrcKIK0qHUOA== X-Received: by 2002:a37:8a42:: with SMTP id m63mr10531000qkd.230.1590079411098; Thu, 21 May 2020 09:43:31 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.43.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:43:30 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 12/74] m68k: convert to helper_cpu_halted_set Date: Thu, 21 May 2020 12:39:09 -0400 Message-Id: <20200521164011.638-13-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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: richard.henderson@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, peter.puhov@linaro.org 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 0f80888203..16a64e4776 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 Thu May 21 16:39: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: 187025 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1717450ilb; Thu, 21 May 2020 09:51:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJztladg9zppjn9bAxQ7EKVaAwiB6J++sHZvfyOKrIV3PpHZWB/nK7gGPsmSZqGCtahQq9Tn X-Received: by 2002:ac8:b48:: with SMTP id m8mr11649951qti.206.1590079899544; Thu, 21 May 2020 09:51:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590079899; cv=none; d=google.com; s=arc-20160816; b=gj3CTZPH76GldVg0cRGsrUXifqt2fZ7LQPvlfhig2znFUilmqZ2KH5CUJB2DkuNfab 6Tj/0VKmM8CoQkuYxOyY428IEJJ4SV8Vs08NtZMb6lkS89cstWWQ+T/gRfB5EtOLtRKr dnoLqDCUF9ZN2r8Qm6g57G9m+6ZM2seOCvgym8dxVqfXgqHv0fzEnJyf6RaTdwcRG3uH 39B8d+9hrTP7uQB4g61y5cdSCvCuOxysbC7OPc/88nj6YgUgsPPrblZxBscrg4nLc7Sm ZILcuo/gl8lbKqn/pA9q88uCpUn5JM1+q/az0zevGR+CRubHYGnJJJ5DNssqvkkfq9Mg y11A== 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=pfQTkpeZUPFzlNB+7owLtLECn8O+Qes0/gIchOPs3HzOjCScZkcdKBO88u8T0/hyUW /7r+Kh/uy2Js5SMjMmax33rhB25sgYgfetgISSIKq7+mgskVHk54QEcSYzE7X1ho3sVR 3NX3SBwQE8olx41I8zfUzC4ooifSoiLWJ+BYrZD/ZGLvnHE8AHcTAPRvitENB2Lu0oES 3gow23p3dfx3uE87E5uq6UbbnWMtiqSUrzmheOBmWdr685vLNHnBEyEjzMdpzWcRXKNK 1L23+tNugyiSC4H/O1wJVGSpj7g7+lfEZa2gv9oB+NWLQpB5gzdukSng7+nwp0mmsCX1 2OvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=SGKCHWDZ; 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 v15si3932543qvl.51.2020.05.21.09.51.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 09:51: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=SGKCHWDZ; 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]:56854 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jboPy-00015Z-VT for patch@linaro.org; Thu, 21 May 2020 12:51:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49736) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboIA-000284-A7 for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:34 -0400 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]:37276) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboI9-0006WW-EC for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:34 -0400 Received: by mail-qk1-x742.google.com with SMTP id m11so7880098qka.4 for ; Thu, 21 May 2020 09:43: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=SGKCHWDZY09KK8Z1xny9ksZlvnpuBkaMA+nswHU9X7bUmRqFGzEiucF7NoTK1l/bOJ 64RqsnWqmnCA8xUnECSl5fnKyz3QJtefvmu1ADa400dt+VWbrVgy9cR3hUaSaikLPHVv 0FdV/QuI0AA/R0hjhIDOrMUqbpTcRFK013i7Kh3ib7sjNIkFBxD5eIefrSnL32negTwP CnZRA6fJ5PF6+3c1Vk/q6ZRJxFiC/8+iBCIYzQWCjx2N5lLQmntYOeih63T3wBpUh+XC uHJUgp1ULKWBv+kaItsEHgq6uFBoCnPjdX3HhKd4YL6ADKKscnkOaSWCfIf7jZ1dbO7R VYoQ== 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=F8kSWphnAa7/2nFu7rK82Ez3V8WEgo7awQsx+BRBNPxrjZna6vwU2iME8Vx8CuzO9+ JaKoUt2KiR0VH4LHqa4Ds3LHa0ym9LMpo5Dnx3Zjb33TW5NmH8LSha5uPUsZiFFK7lkd fIO3yFqNDYTzHCLJD498UjKMOC9SIKkTwFFFnCRRlzWFDvNS1DIMQ2uIscf/8Qi9Ook7 qHbwlogMK/FXi+z3cRTPaFSYar1Mf4t0MalvwGdOGIPSwGlpRBmsi6gRoUI214ECvxhS 0oJ5Q0tIaxoqMfvt51vso72r0bJRhAo72K6b5ERo0LKKeNx+T89hohAyEU93OI8Kf1zf /2BA== X-Gm-Message-State: AOAM532yle7yM1m0CGb6yV4mhxpgbfkiznWs1F1I0Jr0qLaq2e28IBCw Lze/w8BHWhhEEJMIJPWHIyvQ7WhR40zZsQ== X-Received: by 2002:a37:6cd:: with SMTP id 196mr1795854qkg.393.1590079412346; Thu, 21 May 2020 09:43:32 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.43.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:43:31 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 13/74] alpha: convert to helper_cpu_halted_set Date: Thu, 21 May 2020 12:39:10 -0400 Message-Id: <20200521164011.638-14-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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: richard.henderson@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, peter.puhov@linaro.org 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 Thu May 21 16:39: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: 187023 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1717055ilb; Thu, 21 May 2020 09:51:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7W9siB7MI5A3GMhI3tNcBnoni6i9ybPD5+YU9ZcVILZOaZ06wAtOdlLk5awlrsZ/BKGdx X-Received: by 2002:a05:6214:1422:: with SMTP id o2mr10988462qvx.13.1590079866592; Thu, 21 May 2020 09:51:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590079866; cv=none; d=google.com; s=arc-20160816; b=PpzXMQa5VzrHzEgFnhzvR6DJh9c1AhdtobYLbnUpkW9GmK7JHT6miKMlAJWTHqtHTb z+z3T+P/yluV7EPJ6vjN4tO5jcdkmf3R6+mMBFsl+ebTARwClBWaEu2T+8gBdN7ko8Ee EuwGcktiOTU1k7WiVsRIlhaZptC3+KDs6+c2JeLv1CvV4XwPsotkU6cSz32AB+SGmOT8 yAsgzLQruhIAZDB8KXbJIYm7z1C7cCN59PhzJq/aGFTglN2BdRff5inSyPZ+yw9vxNxW mJ28VNLWQ5MdZwNCW1WIfyCHQxt8GA1ms/huPdJ5crnPWFtVCW0bHGBGjcH+1D6THLbx 4iug== 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=XpDaiKPid7/Y+hg6nqP95tP3OCZMiTwwygoeI2gWXpY=; b=bj01affGkR48heT3royu5kCVdgiU6a+EwdDWj0xEMdmjeSFRUppZq1+d1wneo8pZv9 yolNR05NqPTroqxlsM4ShI85O6AVo9YSp0jixnSHM2mhQadl900ETRLnaMZ2pISriSmM GP8JpPZtke6usvR08Ar+55zYvIOpKzifxVo1zb6MwslEajYPK7rp7qp+XPqkWSYCkVH8 K4EqbfgnQBIZUCHIR0kLMqsgpjbSuqDSkUisFRZHGwf71Qp1R5YHUeDsouwCnZdXL7QU F7pgIUVgLWcgaZDFifycCFvhopi00wMwyAA7tvG31lrZ5g5gVtR43OGbKNWDNASBkUgV fO1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=fGlzNEeR; 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 l14si3824921qvk.130.2020.05.21.09.51.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 09:51: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=fGlzNEeR; 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]:56406 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jboPS-0000uW-0e for patch@linaro.org; Thu, 21 May 2020 12:51:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49742) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboIB-0002DU-TI for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:35 -0400 Received: from mail-qt1-x842.google.com ([2607:f8b0:4864:20::842]:36667) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboIA-0006Wj-T3 for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:35 -0400 Received: by mail-qt1-x842.google.com with SMTP id v4so6011980qte.3 for ; Thu, 21 May 2020 09:43: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=XpDaiKPid7/Y+hg6nqP95tP3OCZMiTwwygoeI2gWXpY=; b=fGlzNEeR+AGHFmUdJLgnarLRXf99CwCGNAMiQCTn9H601nP2Hcg/aUpVO9/5yWrHP8 QDnIMMcoqv5JJTwMsSUwigFsQ4QjNwYqxXoeu75feV6pJerGQSB5ZcWjx5g6tMPXx4GI oxjyFNNy5/hvpsx7cUJq61czTKeq+F4T3WBu7mFlFg8uOlTUQbYE0/fsm6vRXKRMJFpP Yx9mvozDatStV/fMlWujfU3wUke8Kws8BJoSoeNWs2IIEpyGGsbmBvJoHhXsI138CX5l x1YNW5SpSPdcUNEzhVrpIlcQ5NRcRZewK21f2BEfZfToGFS9EaVCurHFUnxEnCNJLjpj UTkg== 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=XpDaiKPid7/Y+hg6nqP95tP3OCZMiTwwygoeI2gWXpY=; b=UWJTyAdzbeiMx/cFM7HaiW9wy6G3p4CyR0GEcCMkARzUq/Gze4xN83U7U2QjoB7D1W rcyitfjT+AgYsx44qytG0Qr2cafvZTFIDudJVoIDxUslL9mFRXCpzSkc7WEabo0thZyz Aw+jcJmNMDvFGiCGwEQh4Ars88jPbtsZA9eEqnTyPauTz3B6VGSPimE98cDYdw2eUEyW bz499b/4XJ7i2x+F8rrjIPjJwe+gyPGT2TOdw4eD8v5JRhV2ADuwjia4lOTxRtIRSxk7 WvrYEwgQCgfNQMCILElLBvIWtyzlJaU7caQCh2TO6dfn2yQ81UttzQ8COfb7cGPWVGSk sdxg== X-Gm-Message-State: AOAM5322pF2uTYRbEEK2kegSIjj7nh8mlcU2iS6PgRHGayffjDKr8qx4 +DuMBTPESddb74hLwuQHxn3qYQjnLjdgkw== X-Received: by 2002:ac8:543:: with SMTP id c3mr11108406qth.8.1590079413577; Thu, 21 May 2020 09:43:33 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.43.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:43:33 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 14/74] microblaze: convert to helper_cpu_halted_set Date: Thu, 21 May 2020 12:39:11 -0400 Message-Id: <20200521164011.638-15-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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, richard.henderson@linaro.org, cota@braap.org, peter.puhov@linaro.org, "Edgar E. Iglesias" , alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Cc: "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 Reviewed-by: Edgar E. Iglesias 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 Thu May 21 16:39: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: 187027 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1718204ilb; Thu, 21 May 2020 09:52:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7veECryxonEiFMNzBcDWi2Dg3neSVNnk0r7WU3u9gUJM6t2twzlm6iz/pndZipKvBz098 X-Received: by 2002:a37:6658:: with SMTP id a85mr10934984qkc.493.1590079957240; Thu, 21 May 2020 09:52:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590079957; cv=none; d=google.com; s=arc-20160816; b=bAw8SEqhjwKlUo5APKWXn84+5A9qg4DejYOUCz9PYm1AscK/3dN8aLxLIGluzP61DJ OMQbOwoiUCIIpBE8MCiHxjvBcAkIzSN2jEwhg0hUpWfjhWsJcj9FEAQpFsOshxYcEh3p ODZHfEhQWSrr70Zt5AROgtB8sDoelOSEXXK122LljQRuV8zTVfFsYEgcOnjNKNDLvUuU e25J7XkPX/BZA6UZNxS0botiKtAOtQmvYVZ7jrOU18QV3Nmt7MoW934ry3qV9LJpFQhq XgE3XQSxh8RNG6bFppdvcbN59cwSRFeEgJ4PXYBpfvorhDDy+G03EBnww75S84tf6sxC RAYg== 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=rcwZxV+jbsWTot43K/gufTjtZF8DW6GVBS8lNVigpbk=; b=QRXP3k8xSxTOyhid3V4ZZysHMmOd0KyN81LwtDKG0mzCzmL9gUkdTTJbkvR/MSmnJh /tIY2I2NEEdAHLENp6Yx7eoiChMM7WRcO19NCfn/3qHOTkGOpaoOkBz2A6899kLc6mEv z0CvdDFVhq3lIAfOIPiIaqL10Nn+2Uu31Jy1po7jHZI0ozalcOL0bRmGA6103shI27M0 hLFck0TWixMprUX53ugr+tGnkgv4ZytFQRld5LE7Sy5a97tMAXeLBZKiyySzrgsL3IDg F1u5x1zVHOFNM12phyyOwPLVfRmw128rwgrRBfpLiHD+BP//djcDFY7/qunG+UxxzkzS T5xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=bqhwUvOV; 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 d8si3937084qkc.172.2020.05.21.09.52.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 09:52: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=bqhwUvOV; 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]:36714 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jboQu-0004Ra-Kl for patch@linaro.org; Thu, 21 May 2020 12:52:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49748) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboIC-0002Gi-Ty for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:36 -0400 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]:39752) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboIC-0006Wn-0k for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:36 -0400 Received: by mail-qt1-x843.google.com with SMTP id l1so5985664qtp.6 for ; Thu, 21 May 2020 09:43: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=rcwZxV+jbsWTot43K/gufTjtZF8DW6GVBS8lNVigpbk=; b=bqhwUvOV7Cjtw6ugFb1N9dZ3EEjo9o0GTnmP6QidOuapa+BcmL0DCnJum9f52oz0KE BtFyPAlzdcHhALmFS7nKSn+QDnSgyR2JaFXqZvT0vcaFG1CaX8Tn1p/Wramu71uVZmKg l3/nRgjkfyVnkob08USuJMQt+JOHCN8n7g5EWTLIAcntCsTSjyCfkag99oeS45cIZDnm XJI2X2s6z8iu8bcEW9o6C1pz4qnOOqmQq0rHA/U2bbI3Z+VZCRjyIL7AO6KYV+t+ZWH+ qgsJ6MZQCNszVrK6LJyRsJV2Z2gWRcBP5wcG9myL7kAJ/PEQvkOwbSzMsYx1//XW1JI/ 89Eg== 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=rcwZxV+jbsWTot43K/gufTjtZF8DW6GVBS8lNVigpbk=; b=WTVTYqTC8BpIo/mz/mhlhg19dpW9vmaGst7gIG6CtG7e/S+yYPsmsI81ndBMT1pCE6 9FMh/E/jPtr0/mfBcH3ys68QrYBhfqTAcrHBo++uvg6Gv6qboOTDEbchz0qgOjCIMb1/ dBy6qNcIQ7whjBBLydX4mmJBV9apbVXBDt8z52SGSkvfC0UJzeJExIX+b1NscDwmoHmq W/hDZVb23F64pr302LkwhGNF6Pk6d1Ou7zmohpVfCt4LVUoebFTmrytnwKMQBDdJ29Tk rptR7cKx8L3d3Cj+XllIZrt3ypftbcCrPS3QuaheknmzypIzX8YdaAjdpBa9HAk55K7z H+Fg== X-Gm-Message-State: AOAM533IftXldpUPZihygMcf4yG/VFdzVqoH/zjcIlMLHqY5RSCJU0ug WpN6d4jL34gjdlB+E/VA/4oJdsIDcfgtHw== X-Received: by 2002:aed:3047:: with SMTP id 65mr7301769qte.277.1590079414862; Thu, 21 May 2020 09:43:34 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.43.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:43:34 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 15/74] cpu: define cpu_halted helpers Date: Thu, 21 May 2020 12:39:12 -0400 Message-Id: <20200521164011.638-16-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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: richard.henderson@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, peter.puhov@linaro.org 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 2959ed1b49..820c5b0a9a 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 Thu May 21 16:39: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: 187015 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1714092ilb; Thu, 21 May 2020 09:47:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPFZFyZKl38WmYXrLFx4NOKdBjiW4/F0sZHXvnBqODLJ/XHsXGHOAZRg7Pl+c4pSBdxPvm X-Received: by 2002:ac8:5359:: with SMTP id d25mr202082qto.86.1590079636096; Thu, 21 May 2020 09:47:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590079636; cv=none; d=google.com; s=arc-20160816; b=bkj4SL29fbu5OrehPC1N8r8Mcv6z4Yh4EdlRNoZnrYgS+xLfIExC8QKfuzgTKMt4Vn V3Ejy4StLmAMhrb1arG0IbkHzT/vGE4QLUq4iboQ8tINP9sSdbmfpIOWBstk7i8dtsT9 dip/sYOGXlwcPJRKhREJdMPk2578hFVt74BM8Y09cVFWeCiwIybBFVNZHWMDS4AqK/F1 HXBRlauXZJYCQTnMmzLOtD1DWoK385gJYs/WqqP6RS1eUCiCJGT1kRv5HnDjfJiIosSy 6btCiZ/mqZFNeNO+RN+5q1HNXvqFPRi7jG/zUVT7dnYCRZE36FZMGSYfVVw/fFFNDgaj O1Ug== 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=TcTYzneWb6zgjb84ARkvdSCGNhOfDYa8SI/nkXJEIDmbsDSA9Hm35CX+rDvi6OjOZ0 AlEU/OM81422zMHcr5bYv9tNVyX2NBz8bwtlXPzhe4rj6AEALKkwJFtcJ7VbPdbv6j/X Cowz0kDabw2UMGCxlPEO6fH0yJcMk48TZarOg6KtQR9cjuQdtpzpY5l6mV1IAnyGnM9k k/8iASmCbsF/5HCNazkQbLD24poDpicWcDeafRJLfBuWqk8lik3CeYzqkIMaTuByX7CI Dk/Jx3yiPn0qIphe6EMXcMcdkORA1FqgL4NswW6z1s+EK8Gpb1T56WqAqiQMm89aVlNT b0KQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=TDdqEbk6; 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 g2si3620639qtj.141.2020.05.21.09.47.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 09:47:16 -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=TDdqEbk6; 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]:38764 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jboLj-0001NU-JL for patch@linaro.org; Thu, 21 May 2020 12:47:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49758) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboIE-0002JW-1B for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:38 -0400 Received: from mail-qv1-xf43.google.com ([2607:f8b0:4864:20::f43]:37865) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboID-0006Wu-4V for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:37 -0400 Received: by mail-qv1-xf43.google.com with SMTP id z5so3373977qvw.4 for ; Thu, 21 May 2020 09:43: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=5p5QVMZ54qL4PKza/xfxsC7DswUaUr8tRQACxDFIq5U=; b=TDdqEbk6IX9z4XjZHxvf8HwqY56a2NNvE/lbRvy54fv88C4LqyMEVOTbLkkaL+NQw4 t62o5xVjf0LYZu5vCJ+/1y7FLD9tXneVyGyGaaippzhChniq9ZCc3/E9IsIQEsltvL2L fgvY/kbobS927GncxGuEhQsPSjDrrK7TEtUA0KEEdegBgcafpnf2i23zZmPF17BMHyt6 xhAXQy5w6ydVDYzKE+Pphw25qIXE/s9xKy4A2WzpxwPWHeZpf3EyJpodnuFkzgxwgudB T++Ze6xew05f0IvnVwW0FHo873oI5iD7r72thC1g0/OCR7s1Ree0+PGL+nIQKFnD+CrP 4lkw== 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=CHfEkyEMV88N4Hx3fCXxJTNDYOClkb/xGchyNH0MDBeS5xKxKsImB3pb9Buqrj6148 6YsuJ5fL8DfTuvbcxWyM6w1BLnhB4nntOWycV79smwQ1l54TgiugDXEowkJzvov9CUTc XR8M7yZOog53TnHTUVSeIIRoTIB4RjZ+U7NqYzAgWv0WEQt7s9U6VMrGma1AYEqhdBaL LJYlnDLnzTaVC0yPW1M6JnZkauIf3DpvCBGR59WlKfs5zskGMM9R3vkG2d7xAvRW0vVf 6fgqyNSjVe4v75+11qkFabgq8jC6oPNkzqsR24qpPZdx0Fy7jWA//n3x1uE05C8aLY9s u2dQ== X-Gm-Message-State: AOAM5303Lz0fdDdHtL+QWaJmkUf0NF5H6fIvg0Ln4KHIj8U7rsxCe/UR 4YuQTVT4Ceu8ytlMf7FqveJoMv79DqaOAA== X-Received: by 2002:ad4:4141:: with SMTP id z1mr10624562qvp.227.1590079416020; Thu, 21 May 2020 09:43:36 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.43.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:43:35 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 16/74] tcg-runtime: convert to cpu_halted_set Date: Thu, 21 May 2020 12:39:13 -0400 Message-Id: <20200521164011.638-17-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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: richard.henderson@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, peter.puhov@linaro.org 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 Thu May 21 16:39: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: 187022 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1715830ilb; Thu, 21 May 2020 09:49:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwSRiTiw6YQVI7wJa+w2PmtLP3BEJ9gHinNcNKm63c/gKm0o6BdV15idlT4cWpF0HpV3foF X-Received: by 2002:a37:b185:: with SMTP id a127mr10679186qkf.87.1590079779156; Thu, 21 May 2020 09:49:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590079779; cv=none; d=google.com; s=arc-20160816; b=Su7PNza4udMwWzTLDqkMNv99VV/DtagCb6FxKxKcK6HGixPthJkaz6e18Xuv1VOdba VM+/nXVHcc3sE6N7V1LC4yxXJKrq/kVO3t1bwOwBGoTLqv8nqeQZ1rXxTqCbIWq3oIxB 2qAUOj96SQQWwCHPz6EwqcPQoWGXZHm4KwvCze9HzV0T+SinBT6kPGEIPPSJTYGyjzV9 KgQC9v0LLf6o06whiyatB6ptceamn55VJ+EC8j5osX9yBMsxKWhv4amsOeK35OW7DJfV 3FpojwZjAA/1Yh4y+rGz+8AH+K1bSgJ3GWUwzV3JDwkjRJB8UTYrrT2oGTaGskcFXxR0 u1Ig== 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=bFdbQSB6mgaVAkP73ZpxdyRWP8s8cwxd+Gs2aZb+ids=; b=oK1Wu6QBhbk/KXc+7q3e4hrjfDS5s0OclfSE4667sMxcKaG9zZvDqxdkh2LC5pSgHX nhTKQ3kXKw4VQDwIjpV3dM+crf4CaGp19LzVw+JGsYQTNw0AU5f2s49UlmkihbnZ4a6Z CQAi2KzPy8HmqFy0+jwet6tcL2Ws9ipQZA0F1MDjdplHyNvn4mpH4n2lh2t4AI02unqk lBU1Y6pZp76llwPWPaUn2b28l8I/6Y5WJ/qE7fAYIHFasVrfcQ1Lvpp5Em0lwsQZwGEV 5I4UNCOPaV8FFdvhel05LF1BzMcdRXISxkJtDzkeU1LApnqAeOOxHhyrK4A7smU36/Hk xwLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=X176vZ6T; 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 c9si3890328qkm.156.2020.05.21.09.49.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 09:49: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=X176vZ6T; 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]:49106 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jboO2-0006Fz-Kx for patch@linaro.org; Thu, 21 May 2020 12:49:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49766) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboIF-0002MU-4A for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:39 -0400 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]:33066) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboIE-0006X6-9r for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:38 -0400 Received: by mail-qt1-x843.google.com with SMTP id e16so118815qtg.0 for ; Thu, 21 May 2020 09:43: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=bFdbQSB6mgaVAkP73ZpxdyRWP8s8cwxd+Gs2aZb+ids=; b=X176vZ6T83RSIA15N/NW0PIad7u0EDLMItBw7GiLqVzDxhQ5rUJoBbSinbFS9RmW3O 5pEu29Hg5kDDpl+KCqf5uPt338u7KtIcsvMBVJmqkHneJjCWDd2RnBCxXpck/u/gmJLu gJVzzlEp0GfuwDYVDXMSDJ+wZovPT7cXgIMTTSzam29y/76InNUQ2inPYHQkSJGoF/MM eUo4NnULI/AWHX32wqqzj7Bx5ZBa2+XqTr6evOzfHKMbcuCi/u4a+rmNHmyPQPK5KMqS fXpbFd5tu0wPCqaceVeQ+n647k9dMdy2oxisu965EoFtDZDSX3Xg0ZUe8ddEMePF9pPb yIKg== 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=bFdbQSB6mgaVAkP73ZpxdyRWP8s8cwxd+Gs2aZb+ids=; b=f34XcuSTF2qMpftDiuwPT8SUcOeUVcWknDVelVRae9IvHli84l7PrQcdpAa52PTOz8 NQsuwUY6L8AzJD80ca69TurwYRPhRRJhn2jPAVbNuT+4W/4ukOW2+Fl5k8PmdDI4QDwp WMnBSuQNa/eN/5mrMkW+OeFh+T7Om+6H4lVFDCxLj2OVA5DlLBvEbiZpnJ3vqKUPY1vE ZWoW002J9Dyyaujr9e+9Filixd1KseLjjicfMiCD/D0szXlhxl46Qzlx4rX9MnMVoLGB bvsy1zibU55hJ+ojr6dHJyxt3EXwH7BJk6r/AE9Mbsr1otd3qJ705l09Ecw96bUiQbT3 xiSQ== X-Gm-Message-State: AOAM533/h2/j2TlBPff96SM6NQzotveLkBaBTuY3Z4LMDNQXasGIj4im v/GdRu2y+gOjz0lFxF6P5r0HF09xI/m1SQ== X-Received: by 2002:ac8:326d:: with SMTP id y42mr11349417qta.243.1590079417200; Thu, 21 May 2020 09:43:37 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.43.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:43:36 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 17/74] hw/semihosting: convert to cpu_halted_set Date: Thu, 21 May 2020 12:39:14 -0400 Message-Id: <20200521164011.638-18-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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: richard.henderson@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, peter.puhov@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 6346bd7f50..f70085f3c1 100644 --- a/hw/semihosting/console.c +++ b/hw/semihosting/console.c @@ -131,7 +131,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); } @@ -154,7 +154,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 Thu May 21 16:39: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: 187029 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1718254ilb; Thu, 21 May 2020 09:52:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZiN4KNnLGJO4mjwR6Nq78QV7eYTD181d/hfo1GxcTcnjibw4pgV6pSx6l7hSYtEC9TtVp X-Received: by 2002:ac8:66c3:: with SMTP id m3mr8916665qtp.262.1590079961234; Thu, 21 May 2020 09:52:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590079961; cv=none; d=google.com; s=arc-20160816; b=VuWlwgKeBtAo6t5Wr+3W+Wh/KnKLGFnEcQBgj2odXoDQ7B8QL8dvpBMX+xldiEqPHE R4NRUNN/1nX2DlJcKl3IYM95maIUkRwdt2lg4Q53Ee32VDw73X5kAr+hdd3pokXFVELm tHHIkbyLAT9oug2xzp3YP3t80DUrToLZmzNxbZ/JmAWSOQzDx83DJKuWIF+2qMvSCbBc wfJcrI0/eoM75bUsAbOPlrqmB9KSTCwI164/ZaftT0MksKGSDgVwZ1Rr55zaGWinPVIr 15jwLfL+xFTVklDQbPG1eJcGMfF1XeP/oimh2Yl6/I+T5CuDIHlxPInkjUu8ae4LWDOK qF/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=dMJD65Hlj8sZEjsVc6zG0Ir/AhvAmDKltVf3k3r4CgY=; b=0A7OIG2ipXeIuPqUVKY1uMu3I9fgKLsdKNgTtWTDegaCvBWMLeqy2Rvj8xBPZMAhZ9 MMuSV2QPkKIbr2DSQitHatTp47+NaCA/jIjxKgntyfU39Pc9G/7+h33xaIbCFYED7UoZ ssgf/3Im0l8a1o1Ho6ft8wMYkDPGIgOuhhomU7geNqC+Uk/+PZ9yikx5iza8+LM5k2O4 tFW94Q/cqkRB1HNbJelMSmtQkB9L8NoZoq/Yf3Z0IBhV3JfCE7R3YL3Gmk97IYsvQDG8 hBitUvO2OPiXT97xxH/U7qTXyT48n9oAZq7/DNaRfHU6MgMEiOOb+zDg2CWoVg796MEA JSzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=qxolO3NH; 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 f9si3717998qtg.3.2020.05.21.09.52.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 09:52:41 -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=qxolO3NH; 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]:37300 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jboQy-0004gD-N8 for patch@linaro.org; Thu, 21 May 2020 12:52:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49788) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboIH-0002Tc-Lz for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:41 -0400 Received: from mail-qv1-xf44.google.com ([2607:f8b0:4864:20::f44]:41358) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboIG-0006XM-Mm for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:41 -0400 Received: by mail-qv1-xf44.google.com with SMTP id v15so3357276qvr.8 for ; Thu, 21 May 2020 09:43: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=dMJD65Hlj8sZEjsVc6zG0Ir/AhvAmDKltVf3k3r4CgY=; b=qxolO3NHBjbuWSRVm36ecn5krJ1xJDM5MsGZe5bSWEmRz2qykCI/o2yo/NPfJ3CxQP UqPRK/+HK3cnZax4qIl/EXV5PqZd/zWzN9uyUetgiB/7NayvCslb5KR2+jKttR6Flm2o oXT0VevNgkoD14jUvTXvMbjiDA++0c8Oxv6GGAMV8JWe2+MxNWrBAx2195PKKvY0FGUv PG/n6uqVOMcQO9T4xYRpIRjbIaoyaCYpJzMPk/pkLqj/XsNniKiEmGjm9TwiyZqI64dO BBWUZDbpuiCo6+JCd2RC0lsYhp/6YKmL9IeXLsLkxmkzObsyg3H/Y7sf+uHiLQXhrWbv 7/sg== 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=dMJD65Hlj8sZEjsVc6zG0Ir/AhvAmDKltVf3k3r4CgY=; b=KuYo6IZlTZ1XttfxunsmF1aGxFv4mcvDe0aIuZ31VVzTZ6DAkqGoTEoXH/hBnM+dTj AP7RBtA9iY8mWIQvj5HPQICSUwFqQ+IaGzoYUSOoyfVcrPswBkMMG47xGUHTWq+gJpgM 0f8zY3Cgh2CuHwolhLwB7vI2o+7CIvVy4DUtfs3Pyss60uRE2EAFGma2QbJu0bfkYDB4 FP57VJ0OD4OWpUpz8kIEM95KCIbp1HR5sdWHHnEPvf0al/8/b38wz6HHX1Xh9H4ksLCK jvb98sA5Is5fMQH7qEGkGPiaQ+DfJT4CjB7xo4OlYJ4pNzZ+/0SbblF5XHeFRxBcys4j D1Zw== X-Gm-Message-State: AOAM5332XtZyh+abh8PK8/yt4zD86oNYgCBXHRSlXW7VrP2A8UeW86n4 LjrjaM4h5eunNvDZK7wQYLVJ/iNenEvjMw== X-Received: by 2002:a0c:f590:: with SMTP id k16mr11076855qvm.81.1590079418769; Thu, 21 May 2020 09:43:38 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.43.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:43:37 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 18/74] arm: convert to cpu_halted Date: Thu, 21 May 2020 12:39:15 -0400 Message-Id: <20200521164011.638-19-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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: Peter Maydell , robert.foley@linaro.org, alex.bennee@linaro.org, richard.henderson@linaro.org, cota@braap.org, qemu-arm@nongnu.org, peter.puhov@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 761cc17ea9..83b1d63f27 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 f8df3cc227..23b4a06a4f 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 203d4d28af..057448c2ed 100644 --- a/hw/arm/pxa2xx_pic.c +++ b/hw/arm/pxa2xx_pic.c @@ -58,7 +58,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 32bec156f2..dc435a18a1 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 Thu May 21 16:39:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 187019 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1715605ilb; Thu, 21 May 2020 09:49:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKJ0y/9rgwHZxf/Npam3AOrk9T7fTPqrvz24kKWyzq+oFvEAGS1K6qpHK+LoyHbkRcKJNN X-Received: by 2002:a37:bd81:: with SMTP id n123mr10340048qkf.57.1590079761015; Thu, 21 May 2020 09:49:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590079761; cv=none; d=google.com; s=arc-20160816; b=FGXeuDgG3v3z74POvO2cPQwx1W2Yv2gwvHoL/fmLbnZOy1+o6htNJT1Ih5cgNXJ3ib 3fU5PtJZRjuj0a+nVf4SOO0sHdzRfJbjtN8rsUlu2rtZtVgpb2wk/iK7CNNk0V7PyS5g WOtInmPkDudjZ+G7wxjhH8JAZ9cPVq/khwtms1Cq0YL5jO5O1i8OyI8mf0ExmDrFSdOT M3CK0nG3GdhbI6OHlaFa1DdT75M2I2nmmFBlai+iyxCVNP192EsGUtBXa7q1+J1LYNxs g3n0I63GNT3eZw1L414vDK9/lkHrfn5vTe2OX95wjWlTEnPf3Jikh3K0kelYGDZ5gvbR PgVA== 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=6NkPzVbp7pB8hvFfdsKA9EEdR2aYnidZNgYq++P2+/c=; b=hr7UZHmqY3Ga+L/2aJ/br6aemb9LDW2xsvpwJ+jpXH+Or1s24UA5AqNzRd1h7Ksow5 8lFss7CDTsxVXMZLDSLqG1BVwBQ8rlhhL99AvIQlDfBSEN0NsaZb/bO/2N6KktPHj8rm pKUqjwE9wldhhxnb7dgXdONgAYdgig4efSp7Xc6e1yXTwKnV0v7xrS1hVGLY1zx5XQdN w9+qut3+PHhibx4+REY0RqqbXIFUOxiXfDegUW8UXPCtpQ3NcBtcryKYz2GyOP/0SAMs 8f8L8GxYdA5Zo7Xh2Gb7AgPV7vqHig+mikfW8xJ1ARhQ3FpEcqvZRkUMnZZsFlGpGC3c dxuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="bN29/13S"; 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 q40si3754388qtb.354.2020.05.21.09.49.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 09:49: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="bN29/13S"; 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]:47216 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jboNk-0005VK-EK for patch@linaro.org; Thu, 21 May 2020 12:49:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49790) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboII-0002VL-N8 for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:42 -0400 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]:38180) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboIH-0006Xb-HL for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:42 -0400 Received: by mail-qk1-x742.google.com with SMTP id f189so7857517qkd.5 for ; Thu, 21 May 2020 09:43: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; bh=6NkPzVbp7pB8hvFfdsKA9EEdR2aYnidZNgYq++P2+/c=; b=bN29/13S1TB+Mt2KQKrLcDbSzGXtjcu7xAuASP1uygOxNBrXG1x+JT9OvurLi1TB10 QD9s1V9bZlJZpweuS2rFiinRWa1HgHI4zk+7NERwvi1Gonw/fFaxlbOiXdhU14H6Jmbo kgCmP3LsQ7H1gZe64Iq8YxjdUys6nOf3soRG9pbjrXHlLzfJgPMTq9G4f17EwwTqOndA LpVUct/Fz0p2g6lYVweB9yZKZwezfOHdym/hwIqZDEMDU3cyhhck/VmTj2bxlI+xKzn+ 3XJM8PYl3J/TMDeltrcgWnUXximXal1rUPscxiJRlusBER0ndCRx0CgAaTrOXEkYUAIw q+CQ== 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=6NkPzVbp7pB8hvFfdsKA9EEdR2aYnidZNgYq++P2+/c=; b=taNYWf+7EzXzGr/71Cr48SZXR+5BZZOD9NcyAt4agHBO9IN/rdm8UOZ/ZbWpDbgGpP M2dsrFMXpA89r/tBWtuzp818WGwouD8+KQ6MCzSjey/eedAwIeD/bx+OqOGBfj0cLmQC 5GW1eCH88WvpAiKJ3r8ZOb3yzEgpiJHgEg7Beb0nVZvE/zWWn8sL+INdgMS6GA/AAaBR MqtS5i7dO+G5GfXkU9X9bLBLza1UXP0rLHRxrhQB+7hBX5lrzEG3gOZUJ0FbrGx4OspI GRFhfT7DxQRRDAUeay7ga8KQ2yV22qF6HYzbgsn5nPEldbGbwfWjrrcnxAEhXw6FIr1Q r6vA== X-Gm-Message-State: AOAM533My6drMsFd3lkiuJPXBbv3+cAlN+C+4A4RaTKwiLiCr5HI39TZ z0+JdNgcYLgStYF6sIiSfF/oEkR/UF0xRQ== X-Received: by 2002:a05:620a:14ac:: with SMTP id x12mr10388327qkj.262.1590079420064; Thu, 21 May 2020 09:43:40 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.43.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:43:39 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 19/74] ppc: convert to cpu_halted Date: Thu, 21 May 2020 12:39:16 -0400 Message-Id: <20200521164011.638-20-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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, richard.henderson@linaro.org, cota@braap.org, qemu-ppc@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" 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 2a0b66a152..5683a8576e 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 e1f76c74f3..b5d0b06f3a 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 f052979664..4c7da88682 100644 --- a/target/ppc/excp_helper.c +++ b/target/ppc/excp_helper.c @@ -293,7 +293,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) { @@ -1095,7 +1095,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 d8adc1bd49..5838b6f7bc 100644 --- a/target/ppc/translate_init.inc.c +++ b/target/ppc/translate_init.inc.c @@ -8539,7 +8539,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; } @@ -8701,7 +8701,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; } @@ -8901,7 +8901,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)) { @@ -9117,7 +9117,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 Thu May 21 16:39: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: 187026 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1717724ilb; Thu, 21 May 2020 09:51:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyS9snjVVFfuB5pqoJd3ZSB8SSm1Pc3uXpEgA6UGnZyh9vpxcNAKoMYiVZMc2GueS3Edl4F X-Received: by 2002:a37:a008:: with SMTP id j8mr10244982qke.421.1590079917591; Thu, 21 May 2020 09:51:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590079917; cv=none; d=google.com; s=arc-20160816; b=O/RJIA7zQtVdnyBe1q+b2kRZ/vMOXuv/tbHnVYxVxX0tLoFBqRJrtuwvfecVggA70D aO/vEDrIcHEUdnmBeuSQrzPbsAfL8puYIoqd5m2LABHgVxhmWkX1er2rsjjbH79yT8vq INYrLMVXrUdn8DALF/dyoe5ZHpNnPoUcnSYgLiObdJDD7n2+6nCL0Eg3KHNCm9U4Di5t napsjbD/vfcFoq68ssAMvycBPnAfVlFXYAcBGSqc/TBPkH0q1t2ghKLMvy0zXvBfFo9T kuOZWchOKNYD1FOnbPLcanfWHu1Cm+bt27yxjcGauP6zTSrQBx6zQNfHu0RUN2LlqPyE jgSA== 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=sG6SUl+2TFK0CGLtysNBXlxtzrPl3cEvC5GVImwYzCX8Xooet+EVJXuKn4jCj11gPp cRwdi5bUjqnZjQjoqBt+FKhRx/7Cf0xW8O9L3ygbhnyDf51BbAepxocks7axwnb+ByUj 2F445XtKFf/4i3UFLUBbnpgqpzcnWOY+xtJ3rx88a73fyl5t9J8tux7mKRgn91AJosmE LlKSk/ih5WzbxP7FVScVfkwdN9dig22UcTJ1UJHYprmEOxsbhqgvs3ifwO9HjPdhbgoq 0ChPeeowMpo0+tlP7zUeAMrF8YiVkX+rLrai4Ycs3MAZv8SDYKtlcpCXUgUypYPrl6T6 ElRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=jvGgoa5J; 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 f10si1358007qtc.196.2020.05.21.09.51.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 09:51:57 -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=jvGgoa5J; 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]:58814 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jboQH-0001sU-2F for patch@linaro.org; Thu, 21 May 2020 12:51:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49798) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboIJ-0002Y9-Ku for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:43 -0400 Received: from mail-qv1-xf2e.google.com ([2607:f8b0:4864:20::f2e]:33325) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboII-0006Xi-MG for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:43 -0400 Received: by mail-qv1-xf2e.google.com with SMTP id er16so3384918qvb.0 for ; Thu, 21 May 2020 09:43: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=B03XAH5wL6d9wQMcetAjOEJJOmedJjFZih4s04YDqvs=; b=jvGgoa5JZt5CVicHbc16hTgS5Fn5N/TMorjKWHm/EtJ0QfGc1Qd1Dg4L2xIVoTXL4M sv47rnUIQPB8R1OnFOpYz06yhZMr89bfS0cNGrNBq18RChGMckFReojim/2Cz1ftBvVv DnopBTJx1HbEJiTmabP2gOyYgBkMsVfrDrLW/iazS2hsMNzVaNtwttYQbqbzrwM3a13W C3UOfrAoiVszrbk4NgfhstQ/y0hnUilj3M5W8h5BmMVArhh9KPcmBYJSe6z0gi6GkJGb MIsQeNvpoqaGMp5GVagE4J9S8t5g1WdyqjVvLAbGtLzoOcwWdtXeFnbJpPmuaZYUhM60 uD4w== 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=Br14/sRPpV2JvDPEeWfCUHZlvAoQF28dKBnwBTqiH9bta3Ng0ITH8C0F8ziM4Thhrp cdFR4e7JH402iEJxPlYJhmQATJ+Pd6dVCKky+WCYax4Rp//ZHSHKxqmB3d8wdTvlLJ/7 QnrORZdXYt0akax7HqMJ5xn68aZXB6hqNWoiIruQFMyAOK4O4oTi6EaR0edm3s7RhZ8D mNKu7FP90KBazRBs3fNT7t3tpHh7vEkH4TUNdenpAEQED7AukJ0dOchLmTlusQ6U0UKM NmvFL0L32h4n8/mLFUJyqRmkwGTl8R/R5LJpf22R5XyDlkg74xsv0UaqqM7gxkJJNoIv XGdw== X-Gm-Message-State: AOAM533gJ6XMXWsC2/nNHHjY8+mVEEDbH2Ypqn7L+2gUxiuzjlFwdAc5 XXB1ox7UDJD1atlDP2VYz3BiBYypESZoKQ== X-Received: by 2002:ad4:5290:: with SMTP id v16mr11065935qvr.240.1590079421433; Thu, 21 May 2020 09:43:41 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.43.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:43:40 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 20/74] sh4: convert to cpu_halted Date: Thu, 21 May 2020 12:39:17 -0400 Message-Id: <20200521164011.638-21-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::f2e; envelope-from=robert.foley@linaro.org; helo=mail-qv1-xf2e.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_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, richard.henderson@linaro.org, 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 Thu May 21 16:39: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: 187024 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1717446ilb; Thu, 21 May 2020 09:51:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJygwhuTgZkw1lZtDRpyHRqy8420Dvovi2tXdbIG8kSqdobvB+nLB5GJTeBy9xwDOfNqf43N X-Received: by 2002:a05:620a:6b7:: with SMTP id i23mr10444221qkh.156.1590079898996; Thu, 21 May 2020 09:51:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590079898; cv=none; d=google.com; s=arc-20160816; b=oF8EVXFRaXtVjwcjXu/2IR1PLQXut4Tw0aVZ4dwYdbzOUrzovsN6kIkoSUw5C3lJjs 6PJIC7pEO/OypLUbr/jmAR45Sr61AVnobpNEAgD5IEMUtJ6eG/nRgvt+IyFfB4sziJpH UbAgN06LcNxosQ5EFQFKiUSIAlw3tlURuxkBZ+cCD9Ri8idcLRRDEGVE4E5Jq9EmNpak osljrVcN9LI4d/e6Vxdw6iPQPsPb9AmwOARfFpXqKka6M8bE6DbOlHKMckd5MXSL3KxH 3eHQluIc3A7AWp5w4sCNKyM9QtQRf1AHRjn+ng+ErEqNn8Owcpy45y1tl/REFYh6qhs0 Em3Q== 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=qtqfEoZBoJ8vkEt8rL/rMli38pXfJMRcQSr/KYX6LMA=; b=y/ecCUSj2DRWvPy7Bgo6vblF/lVX8VuuexLQaIXyUCNhWhAwQltqmeL17MChW4R3xL PveaDgDlJxDo5MJpcmoEWISBtbU55EAKwBUaddjm1cej8NzEa42OSPjP4JU9B2U48NT3 im2OD/dg9zganjPAD7PSiKvrk6GctBBDj2mpyCTeUGLpTH8d6KmujaHIfzsXZ01Q4niM Gx42aVU8dWg68gunNq0ummGRd2dsRvswhcuR2rnk46n+NKNid6Dnz479T++X7SwCo3Le kmZAcGuoSPvaMOts827jf7KKxAcYkCCuts0v+vhwEw4yWLGBlx4O4A8M+nKeOe7d0vg2 f2HA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=iSj+bopD; 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 p97si3537437qvp.131.2020.05.21.09.51.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 09:51:38 -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=iSj+bopD; 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]:56868 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jboPy-00015o-DC for patch@linaro.org; Thu, 21 May 2020 12:51:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49804) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboIL-0002d6-CO for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:45 -0400 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]:34575) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboIK-0006Xw-06 for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:45 -0400 Received: by mail-qt1-x843.google.com with SMTP id a23so6023936qto.1 for ; Thu, 21 May 2020 09:43: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=qtqfEoZBoJ8vkEt8rL/rMli38pXfJMRcQSr/KYX6LMA=; b=iSj+bopDCoBTHZxhZbdSZLYG7WuOx41MlKy2OfnVeNpaZ0cnbPO/y5FoTYouCPDoDz kPrH6h/tjlTnVraLKgYWEvt1CZk1/gC8fmA4fElsaOhcldb6SuHTqvHX0I4GHF6RN7iC gFIbreBnXtDAkxC+BQIy8hbCEJAfYG+WvzxdtEO5arfYc51MNeTDM0qQA5qZVIBQx5e6 jZvN6cSE7zhbiTDZlzBde+0H8lvpHE4NLkQQ9ohz8r0MwDKiCx8TyQoFwJwWqttr/Bur 73XnL0cIlthHROXMhMkZ2g9XmVelmNZwNzHw/XiXkcLbRebrjVrYnc7+KrVWCtqEdt1u ZUog== 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=qtqfEoZBoJ8vkEt8rL/rMli38pXfJMRcQSr/KYX6LMA=; b=ot6Tkx2nB2L4NnvKbG5hbUD1pr8q1ZzgaAyQML/+yRmeczkold01OhO8m2xL/989eg 7G5R10d9krBCqHM3IOOLAmDVBQgCSVaH6YsYpZo8VE2GCbv0CClGVbOyRVqdjWMvzYbG UvA9h6e1bd+BVTti1UOcSTfO6BjOTsLsRnZVA7fTh9qutozzA5dGmRDTS/ujvKpYODxB 3Q8Y3G6JUhwIDX7l5447ZxIEtYBEHsgWnz8lTXIPK1wUjiPMx9AgrD9L872AnJE47HYR VR4Wr/fnZ/FHHbGshEU9atYURyMp5x/IuYehXG8I+/1DzeoNYRC768g8js0u/U5F5OTt 296A== X-Gm-Message-State: AOAM531NucF5YSDBe2qHQH6HMnJYEXAE34bv9r3Joua9w1rUVDDtJsCU mUwsq8hFkdrKOjjdss2zEaYskEe10RMI0g== X-Received: by 2002:ac8:86:: with SMTP id c6mr11440993qtg.176.1590079422715; Thu, 21 May 2020 09:43:42 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.43.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:43:42 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 21/74] i386: convert to cpu_halted Date: Thu, 21 May 2020 12:39:18 -0400 Message-Id: <20200521164011.638-22-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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, richard.henderson@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" 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 7a4a8e3847..9e8ae1569f 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -6045,7 +6045,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 408392dbf6..ef1dca3f98 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1867,7 +1867,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 f9c83fff25..25bf80b5f2 100644 --- a/target/i386/hax-all.c +++ b/target/i386/hax-all.c @@ -498,7 +498,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) { @@ -516,7 +516,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(), @@ -581,7 +581,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 d72543dc31..bf60ce9d66 100644 --- a/target/i386/hvf/hvf.c +++ b/target/i386/hvf/hvf.c @@ -704,7 +704,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; } @@ -738,7 +738,7 @@ int hvf_vcpu_exec(CPUState *cpu) (EFLAGS(env) & 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 edefe5319a..cbb2144724 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) && (EFLAGS(env) & 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 34f838728d..1c1d4c8c0a 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -3568,7 +3568,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; } @@ -4126,7 +4126,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; } @@ -4149,7 +4149,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); @@ -4162,7 +4162,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) @@ -4173,7 +4173,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 7d61221024..dace1956a0 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 Thu May 21 16:39: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: 187033 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1720005ilb; Thu, 21 May 2020 09:55:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzsfYHgAVt881heI/qIU/rLOtX/OEdiYOhsjw29rM0lSEZ2vX+fKVC6BVY4NI6zlUDR+SS X-Received: by 2002:ac8:319a:: with SMTP id h26mr11477298qte.317.1590080122434; Thu, 21 May 2020 09:55:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590080122; cv=none; d=google.com; s=arc-20160816; b=E5ema96uSEED86EdYFAJ0A2B3WJwQDCdE7NBrwQL+3BlcwpvCycryXOsRc7Ff9JflD 2erB7RXVt/nb97LT6A7LKE2QrcvRnmzSeT/AiNqnO6aJAY/HlBTY3cWiZRJIMqGvrK/B n4wfuGBnzv4K9rAak43c6sjm1XHIvXTqdUlKkR3FelxGf6KAgQQRG4LwTNB1/x9RSWLH Cs6ZwPAHOiTuH4ABcER8PfjoMKfLFBFeJYEy09Lgaed813SMsjNwuAF9h96WEpuYH3zK 5P85OgUH03PeIkz+CV8GTdN3Ctd14pWhxxIAnq486XqCefe2ENgZHNv3zRoCCogI5GoP luLA== 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=ul1RJ66BdJ1P9D+2R90sxrPIAIz8/PThvDSKxWzX1sliJSsPdBwXJt3q/9IGZRDZz7 zlgpgocIrn+g1S4FNiQpEu/0kKPhb2gHOg8r1PygkZ207yoZbPXLU2lOq2m3OGqrua5V PI6cic6BPqCPs2J0rpkxT59NORSxfR1XU28HWiT6Rt4y6aYws6hY6g+zZu7/G62bWU6h JAGwyz4DvT9aiBNGlCM0+s6Qz/Nh57NWAWit32T16KynmBeiPo3fMTxZMLJXOUMeoFKh jdw99Ig48QQFwlIk+cEJsMSzA4aSmRAt2pigxH9ZaFqNVGsByvad333adCFWKJHL507L iwvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=fWdhUQ9Q; 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 15si3622537qtt.70.2020.05.21.09.55.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 09:55: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=fWdhUQ9Q; 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]:45294 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jboTZ-0008K8-Rk for patch@linaro.org; Thu, 21 May 2020 12:55:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49818) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboIO-0002l9-A2 for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:48 -0400 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]:40832) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboIL-0006Y0-Ck for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:47 -0400 Received: by mail-qt1-x843.google.com with SMTP id c24so5986612qtw.7 for ; Thu, 21 May 2020 09:43: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=KjBP9WZwlnczZ3SxEnPdyurMaB67UgSlf8Umf0tpZgo=; b=fWdhUQ9QDGfIDTwPNDlX0mlIPYdDBaAqTFJsRlfJaT5q/AK7gwe/FrEKQp8KiqRTal PSReBmdNn44dU6366N0DN5DmPy6SxGkrlC+9gMyXLFOKH3SvBISVc9Em3255AFVWQa1h q1tpMeKJyNPVgM8FOQGDxey99hRJPfO1Z2Gd+Ta2bQvMKZI7Ncq3oAY5b/i7imRbpz2k f0+Pj52QXw1iR0yuztBfP0YB44aZVi6GmTxI4WR/3gC9Er+GoSq2x5QvkMQUtC3of2u7 IY7W8R1h4PQsc54hJ78/VDFaZ7G4mjo4e+0Evwm4vAiW/Inmwcl3xIkV7bfZUHE9JW9K CuJQ== 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=EasXcB5+JN1Fcr5SQGqNMEbtmvDETbjpY66TI19viISAXXBsN1WXnQ7InRVqbfepeX a0HT1POqYwwGwsFuj4JodfbCiu3a8ZFvjYE6KrXDIMFq3oTBAkqKS4HmPJR5z+QJoBGO uQ8VqgwCZCsvkuUfSV91yk9YQEkfAbj38ngCZhO+Ugt12xrYOwawSmsyupFJw1QOZCwh 3s9xKWIj6K10tKHHvAEIqGBvgugWuiD+sP6isPFrpiR2x43aH/svb3dEzC5k5usPzozE H4MNnpbJ3uuv3ZVagN2716fI4YvzYbagxd8pT7vWRfBsA9cOLyzV7vYb2vmyEOZjO+ru d0xA== X-Gm-Message-State: AOAM530o0M1KG1/L5sujtgERZDk0YOgqbG9yIrPuKYgyfa3O7QJkNAdO 1Ti29GjpMcFiap5GjT+oZHoXgocfHaQS5Q== X-Received: by 2002:ac8:2fb9:: with SMTP id l54mr10849450qta.211.1590079424259; Thu, 21 May 2020 09:43:44 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.43.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:43:43 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 22/74] lm32: convert to cpu_halted Date: Thu, 21 May 2020 12:39:19 -0400 Message-Id: <20200521164011.638-23-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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, richard.henderson@linaro.org, Michael Walle , 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: 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 Thu May 21 16:39: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: 187032 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1719640ilb; Thu, 21 May 2020 09:54:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJximDmraxq+WNX8goiMs7vEFDQvxFwKtHGEnISh72YSNjPJPbtM53BnS+22CE23sLF8x/1f X-Received: by 2002:a05:6214:8e1:: with SMTP id dr1mr9966206qvb.193.1590080089210; Thu, 21 May 2020 09:54:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590080089; cv=none; d=google.com; s=arc-20160816; b=E7ynv0Pa+91wxgzBooFOivs3qVqszvIIv476zeUwSIdzGPrVV6M7vmitC2z1R5gxYt ZgkUXra/aY2FfWt43eA700IL++4BLIYf5uRM2S5tF10N7rkoL9WbKb+WIKVLsLK5nMws ttrYX6f+fTJBIWqz7mY9XqZVI4B9onf2rJh2D940NBYb7kLHPFf4zfHNlo7iMSV+KZOy hYlaxzW+2bMXGvl7/B8YiEb+YLlOz653G30JY34GXseUXCr57IyL012cSntuFNYOjOiU vGVcBY+CqIWYdTckcJJ7GfMb3ciihliVDJs6VnFI65iP08d5mDt8v0W3n2Of1maxxGvM adrw== 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=gnjvbbIscpS/2zUkI2Bb21824FUNrjf6v1354JHkLNvUa8yGnOtRhWfW+54G9W6Ejp NXiEvy3jOW1fq031tKhW75lO3mPIFmQh1nYlG780YWCgzaaWZDhj/0MxIB4487D0VEm1 R03b1I5bW0U7EHDc4xxlRSWNawdV0vRnDAXbOXwBnc4tHe1m3+r/etl3m6c0tM5GimKC wvddhyysQg9P6lKoPpJs1WmzC7QoEtJwDZx43meXJArTZ8RwWHdrDM8LOVVL4rCAJv4g 9AgUr6LOEOhw81jSOMLQXG/0T2E/LLhIfxEgOd0fRK6KafWOsIAOiECDS5n88xprjNzb I6wQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=KiaWPAh3; 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 x16si3433405qto.300.2020.05.21.09.54.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 09:54:49 -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=KiaWPAh3; 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]:45744 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jboT2-0008VN-OQ for patch@linaro.org; Thu, 21 May 2020 12:54:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49816) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboIO-0002ki-3w for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:48 -0400 Received: from mail-qt1-x841.google.com ([2607:f8b0:4864:20::841]:42228) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboIN-0006Y8-4B for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:47 -0400 Received: by mail-qt1-x841.google.com with SMTP id x12so5965725qts.9 for ; Thu, 21 May 2020 09:43: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=9s3zaT975n7OFyLauiO739G/mW0fqcwhecj+9+iav3g=; b=KiaWPAh38N4S3fL3nVjRC77mYVrMao+P5F0G0zi327mlEdTOHRUjDXZS7qaVSyT90N /iFVBezNTO1Vp8SSSzAnk4h7zTn1F4vUznS+U8swpDx1RKmdTf+sL08loxARBlOkMW3z j+C2EYq1+eYdh9D6JXOClchRUrWVWJHSqP/iX1Oafs9VME/DvIzBqhd5LWe9YkVlzK/V xVTaqdUA3QVHL6wgBOS7D42XVrZk+wMC/A8B31hWxG8c0uL2Oe0aYnTW8lxB77tUKZnU g3C8xKYUAB1OqBu1K7SGuayeYpTjbIq+9hu/9E1p0bsPMvVFLwAaRusmXSIuaJ8FeyqV 0exA== 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=X5iEf2lbl/AlTo7I95S+JZbgSDVEhV8nZ2DtidkbPiTX8i9tsQl8qbJ2qlRvyph2Ry pT40nN65xNLrGGrw3Gy7DTTIwcd1wJCE0bU56OtlWjq/+HKNpnTYPewVVJ/MFMI4++vI +K52jWWNjaoGIwU1TagDw9FcjSfAiHjZn/CNYMF3ADfHhRperf7CBBxVL8sWDgF0kr5z FnSoCsKkZDlKrMg3IvEcqO4tO8ACEA7kO6fVcF9qPibxK3dHM/OwK8gaGg/4mmp2iKCa 8HRQ2VdUV7QxJ1ypKtY/oq2Qu8xCl6iC5r5WweIO3zLdIj99O7kp+RzL8hZROt60RTnm NfEg== X-Gm-Message-State: AOAM530/6nEtesCibHInp6r/OdNkY1BpF2+nf+9tC6+wS1ahkrAXLBlu MFA9Tmq0+VWKAtOfhS4biXd27ql1SjnoVQ== X-Received: by 2002:ac8:699a:: with SMTP id o26mr11128102qtq.92.1590079425655; Thu, 21 May 2020 09:43:45 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.43.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:43:44 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 23/74] m68k: convert to cpu_halted Date: Thu, 21 May 2020 12:39:20 -0400 Message-Id: <20200521164011.638-24-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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: richard.henderson@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, peter.puhov@linaro.org 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 Thu May 21 16:39: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: 187028 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1718232ilb; Thu, 21 May 2020 09:52:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnFazjz7Pg5P1q0wvycAaqieRJJy1ma/X8LnphJ/81Ni07LOgk8kBlxjNzJSTqyZnoSrlL X-Received: by 2002:ac8:60d4:: with SMTP id i20mr11542766qtm.324.1590079959476; Thu, 21 May 2020 09:52:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590079959; cv=none; d=google.com; s=arc-20160816; b=LMc95oNhIDjBx0LAqPCgYFw0RdOiNtlgZKALvzpBDiRA+nRvRSfBaUe8+UuNWDR/+D fWVX0+IIQHzi73L6/FC4yLkWBuhAXaLNEoNbWjMKuSmgkXPqI4A7zF5iXentfVqw/Gf/ sCwtq5jWjLcEQ7QMUku6xdHaAjtgYJ9pQ6osXzbEh5yjthKh3q1I00CHTYGzWgwlypAg ssn7SLFLewm2TNvNNxeMTtoAo6T3fXb8x7F7v3lKQ9UY9W0uACbL0g65gs/nn+ZNURj+ nBNb8uPmRsE7PAnq/kmVvmqZqRtD3iIzWiROId66zAZcSmDoEsUefyFEn6mqGvT1OgFv XL8Q== 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=g63owhhb8d7q+R165WbO0bbEASJ91qSEhs9R7K8DZ68=; b=muRpPwqKxLqbhhyusdndVn7JSMFjMa/U07ebQZbhLqUp3D7Jg1buXuGLtv0n/U65ix N8FHXqHa8772if9mRsq/MgsJBKvTz9pBEgfHicrpnFV3BiiEJArbB9PqCwmdxaxbtEUM UbyBAVSVnePAV1fhYNzdSpf5LjNJzWebQOxjBKGb7YaAAsAxIVsBEkYP8o/zIZN9/ZpT P1ueIc16SqQQ8A0urVFSWhKkeLQueV84o993c8vxiUBVFXV265WqNzIwKDSqfOMMBtgs e7yhXIkNtFuQHOZkiDUHQM+yF6DsY9Pc9brgN3BBnKKRHFgIpO1B41gNv8QlZEXOfNCH Rzlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=pZb91J4+; 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 w23si3709426qtk.116.2020.05.21.09.52.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 09:52: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=pZb91J4+; 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]:37212 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jboQx-0004e9-0U for patch@linaro.org; Thu, 21 May 2020 12:52:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49824) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboIP-0002oR-CW for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:49 -0400 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]:43885) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboIO-0006YJ-8c for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:49 -0400 Received: by mail-qt1-x844.google.com with SMTP id o19so5959582qtr.10 for ; Thu, 21 May 2020 09:43: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=g63owhhb8d7q+R165WbO0bbEASJ91qSEhs9R7K8DZ68=; b=pZb91J4+YV1jkHgjHuVL16X0gRx2pwVmAFRvZc3r7ppD8tNl4e4ssbPY62XRNoDpZu IE0+VzWruGoYhdw9k2kqB8lrboZGXkAmX0rjGf9V85f7fcoV2ow4k7fHDkYjTeDOPltX s7bJZCktdCI7Gs+RN0YkXSONm7E3cYXLNTCx3HNDjCbkQPJU/19CVBEFH2DuxWWqqSO6 a5s5ZbTwTZeAH/rrJsu2x1jeEWTgZjRQReo7AxajmxTNAiwAcrhNWXDaCQCIZ/7OK4YQ iUpfjJWQtoxw0uP4UB0g9iLOAW+SSfsX1bVeb0wPz2LCWy9xTJtOrqyVhg6J2wiN/idr DKNA== 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=g63owhhb8d7q+R165WbO0bbEASJ91qSEhs9R7K8DZ68=; b=eYbEhl1GE0QUvOcv/NaxZT0lNzuoixxQeox1PUad9t/tI7E0lOcboV3KLrqiKtFNyi zIMh2/56BlC4lSA2pxLfwyZdAYuwMPQ0D5FNRKMtIN4RAnzqrQlU/3OR6qVknNRxu+3P SDB3e/FgxrcGBgmZKRI2c/eJwcNXjG4eiuJ9nC/dwoB05ILQb997WqSPckd27Arg3qLe hntgvIyOS62yoV4Ra9KQoL2ltlODHum3VotGLRwCpymSxUlBEHfloA2S4yh9sjowA6Ch dcGTGbA7Fv0YB1ykHOqdOeGudioIP3NUlzDTKYnZc+eBEc69gEKKoRCFSJbfrx9vlqOS fBow== X-Gm-Message-State: AOAM530Td0fp3E6uW5Yi+VyFTwAFtjWLeo9mL6xGU95PMWhxFMuS4fJc rJPp8v4UGJDKVkPb16zdHldwq9zKUcFPVw== X-Received: by 2002:ac8:6c54:: with SMTP id z20mr11445559qtu.76.1590079427042; Thu, 21 May 2020 09:43:47 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.43.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:43:46 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 24/74] mips: convert to cpu_halted Date: Thu, 21 May 2020 12:39:21 -0400 Message-Id: <20200521164011.638-25-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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: richard.henderson@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, peter.puhov@linaro.org 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 92b9b1a5f6..0123510fab 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 de3e26ef1f..2b7d680547 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 25b595a17d..35ea86a49b 100644 --- a/target/mips/translate.c +++ b/target/mips/translate.c @@ -31328,7 +31328,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. */ @@ -31336,7 +31336,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 Thu May 21 16:39: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: 187037 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1720780ilb; Thu, 21 May 2020 09:56:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1y4kdKzB9KD0AW3GdvYNg1BmIw+mWbcr/mGIm2LUgWAlyCToNoo6X7u0NNPsMRLT85Acq X-Received: by 2002:a25:ba81:: with SMTP id s1mr17129392ybg.114.1590080188590; Thu, 21 May 2020 09:56:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590080188; cv=none; d=google.com; s=arc-20160816; b=nJP1ScitpVga9JX41MQjVsEBpOi2Mvcuo+fYeQAHTgSLceD6RrRs9bHD3nEzzxhJ3A vnoqafsTVbaXLybbDNxM6hNiTBGBmhvKTvcXP618k4DcOaxz8qXha3qT+ZILsTogQZSz 5ko+dsQ+rC3GsWBAEvQHKubdkxHzBKNMDCqZNHD/ekkixWMWE1WEqUntLRN/a7qjUG4e RLcjbdOOE40/JQZbCiWibaz0cigTeKBk15tSyEaekKOBSyusmwqDsdXI4SBRJRCVee5e sLnd6+KvcQ/nkFrNF00iUhGtRVKItzBtEHtOhVTF+T6CXQdPOP8WRr/NCG1YXIUc7oz5 LZnQ== 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=bf2M7IKMoOMF6Sjf+JSOoIalG8faUHKpuzaEeGoqpyk=; b=dvtk/d7xfQJPfkK9Noq94RxMOKjkBVh7sQHf3Hiko+KEDA8LVMwvLsz8NLvVB5Jwao sgizSFqdhNdZaqfzT7HirGhp5pBDvdNkWzda99aMgEJAmk/SgzwiJMPZlRSPLMFrNp9O qXSBsi4h+jn3bxfSgdmNFYZwjXqvZlnMD/bMnTIACIy8Iw1X7lB+ItFGaftCO/zqwdjR zb8FT9NoyDEmqyg+2Un+lR2p66uAHKtDsVbbNjbIJzoxhc4PS2OpNgEMzD56LjijeQKs Dhw8TAZF+X+PHImDa7JkCCMK+Vc8JUo0IzTuIFjrdONlgeFJ7fKH+fbSBpr3CGco3d/v pE5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=CpxQeAGx; 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 t19si5651508ybt.297.2020.05.21.09.56.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 09:56: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=CpxQeAGx; 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]:54192 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jboUe-0003XA-2D for patch@linaro.org; Thu, 21 May 2020 12:56:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49842) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboIS-0002w8-6F for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:52 -0400 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]:34316) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboIP-0006YT-Ib for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:51 -0400 Received: by mail-qk1-x742.google.com with SMTP id 190so7915052qki.1 for ; Thu, 21 May 2020 09:43:49 -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=bf2M7IKMoOMF6Sjf+JSOoIalG8faUHKpuzaEeGoqpyk=; b=CpxQeAGx8TZeGeXCndTivoFVEPvVHSGlAHKM5Z3h72tFh8Q7dbUmzVtrWIwZGXOuDF H7QeoRrBEdnBPtnHglGne7Zj7GIvtaNs5mTEkCQPvK+YGehvF61Go84gnUiDk0ZkTEJh d/JS6OAOQvuqsAPSAa+S2qI6Ur+wL2E1w7sd7qjKoUUjrlqiYLiIVrVJkaLBYrkpfjWD j3p5TN6bQI/IQo9lPk2zisrB10SEJPvW5b+OEI+OebCqpLgDkA3tO+DcK/QFCB32hdqQ 2MQVzLoenOyiIf2zDNs00ls0VZJ/gvhPiNv16yzK05ikbFPDfwrluxNiYJgaKjvQlmXi PZZA== 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=bf2M7IKMoOMF6Sjf+JSOoIalG8faUHKpuzaEeGoqpyk=; b=md27t9Ywitrji/i89v0Rl9Ll9Gdgo2KzKVr79oYm4Oy6pAjZQ/aPRcYmziE4YDts+e gzfuL/Hd5aePReD8WXEqa2tO3nmFhYngaoLDyCVklffIVJUMp7d6vRC17PRzZOcH1p2H 9eaAKYIDD0zTLhhjUO6ECtnfqIqRrMvsk347/Mc7k16PdTuyX1c+AJNFUhIQVnUvb2oZ 9Mm8MCFS8lbF4jcetU4zTCIG3DzoJGXmihG5wn8r1pQix80pIEsoInIDomBjIZVA1FIT oGrmrChxfb0uxjPdmw8RY3YYX8Pi1VCyINP4ZR+a7g3LpNU697bgnhISqO49KfZWgl+B aatQ== X-Gm-Message-State: AOAM532D2dtoHxjZR+1p20v6M+NKjUlpwlZ4zAPt+42BJTd8igOSU4v+ ApNT1H8K0/J3Zu14F4o5/X1HkoxSwGvExw== X-Received: by 2002:a37:4917:: with SMTP id w23mr5295799qka.161.1590079428361; Thu, 21 May 2020 09:43:48 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.43.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:43:47 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 25/74] riscv: convert to cpu_halted Date: Thu, 21 May 2020 12:39:22 -0400 Message-Id: <20200521164011.638-26-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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, Sagar Karandikar , Bastian Koppelmann , richard.henderson@linaro.org, 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: 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 c6412f680c..91f8833c2e 100644 --- a/target/riscv/op_helper.c +++ b/target/riscv/op_helper.c @@ -182,7 +182,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 Thu May 21 16:39: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: 187030 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1719527ilb; Thu, 21 May 2020 09:54:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJZHYk1HTkXj3O4N6/WERf4WszatncR/Zh0+eFigAVO3VkeEkmLfkNlCZdYCQ+06w/Ga80 X-Received: by 2002:a37:e30f:: with SMTP id y15mr10929550qki.249.1590080080505; Thu, 21 May 2020 09:54:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590080080; cv=none; d=google.com; s=arc-20160816; b=aE1Xsx1yigLbExKdmESr6S9n1ymFnQb1jNcuIheBc0E6o+Lo2BOlbkoeTPlmhBZykv GhghSwrZtBR3gNRXB7n7gVwd7Z9TgLguvy3ZNpn0eVUHlAgqwUo47GzJOKqwoONLkQ0T dmGtxOtv2TgnOXwuWjWlYqz22HvCh77Lo4yoC0C0RG1+vZYZmQNBg72Ia5N5SfIFZ39B /OkxLYlLCJu1BnHCr29RNyMqh7sO8mdO3BYLJUclOdZPbiZDfOdh6KtOh8HdLKS5jM46 C6yX8WnaQ4GNhwyiELT4r4QlixIzgH7Z6QtnyJHn1i4PY8/ijFOy+zNjRNHDt3qV4cGK lSJw== 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=WqInjgZviyNdzW5p2Hg5xhlKpmgDlxcslWkF7JOAFYA=; b=iYwsB+HdRKcFw8fxv/FWB50l1+yIVogcpk6gqssKTti9S6OUDAAMs+0qaZaK6EaDQg L4ern3tdgqAiJ/1jiaVCRDxAmrxl48Nzjiq7ErQvvUy6BrG/MCFmxaxlAHQkr7elTFkt Coetklt5y7lMEbIkxDfCFZ6ZHkm2l6+dg08qVjwRSntRLthpZqN+qm4dfPunfnxmy8Z5 Exm3XtJ3C+l+nsHZb+1oaC/OXwAVw7vEku+7eBkX6BPtC3S2UxZ4/0kxIPdHrowsiKBT GsbMZ+tPu3wyJruSzRnU4Rgr+fl+ovuKYiugvG0sKStMpfX9S6ABgrxn0uH1zRCr2/MD Usuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ZkfYDUUg; 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 k8si3869464qke.197.2020.05.21.09.54.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 09:54: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=ZkfYDUUg; 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]:42218 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jboSt-00074q-V9 for patch@linaro.org; Thu, 21 May 2020 12:54:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49848) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboIS-0002xs-Pc for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:52 -0400 Received: from mail-qk1-x744.google.com ([2607:f8b0:4864:20::744]:42237) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboIR-0006Yh-3S for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:52 -0400 Received: by mail-qk1-x744.google.com with SMTP id s1so7835957qkf.9 for ; Thu, 21 May 2020 09:43: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=WqInjgZviyNdzW5p2Hg5xhlKpmgDlxcslWkF7JOAFYA=; b=ZkfYDUUgKAGy5gWJ52+BEeFQi29PP6rBSegwRrL7iwnA+lQL8U9jVTc1qVmX3UZ6SB E/2bDy/H69RDUeIB8fHzgZclwxLndyZDP/SFsHfBNghvnUOjmB4puCH+Go78ZUYJ08Zw zcRtGdvEmJpV8Unf7qgLaHRtAQ/bsT4ZAlq9rU4h9ZRd56fSfO2YMlmU3G6qnl7Uz45U JTu4HKBFKLVV17YC1ZR68FVuAPyGyLmwGFG8JL9ijgSMxQNQ8LZzmTpQ8UbJUdxxrJnO mTWB+WlW8I9pDhY1+WOwue8nFcfUtHBPAvzerIJmbJDyC5UXWW3ehRQzYj2Ebj6n7hK8 +l6Q== 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=WqInjgZviyNdzW5p2Hg5xhlKpmgDlxcslWkF7JOAFYA=; b=bu7/JQyLou0U004XlfA/mMA8yOBANvWGo1eV2NvrjouC6TIVxVr4iOOh2PmtuPF4AH FXPbFcrU+uOdym177cjQ1xCEWxUY5JWquBCvsuwcZzIoHJ9cWUDP+8iVh7Mk5T9gVaL7 ysC3bN3DKnI1kehmW5Bn99YEzQot05JS6/uVh5LFyQmQeqJ6cquFFC/jMvCt3gI8Jm3O /bV4qPEkevEZUQZOY6fxsmUu9V/g9NOLM2R0SLlnP6Zy7Z2PtVw/62s5NYcq+foQmTeF eXpCVQYNRwkju9mxalvuvJp9klQaYqVvb8r1PmZXxB/ibRvD4wvq+3g2DBC8ZWNSPWmW r/gg== X-Gm-Message-State: AOAM5332tqLw1YKKuh08QNY9677FRpwAu5VGL6I+kx3wCc1QhMISmAe+ VZuAaeNbRZWwss4sUJ/svc1mzDAfSOpX2A== X-Received: by 2002:a37:9d09:: with SMTP id g9mr10906870qke.154.1590079429752; Thu, 21 May 2020 09:43:49 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.43.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:43:49 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 26/74] s390x: convert to cpu_halted Date: Thu, 21 May 2020 12:39:23 -0400 Message-Id: <20200521164011.638-27-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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, David Hildenbrand , richard.henderson@linaro.org, Christian Borntraeger , qemu-s390x@nongnu.org, 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: 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 baca4d8a2d..a1c6b8a6f6 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 ca50b70451..4b1961694e 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -293,7 +293,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; object_property_add(obj, "crash-information", "GuestPanicInformation", s390_cpu_get_crash_info_qom, NULL, NULL, NULL); @@ -320,8 +320,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) @@ -347,10 +347,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(); } @@ -360,10 +366,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 69881a0da0..ae3e0880f1 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 Thu May 21 16:39: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: 187035 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1720722ilb; Thu, 21 May 2020 09:56:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtoULiBDOjXcwtV8RgTVA16QGXjirb0y+K9BGr7i0ubvCAWt/qDa2L/WKoRNcPcuIViPwY X-Received: by 2002:a25:13c5:: with SMTP id 188mr16629327ybt.353.1590080185081; Thu, 21 May 2020 09:56:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590080185; cv=none; d=google.com; s=arc-20160816; b=i3FGQglNEwuX4jDSZ0xG3QFR3wi3gmAxk8BkPNUMF8eePw8NXhM4m8bS3cVIlccsbn kJF0LyecCsbBoys1GcgDH26i0Frum7VfD8MPGYYeb8pXXtVheIaynxSdg6Q4szIfaWXy KJlo3CJPfg/d1qpCanlfOBwcTWoqtssBD4r3cQRSaC8nRy8WpKC58bMB2TYfYj8SBA83 gXIrXdTaocwcnPyZyQM4Jl15rTAGOnRMnKRfB/22g7CJ5rPjz0j6lU/0r85waXJ0LPu3 kZ/e65PHEgq5wuHs9N2z/FhCxDzzNOpVTX7JtOEhblE6pIRBaWoD7lovVFHtjQO//W/y 2XrQ== 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=eHaQBXlGwYEJ+LUDpIzgk48KJ4nxL6vb+7Ag6IrpPa0=; b=IIBX60r6wB1GwCGKq6n9B3g6fiQ1knZOYUUQygjz6Ys4z4JNq0543duEt9HJ/cRQrY YbFcHKsrGeoUFb/oR3tdIZNXmlUZPOlp+HUAL2DR8IGjo6QFk5Oe96Xwi+be8iB4AQPm H1lm6sexWIM1zrrKhxXAc4MbrPO9R5h8m/1TE5FqENujOPC/5WF9WtgJ1Ag2NG5iVApW JRqK0Uwio4398DnYZFTVtMjeiO1y27HJP0d/XM5tn0iF/gJ/6/8WenC1qs/yv102wDT0 bzAffTmUrE7nsQdLp7jCaIOQiVLFkj5A9SqutFPX3Zx39s9FWWDIWQ8klZreBjUUWl4I /wbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=RDIeoaKV; 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 m14si5376246ybf.193.2020.05.21.09.56.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 09:56: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=RDIeoaKV; 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]:53746 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jboUa-0003MP-GW for patch@linaro.org; Thu, 21 May 2020 12:56:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49850) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboIT-00030Z-Np for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:53 -0400 Received: from mail-qt1-x832.google.com ([2607:f8b0:4864:20::832]:35551) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboIS-0006Yr-IY for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:53 -0400 Received: by mail-qt1-x832.google.com with SMTP id z18so6021834qto.2 for ; Thu, 21 May 2020 09:43: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 :mime-version:content-transfer-encoding; bh=eHaQBXlGwYEJ+LUDpIzgk48KJ4nxL6vb+7Ag6IrpPa0=; b=RDIeoaKVwO60kH/bb4xqU79wAH4A5kAGqh6pg4mG3qUN081R0/NYSQKrYxa7PN2667 UtmNc34vJIS+NZoY7Afx3SgzYhhBxicmb9jME1fbIiqpJX/IFyAWI43BiXziV1rMYwSU EeN+ttXpYvKcKJYnU1vdoSe+3/PIrxGCz7D9Q3eBPJH1Bnh3GaOBQ/4p+3SRt38ppu5T 9z6zLy/f30lhlXCpg3B4zGqRbCZJ02dfUosiCdFiTZl3pa5OCFgeG257UjLD7p7BcBJ/ k4gW8DxwJog+JPsMPoEOuINiOa1yq/ZIuvzqxT7bugiUoQqdWcEFIYkAUF9vEkKtAQPr zJsg== 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=eHaQBXlGwYEJ+LUDpIzgk48KJ4nxL6vb+7Ag6IrpPa0=; b=osbgRicbre7dyhmxSN+RjDemT+xwST1YazoWdhAaQNguwDY+3eaCTJPL3bcOCDb4jq fqo8ixQDFCiGKzWHvzbUzT1S5XukMXVkLKIbUsaiIjTQti3YqT3UTxsCYUeoxGrqE2O1 tsmYjFv1elgh4u7XBKHZUtJxr/5gU4AlBnypSvgTx6bjcuWnhZchiVlMb5u41cfyu0Nd ODbG8Z6610rmNyhprn5oB9NhPQvdqixYEYcxANJ8BgLgEoimA19R1zVfQ5F3AclfhHJC 42jqJf41glAVNQJCNMd/NyPA/ZuG4QrszMoYsIbaefewlJ+Zlda/TXY1kIAfORS3fSL1 QPmA== X-Gm-Message-State: AOAM532TrWnrIStI9jRv8XByqG9ibXZ7ZZT7GDUR/4aaiT74QY7k+tru 6LDw+iJJfy0QR5kFgdZWAorMh1NwPLSjAQ== X-Received: by 2002:aed:20d1:: with SMTP id 75mr11676981qtb.1.1590079431267; Thu, 21 May 2020 09:43:51 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.43.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:43:50 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 27/74] sparc: convert to cpu_halted Date: Thu, 21 May 2020 12:39:24 -0400 Message-Id: <20200521164011.638-28-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::832; envelope-from=robert.foley@linaro.org; helo=mail-qt1-x832.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_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, richard.henderson@linaro.org, Fabien Chouteau , 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 8f024dab7b..00d1efd430 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 8dda3f7292..e189ba5395 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -192,7 +192,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); } @@ -223,7 +223,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) @@ -232,7 +232,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) @@ -831,7 +831,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 Thu May 21 16:39: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: 187040 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1722537ilb; Thu, 21 May 2020 09:59:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyjU/qGzDKjS2kOqPLdv9ELyDAaMq5tCRoVnSaWdUiLMFWSmA80vEYSrkugVOxDnzJrzqgW X-Received: by 2002:a25:b8b:: with SMTP id 133mr16520284ybl.288.1590080345584; Thu, 21 May 2020 09:59:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590080345; cv=none; d=google.com; s=arc-20160816; b=WUXgf9Y5ErOfak08Msz90uBIh6SgzZd6Gnxge99EMCZKsUAkPqk7vf4Y7F9Bgt7o2h Xz44/CmDVKCVPy1yssRGdgi15zhWZWLXaQC6eLP+eLIg2mlOhXhsDwRHf9FMtNs79+5b hXbaGy3SEXTRBd42XlUrz3LKmQXDJXwUftqtpZY/lvuiygHRSvGNiubva6/hBNIKd1GV TYbfv0R5DGyJhIHgAkEsMYS/i9tobE0vwWaz7ZVk6zvO8yYIGmzPluH4tqoZKG0tPG8P gbJ3IFJ0ZGM02xUNgPP3u1MJjCRT+tpClVcb2fqQ6iSvEuhmExzfN1aorlRvkRGxGqmb /KAw== 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=mdQ8Zn1hngbCo7HJ2B3NlcYfxHhBdhmjAXTKXuHzpqROS1SpQQyUVOfE06bosDKYdi XaXtC3x52EoQ/2Rkgnbkbt7ttrT7YtjhipT5n62mbXAc7RMK0fydayGLZozV1FbBANEd L4zEmv2/JeLKLq9H80cWUJhrc11GvEpyD1JwOeu9lybA48nPDSsm+ge+9szEYCnibP8B t4L8J+1a/xqTpWX5S+HDD1lzcHQzRbbtJVuQYFm8HRFAFrQQjfmGXBK1+r+kOmzYwk2G 80zSTn4M83tVf78MD+v8dvZHFBI9Co+P8QiSw/rZWLlWxi7hizJ0bXAaFiRJMrOnYJ/h Ucdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=rONSTrnG; 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 4si5209163ybp.116.2020.05.21.09.59.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 09:59:05 -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=rONSTrnG; 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]:34358 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jboXB-00070m-0D for patch@linaro.org; Thu, 21 May 2020 12:59:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49856) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboIU-000336-KJ for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:54 -0400 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]:34317) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboIT-0006Z0-Lc for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:54 -0400 Received: by mail-qk1-x742.google.com with SMTP id 190so7915286qki.1 for ; Thu, 21 May 2020 09:43: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=LDQ6XQ/3vPiAN54mt6Pw+hfW8ObudV4rT2qqPEmK+8U=; b=rONSTrnGrSZ2PsoIrFLqBFuu6suHGbrMjX8uNyhMJMBGg035NputYOHa8h2uI8xtlF LOjjEFaAEKkn8SxHd9pFLcvc+FgVqlAAsvunyS530dGc7thTweLioc3xQRj6myQtUnLx CI32Z6rrO3nr72JWTeh6hFju0acnpQvitBwwDOgHgXCgLjooWqJ4mHqlHiphU/eby5at k/81cNpVH8haEAfc1pRSpJna3mOqwqfqMr5lAaGKf/+Md/yj69tA2eYbdD1ujFjUAwi8 Lk08Cku5kOH1EfDrI8KUefdy7IkNzG49rii+8nDLJhIBuDwIXpN4P35dTiCr3dA0cXC1 DeMg== 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=uGTSVeXZrjtgJ6lS1WsqEVzJkTpf9trALB4MmT+FvLQoY3M9i261vfCyw8y0di2yaQ VWob3VglJdPmSjsuaU4g6KxsGUlmvG6jM1i5o8DLCFwD6MiHM2oI++uJoFw7G8hL5Wp+ nFI0TB3Ts6Yml2oVIPbUx2VBBu6+4TYXklgVnaypDPFFA0CaRE11q6DfLl33iML0Ah0f tceeUVHVd1znBrraPni/A4AAYnQ2gX01J+PzLkiFFEcnVmjO4EyhLBGMy/VeRNpDLkOy MXfG1suSjgFTuwdcPnok/dFNd6rY/vyDwyAzCRYBhzlraNLPkWKb0jCjZ9otkP7untIj 3rDw== X-Gm-Message-State: AOAM531loOJiljYRFHps+dRj+G59Qib0PcirfnkmLMqfGSY1lf/8rNY7 AbEXlqFJr3jIoQZT9xRBqr/hUdtqfnAL2w== X-Received: by 2002:a05:620a:634:: with SMTP id 20mr10169315qkv.15.1590079432542; Thu, 21 May 2020 09:43:52 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.43.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:43:51 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 28/74] xtensa: convert to cpu_halted Date: Thu, 21 May 2020 12:39:25 -0400 Message-Id: <20200521164011.638-29-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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, richard.henderson@linaro.org, Max Filippov , 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: 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 Thu May 21 16:39: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: 187043 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1723970ilb; Thu, 21 May 2020 10:00:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJJN7WWaw5jZC6+YU6tMOAFouM4s28YVcY2nIeU3tUq7WSyRNW9z94NUJzBGFoecpIJk2Q X-Received: by 2002:a37:a193:: with SMTP id k141mr10686568qke.147.1590080458792; Thu, 21 May 2020 10:00:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590080458; cv=none; d=google.com; s=arc-20160816; b=jQfn9m9dkF2+vwldlHEneHJAIqNmNrAtDbD68Q/+q3IFtOrKwTNyDI/x4xssHPCi4i XfSeBpIUyFWPvTBSY0YLfBrVb8/TBEuMQY29yy/Hw7DKLWpVvTzixacCoQhMKZb+E8nM cQnHEmLbjuJhY7Zi3/yyLXPmSsNsxu+EMofZ3Footh4uOvGwHDoDqu5gMzjxRzxaz1a9 5/bHUFrEeSbqYdVDCVp73nby+aoEDxXTmXn/b8ugmLYzgfV0VI/92U5V3mF7dZFrc+4H h/FLx2JQF62y8OK8538YnbcSfifHDHAez4pQ9+4BhRWtiDBHOhPzGjZteig/YH6jf1mn Mz/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=r3ihf6Hm5TzP8tkXXmmJd+HhpHTqUNEyVizEpWsgvtc=; b=yI2+blQ56J/eEw9chZ3QL/lnHD7ON356Jx5iM9xgVH0H6zqnA2tnif6Dw9aPYdxPFu dPcO1FWOZ+YEviDMWOilrn/wCnw74fS2BKYIuG5kTRcdzWI0VbCyJnv65c2w6QisOB7T lSDkOKU4Bvd8whaizNYBCoL0wp+7y4tdaq4xa4zNVf22jNkjD/Ww3CxXt0QvGR8fM3KN 2O7QA37bz+Yr3gg1z2KD4v16I3FifOACqoUrvZ3wXyoce6e2hTtSsSGuGzc+oZzocTK2 ACu2AelqB/tNghSFbpuVLeNAJiDwuaLCm0dJMdrHwDSWrbzv7uwjGjIPlea1P0DiHNX7 axfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=dofwbhIQ; 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 v15si4061757qkb.303.2020.05.21.10.00.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 10:00: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=dofwbhIQ; 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]:43026 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jboZ0-0002KQ-51 for patch@linaro.org; Thu, 21 May 2020 13:00:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49862) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboIV-000367-Ly for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:55 -0400 Received: from mail-qk1-x744.google.com ([2607:f8b0:4864:20::744]:37282) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboIU-0006Z8-QW for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:55 -0400 Received: by mail-qk1-x744.google.com with SMTP id m11so7881267qka.4 for ; Thu, 21 May 2020 09:43: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 :mime-version:content-transfer-encoding; bh=r3ihf6Hm5TzP8tkXXmmJd+HhpHTqUNEyVizEpWsgvtc=; b=dofwbhIQEtWvVwznSPn68P9c4ugfBCTexDdljcODqQWG+DjyYOY5lP7pauQpAYMjjL +aXx0gqXBKheKyeehSQQFJLgDNZ1SGDybjZauKqFAOsNrI0U3goLecHNVlRhKHq6C50A FchHgD+Xf+qTIuoz1daCb4X/xU5kCbrAuJ6vxm/4+uDsM/kOZHP4T3SZfrEGqO1OC4SJ AWVQ36HblfaL7N5JeJXOz2t9y+FEBjSSIgnLbEsAU0O7iddzyrbsEXAUxoWTbRLvtX9T aGfY1h8AbsWMwB8Rd8HeBXzWl1Xqo+a6o6GumqKs7IQhpzn6bdY8FS4x9lNzLEjaX+Zs rx3g== 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=gyLB74qVdmyUt258HL7zE1KQsQcuEfMJBvL0zxeoJpex1LRtSqp16OQV8X/PbaeCwo TeE8F6MjScb71syhYi+xJQxM5fqw5SeIFLrgEVD7OPd7Hzm59kNi0ZedIX+qHBWjFcSe Az/PdElspcZkpNEP3pb4LRrBJHk3w13f+fjrMFmeLnl65l9KsHbPbdGsfPozm9aK2dLK KsNTiZML059+9Wu7smavWULeddEMa7WHSICAL/Q7YCul+FwEKUJixvSeX3l2u5Mmjlf3 DrJReBIO1vj1leIvvhayE1QJcUOjD8IxqWU5bd1GnpxB5eVZOonlgsULQxIYe8SDjbRE 75yg== X-Gm-Message-State: AOAM532iFTUGCZZBIIcEfidzwpMMmHCszMwTsxLNKATs7u8OhHfAdIDV lVOCaIuMJ8gQo41fMpdZklNjFIKiGT8p9Q== X-Received: by 2002:a37:6fc3:: with SMTP id k186mr7870093qkc.419.1590079433750; Thu, 21 May 2020 09:43:53 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.43.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:43:53 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 29/74] gdbstub: convert to cpu_halted Date: Thu, 21 May 2020 12:39:26 -0400 Message-Id: <20200521164011.638-30-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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: richard.henderson@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, peter.puhov@linaro.org 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 Thu May 21 16:39: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: 187031 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1719627ilb; Thu, 21 May 2020 09:54:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWAHHajotEGrxXjpTch8e1/7gvhIP2RmOwnk80nKdcSCCaxZ4H2A+J7qQungMNdVZA0/Mv X-Received: by 2002:a05:620a:20de:: with SMTP id f30mr10463299qka.479.1590080087923; Thu, 21 May 2020 09:54:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590080087; cv=none; d=google.com; s=arc-20160816; b=a7ivNy9xX9FfC6R/3yKPVavTwer28YEiIHwvZcNa8MsjJoi6LrqpFkO1K8BKh4wv7b YuL6d/Uxc/Uf8sVBzMVvVsMA6rXJ/jk0YigDgJGdQfqZZmjLeJpAtQiNYjr3GBXSdqDv 67WfZ4v4b46MdSp2mQ6PNDvWWJqThF6vTSRLt9EPbX2X6iZ6AMigHpP/wOWZUAtOCkY/ XJmHUwH5dp6MUDs9qSLfNIvReTWqo7hvFWmnXTYr/14UZvKCe1s6WyYsswalrlAsMriP NiD1m+ujC57Jr+aZMmXHXtxfGsrlL+/zZ1sb7LIEJr3w9x3Nx8Ky7BrNXP+1/AlqbG9Z bkhg== 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=wX1dyxfEOlstfixqwQtodAx81yJujaV1bctuj0rlK9Z2A8uwzzoEoQupdp+8W51NPH Wxmkx0I5h1g253rfdmwIfUmlB4nRtIqpu970Frs/9nAHnKXvsKB/gdr6/aQvn3CMxiYM 4qDPfJBKUhKUs848c1kzHn/DJt/x10ZiQWHe2+a7ccis76ytB6TkJPs9BRd8omTjIJBk wyYk/W8wWrEG9vYtcZhkt9ohKJb+oxpWw85PZI3fiVKn6E3N9ZLyZtFhdmR7cV0QiefX sfmU96NHvqL703sXDRPOKDAO+s6MKQsyTrCLHmFWVX3o0SuQaXk7NMmTNc4Ep2+HYoWv fyyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Nfc2kIvS; 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 d51si3426751qtc.364.2020.05.21.09.54.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 09:54: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=Nfc2kIvS; 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]:45562 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jboT1-0008Qm-Dj for patch@linaro.org; Thu, 21 May 2020 12:54:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49870) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboIX-0003AH-5I for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:57 -0400 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]:35890) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboIW-0006ZH-9G for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:56 -0400 Received: by mail-qk1-x742.google.com with SMTP id y22so7877338qki.3 for ; Thu, 21 May 2020 09:43: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=O0fBrT3P1tRSLH4phcxb7WjFxDduimB9rIeQgvMHfic=; b=Nfc2kIvSPenViflfeJM4tjswpI4JwXKOCODAyP/Itoxn5rdYCVYjQD+MHLXotXd1vG JVohFIhLLVnNh5VVHD7Y5jkowCoDM/aNYUCGeRic4azba+iVBe8XzxG6PH0F/XDp97Cy XJczMJ6HR2E+agnQsjMpSmv6Gi1a4oCv85tVqPkw8nNLlubJ3R6cun3/UWpvrage2E+f wSavcfef4cVnzGMqCkca+ggKc5neCUsz1qz+bqwmwP7cy79eE10diotJPGjgRrAU6MZ0 m4lRtUDSOaKAg4asH98bPpyZWzm3xXoCWwyz5T/uVjfWwJ/mASHeoGiPdfFhQY1pJHwU RqCA== 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=YxhwCWegS65z5hOq4sTWiSEV3b2N9eCTtMl/dF+jstWZ6RxdlJeA4RVM2GUDpWL7rW nCEs3n9s8gmBucBvVf5XNdUYCNxkqUQS6Lcg53AhehIXaNNbFguH03aWuqrl9WscQ09N obMIP1IIQn4XFxwoBAG9G3MwNOpvWJ/dOGpJ3/HllJgx6qt/mu//4ubjz/71yWMzDSJn uPUTOfHzIbyX8rrgLdw+H74Ttv+0VIzbrKWCiCLypAK5KUSUM2MSXA4KXwsIPHpD+BH4 zFAMy83vkY5Tsy3PxFPtDokG9YnSiK8D2ACkDf5un5vcgeXqhu+SDfjWrYuvLrrpTISQ V4cQ== X-Gm-Message-State: AOAM530vfmGSB7qaE8NuPakwgwj7Ypv4Vj/cJumCyYX/Lsz6ZtIRdDoQ RcoHQKcGlXBxk8Ox+VcF4kbkpkBGH05aRQ== X-Received: by 2002:a37:b144:: with SMTP id a65mr10557733qkf.462.1590079435014; Thu, 21 May 2020 09:43:55 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.43.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:43:54 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 30/74] openrisc: convert to cpu_halted Date: Thu, 21 May 2020 12:39:27 -0400 Message-Id: <20200521164011.638-31-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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, richard.henderson@linaro.org, cota@braap.org, peter.puhov@linaro.org, Stafford Horne , alex.bennee@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 Thu May 21 16:39: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: 187034 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1720384ilb; Thu, 21 May 2020 09:55:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQjstEnZYfYR2xwOrjVM+itDI8TDQY3X3Ud1ailyHlUvv98i7tYMBhovGYo5pwmHAigVRu X-Received: by 2002:a25:148b:: with SMTP id 133mr16536356ybu.38.1590080156832; Thu, 21 May 2020 09:55:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590080156; cv=none; d=google.com; s=arc-20160816; b=BsI7v44V/vjLtIGhNecQz5kdohj3Yyl60F6FRQKJy0tJ6R9uj8tqcZt27ggLyG27Jt LkqXc/AabaZ7BolXlePatNzNJ3BwvNVwBll49BA6m1J25OPKgMc0ovbg1qv1Uufwlmbh np2jhi1BJKBN6S7DUtKNwaisNf0ONHh1Ibw2JRfDnQJjD9qIyZGpwYN2Tb/Owu7v4ww9 anr0bo6FWJL0vH8VHPt37TR0P7iZ2Nrk3WuP87yfsAZnqLirk9B9IAuK3rZyd3sIW54s H5rcOVOGMIF6Cst6OzbxfmHpvIuGq99PyWLWkFqNnH7doLa4KOTMn1JYhtSTVwaUqu+S IFpA== 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=Se2e0+uO6tFzA9hYL73m/GnLc+8/x4pKlJBXy/MClbhGJGY/oubTh2REwau/PuCXhr PMVRINKHAX2iouEUjbN8DsE9So6Nnf4MU/9Ozc1y8i61b9K2DqGZtv8rCxv+Gi2meQEV DHEBS+2PFt0PlMqT7J5be+naCPu9hAMVSbObOquwykQnL1mEVKpwkLJK0K7voHkqXiRg AjzzEL7AtZsDg28MVfTXkBQKWAQnhJVrgd2WlORGxvY8qhJFKaSa2FoE4PlYt2kkbp+O HlYNHxfyaehV+QjzfLo44QQ4t/yAwR3rME8QQ4BLw0iaV7cSArLbwLhniLAo1otfmeEE X0Qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=IzbY8sNs; 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 e189si5350477ybe.281.2020.05.21.09.55.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 09:55:56 -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=IzbY8sNs; 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]:50824 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jboU8-0002Cg-84 for patch@linaro.org; Thu, 21 May 2020 12:55:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49878) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboIY-0003Dn-GY for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:58 -0400 Received: from mail-qv1-xf42.google.com ([2607:f8b0:4864:20::f42]:44595) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboIX-0006ZU-Gx for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:58 -0400 Received: by mail-qv1-xf42.google.com with SMTP id ee19so3342776qvb.11 for ; Thu, 21 May 2020 09:43: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=pBQreEfimlo/TeCu0za1hNbEWK5jCOhKGwDICZx6xko=; b=IzbY8sNsFCCG7RUPWdXm/GGEFVHfY3p59He/vZwaEPAQf9w6cTazD+Pzt4hJ5nhN6c qJfuJEjJjlOYIklwyaKoRbThan844MI2O1m/oqpQIdQprCnzxLM+wqzqVfpwnrHJdexw 99axPxXW77bY2l2Od7t0JPMWSX9vftYb8xNjtDFFRpAcADxJNk4sAvkiLOiOc5IE0ogC +JmUfSJcGRoEk86Es0ZNZgjd01siy+6azz3JWGhit9c8jey3E9jbu0kkDIHmnHgIn/C+ sAYJiJX9aGS9GyDfiwzsPScSxKwXxHWZePb3Fo0tZzK5x6ieUUBSBmXPMr8++sQAlYaq UsLw== 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=pZWCDD4GdUU4L/DO24Jfs2GZmIjaOGZvxriRqXd4OHTQ3uscclxSVg7Zn/6gkOrsz7 93Dha/8TtdobhWO2QZCTZ55w7iTmaPqjbiinDTVWZ/7lXOX+vI5nriAUFWw3kXpMFXvd bDew6GnvLziWaOMoCaec6uCQU1Ip4TXRHUB1EMAZFTpu42LG18ULi5eIJkw5owdpeBtE RIjkQPG1yjJISRu+N/FPSq2ctTK48nhLUOCYbSIoLbV3n/ylYuzAt1U/DFtznLyk2zfJ 1kHgeJ4FyxKHjVkeLnq8CNkljjWNynBvRqvQQ/DFQsIpsGiM0/VN8aFzYznHRTPdzm7m aoqQ== X-Gm-Message-State: AOAM530OoURYh+TGVVBnoFNw9EKv8kTBcJ2NmEcsvRTuGLcAhA9EVsaU 9xS1UKDySfOKBoVJDjZkE4GLcz7kjta7HA== X-Received: by 2002:a0c:b259:: with SMTP id k25mr3834404qve.111.1590079436348; Thu, 21 May 2020 09:43:56 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.43.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:43:55 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 31/74] cpu-exec: convert to cpu_halted Date: Thu, 21 May 2020 12:39:28 -0400 Message-Id: <20200521164011.638-32-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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: richard.henderson@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, peter.puhov@linaro.org 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 Thu May 21 16:39: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: 187038 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1721995ilb; Thu, 21 May 2020 09:58:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy0PvVHUK68uBmDGrszMbZVIqSUz6XL2J/uM1M89OMf2rsk0jjZvEuw4WVe1mK7GA5l/TDv X-Received: by 2002:a25:a094:: with SMTP id y20mr15306155ybh.522.1590080293681; Thu, 21 May 2020 09:58:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590080293; cv=none; d=google.com; s=arc-20160816; b=zRECfXfBdDGuNEwTAbibV24afjcwtEfm3QvYn8eBvE3Gn21hjdtGoqCx1eAzeuUyB2 m7+jBO9LBUkIF5zacfvfHu6x3t1i/qQAs7hWmRV2k7pc3EG4fEBujrs+m6zmIzo026hJ vxRcZD2wwOGYwpHAlIvDjaZkZVsOZwSz5RDqwGHsSaRss2SybfygOuvPMGJ6AvRlvU/M iNdm3fdzclV+wRx6YfBu2I7eLvcREGX7kooSrVtNIVSO5a2tTi/WdveYqzJZWNpJ26+S D2fgvrb3Wjm5Lo5PoZrpeWPimCWmuJ7be2byOXSCM9Gvwl+ingJydq2hCw1iqiZo7UA9 OKmg== 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=84L+h8uFg3q7QdwSmv1gXpJhNAJlpTSMoYkmOBESzcw=; b=TMZXkl3JXy9LRX+Lg0fCHjCrcPQxsRUQsZeXsV0ryFcR6VW7T+X4o9tD1LLJaQwAtl a5kDeBhg3pVYJWn9fo1KshcIhoBczYzbG+6+EZjGV9Ne76hD6w7UFzuiSqR8yfA9E8FV eoaR1S+7x2mbf6lG/3WlsCZbz48fVvFfKrJNu6eXa3cLIeAVkrUKFA7pikvVEija7Mxq lyoGNFmtVx9ybqkIotLZxGFB0a63dTmw5VFVMzQo2CueY/ANvWAYHr5x2WqfQP6m7osc lrocUU1biHnkGPrdcxTY1dvvhVvd2sAaWstX/2YvIYiEB3cfs8oRa1MfHDx1gmEinTeE 1RBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ymGxfTzd; 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 p65si6095122yba.66.2020.05.21.09.58.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 09:58:13 -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=ymGxfTzd; 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]:59284 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jboWL-0005bM-1U for patch@linaro.org; Thu, 21 May 2020 12:58:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49884) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboIZ-0003HF-Lu for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:59 -0400 Received: from mail-qk1-x741.google.com ([2607:f8b0:4864:20::741]:33282) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboIY-0006ZZ-Kc for qemu-devel@nongnu.org; Thu, 21 May 2020 12:43:59 -0400 Received: by mail-qk1-x741.google.com with SMTP id z80so7918616qka.0 for ; Thu, 21 May 2020 09:43: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=84L+h8uFg3q7QdwSmv1gXpJhNAJlpTSMoYkmOBESzcw=; b=ymGxfTzdloXlZM0VfvEF0nI3toXOk1Lfcuzt/jMz2NpgokHLp7j2pSJB9HLhwIlYzy kiVNe9R9XnktkyHSHtS0KrXo9eEAprSSbRb7ywhFj9A2/U4qlQMwQr9XJMOJPbL6cT8g 4EmwaWh7VQ2ANO7A6DhlR0WfulX0UuoyzkxMyNmg7xLBSFzaSO0W2eYiSnLXNCwdbC92 d1Y422hGnTX//BJZRqUtoIcc9pR+qJn4lED1N3aTaxF01akF2ISTMadlSlyLiWmNBTnh H8J4bmXZq90zsJexYTo6ZHtybNVn/F3Cd0Evcu6zKSEl2QkIXow/zjjoTd2RRcOyq0tH vq9w== 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=84L+h8uFg3q7QdwSmv1gXpJhNAJlpTSMoYkmOBESzcw=; b=oquKxzqkmCKCQ12RDd4uuy30fhgLWP0jKqtnCi042wmuGK2X1lecvbblkN9r4KRA7f jnUr3ZmKMabflSQUu0RCv9yjJe9YVkpckpEKolDo1MsT90EPec8GR2/P0UPnjC4vOpjT OHCEsDBpWzIaE9zL5hRg3c2B/qZ8lakFRUmw1ZHU3JUkIYRlbbgeAwsWyJyQoCIm1y2j Nf2qlutOTD5ASN9WU3JHzQUqnfCcKsLeVJXuIKgINRQqJNnYurdpI4RFoWE3q6VcwlJ4 gF9NJfiC01HS0cs+Np51a4XuVtcXgxwKUYbWb8gDFzhIhkxeuPvc7EovuqIVKhWsxkQX h1sg== X-Gm-Message-State: AOAM533qWqd//0rF25jY2qTwTHA6XWn95SzvmkL6hj+QQbNDXLUVnuiF ve425rgfRZb5leuh/VG1F8tnC/wRZSdaoQ== X-Received: by 2002:a37:6cd:: with SMTP id 196mr1797829qkg.393.1590079437539; Thu, 21 May 2020 09:43:57 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.43.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:43:56 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 32/74] cpu: convert to cpu_halted Date: Thu, 21 May 2020 12:39:29 -0400 Message-Id: <20200521164011.638-33-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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: richard.henderson@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, peter.puhov@linaro.org 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 9cc5f4767e..ff67fa9f5f 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; } @@ -1845,7 +1845,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 620feed3e9..67a9c2bb16 100644 --- a/hw/core/cpu.c +++ b/hw/core/cpu.c @@ -257,7 +257,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 Thu May 21 16:39: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: 187039 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1722504ilb; Thu, 21 May 2020 09:59:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjRN3zuHy03lvGg5Mv8ne98H6l36ig7qJxgquanyCwlp4Xb9iRUki3rdhFjw6qgY/jhUEN X-Received: by 2002:a25:448a:: with SMTP id r132mr17535971yba.277.1590080343555; Thu, 21 May 2020 09:59:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590080343; cv=none; d=google.com; s=arc-20160816; b=skXkmB0oi0vaivzhldM/EXOMMJIeiYhVVKCKQHe8e+wWwT8GeNpdtSXnbfLk7FzjoT bT0LEkadXvusgsPeIlXawSkyPQk7z5e6DQFx3MRPnHEJoSXWCgyN7fOwfRCWhP4T34ZX ytdCZnBTSBNEUC0A3x5RSVOXbCwyYkSfEjxEjJLrUrU9Jva+eM5m8p/l0vLsBmVcjfqz /U//CAQuwaQ58GKfgz2jMI7OTShwjAi+KTaljMyVqUHWOBGH0jih0Z8nAs1cwJveCHbc WWIgZGYR6pcFIA2ClhmBGmLdBdwBugZOC7JqQYiygSbX+2LkOZ6Q35R6Bc/HS6jdcHEP 082Q== 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=vmVPXwFQm0m0SAqlzFsT5BhTrQzusWHBnvRHdxyhIFI=; b=dJAJpnSEsa20iO0pXFHLLGX521bWUEWFVdHFEhMHgwOp70sje3m824RU6MxMMVG5l3 nIvrMk+wS2RGNLJGSJgEOngwgi2hfmb1swx6s++MAtAG45NfBhvvbylaIXTaQ+oqE0nC B8JQBf8BilR0uaYi+Y40XA0WIwlwrQdZToV/uSO+9MhgwbudGSswBrlNZZaEYDdChxz1 ksSDeDGYLCkgghSnPy8YRV+R5zwRO78YJ6eLVNNSMg7/YnK4bCLSue0XKKJV4zrRxSba DMripBdCe8x/oiVGp17wE42clSgKzR5nRz3yD7uE/TncyQXSIcM8sZq0HgG6ow5A63Ts CuLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=NMj8KPVl; 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 l4si4893793ybb.495.2020.05.21.09.59.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 09:59: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=NMj8KPVl; 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]:34150 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jboX8-0006ur-V3 for patch@linaro.org; Thu, 21 May 2020 12:59:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49890) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboIb-0003LY-5h for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:01 -0400 Received: from mail-qv1-xf32.google.com ([2607:f8b0:4864:20::f32]:43923) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboIa-0006Zj-4K for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:00 -0400 Received: by mail-qv1-xf32.google.com with SMTP id p4so3346259qvr.10 for ; Thu, 21 May 2020 09:43:59 -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=vmVPXwFQm0m0SAqlzFsT5BhTrQzusWHBnvRHdxyhIFI=; b=NMj8KPVlLlhzODFX4C1vHZ8TOeFAaZ+gz6xo7CPO0X3bl/kX38yuw0Y2fqmoynghIk wVjelWmkoGmWoW+sCxNPVdFLrQtwK526N/a7F9F/Y6iV9GKhHp3I+4Jf/nHNTMQ0ACVl 1Hjz2LDEHqFTH3Rnjxvz6stC42NMzTiUX4sXi0uOJRvFC4TgfCnTL5X+zkpUMi/HXvSN xpeCZrGLKKCUBXYzQSuGeW92KKJFG3BjZaKLyIKvkmC6lw3ERCjZTsBqpWax/H2KDETR kiCAY/giOqioKt1PE95ZJciq+M2jJleN4M1lEsh5u0R9xWMS9Or1jeVVwAjwBUod602r cvgA== 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=vmVPXwFQm0m0SAqlzFsT5BhTrQzusWHBnvRHdxyhIFI=; b=GiDw0rhUpma8apRm82mwoSNKc1k4zr29gzUQwc9G74+QH1oAR1F2slUZPeP8YiNxuO UguMSAWCHXIKJwXRyuOYlbZvmWUFlmLnzvX2qXPWEkXcN24oZKkRErQDaLBvD280awpe y09phtaecy5zy1L3BW0lCRAKbwO82J9LybLlsZCWJM/SCQwPkifmoaWPq7U3lZwMoo1Q lHYiXnd0yzSGiC7L3fOJSHWjEQAXytR5uu386/I6pzngCFz4yljX65v8tmZcpwTlIbbr kMK9tcOpPa56qoXuw+1MhO3u7PN3KF0bdF86Kj56l+sB/eYSCc0+QS1TmmhWUWDz2OuO jfcA== X-Gm-Message-State: AOAM5319th99ow/ecG1n/XG0Zfr1Akj4ksPRcCW6e7VrZqfIjRa+jcs1 srM8v6XIf/W5zBqFIckiZ1ViP9uy7pNBqA== X-Received: by 2002:a0c:ba99:: with SMTP id x25mr10929438qvf.119.1590079438779; Thu, 21 May 2020 09:43:58 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.43.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:43:58 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 33/74] cpu: define cpu_interrupt_request helpers Date: Thu, 21 May 2020 12:39:30 -0400 Message-Id: <20200521164011.638-34-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::f32; envelope-from=robert.foley@linaro.org; helo=mail-qv1-xf32.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_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: richard.henderson@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, peter.puhov@linaro.org 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 67a9c2bb16..be9efbeaf4 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 820c5b0a9a..6ed806db60 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 Thu May 21 16:39: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: 187036 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1720763ilb; Thu, 21 May 2020 09:56:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgaYlR2sBkussA7woOcwjpDSfA0E1CMi1oYZZwlKjS12Bt22I/XbUfEfsFzw643eP8FsB/ X-Received: by 2002:a25:605:: with SMTP id 5mr16331879ybg.323.1590080187488; Thu, 21 May 2020 09:56:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590080187; cv=none; d=google.com; s=arc-20160816; b=WuMhtNmOIZNS2GU4qLflBcn6YAkoX0IXgUFRvR4aLKyV91wYZ+ZmDZng1ozBhlQNRK 3YvdGqJD1QfTiNQL7MqyL/LagJA3oByqrvUx7zQVdZBdxQx4i7sHpIh0A/BrNQXEfumK u5LWZkkXJYfgEwBZoI7zOfUUyGEgO6i6nwz5RmRhtul/y6yKcSuYSe05k/MMBO6WoxUC NZSsUXFduTAZRqem4uN+HQGm7qPFPkcyWJzblBTaXQbOmPHMzmyxcYycdoCeJvOI08Oy WarrE5NC6+pnhBZzCTr4tuYfbMda3Gr8FqVAHQ4HMAS/TrI3MqiMZlJLLQK4QnEl7LTP aaKQ== 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=roYFUSuiQ9xl45PTniWtLw6l9xYhMo+mP3mKLillljc=; b=mwqQllyRgKa3X5mc00I/l0thj5wXApr8ySvIBS9M3/0+jIt1AiipfNOkfkBdZWT75B j84/mBfGRtwehzMcWD7VXinmBIbIqO+IipSxpaYI4dHhzmPkgegigXWRPa54SiYFntbC G9IL/TsFOjCrNBQ913NcYQjoqIVpKS36d9L2ljd/aukJnbbFS3cKsY8g6kX7mjgvr+8Y jKYKlOJYxG82CVw5EVoBWHYCO4Pur4IJsGga1d8BV5wSFfuK8deEIOe6Dp8SJ4rN/z4q KnfXjRQKmNCZNh0MixbSQ9UupI+YpiFFwXt8BLsBrLXx+Q9eatmGwUSyZsCb7WPk1ti/ 2Wow== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=jI1QZvIP; 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 j205si5010212ybb.151.2020.05.21.09.56.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 09:56:27 -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=jI1QZvIP; 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]:54056 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jboUc-0003U1-TH for patch@linaro.org; Thu, 21 May 2020 12:56:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49906) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboIc-0003NF-Qm for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:02 -0400 Received: from mail-qv1-xf33.google.com ([2607:f8b0:4864:20::f33]:46682) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboIb-0006Zr-CF for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:02 -0400 Received: by mail-qv1-xf33.google.com with SMTP id dh1so3333586qvb.13 for ; Thu, 21 May 2020 09:44: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=roYFUSuiQ9xl45PTniWtLw6l9xYhMo+mP3mKLillljc=; b=jI1QZvIP/2Bpw307VN07UNtsqAg6EkOf8nJKGGeG32k11YuTdf7Os/MAxIVfm0V8UW FfGeCrvyUTlYcpKcw6Y4A3p5C8XI7/+kdJ+J4Z8uY/UEjv6a0gzYvrNhg4EOtyFfcjd6 mPjHKTu5RlWjlOdDA7Tq5Q89E1FZCO9cOLNP3lWNmcy3Q8loqXV63cGCnFsKoLGn8qh0 c9o6sRRcTFZZ/LMY8BfZvTELcQHHHY8+mQMobqmPk4FPV6lQVlsmeD3CcCOb9+8JiVsY PZgTWKiPcNsUXuWXPLSKDa5OY6Y5LmubHO8fny797VpTnVL+UX6xBUdIvHgXHQ+PVJ6b 1iPA== 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=roYFUSuiQ9xl45PTniWtLw6l9xYhMo+mP3mKLillljc=; b=KB7pS3DsnSXW1N9UJF4PHMpl+ML8nzZ3I7cqRT3Jna3K7hPI/m4ozMrwsV/pKLqnYR eVhL/giAQpA4xM6OYuPSDQbR35BE95tBiggucfi99Fit7Lyp632V8gM7HeFuB1bn32r2 6H0PGDs4P241gorXTsvOq2FEFdyEwQFnqAhlXI39mczjc33aqstpRqzOnzkonI4ke3ZX 8DmsOx1sYaro5uQwTVDEE03AmCDxyvV2JEmYcTvoBau0IUyZ2TNyfzIPnYMliHTAzEqD DewIer4HmJOnLvAUEIPlpXsrfj0WD9f2Vl94svISyk+rwB4/zPmHA8CH1LnFIs4DRP5M EsYg== X-Gm-Message-State: AOAM532YIpCtY6qAthphFLMmT935gxHiyIaVCgqPBIQRZYH8fHv2AlXJ 23sRkhoxowB22D6HO1x/HWCvII0+wqhA3A== X-Received: by 2002:a0c:e488:: with SMTP id n8mr10324642qvl.172.1590079440158; Thu, 21 May 2020 09:44:00 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.43.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:43:59 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 34/74] ppc: use cpu_reset_interrupt Date: Thu, 21 May 2020 12:39:31 -0400 Message-Id: <20200521164011.638-35-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::f33; envelope-from=robert.foley@linaro.org; helo=mail-qv1-xf33.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_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, richard.henderson@linaro.org, cota@braap.org, qemu-ppc@nongnu.org, peter.puhov@linaro.org, Paolo Bonzini , alex.bennee@linaro.org 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 4c7da88682..5fee92c310 100644 --- a/target/ppc/excp_helper.c +++ b/target/ppc/excp_helper.c @@ -1021,7 +1021,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 Thu May 21 16:39: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: 187042 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1723090ilb; Thu, 21 May 2020 09:59:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxNRkzQIZwlFQ1OjlVIvqRe6eP3LRsS+GAbfhX3ABVdiMw/tepeBWXcE15XUx0RdVn+p/rt X-Received: by 2002:a5b:786:: with SMTP id b6mr17443856ybq.32.1590080396440; Thu, 21 May 2020 09:59:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590080396; cv=none; d=google.com; s=arc-20160816; b=IGHXkmmGlICSuvbKGdyZJtGy9IdYfwGzBJgWHGEp7sn7KIX9a/jOCdO/qcMB7UcXFg ze1n4Z4F9lLnKcb18I3N196drWR9GSg1bv7khCv9gFzUVl4XLlwV9xvOlKWy5M4SSxb+ fu44PVSG7vEP6OIBLSfvKrjrMeJwrL45PMYDfC8CHk2ie63KFTmTMQ9TKp++VlLkxPDU HN9pXABxn2K4cb/Flnjolq546YmPl1TX7SfwmIXogAQl0EXzvx9U5asKF34hQ+8j0ccQ Qc2GG1GYbRYi+NzzH+NjL98TCJSz1IE7mYw3rP3l9Le0juK4noperZkFZ7xVge0Zackd Mwrw== 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=0agZvpWq+VTT3lSSfcqtTtVkY6vnYs4TCtFCyM1LZ9U=; b=eb1naRsD9/EDh6RNipLn0cAjmFrGAEPAvC0+G1sRV8UmchnXoPYm7gmn12YCYwDMVO NOrhD2OxGaXKc/nlCJel3L/aggSO6qIVs98tuNhotU6AK8YNuVS9/l8jZ4Xg5vg3t3/8 POj6oaWGs1tZuDq8ce1YmkFZi9BH/fE2dse6rFVeIkYuYJvQSaDnVK7+HFVSx+QCNDDu C6HQqmkWvyydCs1HItTD1eA71QUhUuYXn7+q4Nvg/dg1mB5H6rg27c1a1eKni4gRqTSv FdcG9vPoCwkAuuIUAUv0gKYV/+m9ra1KL/o3g3gapqzfPh7Aoeg8ZJjKqj5IYI/UxCPw LREw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Vu7TfWhY; 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 f6si5669391ybh.189.2020.05.21.09.59.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 09:59:56 -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=Vu7TfWhY; 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]:39626 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jboXz-0000pJ-TM for patch@linaro.org; Thu, 21 May 2020 12:59:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49908) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboId-0003OB-F0 for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:03 -0400 Received: from mail-qt1-x842.google.com ([2607:f8b0:4864:20::842]:38348) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboIc-0006a1-I6 for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:03 -0400 Received: by mail-qt1-x842.google.com with SMTP id i68so6007140qtb.5 for ; Thu, 21 May 2020 09:44: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=0agZvpWq+VTT3lSSfcqtTtVkY6vnYs4TCtFCyM1LZ9U=; b=Vu7TfWhYT7YpBM4pDqpNjE3JWqId2aVu7IwM5hWvBpFC+CvBIQdAkzs71KoR51Q3st 4uUIwR1alwOgrL2rPTE2puKSH5SnB/fwyPu+DmZr9FP1LXl5tGm43viE1uRg5It76ixO qwJjw9DZ0MoIiuEdGPP78lO3lTKGqHL+i40Yjh8+OMcEQH2NZMPidJGMXTGXwSaOPn2N OPjv4DLFC2gha2NrVdl0XO75RNqxANob/kST3NSgSkVGWi9sb9qqPfqj8dceJRy02J6V t6qgszSm/XPU5PTTsHw+U1GXnJZZb4arWhP2YChGftIFGGjwrxou+6Iy4Jy4e59i1oZt wcKg== 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=0agZvpWq+VTT3lSSfcqtTtVkY6vnYs4TCtFCyM1LZ9U=; b=DBB8I/tCNG7yIAP5LEoGK5SeCaa8tFcN8h8TGDjXf1nqIMvXH/umvhVlU8+t5zJnO4 dJrUjm5kWjvdoB6uuzjabZB/w9/INgG18+RFrGjKWEG8w6IfQGGFUl6To86UouOxjCJm Ll879bjWPQsy80bcZq0dV0Squ7/FwJ6PAZuZUYn+Bq5e1WYwiMNpJOExAuXkCDmNJAyu ABpc8CQ3j9TR/p/JQcqlEMM9jcuDhCpKRHYIVag0VHXEh0lLSRWSiyuOElikjAHw36NY xixeXXM/9q6ZtIjtA9Na7cGimxSvnC36EwwgmvN1HRDvsjcKTTYj15SMoW1q0Ns9/V3X oj2A== X-Gm-Message-State: AOAM533JRfgRz9LXEYs5C6KGNkaCL3pSzH8VORvRk654LQu9XfFX/VTC HOnM3/xOOhsTi5QGNPTHVUTTvKBI3SyIyQ== X-Received: by 2002:aed:2c41:: with SMTP id f59mr11618064qtd.123.1590079441493; Thu, 21 May 2020 09:44:01 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.44.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:44:00 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 35/74] exec: use cpu_reset_interrupt Date: Thu, 21 May 2020 12:39:32 -0400 Message-Id: <20200521164011.638-36-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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: richard.henderson@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, peter.puhov@linaro.org 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 5162f0d12f..37e039de06 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 Thu May 21 16:39: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: 187045 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1724089ilb; Thu, 21 May 2020 10:01:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxcfpLwse6tCGuTecsuplKMsGIRZdK9kU5pEvqap2pW+bsI8GapU5mV0cfdRJkclRFEQZXA X-Received: by 2002:a05:620a:1274:: with SMTP id b20mr5328466qkl.409.1590080464964; Thu, 21 May 2020 10:01:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590080464; cv=none; d=google.com; s=arc-20160816; b=eG3lBdsh5gUJXE0Fuhrwz89O+qqqOy7tFxwAGnt0IObUn3e4luSyNvUiRodLH2DDdl 1JseH3XlG7IA599sISj3sRvYJRzvwEeLSouHSKuBfXnM7ITlwnJr5bqi0ttCXNxdThYQ T4z3a8KLMFEAFRoigoEO0FAi9bKmX3nFBgNehVBnNWFZDBHEBGtqkwtpKv6aAT/2fc1u DNbl4l8qB9FGfo2jD42LwmunIe+poCLTDhvs3+ggXp1s4ZkqQ4AROS4W/s3J57PQz2oW v2SeLUXt23+d/lBmyyuMBAzHWO6nzuZ7r/F7tM5eKRW/Xkj4DXe605H7nY09+Q8YbwyD qraQ== 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=Dzfw84SBLonEKMo8witPSZf82hddunuWNS4DufYhVeY=; b=DOb++cUaZa20wspER8qCTVE04vrXPcjPv4aMQBEu2xshymDtVlxK24cAYEZE/0IgWv JtMz6gbtB+39Wc+M49unBa6IRoFqjPl673O02Tgw1Doy1hWs2CyqWoziXonQ6zm2QOPb nVAvKEbU1pKivn2LlN8x7B2Vx7MQQeBsZOJfewrFcu80nbM0XapjQpUlRRBeYfRr5SwW RMUbBwvcLsbjWe6WGnHmyub8vt+5Dxzse9JXBxBpEmikxT+x6tpZltjf0w64Y/cUal43 Rl/tMG6jEbDAX1KvbFnSEWwOdmsjDmKn1gfU3F2OOFhL9U/7hx9aVTCt700JDoWZfv42 FkKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=hIxS2GkJ; 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 d12si3777705qvz.215.2020.05.21.10.01.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 10:01:04 -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=hIxS2GkJ; 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]:43566 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jboZ6-0002a6-D8 for patch@linaro.org; Thu, 21 May 2020 13:01:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49920) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboIf-0003Sc-HT for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:05 -0400 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]:46771) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboIe-0006aJ-5Z for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:05 -0400 Received: by mail-qt1-x843.google.com with SMTP id p12so5960570qtn.13 for ; Thu, 21 May 2020 09:44: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=Dzfw84SBLonEKMo8witPSZf82hddunuWNS4DufYhVeY=; b=hIxS2GkJzQCz6ZrHo85gOXWfg+Uxzi8IO5qLPwIT6PNaXtb+gGM88nrojPgCSFWZoG AVdYYcpnEPYhXe7o7qyendpjFskEiE8tZS2pfF6bd5JwvBCUL5DzcrrQN+cEuBo1X7j4 9r7ibWAYUnjRkFpVVO49Idsp3LOs8xrRRV7bs0PkpWys/JfA9XBBEigz63X7GJjXuTpF t1UJSAqWiO7SJ3oQ5RMkXSMNUKSvo0si+5scRrk62FiJk6Jp9XK7wWgq1urD6BP2T8ps G7/zHnGDB3qq+23EgKc3q9AxSjeiXr4X1KT9SqxPxgXXWP8pOf04Y6QzKpw6C5zBE8F3 n2Ow== 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=Dzfw84SBLonEKMo8witPSZf82hddunuWNS4DufYhVeY=; b=f+hhoHnmxDEeHa7BfKbwwJOwZg73Hq5uBPokyzdIG4GZj/9QBTmDmnQJLUH102lvGR PMgRmhASoxnXX/z4yBVKLLoJZJMN0HxipRD4NV+iwZjbXKgoXubejuliVs+AjrW+ES/j ULGTdPN4S+9eWFLXSCGZI3UldXK9YxEQfx/C5MzaCgzD615avEFpLWo8oYAby6eG/K9+ 0djWptwjIsRQZ95HHIqw2n1cXAOFTiDO/hN8IAxpS4Lw3RMTzBb0n2U9jVlk60qbxqG/ yC1nkyp2d5QuchAQCuHxUKR98OF6Oz8APTcgGKKcUSVOdytUr7QXto7JwrUWm4dHBCP2 AxCg== X-Gm-Message-State: AOAM532G4LeoWkaZreEaqoYyTLThxPp6XWQhF5sjm3sBA6Ajxoyh/GKf /23kjPo9j+zPbUXZ/V3UrFgwDRbtpxlnIw== X-Received: by 2002:ac8:554c:: with SMTP id o12mr10989452qtr.89.1590079442834; Thu, 21 May 2020 09:44:02 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.44.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:44:02 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 36/74] i386: use cpu_reset_interrupt Date: Thu, 21 May 2020 12:39:33 -0400 Message-Id: <20200521164011.638-37-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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, richard.henderson@linaro.org, cota@braap.org, peter.puhov@linaro.org, Paolo Bonzini , alex.bennee@linaro.org 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 25bf80b5f2..1edd6c77df 100644 --- a/target/i386/hax-all.c +++ b/target/i386/hax-all.c @@ -425,7 +425,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); } } @@ -473,7 +473,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 cbb2144724..90f1662d0c 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) && (EFLAGS(env) & 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 1c1d4c8c0a..2451840b36 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -3632,7 +3632,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; @@ -3995,7 +3995,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); @@ -4006,7 +4006,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); @@ -4042,7 +4042,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; @@ -4113,7 +4113,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); @@ -4143,7 +4143,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) && @@ -4156,7 +4156,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 Thu May 21 16:39: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: 187048 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1726097ilb; Thu, 21 May 2020 10:03:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPkl5CoRPABskWLSrYjMZysjSyVPTdw0SQQaMKsw9V1XNEGALkZaKrZklkSZ2/iGKbxJD/ X-Received: by 2002:a37:46c9:: with SMTP id t192mr7624266qka.3.1590080581944; Thu, 21 May 2020 10:03:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590080581; cv=none; d=google.com; s=arc-20160816; b=BGwiPerhnXLv75JRKxyTMeBT5QXOUORD7c6gHfMAQGqZvQzhLDw6XFB4ARywMPbQr4 DUnhzvn56N3uTFK+cUgNRg9j91wb4XCtlxvx0nFzjva7hNRQlNJqJOKA6aEXeQdVhXHa gvq33LMvJO3p64USjNI/YwH7gO0GJWNUUCFKsyUAqENDtdrlBGB6PjKyzzVywoT/c8uG X+78mM/vc1Pj1ANRDKF0vFOvCwHlN4arN/QsYRLe1S8hKv75NrTeFUNQVKIUF5YIC4OK 3qHpqTQ+XG/h93vBLdFOoNbcvSVcMtcfceYTVacderi/6bIP8n5+mjrHmyrft51hJgqW IwmQ== 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=PoHRgP5KhNxjETls7Ozqbsqj268sYRvr2YVV5ObO6GUMUn9Zghrj7Y7xdjgL2d5+AJ GozD9CF0uSUPfdwuaVWgQLeeYg/syh8dOJy7hB7MlPT60YqFoEAnlGVYz7atov5r8E9y s3iE27LeGH3jYa2j22RN3tu5B0LB4RFzyvSRpM/J1wYlRXESgdnv4wcgK1T+OoTfyIdJ T4Vi1ST0NZtipJO8aAudqFLMiGgMTKEX3UNN+wvEZzJgikmwZNEQ0zZTEzZTUUrjYa5q evt5gKN7N77roCwUs4xthK8K5cz9j49W7bEhykzeJOSYTOZtdrkIQLaHpUStWWH15xOX OvAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=epo1pGI3; 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 f1si3737866qtm.223.2020.05.21.10.03.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 10:03:01 -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=epo1pGI3; 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]:51520 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jboaz-0005yy-D7 for patch@linaro.org; Thu, 21 May 2020 13:03:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49928) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboIg-0003Ts-E4 for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:06 -0400 Received: from mail-qk1-x744.google.com ([2607:f8b0:4864:20::744]:33287) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboIf-0006aW-JG for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:06 -0400 Received: by mail-qk1-x744.google.com with SMTP id z80so7918986qka.0 for ; Thu, 21 May 2020 09:44: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=OzUdSzbvDHrAdBgz7T3QQ9Qj/8hER0zlUjzEzhKy+Cs=; b=epo1pGI3gpW88W5PHsy3ZFJt+SK4RoqLsF/r2FtdCz1E1btUeehJKBeB+0OEcyF5iu Rs/5AlC+AJxI8BUUF6VajZyYwQtuXamDh4fSkvY1ZFPPiU4zt8gKNk3Vnj9zJwKJtZtN YYlRewsQ9NRETBvne6hovJAJi0z1oOcTEbG3aCVVKsRfaICHfwloEVbY5r9pNl01EC2j /xFWudmPAZnfintZgM/2Y4hldekthLaS1+ZM/zMBRqgmYZHRru86pDVRRM/WWdHOPtLH 81uQ2NQx2c92eGYM9bavoo/E1CGZ2wbrYecHJa6OuLuo/CfkhG1Onxb4OmeoWx6xVmyp C/1w== 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=tviNCnzwBYuf6n83wjT5g4njfRU9NmpQ30XZ1ylRGbZjI+/y0dt1RW7foRoSGZuZrL xUznilPiW6MN+xyllVyOHtfrdDQQwWTAR1f01Ztxt89ewSiyj7MagdN7XJS0isRG1SZe BCF0lCtJQAZ48MVxVCy9/lGinom8Xi9Idrl3THld0ne7utENWwKeEV/nOsMn0YUn+FFo Qb1BJTXljA0sYcfr2Mo2LXrt+YaQwFL2JQB43oU5jYvKz7bK9X5I5h5W+un+/ADxqYwj EW7rfwxL/zVAMhpQrsFOxpJI14itO6Rt90GPUyvtfBt5hZpsgzbWHRfTPdfBd3HcK6Yb 4+xw== X-Gm-Message-State: AOAM530qxB9r/y4IBANrtZyrD/7C8SI+8Uo9oMB1+L3UXwm2m3aOQvIL pH1TrUrUDrtRqVWkv+Imo/bNJHRJDeUX5Q== X-Received: by 2002:a37:7904:: with SMTP id u4mr10743206qkc.297.1590079444291; Thu, 21 May 2020 09:44:04 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.44.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:44:03 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 37/74] s390x: use cpu_reset_interrupt Date: Thu, 21 May 2020 12:39:34 -0400 Message-Id: <20200521164011.638-38-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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, richard.henderson@linaro.org, qemu-s390x@nongnu.org, cota@braap.org, peter.puhov@linaro.org, Paolo Bonzini , alex.bennee@linaro.org 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 Thu May 21 16:39: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: 187041 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1722557ilb; Thu, 21 May 2020 09:59:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXArAenlcLDI9mSLy6zxS2bUVu1j2u96xFr2MGolCJtc6q0TCQcR8+lRx8IZ8q2zzYzXBI X-Received: by 2002:a5b:185:: with SMTP id r5mr13153377ybl.39.1590080347780; Thu, 21 May 2020 09:59:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590080347; cv=none; d=google.com; s=arc-20160816; b=XHBSsa2cJGkD9+D7H2OKmff8gbpGiDNSB13Mtuk1oEZ6mjVvCg0eNyyP9nYPsg8859 YDN9wmQhuhT1SrgjCtq8JQreGeMHHOiYwUT5jvy3IPCjOakRn6RJja49b3RfqlWfmYEc uYYmjqkVSZ0GRwfg9J5IORoD9SfHFPJeLv4l4RZYs7rK0uvA0X1p3kATT5QGY4KR9R1e xh9F66Vl3IPSXqeGl9T7tGy3avhdoCL/ra05Ox3U080xlst39Opm5BPE6wJ9R6A9FDVT pa0XlH7q9RdDHYV6dsicNScxRVyRax02cRBfLg8n1KkCjEWrTr/VoU5YTGup+OJKPwMu z6kg== 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=dCgRUaoeD5jc2zADqd7QysfMnUlfeY7CChzOIhtXMKCr+0SOlR5blhi9/XpkW0keyk 1FekN3PW9rTn7IvRDqpJZvwyf9FJXT0BttsXwEaGAIPSCHP5Xz5LEsFMAKbpy9/JHW0o nuylI/O/5kIiQoPkHWmqP8hVijGZ134pSse625Da5ketvWiUzI2mo1SBTlFMO42jgEKU os5mx2DrCTVm5R5edlLnc2XnOzaZsvI3xFPGUP+AVps5aC5obfZvwY2HE7fP4tPeMAXN ys9a3+n+s+TN4Xgw1kdbDOYaPQR7Vtx8yAQv4laU4fzxY6cCTg0isiWqA+/1vqXKpJJ5 rCRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=e4bgSEXX; 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 r8si5413276ybk.487.2020.05.21.09.59.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 09:59: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=e4bgSEXX; 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]:34638 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jboXD-00078w-8V for patch@linaro.org; Thu, 21 May 2020 12:59:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49950) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboIi-0003Wz-Sp for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:08 -0400 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]:38186) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboIh-0006at-Pb for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:08 -0400 Received: by mail-qk1-x742.google.com with SMTP id f189so7858946qkd.5 for ; Thu, 21 May 2020 09:44:06 -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=e4bgSEXXYU4jtFQ+KAAONNIwceOG1mUgyJ1Ijww2v8IqnZ75dWoxmC3vc7sg10DIOY 59VDaLq9hcQnoVctSL+c6jjX+iu25CSkbIp0HyIRf958oqFyAXfpoY12bQQOhh4rw0vD tWStt+y7reh0SO+ZduntebBpRYejvrdF3FhcOZfCHeyZLmcRK8XSnqHKDUcJcKLhhAOH qzLRggIu5pI5/ndS3RQOAWu3m+FX+o3spCE4CIrwUJiXo5cbyOdko1FbHdIIPnxyOEgc 9IA++nfbtQQysJ5oH5phH93HnBJJBl9v4hD38X08yWa3xQ+QnuGvwud6KVOyYQ/NDd1E KCsA== 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=phpP1M1y5FG2ZJORwZaxXSqNuoyycbqq5A69Dmpa/Wg12VyQtAIY6opx2T2FU5s6ZV 2irdni9xkWsBeyzapJWm1eImalIjYQ8NvGzrMz7YFqOONyB2Ahx2i5BKCCZ/2k7xcBBa wlwPh2LpIX9JvY64rVO7PO2RPEQR0DAo9sQYF/xhyyVqWCii7jAQpaIQhS0kn2Rap7+V +r3MVkzogv/eM5gDOZPS+qFjmTIdx8+ZrbF/heigWAQiBNgKyN897m0NSVPeuQnP6G9N aa4o8fNWKY8U2aQFOHwjQ5DdqrdPitmUb/R1wSw7U74AD9lkv1iCIa5SwB1E+Z87Uf+a ttaQ== X-Gm-Message-State: AOAM531NVFBNQNGqZGQYJU4iM0Og2q/9faFv7Q1XoCWYwEUdUUNoylPd NrUMUTc9eMlQWdSohnAYrRxC4V4TzXlZMA== X-Received: by 2002:a37:9e06:: with SMTP id h6mr10566458qke.400.1590079445614; Thu, 21 May 2020 09:44:05 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.44.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:44:05 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 38/74] openrisc: use cpu_reset_interrupt Date: Thu, 21 May 2020 12:39:35 -0400 Message-Id: <20200521164011.638-39-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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, richard.henderson@linaro.org, cota@braap.org, peter.puhov@linaro.org, Paolo Bonzini , 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 Thu May 21 16:39:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 187046 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1725279ilb; Thu, 21 May 2020 10:02:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+1Nbd0Cc2SaAam7a9ZhXYy8et6nADMGEA9fBP/tZkBN+M3HqxnSvyIIC2oAos+6Rll7TI X-Received: by 2002:ac8:7612:: with SMTP id t18mr12179763qtq.241.1590080532704; Thu, 21 May 2020 10:02:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590080532; cv=none; d=google.com; s=arc-20160816; b=hDQnTL9bnDkIZd+6UZ3zFoxZzc3G4LPhU+mldiZb1VDgOF6TaYfk27FsgqTbRuF7sz P6RzUD5V73SqrdaLw+FNsvYyDcCOJkZTloSWTVEqIzmrOvYn6uZ0102VGz0H4JjMg6Il unYJqBn6t8cgq3F+4l+aeMh7NsMmIeeaV5ODgJpECEY5aYTzEr/oqmLlLszHLMsbVSu4 tcybPXEBUG6xp9vJhhpf9V+pBnIXSMmaf9a9PX5ZkRcw8tqPSk62xuoXf+VYxB5UjN2x q9E0w994aSd6Jc9iWqkWDmBp6MCGLlnSR48ApKxkAWnikKNWbO/GSWATk7XOaNMpE3dw j+Hg== 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=yGVX5kDKORVWzWyGlj0YwmQls1Q4ENhSP5KQMqWdryo=; b=gl46FRpWP93nuaQ0K53e4Rjmn9kbH1mvYrmYTZivQKoWbl++eDc8Kj3f8BwP2C4CTL pOJUtGz2SO9XSb8elibfHN1VSAqJYEDbVApvMTw1EyKyY+ZgVA/SVe5kySubs5F6YrwY 9/vrcaORyPQn7eG5vvJPhU92DTVYvEO6Y312dpJ2pG7uCHwWYLCZeFzQwa/3ktDKyfao jnZkzoqmJQH1y/EK8sSy0iD3k5FM3WS3mkDT+Jj7JvtU4ldyvDUs+Ki/4OsJGExy2zpF EvRyRr6wkLuE0ek2UvpTNiZFfiA2oqHdkLGLAXVgAbbnfGajvZYO66rjB54RGTamYGxg tS2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=PnNuNSdi; 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 w9si4087595qvl.45.2020.05.21.10.02.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 10:02: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=PnNuNSdi; 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]:48210 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jboaC-0004cO-5o for patch@linaro.org; Thu, 21 May 2020 13:02:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49960) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboIj-0003YK-Jn for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:09 -0400 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]:40814) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboIi-0006b5-Id for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:09 -0400 Received: by mail-qk1-x742.google.com with SMTP id g185so7846555qke.7 for ; Thu, 21 May 2020 09:44: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=yGVX5kDKORVWzWyGlj0YwmQls1Q4ENhSP5KQMqWdryo=; b=PnNuNSdiscK9zZByW9Q9FHuJsaSawEAEhX4G1K9tT0Il1Yy0rgKX38wsSLAoBrT3l4 5Sp1OwBk016raKFaypH/c/EwNpdr1gc/zpv3dC3jqbDoMqJ8aYyzq7PusgBRjO9hpmjO ieL2HrKusmEbRzD27Mn7G2LCviU6YXjLGJqR7+2RE12+jMWaNVzZX7RTvNAb9ZB2KZHs 6QAf1qls0gjP5hVPwMoBULz4bjtpd9dJJ4G0TPrOsECwoU/NCJkODQ8G9rSk6p3Qq32W T0NeTw+xMcpon/Kvfn7Q2m9lT9u8PW6pEpCcAOf68jKFlxZaLftr2LJ1hGEDlCksE/y5 y0OA== 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=yGVX5kDKORVWzWyGlj0YwmQls1Q4ENhSP5KQMqWdryo=; b=rUMy1qNK3/5fDq+As+3V6wBJWmJN+U6UuY8HeDGlN2agt9eb9OwkuBxEQmwChskb5V +6U0UDZVWmmMEuKBj0uY18fnCf7CLYSt565DsWZJLwQJn2FrIfHpi3azNhiSX/JIe3+s JB/z5Zf3osNbt9GtfUShw84djQN2TsQCte0IhHpmwAuagrQSOPrBgfDLFZOhQolKDmqo fjnaOfyVgL8eB2lEL7XT4o1cbA9o7FeoG5+vLsRFYLnhBeRTl310aooMyRwGO5xVG9sV zTur3GEUU6v7G6UcA+Ikk55nI2UFlNcS997/AwqP/0NLmNc3kARqYgFd4iZndQFcnHXn LdzQ== X-Gm-Message-State: AOAM532GoGJ8p6J+9qv3Mxv6sGerTbX7QIEtMUArfuezl4Fw0Dmh0/vH XIFy6ru3MG9MHt2gkU+tI6WJm3fsm31Kuw== X-Received: by 2002:a37:46c9:: with SMTP id t192mr7538363qka.3.1590079447298; Thu, 21 May 2020 09:44:07 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.44.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:44:06 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 39/74] arm: convert to cpu_interrupt_request Date: Thu, 21 May 2020 12:39:36 -0400 Message-Id: <20200521164011.638-40-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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: Peter Maydell , robert.foley@linaro.org, richard.henderson@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 dc435a18a1..6c308268a9 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 a92ae55672..5d018b2d88 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 Thu May 21 16:39: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: 187049 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1726300ilb; Thu, 21 May 2020 10:03:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXpKCni3/D7OLMqktuCLLlCSYi8NRfJ+yu5SF1urWsG3myWsuEbu0Qa/GbIaN1sn+bKIet X-Received: by 2002:a67:f34d:: with SMTP id p13mr8320102vsm.164.1590080595032; Thu, 21 May 2020 10:03:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590080595; cv=none; d=google.com; s=arc-20160816; b=YtGGIZEQKDo9LoQgZupw+3Y2spNTG/UdMYbpozkq6kQmIwggHQT37IPUrdksek5X3w nOX2Q9dLYIr1oqaS5OgF/MV9YKQnr9bpRzb7mtWAfye5oHSajUvEKmS+sG2lT5POoi9E enq9ZzaOjo/X4kTNv38oKwiYl/EP+llSwcCjuu59IGR34h0kFxycHCHWZoZWUJJumIo0 +nWQfy+gtn3+X/LcREytCwMcj48b5zb/px/0sYrJCMN3PXVdlGbzt/8mdQ0h/7NA9b/x 2GUTCwtYWCzWXnYnnyOxhUu69nfD+3J4lo8okxR8hY5YB1QSlfDlCuJZtOV1G8uaet8H toJQ== 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=my4fqiSIl1w93gA3LXQg9qyTvqo7M4OmKC+VI+dDUhM=; b=Yx+3BVZRO8fJKABvousyXdshZID3d9pXicOcVGBp35IdmeZYYZcjlqT2okUIcnr0Uv iEUB+QBgpaBamaTQszENAevM0/IXa7ET1PomRb1Qt5tfO9TTS/Kw8ncwoCNenMtVe/f2 e75x0qGi4eUQ9wmGVaRLwNYJeWab+As6QXR6afZ5IkFOQa7+mpfT/F54ZK1ERS9GyDKm ecAxaoCv99EuBcM9BVvdV9hMyIRV17ee3r35CN69Ko/2VuMMAzZRw0zQ5PctGWjWx6r2 KYpB441Ls+FxA0jjTs79qn+HIbb9sqsHVrckYuMjHrbU/DMQS/mze+aSNm0ZBmCfwu5S /TFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=meorVK5R; 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 w2si695394vsk.151.2020.05.21.10.03.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 10:03: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=meorVK5R; 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]:52380 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbobC-0006RS-CM for patch@linaro.org; Thu, 21 May 2020 13:03:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49982) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboIl-0003cP-4e for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:11 -0400 Received: from mail-qt1-x82d.google.com ([2607:f8b0:4864:20::82d]:38436) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboIk-0006bU-2i for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:10 -0400 Received: by mail-qt1-x82d.google.com with SMTP id i68so6007532qtb.5 for ; Thu, 21 May 2020 09:44: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=my4fqiSIl1w93gA3LXQg9qyTvqo7M4OmKC+VI+dDUhM=; b=meorVK5RVi6Kw55tcaeJQo5fbFT3cQFjgwW/iSnZZGi1g+FIIVpltIQkOO44x5qL+U 3J8rlJ5Z1v9M+Lj8gCoUmPQJ5dDDwR6zbGh12Y8FkXD5MrLWgrTz2I2bPPmM5RrG/z/1 og+XdsGNMHL0IArix27FHvFJF398hD35+CfNT/DuftgLesl4q/kagIiHRdI5M+APcT/F AhqBhuzQ5MGj2tGAGBzVCj2fr6HKJuI+arwpKvasRo1XKOXENwVBjEsxbP8TQ2ZGMp64 d1eqb3e6VBp+RcBacHOJjguFo60+REwW7u+hk3q/6DJBfXf8X1an4uB+Gm0UMy/PgPju ZPOA== 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=my4fqiSIl1w93gA3LXQg9qyTvqo7M4OmKC+VI+dDUhM=; b=J5eiiU8za0wXBo7FFIcSyVR8BI1i8JgiCkNjOOEM73sJn47/pnfjl2B1VIhSFk3/44 JXGUiMI/N/CVBSz+gpFWml0UKqFXbUmZ070s0xB5VR8sWp1F0kIds2BDnzUsuyvuosQ+ XNUsPW+uZRFncLRRbniBAWqlo3re4W8IQlqK4pOVg5FfAa9enIC0Eb8+BRwepJIcdQ+e KpumXgRzgJYb+3TX+4+4YksTGUlPuqCJCP5Wmt+wVy891IpwrlqS0WB2/LfdoxrfVU6D tf6qa4syH9vQnd7sxX6Di7XZ8Bj2+w6YbWF6o8LqHUvlDRyPu+CJDEoP4WIvgJkVlhIC h4xw== X-Gm-Message-State: AOAM533M18bFDD43J9yAQhyZs+WS5k0nRpdFy+eeqDPsXK0oGhP+TtWM 8mC+o6FkBSCSPeXi/PRikaUD3DwRZvvarg== X-Received: by 2002:ac8:39a4:: with SMTP id v33mr11823361qte.251.1590079448777; Thu, 21 May 2020 09:44:08 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.44.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:44:08 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 40/74] i386: convert to cpu_interrupt_request Date: Thu, 21 May 2020 12:39:37 -0400 Message-Id: <20200521164011.638-41-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::82d; envelope-from=robert.foley@linaro.org; helo=mail-qt1-x82d.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_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: richard.henderson@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, peter.puhov@linaro.org 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 9e8ae1569f..2b60537b23 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -7051,7 +7051,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 Thu May 21 16:39: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: 187050 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1727221ilb; Thu, 21 May 2020 10:04:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzfWcgg5dyTf9oaidY/KOS7xlqKtsQ6s/YAOkXuoiZ/zKA5q/oRvUno3fCbyOCVXG0UbHMh X-Received: by 2002:a05:620a:110d:: with SMTP id o13mr10896146qkk.212.1590080652707; Thu, 21 May 2020 10:04:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590080652; cv=none; d=google.com; s=arc-20160816; b=etscNINTIobfQL076f2Fvdm4YE5L1jQOhEF3CWcLzlvlVrUvUz0tQR2ekQ2eKC2Yq0 dLfbqgvcROTU89QX3KejGePpqE7Txe3jLdfdjOhADlH6B4Y+5GVc/jWeIla/GAl905Yk qh6ntLsBkt8RfTBVfz2xcKoBzNTrHxk+v/iaeCS5P3zzlUzrm8jKigBfswyla221vLtb Hs3KZah8ip5Oo5SRZrVsdDoipFg8LZZ9HR+A1O/dqKCKpKgD8gfz6lUPRKsHKk3oBR+9 gY/Ah5mnlJx/Ilty3eKVWsEtEapII8HM1VDyF5xIwYfTJ8gLfDsO4j6Jh1rf7nIIIkmW IrWA== 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=DIHX0WJxTdy28I7CslaN2HbTZg9fiYXdvrHYT2rc2zE=; b=KoL3EdC8BJs0KuGiiR69fF2AlzS9ci3BKh1oo8ea6te0D96gPA8UNlKWYULmrOLbD/ bTDwEBgY78gfCL0z8NfdVCGlrhZPLdKIMhrablxdNs2+ibE/zOejjPaPWIwMfSSpP/Sj qEIo0Lio3L9Y5TmaPNoTvMwYD9bbkdm0Gsk6xiq3ShYu3WE8+aFQUx6RlIyzZrk+0BVK fge0f655/Goo2H5zf4UyuYsOJ2ChGeE7XeABg0lk+7UYWry9VIEPNHcWd+K5wHnHKBaH jgIaxyzhVebgLCgKSFeKxTUdqg0CLhXHJAgJl9drBkbu2v3TZ/PbLC1pe8DdhZOI1Y44 C1Ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Jw4Rv8VY; 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 t34si3672127qtb.307.2020.05.21.10.04.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 10:04: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=Jw4Rv8VY; 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]:56744 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jboc8-0000Py-4m for patch@linaro.org; Thu, 21 May 2020 13:04:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49990) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboIm-0003gp-KU for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:12 -0400 Received: from mail-qt1-x842.google.com ([2607:f8b0:4864:20::842]:39761) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboIl-0006bt-Ej for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:12 -0400 Received: by mail-qt1-x842.google.com with SMTP id l1so5987283qtp.6 for ; Thu, 21 May 2020 09:44:11 -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=DIHX0WJxTdy28I7CslaN2HbTZg9fiYXdvrHYT2rc2zE=; b=Jw4Rv8VYbT7MbaIHDAhN6osOQq0OX+uMEgUhQO5g5LTA/qyVMoGP5YYTwGPyQf3knH Zhtc8+OPY/rxgEENRsFIxDTRnN/OGJuKv2Q7jdQDR7SREBpwHv6ZdrUMAprwLSJpruaA bqDPRzDkT7TB8OqWVVk0jIWPLY3eSfoERHv1HsMYPQMUFFrkIqlMIbIG72cesI8iXHY2 2t4kyDtUp6wv7WIrnu3NTSXYK2NFK0O3I21oub5x38UjVoE8sCRbuvirgahcYI62TNtY T/Z9QB9HP18GZgrUvHHNWRS5eLSRnlyH2+wjhZRpbPspnY6rkE3hvSb/j4vXCiRhNVMs 3BFA== 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=DIHX0WJxTdy28I7CslaN2HbTZg9fiYXdvrHYT2rc2zE=; b=g6XiWm8e7JVONM6wAqWkbMofGkYbi/YS6RbQaN5XPRFZYPQCTNfMzGq5GxplUruAR5 qBMamKWXwUKkkZ6aj/2Z12negBKYLuMlkP76hJwDsSVTIwzqggV5vQjp6GfpfxtCCHI3 E4p0PUcDi2n98oLY4TrDs4N5BK+2stDD3RwYnvbplCY3SaHrylc50ZTqjZ52z0jLlaTP I/vWxSBOOdFh/U4J8jRUYU3g5Y/Smy9E619zWqMgO0ag3bmk3WZayVmxLF1KGM4a+t2T jq8trzR+4WbzybeK2qZB6FMsfr+Qtt/LqqPT9UrutaliNFXqW3JEv/OTrgTu1FDYsNbe YfAA== X-Gm-Message-State: AOAM532pgC6W+izm3Q3ztR3atBcLHlNf8BCqxa/YWGUi51XjNpfjcqgW i14e6JAUWAwAm8SIBjKAYPXEWuehYKJ3jg== X-Received: by 2002:ac8:3594:: with SMTP id k20mr11840044qtb.381.1590079450083; Thu, 21 May 2020 09:44:10 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.44.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:44:09 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 41/74] i386/kvm: convert to cpu_interrupt_request Date: Thu, 21 May 2020 12:39:38 -0400 Message-Id: <20200521164011.638-42-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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: richard.henderson@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, peter.puhov@linaro.org 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 2451840b36..9b0080a629 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -3627,11 +3627,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. */ @@ -3989,14 +3992,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) { @@ -4004,10 +4007,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) { @@ -4021,16 +4022,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; } } @@ -4038,7 +4045,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; @@ -4062,7 +4069,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; @@ -4108,8 +4115,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); @@ -4132,7 +4140,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); @@ -4142,20 +4150,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, @@ -4169,10 +4178,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 Thu May 21 16:39: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: 187054 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1728642ilb; Thu, 21 May 2020 10:05:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwVP/VW+mDu9NJw9JeOCXbucrwOj+L2hEAUm+lXp7wP7R6mDGdxhlpyydOaxuiPITX9jh4H X-Received: by 2002:a05:620a:809:: with SMTP id s9mr10487786qks.91.1590080748941; Thu, 21 May 2020 10:05:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590080748; cv=none; d=google.com; s=arc-20160816; b=iogGNFA/HGCcbdLq23q/d+OQYkkE2vSJmhhQgQhFWUIgUftLvWhCohacHTJO90Xvmk 9VF+92KMJ25qxLTG4OLdkCGW2Z8/OEmu2d75IyUWPdohMARqyZ2oqIgivn/QrOyDWH0O TbLQRbYRpSbOsD6zJGlAQYoPnN5qxh2uYsf2yskU2Z0vjzVZiCCUG98wj51n68GQHxCN XXJy4XD2JAJjQ+eG687W7XcX+6f3K5403sZa6lGVDL1beW3sXdTO9c5CYtvH6i6tHAhF reDkXe9SpOEdkGsJ9lspFBasqYnkvatn1dmNlNpmhaA6+yEahzWZk3rWDcfFBYOkBdvH CS+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=s4hrOWLlZCdJWXysypnArxYHpdNRngJdlfVjmEHFHi0=; b=XyPTGVfgW9hGHwG9LN0FIB7cKE7nkUIpcIpVFNNPrvgv5l3zcH1nbCeEqFtlEDRgaf nzUBjI8JuhrI6/uIUiv7m7teDNkq0Yu38ZOoMgUbrHlApeDrBTZwngV9HdBu/ZJ3KySU oMdNATj0d91kXJjphBgGKKH8fFoCvRcFisWGwZ1R+kHDPCHzSv2yKScOAGfPJRvljYp+ dYvBuiwMV7XuwZjzUDKoEgucwpcN8oNPY5mKNrsCkgCFbusaGlxp6tHYwQZHdSf3hPHT F/hUGnDMCClEL7maG6MD76KVRbL1J/bPDMuWyqLOJ5UFHw7JK8mYMrMtGBSsvZa0eGIJ 4sFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=u4Arfkbx; 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 w143si695759qkb.198.2020.05.21.10.05.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 10:05: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=u4Arfkbx; 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]:37082 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbodg-0005LD-CF for patch@linaro.org; Thu, 21 May 2020 13:05:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50002) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboIn-0003jq-Ml for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:13 -0400 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]:45002) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboIm-0006c6-Mq for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:13 -0400 Received: by mail-qk1-x743.google.com with SMTP id b6so7813608qkh.11 for ; Thu, 21 May 2020 09:44: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=s4hrOWLlZCdJWXysypnArxYHpdNRngJdlfVjmEHFHi0=; b=u4ArfkbxegKy6OUgbVv2mkmVN0sz0duoLipCvIIiUEPoNRNVN634iz7hLO1AcVv4fE 73Ev/Xkn8zoRWuZlF3FcA384xrqqDbBHYLTposjM2f+njbGox0FUfydWkt+5lEo0lUAV farZEEcSZ3yCpGgpDH5DDGgx1qf6pkJGY7aphwd82lPPcUtHYWD+uJvsZ9DxjGJaEIFU b1Pq/JUZtIQVm/NpUN9tbTCh1PMDQGuOVDp8RZLSrf+OH1HVqWKNYllgCgQhaC08ACk2 H3feNnkzuN4+zlSiZu/Ptm2tSJNZV7uuw47hOsIFwrpNLTXVVMjHxLG6pjlLq/PQuR+d 3lHA== 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=s4hrOWLlZCdJWXysypnArxYHpdNRngJdlfVjmEHFHi0=; b=Cw/3VHZF0dMa8iIoPj3SP+8q38hK4ezQCBx8l5KWrOUYTmEnpz3vgVB1mln0NeOqBj 80yMbI59tJMQaqjqGJrkhv5HvVFEf9aQRpOtn2EB+gGyThtYeDaL/7mh0brcT1VDeTFb bZh7LaOWYP6m7lf9KRVyJm4+udfmChLZp0L5Q7asaFaVlyob5QJ72+0Zh04dtoSrY/+U G0Zp46At6w9ks7U7lFuPTe4aJN3KtXgTP+VF6d8Ctqr33mLjyC+eQhODAFLT/IqiihY+ ETOdYEAgtPcJ3RoFK/j4LwFdS7xq4vOUiGKLPYz6xZ+oygI4E45EboWgUzStFbP4Rw+r +nMw== X-Gm-Message-State: AOAM531BxS1lUtYKW89zBs9kZ+fesnsdBhQT+hNZnzbJK1YVWKWpa+na k+hGNbpw8aTEP8UDYroi9Vz0a1oe8qP+nQ== X-Received: by 2002:a05:620a:204e:: with SMTP id d14mr9449775qka.13.1590079451503; Thu, 21 May 2020 09:44:11 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.44.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:44:10 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 42/74] i386/hax-all: convert to cpu_interrupt_request Date: Thu, 21 May 2020 12:39:39 -0400 Message-Id: <20200521164011.638-43-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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: richard.henderson@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, peter.puhov@linaro.org 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 1edd6c77df..66de14b27b 100644 --- a/target/i386/hax-all.c +++ b/target/i386/hax-all.c @@ -285,7 +285,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); @@ -419,7 +419,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); @@ -433,7 +433,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; @@ -472,7 +472,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); } @@ -495,20 +495,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); @@ -577,13 +577,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 Thu May 21 16:39:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 187052 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1727832ilb; Thu, 21 May 2020 10:04:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMrkzAWpA0d9+6I1OB4t+QUpNXic6b8KKbBn/sM3WpADOMqPWly+LgFH+gADIaIQBZdUs5 X-Received: by 2002:a37:27d7:: with SMTP id n206mr10128739qkn.98.1590080692626; Thu, 21 May 2020 10:04:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590080692; cv=none; d=google.com; s=arc-20160816; b=vog/LmWpB+1FbdYdXvDuNqc8h0B6NEr3YInIoKFX7HSCaN/4CaI+iSILMfoeA5MqGv DBjOiOtXSXqnwipNTW8B5IL9dKJ/7W1DlITCPu4HzK1df9IlyEYqaVtb6q/svHOdR/tE ep/2umBuhvfTgzbDTlse0k94Sczcm5UyRLo6X7NtuUklLFQfhYuyGTHDPiFvScD3m1DZ KyPcS8FcsjiTNJzwRMV0wUI7R6WoDXu3UJ7wB7P834nwuRzWzxmlPXNEbIpF+6zPIdkk LhXgU+MOD4OR0i9bJMDHYJSk7NAFbzIGb7mqHBHROSIuAacwqujeTZW+/fokc+uj5ccY ZxiQ== 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=SiJ7pCwp8qc+7BVWegQWwDd1LQ98VEluainK+7k+DnZ4g/JPQA12t0vITLEdYcuS2y JZm2k5pa/t3Z+h9VPrDnK4zMV8oiRDb8aoFnW7LmkVaXT5tJoXU1gk3JawoON6KLapd1 30eHns5uNgfmywzz+oIn0fM58h81dST/yC8YdcdbqI6PRIE0ktsz1KZDJHqk0glkmkpI 4ZbKPoB6nwLwfdSfP1zbYc4qhVBf935kuEtPQbKTYJa0/juPCJuoojS+GVXFQHMEB9CM /R/jsxB5427DigU32p5G/3YV1gUSObpavAks7RLhKgaIoy+cGCaq8M0nnRKfIkSnYAJ2 jxzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=W7AF5Djg; 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 k7si3932208qki.266.2020.05.21.10.04.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 10:04: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=W7AF5Djg; 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]:60866 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbocm-0002iH-3d for patch@linaro.org; Thu, 21 May 2020 13:04:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50014) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboIp-0003pS-Jh for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:15 -0400 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]:33288) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboIo-0006cR-CJ for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:15 -0400 Received: by mail-qk1-x742.google.com with SMTP id z80so7919470qka.0 for ; Thu, 21 May 2020 09:44: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; bh=EcsY6TGhrUKNyVg3Ugjl3o+5XwjzyMO1Q9LTdSRFfVg=; b=W7AF5Djgi8fFdX2rYkKCq77FDBTeYnp6uw7LfNlHtCyKignaAXSWm5Ap3eo2KUlKea JncBV6e/XRudH8Lnz1R2opmCOrpr5rxhPan0rFZ3BgJjv0FAz2ESDhx1aImSujS95zWo S/mVORkgCdX3tSZoIwNhmLvE1KKJ/fVcl2uQRMXgD3NSDzo3ZL7QeQ5RPrU85ZvruFFL 0qDghS6SNZ+LYCCI/AYHGZ0fI+vdGoJYwfRSQvWoTgMCEasDYS3L8v1uWskQ0GYVO6UJ JT0wv4gePOP19fzB40QZyHQZOPrENwgEploBaJtqYXJGrSxexwD/BVdhFnAe1bDVYqvc XRKQ== 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=ubB2tnSwIIE5VCfIVE1Wtw7iCRDBqlMhsTbYgUKP2l/wWQHMipvC++5LiYaZegsRt4 /k46MTFE54Goi37osib7aTnsPxCX86o89711pRi99rKg+FnWzk1WVaQVyHocz28wfgrP ti7vAr0Nf9ZSbIWO0ilMSY9HrOdtB8+pNRI3Ac8ZhrOtzv/gcheEDTo4AxwMuzGaC1DC MqdaTAxL0kwu/VHh7G/6KQGQu77gFBHjg/XwKV/6jE/XqWw3AJ0OzOU/85bgl8Q14UYh 8PpfuBZUGplGEWmcVzaTI8eossi2xnvhaLhekf77QGYF1l8PbuibnGiAjSUixXHp5gOx VfSQ== X-Gm-Message-State: AOAM5326mCzv2BJ21UqkUOa0X1UCFcAeYqeh4DQyfYXQtb+sCB9gYfaz 53w38CTl2Cx5lOwg1hWB1fwzcQvkbomHGA== X-Received: by 2002:a37:b144:: with SMTP id a65mr10559117qkf.462.1590079452888; Thu, 21 May 2020 09:44:12 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.44.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:44:12 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 43/74] i386/whpx-all: convert to cpu_interrupt_request Date: Thu, 21 May 2020 12:39:40 -0400 Message-Id: <20200521164011.638-44-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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: richard.henderson@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, peter.puhov@linaro.org 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 Thu May 21 16:39:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 187058 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1730853ilb; Thu, 21 May 2020 10:08:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJ6pHFyOCIypIMJtidmB8Vu6l1nLoLfrABqfB+IjUi8R/98bu47skFjAmkXonAZOmaBby+ X-Received: by 2002:a25:4bc5:: with SMTP id y188mr17323220yba.439.1590080903635; Thu, 21 May 2020 10:08:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590080903; cv=none; d=google.com; s=arc-20160816; b=MnudSZDKfyYYch5FKsDXijEaKQTGGUNn002FaNahE5KvMitj8AzlC7eBqXIfVvVjzL koHzJyDRo0+4SlR+Zc5Z3AljtMH7fnXCaif3sYSW+g/5DuH6HjzxN7QmkWxaCelNQz3E CzKgout04kw78ORgPJtVI391ufDfVcg/qgNIxxDPTtmeft+z5F1e4fYhDJaCyZiRE6AC WZrWksal9JuUp31GtQydYPsblpH+IhN1fSvhKE2wkrteF9fYlJ+QIdQ0P/X+u1kNmr4B WU1XWtYx9UbNemToVtN5OJfMBxCGgFFrpgp7dX1UQpHniXY0VcEXk7xB5++IIGlqeLwq PGiw== 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=vTZZ/kHNyF+wmPfkKEvG91Ao0Id6+gZs4oPmDCc+3GU=; b=IWlLGq1eFFRFzgwT1suJiV8aAP8e382soSEP5PSTkOEUc2SQTl/k7VnQ2MN6Bv+TnY Al2JQLto2I6gi1CAe3ZyOVQ8xhX7ZBbWC0k8fSujwLLZVjw/1v5gQyenbOdfo9ttIS0s vH7dDu+dV1QXjCRhAIz0B11roFIarb32UhsR43Abnwb5t3igG9Ge+Tmf+oTeSSHK+ks8 f1tPxCwe47T9Nml5Pc9U0RNJ/he0OvAl6PJnZOQMvthpQsnc6G2/Lcr8znTepKX4bOpT NYa+5dnu3tcjHP7PgifIEYgEAmNFeIWNsaubiqHwtb+q0pNGU4lo8fdLLJ7TFupFu0yw 2PmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="ps0vx/oU"; 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 e184si5079267ybc.248.2020.05.21.10.08.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 10:08: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="ps0vx/oU"; 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]:45634 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbogB-0002jF-41 for patch@linaro.org; Thu, 21 May 2020 13:08:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50016) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboIq-0003rp-GA for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:16 -0400 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]:40841) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboIp-0006ca-CM for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:16 -0400 Received: by mail-qt1-x844.google.com with SMTP id c24so5988102qtw.7 for ; Thu, 21 May 2020 09:44: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; bh=vTZZ/kHNyF+wmPfkKEvG91Ao0Id6+gZs4oPmDCc+3GU=; b=ps0vx/oUNcbiF394xVKpKc2d43SnXgW97RR109R+vPJ4bId3k+t4kJQENqluPE9Jf1 rYI+yDSIz1QU4VHyi4Eq2Gv4YM5C1kOZQ1bIpBZ/DwvBD4qrZgmsxIyKmPDgqh5wyAq+ qUsApAt0gVLMo+los8hoXGiVyH8Da6CL8WZ0nR1ItgfVtU9jU60HTJcdqgCJCiSatwZH MGI0KcJ4/2LmmGZyV3LmsatrZ1WnUhRJtfQfrxn4ScVrJTT4Rxa/Hv0Sa+jTX8hdF0Y/ Pq6lBXOFibyGR89nx6DSBS5n+6yinTlWRNPu9aYRnfOssSve3MJDVxB9fCjwVZ4oIbJL yy9g== 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=vTZZ/kHNyF+wmPfkKEvG91Ao0Id6+gZs4oPmDCc+3GU=; b=ChZV7ukIMHSG9KWb+MhGSIQB2vwiXZW+mGYUck3FAyg0upnjWjq7qLuQeDoEtXy6Ja 0SgfyhML0eWJ7pvoeHnjgzvyqB5NQjm+a1zhHTeX/XB7epXi8d3K/Vk9Z3MKcWQ9XLBW 4TcFDSNs91v2n5y+un0dZbRZ9YzG7fKNz9vRAfGa/U7MGznqnMdgHf3pDhMi1M5taBJQ QC9iD/hab+AqZsfEXyDCABWduphA47MOtpCUWxqAVu/ilcEPPNfB/O24f26GpawI/618 QDlZYiOovNLtVu0zkZ+qPHWmrN/jKt48JTIPUQQz3HjwDryws9ANKLwCrfP0EqurRkNh GHng== X-Gm-Message-State: AOAM5309Rb2d/sAGsqOQMVuh/9V1Rrq8aYG3/KLzFW1p8Fs3+qpJS5b4 k/Vn2o9Pb7W3DOZbA/qCC2xYET66vnVWow== X-Received: by 2002:ac8:2fb9:: with SMTP id l54mr10851777qta.211.1590079454245; Thu, 21 May 2020 09:44:14 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.44.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:44:13 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 44/74] i386/hvf: convert to cpu_request_interrupt Date: Thu, 21 May 2020 12:39:41 -0400 Message-Id: <20200521164011.638-45-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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: richard.henderson@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, peter.puhov@linaro.org 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 bf60ce9d66..52ccdf85e4 100644 --- a/target/i386/hvf/hvf.c +++ b/target/i386/hvf/hvf.c @@ -262,7 +262,7 @@ 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); } @@ -733,10 +733,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) && (EFLAGS(env) & 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 90f1662d0c..892ae0e99a 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) && (EFLAGS(env) & 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; EFLAGS(env) = 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) && (EFLAGS(env) & 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 Thu May 21 16:39: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: 187053 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1728269ilb; Thu, 21 May 2020 10:05:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXBDqFodh2/FzGcTaSCbkPJL/Wjfg6q5bY8reSDZVa3M1GDWBL3j4K91XG4F1g9aBjBu6C X-Received: by 2002:a05:6214:1449:: with SMTP id b9mr11037820qvy.74.1590080723405; Thu, 21 May 2020 10:05:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590080723; cv=none; d=google.com; s=arc-20160816; b=ty0ywN20nMfcewosHbfYwkWAnb/a5tEt40eIDZtGGC6Vcxg/mvMQOh9CauEFrXfj7E r3+GqHAYTW3OWQUO3C+bFfCO8WJaYvAKujRrHmlvHx/8kWwAT3mN908dfOv5xsd4V5VI yW9pXkQUBBAxuk8/2CyGT9ToQXdUSn+41Jd13vBUW1H3lkVOWLxARim5zBfCqPS7WJua ZX8ON7GOgiESUmvDz08alhjXdCT9kO9GFBaC1z2yjcQCdDbuYElC1IPFfnb5ZK98Jbqq 6pUdbTiHHnneIeyNXd93XgTQ16LBbGI/4qeoBJ/KFF4sZAcmIu+98Pdw/660BaZYlG8B 7Iow== 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=tPdNOnecxbiLcmdfOUrNbZfK0O1sIcOj2h20T8/5h6g=; b=uYAaCYi8ydFxWqlJE1TLEQna9Ikc4YmWdZw9O4QlJYGXNDhsJ6k9pP/1a4+xRMv4HH OOk7iUVeCoicm4gsdbPWlesQifuH2JVapZQumYB/3N6hkQuqh08VtfZTO7MtZdMKyGdw hpwvxuIsSQowC8YUeviCyNRiRf9p2/X9pFu52EObJ4paUm/FYZsThPnJU4R4jvHXORy1 EldY6AzYIhhO99AihRTsxT9MSUpGlnIO+sZkcUeGDKTTgwPAlsHnt9kWpux+eLO7XG0G gtL7Euh6UgO0AaR3YZhCxFGur/YR/RQkQ31X6zNo8HcKxnbqJ+CoL34yzhAQlLWjkUI5 MH8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Hv5Mpjgx; 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 a141si3951859qkb.298.2020.05.21.10.05.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 10:05: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=Hv5Mpjgx; 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]:35646 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbodG-0004OW-QD for patch@linaro.org; Thu, 21 May 2020 13:05:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50028) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboIr-0003vu-Ur for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:17 -0400 Received: from mail-qv1-xf30.google.com ([2607:f8b0:4864:20::f30]:46680) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboIq-0006co-Vn for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:17 -0400 Received: by mail-qv1-xf30.google.com with SMTP id dh1so3333959qvb.13 for ; Thu, 21 May 2020 09:44: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; bh=tPdNOnecxbiLcmdfOUrNbZfK0O1sIcOj2h20T8/5h6g=; b=Hv5MpjgxKmzxDRaA2DFfvRV5Rpmcj9BGOuOOnjTSIfPpY2jJ91RNqmwDNk7A2I/jlP zsNDkrASEIbTI7bvU3WypoeLEplAnysfLFCSRi8lTzE5S2UkA7rZWvDPXzv9RoBhSF2x DWUYhQZPCqe9x9xfDswkebcHlUD6eTGqyqMe4U9VvHv1Chny9x2smDR+gR+pVAMmcWRy uUPs9gISWWdD3ONjNyaMbNwCvVJO+7g7aMNWX9sji/slNVCm/Y50xpsIiRL5GZI/Z3Kc q4HD/erjV9D4KQXb8mKMMsqduxYjHLVqgs3Ol4gMVQRlwnRnI5uv9GxabShNyYTvIIpx 279w== 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=tPdNOnecxbiLcmdfOUrNbZfK0O1sIcOj2h20T8/5h6g=; b=JnWDBWOmQGazjBOaU6zCZFv5KlhidunuRmGxsejc2SaV83DPSAwpviTakToAcgYZyp O21PidPQKFycvHFzlm/MK+6ibUAEa65TbhT2Dwf78sfbpUSMANdGZVRsJDwnRjbBNA/Y EjwdwiJLgfLy2zfzgOxADQG017SoJ5PdSiRCU8iLLa5ZA8EAh2DUa1WW+QHTR7VnRNla koqZoT9A27e+1gV5L7yKaeJa3lhtnwqxhVu3958uRAKOCpcDW/5CPvw1TdEy3/bg3sZy TwUIYuWBATEJFoNJhnWmrKA+lizKsXJNqTylEEkHpeYcLovRVKs6xibldC0tyacFt076 9fzg== X-Gm-Message-State: AOAM5314ZJhFbEBEoZH1eu9CzaOURtr2SYG0+ok8XyQVW+TkL69o2RY4 YWcqXhzJmQHs920tVSPiybWc0XdGGhTNUg== X-Received: by 2002:a05:6214:6a7:: with SMTP id s7mr11101743qvz.142.1590079455521; Thu, 21 May 2020 09:44:15 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.44.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:44:14 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 45/74] ppc: convert to cpu_interrupt_request Date: Thu, 21 May 2020 12:39:42 -0400 Message-Id: <20200521164011.638-46-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-1-robert.foley@linaro.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::f30; envelope-from=robert.foley@linaro.org; helo=mail-qv1-xf30.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_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, richard.henderson@linaro.org, cota@braap.org, qemu-ppc@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: 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 892ae0e99a..68175074e4 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 5838b6f7bc..e61ba39982 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) 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)) && @@ -8564,7 +8564,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); } } @@ -8702,7 +8702,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)) && @@ -8734,7 +8734,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); } } @@ -8904,7 +8904,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; } @@ -8950,7 +8950,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); } } @@ -10655,7 +10655,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 Thu May 21 16:39: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: 187056 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1730103ilb; Thu, 21 May 2020 10:07:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwm/cDBYNq5SCoEvB4oGoKHIyiH46qIAElY9f+34YLggEvOXfks8bD69f5EJ2g1hPgTpMA+ X-Received: by 2002:a25:b94b:: with SMTP id s11mr16293661ybm.247.1590080851397; Thu, 21 May 2020 10:07:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590080851; cv=none; d=google.com; s=arc-20160816; b=uVYGvcOu1Ddy7iE8PU+qQZOV1CNO/2CBiqBnUQV2DZUpCGfssGDTHrVibWqHtQN9L9 yRKQa/dfm4lr37OObRb9zPJEgR/VfeunfTVhmaaFEN4jf+YxLOaM+tsjSeAUSs2RnbYR unsy4dXCoHAEF2LCdStjekBIhawRP/mWoxtIMYFb22hZPCtGG4XJlDyhuQg+kme2yJlG 67GlceZOGzVN6XPn+ZZ14eaHkY41uwiqZOgEbAUcR/zEXHiqUrteS7V80I651gNPgtLr SLzg1DhQy/BQzbNbYmhaZ83PUocflvWGbws6bGTvv+YXA3Yu1qBPbNKYfw2y1RxkGtuq 8wuw== 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=UjRTKch9n3vx4cnb35fjfGOK53wmAvIQR61u2flcBSQ8/A7ZCq8o0TbDBcaXCpNWLp MCoDGdaSifclLPrCJz0cZ9lH1q6XYnLdE+9hgHLzovytACu9I02sStS0TuXp/Y9Qvqfa fNnvTM5jPNPVLvCIy/3o248bv9hbrOfMGg4rqmUEtHV5domHKT6sRuZWHKLPZK1ino5W t/NdDIo6ZV9IYxcQyjEJuysWt3INNz4Nx44KCmZwWRpbX71U3v9YuDY+N977c1EygkCC ykEDMhQ5a+uWVtqUJylSXwdV/x7svaBQBJ2pUBADiplFJF3RFefqXlHdL88Sigvaa4V3 E8Iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=CfujEWZn; 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 y13si5502813ybj.429.2020.05.21.10.07.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 10:07: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=CfujEWZn; 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]:41424 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbofK-0000mq-Sx for patch@linaro.org; Thu, 21 May 2020 13:07:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50036) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboIs-0003z0-Te for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:18 -0400 Received: from mail-qv1-xf43.google.com ([2607:f8b0:4864:20::f43]:42555) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboIr-0006ct-Ve for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:18 -0400 Received: by mail-qv1-xf43.google.com with SMTP id g20so3345197qvb.9 for ; Thu, 21 May 2020 09:44:17 -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=CfujEWZnCTXFPZ9auk2CPEj0Hxw0F4l/8hAAjB2gUlQOCOxDHMLLp1OGcX1W+lUngG rfnOEA0I1hzQ1u0mYCUIlZMyARu4kLf2/d9VuJBzncz+Ta5isApzSg7VejYmuOTNDSPo 1c8ZV6RYfBL9i9E6y80ILhxHRB3igsGM13ao2qJJEv/yUILzfwTPYNB8PFYv3QlviYtd z7sul4WjYnIWwY6Yv5Scwx3SCZci7bFpvnuY2+EtIuJYr65bDUCcGRdoquQMHd3auBLs 2q4dq6fmFXHFINABhKuK4ZFyuexO3Akq++Avwgqn+pKuQJjQqBCVaAwJaO1QiY0ART9i +v5w== 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=DVGz5PSL2JPuiMdrrJBFw01oH/ngG77LYPlxc+rScLHtjDbaz5NNP6lzDHR7vIDmeR skB4jdPnyGGV9Wjotcv8BfZaQUZ9tIOZCsbIWE1XAVbXmyCok/oLsDcgM/WteVG1wxg3 cySPENf8gxAG2MywBZXX+UgRVXnCQ7e4pLNlUTR4IMtrUnYPfLN4rq/ZVi4caMX2zXM/ QGnNr+CibdDxO5L+OkNwVGo96Bhkj/UDTVbwTRr9KViQF3ukl45QGkhpgRpXPd2hNJco H3RRj28ii0N4J64AGmI260cWvIXSTqP0sd98S/HB5PJDSRelIjcQXKo1wXHfNTGc/DNI KeKQ== X-Gm-Message-State: AOAM531CgPdgLUCr12WhYzrXsjQrMY8JwXHrkxtlaX9ETPoskNOOUbZw 0mzmHnPQHU+Hxy6FVgOC1JcrCMZRwWQLwg== X-Received: by 2002:a0c:d981:: with SMTP id y1mr11099259qvj.64.1590079456735; Thu, 21 May 2020 09:44:16 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.44.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:44:16 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 46/74] sh4: convert to cpu_interrupt_request Date: Thu, 21 May 2020 12:39:43 -0400 Message-Id: <20200521164011.638-47-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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, richard.henderson@linaro.org, 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 Thu May 21 16:39: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: 187044 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1723997ilb; Thu, 21 May 2020 10:01:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJykQyWvXHcn9aNHYHDCySiRU/a5v7Bx9Van0GIkWQnR/7pOVyp0P3HTt/IWWZfaCETlRdN4 X-Received: by 2002:ac8:7153:: with SMTP id h19mr11624125qtp.5.1590080460554; Thu, 21 May 2020 10:01:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590080460; cv=none; d=google.com; s=arc-20160816; b=vhVK1ds/D670Z32STOJnR9z/g42FHcr3+OeB/rG31wdDi+iHrRZhJ7cZAkdn4+vh9J 5V+c44/Dzdlt9yo2aEObdJ8jIxys6MyEjG4pR2tC2GPiZRghvky1I/pdYPpmlVd7DYxd FA8bpVBYks7E6Rpfe72JNgDTKs5Bx71UpoU3pMRSR2fB4GspBRrTQ5a8shT7I0HyGvSb TZywqe0437D2Fj8KMRH+33xRucwOZc5J7JGIN1F+zltlPqG3JSqEdvJO8UTvPwjw0S08 5iLWBr/p7P8GiFd2GpH6ZR440zmcLlrQnfUfzWOb5LP6MepP2O7lL2qIBmJm1GFpGdHx w+sQ== 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=SQwt3BlCMlkRrdpIoHWlR7VL+MoMENIbhHHtRYB6xLo=; b=Se5PGT5srz2K7X/GpUrEqglH9yfLVmg8tBXvcQFvWJ3hfE8Ol2C9KX1rHREz9dQvAu oA2eU1sqakjDSoD8B4JicGe3TgtCETKLbYZK43dtTV9vCsnQmmusWmK5AJm24cAFmsi0 dSWbSslzA+u5bASKIplgHy0wAMmIECzssWKmqbgU1KEC5kpZirxzUISD4AAulMDUOIB2 NS9xt0OTFOZZWZXpXPX5yoKX6+hR50/apoTgjk8Xfyd0C2Rq/IeuiOGBcl2tkr22m93I 5AL3R8CxzZiDCjk4tRwoGmUnYlYdXZHvclLMkLAe6ssL0366p7c/S3+IGx9nBXo6DoEq LGQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=yOGgn9Bg; 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 v127si3782066qka.57.2020.05.21.10.01.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 10:01: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=yOGgn9Bg; 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]:43184 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jboZ1-0002Qq-Va for patch@linaro.org; Thu, 21 May 2020 13:01:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50046) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboIu-00042h-74 for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:20 -0400 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]:42242) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboIt-0006d9-6x for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:19 -0400 Received: by mail-qk1-x742.google.com with SMTP id s1so7837515qkf.9 for ; Thu, 21 May 2020 09:44: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 :mime-version:content-transfer-encoding; bh=SQwt3BlCMlkRrdpIoHWlR7VL+MoMENIbhHHtRYB6xLo=; b=yOGgn9BgznS/yS1LrJvqdJnaqQUv3Vd+eeNO8HyHHNLDVC3F/tIV+2EBndyiFxhUzj 5+5AAik2xy0mLAimDWl5ECgK9p5NXiNwX8lqUMSVya+pxVxplE+KhndczpqjZ/pdqh6Y 2vHUOC7B4KQsQifWJ+aJic+rA2yRGI11vEoyCnIM6R0QIBGrYaZ34b3s29zlFu2jUvrB yQKTRDVwp2pbmEO2/NoC0RztdQj1MIxQ9uAI5GpyyiWw5gt/u0J38OY/sPH+BwREzxm4 O/TCLpxzGgd0WgM0YYFITRIrSmOOWWUZAtpllgqlCcVo6RyRMC6dLCjnZerGFVOWcSaU imZA== 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=SQwt3BlCMlkRrdpIoHWlR7VL+MoMENIbhHHtRYB6xLo=; b=Uyfcn6wqC8Ia8NoU0ptgFQif/EFOTlza+jGDtmF3/3C54/E99gEjKW/v9WcM2IZM4E c8l+gfcU680kK5NTGdNppjQHQTcJKwmoXsYR9bzeSrkquJbijhOguiAy8hczoCHdkuM0 VW53Q4SEoAoWYedyLyZVZxwSZoNHhNpmrLrWizza4RVFbra0PPRz4VOjQYyVzpolR+6U PGG1r8zSeytcBnKrSqnhgbJy32v3KcLnDDNa7LrIzRGmGCPZGaZCSr7vXmR8tD75e8Oo 8Gz+krw02hS6GRse+BgPg26oKmdXwiWzjJf1YbEoV3mclJglAAYy6zdAF0Zk0qKZPYCE GiMg== X-Gm-Message-State: AOAM530cQHQfz/dOWWQ5MMDfGrsNo3tq+UJfSivbyoZBR2rM2dgsiIfX AGcMrbR+NKQguMfe0gMgeaGkBuTK+/t9xA== X-Received: by 2002:a05:620a:a83:: with SMTP id v3mr10996261qkg.84.1590079458051; Thu, 21 May 2020 09:44:18 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.44.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:44:17 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 47/74] cris: convert to cpu_interrupt_request Date: Thu, 21 May 2020 12:39:44 -0400 Message-Id: <20200521164011.638-48-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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, richard.henderson@linaro.org, cota@braap.org, peter.puhov@linaro.org, "Edgar E. Iglesias" , alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Cc: "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 Reviewed-by: Edgar E. Iglesias 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 Thu May 21 16:39: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: 187061 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1732054ilb; Thu, 21 May 2020 10:09:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzV1ed7bnob6jt7tRKHcyBO9BGBcopZZoaJ2W8cMmmggl/CDMceTdeyU0QsSARM/A7epO3N X-Received: by 2002:a25:7606:: with SMTP id r6mr15817847ybc.300.1590080993729; Thu, 21 May 2020 10:09:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590080993; cv=none; d=google.com; s=arc-20160816; b=uVI0gD+bS3J62AlfrIBEEw3+xcWFbMFMbjjZ0Qagi8gFF7KGEesjihTbbgM6CQO+Hr zDSQVDyn3zetQsl9YIyxW7WGS0qSU8ZvEha3o6vxN2nNgoSmnT6NKlDq+jmAoYnQJGlZ xbtn73DsS2RugtshLosHJd+jjnATEjSu8gBC/R193tO4zMXKir7Y69FCz2Y1lhUbH3uC iO8UGQ2Zt8ljoy+CJl57wErK+/Y7SE6cZ1GF06IK7a18jaaPg58wkV7NxokwOs/D4teM 5E7c1LlfKm3BnX0WZAqBJ219c7WMc+JX2hw9jsIw4u/oIC2WCiSUspbTy2qmi1Z1+fhi oPqA== 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=CUjDVZen0MDqFjXuiyK05x8wG01QZHwxpZr3fpc51ex5Fh7jbO4T7fiyBZMklWz3su gnGxqXDrtivKwpPiM6P8e2R6CcwmlZ9/3ZQA9V+2WjUmsIlrMLkVAxHe8mloY3rLClLd 4m3oe0/aZfofJmgKAZejDEppoLGpcBiPhMhQed7R1ppq2q9FgpCh0VQhqV6ZEm1EY09g tRaBs4KZ0q+RWrfdpel6zXysSN7hf7edY9gH8oRXE0BKwyc/6GTgqixvyOrfXmbSorUw jeRnb32LWexEQao8d42+XJncBEsNCBXwSBj1KJheWqOWFOuPsPykqw3F3XHYrx5VoBIf LZZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=PApIav66; 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 p4si4717283yba.231.2020.05.21.10.09.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 10:09: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=PApIav66; 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]:54428 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbohd-0006kU-4a for patch@linaro.org; Thu, 21 May 2020 13:09:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50058) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboIv-00045l-8M for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:21 -0400 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]:43430) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboIu-0006dQ-C7 for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:20 -0400 Received: by mail-qk1-x743.google.com with SMTP id i14so7815678qka.10 for ; Thu, 21 May 2020 09:44: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 :mime-version:content-transfer-encoding; bh=oS4OFCHOXLNPVShms1TjWbnrC15wr+ouKwB5TcDXaeE=; b=PApIav66WsDc1bFqajYu0cRHwN7mfnbvpm1wtAm6l9c+Kn/zD+Xi7kBv3kOikQn8of ue3AN3ddkcbx9dyNM7kcu+nsKgbO8n8E/IJZdEoY3c508n9Cvl4brDZolFBg5u/Cg84Y Ty1sVQgraHCo313hncSfyLg6WTFIEJWBmoNn6RpBanz1HlHPPhm8JpFXj+ZIFh6iT8PG 8a3r60+NYc/pafcnPd3DfgIjIpv7l4TMGYgAVMTyK3kWoEoMkspRgIMKco7hKFVT+RFn Tqwgo4sH/B3ji0TT+eLIrlZhZtSJ7FyYcBl9poOgA2x2H5b5bERkMDAZ5wU5GsT0sJhL MNnA== 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=HgO3Co6IACo7UmWWAAMqqujfQPuyqCXla5Ttnre2/siSGYJUkoHZyMXVYOp5e6Orix +ET4rFPXj2LqM5fkpEKCzYZBKLz4XluR8QQGP+Xyz5fLNInYWEaSHrNVxKjHSmiBG2hw x/z1e2wSV2H1HkBesD9c44SR8EhoNdV+OVyeGR7pXTKptxox6Y+vDbQybgVOyH8uXfFW WC39tN40yzq/SWoI8HfgDRICzJ57LmJBlixGAkfeg4Sz/z0kUGmPtJTJ4p1n8spVtYY3 Vdj/eovr6fU6gukNjRcsw4ETaFfi4B22IsICOXpRCVNMNO7WKwAFtqJBNihaHw8JfvTe jU9w== X-Gm-Message-State: AOAM530sb60ZKP0g7oMnTQFalloeyGuuPWiyqdhCNhgZeRM28i1ofEDA 7AQqW6s/j5feU4+vw5XX25B+iuHhbQluew== X-Received: by 2002:a37:8d85:: with SMTP id p127mr9862865qkd.35.1590079459260; Thu, 21 May 2020 09:44:19 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.44.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:44:18 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 48/74] hppa: convert to cpu_interrupt_request Date: Thu, 21 May 2020 12:39:45 -0400 Message-Id: <20200521164011.638-49-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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: richard.henderson@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, peter.puhov@linaro.org 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 Thu May 21 16:39: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: 187060 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1731349ilb; Thu, 21 May 2020 10:09:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTFVyzvyWwP/C8HcxBkevoP+hcYvB6IcMpKBs4DqYTYfLFoocDCcjbZEzjHZ/Pq0j0zv8y X-Received: by 2002:a25:2442:: with SMTP id k63mr4543417ybk.319.1590080940805; Thu, 21 May 2020 10:09:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590080940; cv=none; d=google.com; s=arc-20160816; b=ahPcKGkwfUMigPy/PFhjF+uKP1Nk2NmQkFdMJqAndAlxNKVUKWrzUGwR1Z2E6nqXFA vpcnaWNoTipz5YIJAEnA+qNyuaBQ8b18wLASuG+dv0XNCV0laWCZIeF6U+fG2YfTtnX0 3x9xl+VDQvey//+yopRz0CMr5nn/R/C7yemi+RBREXYV2PtV2zFX68uqn3FZejVIS3WF hwFDKK8uuDZ3Uf+3EHqiPxV/DQBc9KUbdaQwd5yJMgkmhydhEMrkR5B5DgrnMqmyQ9vz ucWezWkWlJZlzvZM4wKNc1uam96p41ePZp2ie0EYStcC0/rKX/WTDBWBtTrCXJ903OYI BQYw== 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=SnoNHi998YhQfuLhFtBg7e7mm+1SetCIQgRlqGWseZRk6Wz2U9U36TXJ+U1+nM8gkm PsoCJ0B3w+BRlbamCE4P2OV57vpIY1BEkEPRqmTX6oVUOKnSEcFt+67TaqGup3b1I1T3 J7G5IlXPvqHbJwVqdXe9QBYOJCrBu8ldK5vGbjOH6IP4hnmLIkVPdJYyII8BCshMNlKg kQRQtUOU+y3rd48Yb4cjOssYW1O/BdBgOOoZED1rURtLcc4LHZaJVAgqoFIvJjohGlQU Fwl77TmLJ91M9S4duDrFlBOUhAPC82w+M31zw+tVTcEFeWgxV1X/uYlhZCoVUVSzYgTF ibgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=G5aczt2d; 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 l204si4917819ybb.461.2020.05.21.10.09.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 10:09: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=G5aczt2d; 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]:50586 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbogm-0004pV-AL for patch@linaro.org; Thu, 21 May 2020 13:09:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50064) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboIw-000493-Ii for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:22 -0400 Received: from mail-qv1-xf43.google.com ([2607:f8b0:4864:20::f43]:41362) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboIv-0006dj-MM for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:22 -0400 Received: by mail-qv1-xf43.google.com with SMTP id v15so3358333qvr.8 for ; Thu, 21 May 2020 09:44: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=leGMjXpK2HH4jKgWKo9xRsuJr3HkPgiK0233yCfpGgs=; b=G5aczt2dpOKIKi9IgJcGV67xlqm5xPcdhGw4lK+DpCsr5YXe95LUhE4rFDIi4lofkb X4RVjQIWs5VxNiFHfoWr65rESg+N/TnxSY00KrrgBIvLL2bh6t3CWLBu9oe38w1HqTZt RVRstxlcE1JofmLuBd30bJYfkLu4V3/eBT1XEY19y8F6UyfxgEcyEPDD+PFhIC9W2NOW j/xfznMaiFTPQkeZ5uPFpqeq0pgA+j1Z+C4gLMHNVSPTbm6pJQwZQRhs++MFLeJT1a3d 7S0sO1GIvzgYjyr1HyIy4HILq++AHGtXX/ST7tG5Oy1c3SR6bJwMGNBT8nfWqeR2qr5I pv8g== 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=GReuuiWywltA/IHgwbCFtEy5o6YXUx7mIH8iFG+rk8P5ssorbotkRjWqoiEBPSJMut nE2I0/8KNM9GnfBB95oZZxjcYHnxF/QzBk9YMyDly6WdXTVfIgpWnit/bsfCE2ZMCVN2 gAQecjWMr8NqhROvX4ILeMTs9D8P4Q5NZ44w06/HnV3g9R74kWvFAalodlX7CtHmir5s 9r3O4IiKMnb4e4RFCG4inkndfqfg6Vf2rcetPsjXWIFCUqZEdf+y2vYSYQSzAg/6T90Q NMvFNpcj1FY8q/kI+wGJG3ElXt//aBHfvswDdEEUo6+1cqby3ZeRB+61gaghOgotxuwY Js0Q== X-Gm-Message-State: AOAM532j+QfxqN8t9bqZbgwEXYKGD3NJ63QiP6Ygx3ZR1c3GuYL7ig6A xRTr02Kb/E0shnI5/4hWWutCC4JNO3LnLw== X-Received: by 2002:a0c:f887:: with SMTP id u7mr10969837qvn.32.1590079460585; Thu, 21 May 2020 09:44:20 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.44.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:44:20 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 49/74] lm32: convert to cpu_interrupt_request Date: Thu, 21 May 2020 12:39:46 -0400 Message-Id: <20200521164011.638-50-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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, richard.henderson@linaro.org, Michael Walle , 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: 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 Thu May 21 16:39:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 187066 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1733540ilb; Thu, 21 May 2020 10:11:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy2rmJudYlH44bVhCHdICSn6Nrteg2Pm1RIoh2IMP734HKW+VCF7tC82LH9xtTaPRUMszl1 X-Received: by 2002:a25:3187:: with SMTP id x129mr17143246ybx.428.1590081108889; Thu, 21 May 2020 10:11:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590081108; cv=none; d=google.com; s=arc-20160816; b=HHmNu+Q3RWBtwXSOOGPtmcofM/GKh28sAwfKC87JeX0OcCCsoX0MY93yodxZjFk4zy 6SWslaKc+HRwL5+Wgw5+TJi5in7cdRmHQExzgdWrSww0ZuxauCcaUcniC18cMEwWZ8sG f77EbNUgbyAiBzRF68aP/vxsNNjNaiyh69wJbnQtGJKFjMyI/yaYE9e6X1z/brUy9qrK oZIdmRDQ9ws+f1SkufRJUNqKTbSAgfQvixNti4fdrLaKUrjsicNW0+VSii9wcUBvUTaG lXhgwgStPYN2LkJxh3cD5wNkppA1e9LYPGz+GQqHbz5YndPiIE+0QENul58QgyNoTx4O e7HA== 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=NEpmNeGAchDpGg5hJIACdBE1vZIH6eEYz4dUxZUaS4ZjbVP9lFX2uLlANAzBomDmuR IHnm1sAGdtDsDqufad+hpL/NXq4N6hlJ5/fTg9a79inpBYC0/VJhoHHG1mSjzEfteYho 6WPXiX0Uq76YyLTU5T/03CBxG3smOpxEwWecpUQ5EderMCaKdBEDs7Sh3R00cv09Bqko QXW/hEXDdZGkzhuGxSC30Ayq51Ql5twzNPwC8jsDfilME/GAfihizQHDiOTEjjb+rGdL RZIJCUH3/DY+We1yNWxwfPqzhmVwxyrR7vBgJzh8MYPWsd/iOMyjEfcxVlQcboq4CdZ4 +PbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=gyGnLVoc; 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 u8si5148940ybb.121.2020.05.21.10.11.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 10:11: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=gyGnLVoc; 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]:34764 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbojU-0002N2-86 for patch@linaro.org; Thu, 21 May 2020 13:11:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50070) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboIx-0004CU-Mn for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:23 -0400 Received: from mail-qk1-x744.google.com ([2607:f8b0:4864:20::744]:33294) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboIw-0006f2-RX for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:23 -0400 Received: by mail-qk1-x744.google.com with SMTP id z80so7920000qka.0 for ; Thu, 21 May 2020 09:44: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; bh=lvs+qOX6bs/iZi7N2ZR8e7cxDlqBQWqbjCB2CJTYkPk=; b=gyGnLVocNsqusg7aysasSPmEq8EbrQoPhaHALMkIrdkI+AvNly4pE78i1Bu1PYCNVD qlwnYH/llKom/fosGdp5qKqr4tG0Bvu1HorIXbHU2OdqMzKE/yMgU5yaAnJSKCNVmlPX JUCtdVcIqLC2ZHA2WjvAYgz6FO+Fxyu8aeBBJCJUnZpS4FTYGucfwybRYqvDR44cPSt3 Fj99KATnODezSf+3PzcfC4DGqJY0aNyxit2B8gGq8iLoYOwWxJ524ZAV2stAqCYd5IAN NQ+ORLLPWNthNBYWAEEro2JtgzfmEPJWdkM6k9/P/T4XDJIk+bRtVv0VtXMmBCozn0i/ 8xnQ== 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=Dp5P22OouW/LEkMvxv2MD5TtNOAo+7B3wGoeAtE2ayY+5kegQRlO96Qw2isNCgyr6J A9J4oNnGIZsoBBMhWULW3ktK1LSvfHhuuh2TOMWe/PpGf7T39RjcpWU+8Mnicp/cet/z fGji7ywHe11pGePQRMRP6Q21x3M3x4AmxHr3XFwpFt5guu55i9d529oIafS6JX8EWw67 VY2egJkbqd/VkXJVa9Zuhb75+rEF6c0ykfJ7HmpX1ltdO7bANU8zn/Jhr/1PLfqidEDd KXbm6MLedDLVVzREy8ynjoP8kBADaAQ+LLlFZo4kdz+7mm0jAvDl+YtyFvJKjHaVimZK Iujw== X-Gm-Message-State: AOAM532vLt9h4dR1VJ9h2W3XmpJZGfnFyfZLTSA0HSwvrkFx8RvLF4yR jC4RwhPLqlBkMLM/wLAz/jRNNAsupF1l1g== X-Received: by 2002:a37:6fc3:: with SMTP id k186mr7872318qkc.419.1590079461789; Thu, 21 May 2020 09:44:21 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.44.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:44:21 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 50/74] m68k: convert to cpu_interrupt_request Date: Thu, 21 May 2020 12:39:47 -0400 Message-Id: <20200521164011.638-51-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-1-robert.foley@linaro.org> 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_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: richard.henderson@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, peter.puhov@linaro.org 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 Thu May 21 16:39:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 187069 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1734949ilb; Thu, 21 May 2020 10:13:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxpLzaEyIMiCx1yB4GUgYHT7spvovsSpAesBcEovUkNZuG7Q8Z3o3AqIbzUCSeHbJ/PIQf X-Received: by 2002:ac8:787:: with SMTP id l7mr11493801qth.301.1590081214473; Thu, 21 May 2020 10:13:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590081214; cv=none; d=google.com; s=arc-20160816; b=B2M6LI3AAde03nl9Cusp9C/qfwf7t1Ogi226q833zyYkJr1ykTrhO6s6GX2CwqFRyn XR9Y/7WvwJkD3cVAEexeLaWZQtTp498S7pEbyYwtL89+CyngES9XOimM3ecIEIidojbh m5bA2V2+GJT3IhIry0uAu1x4MOLhQwsaiBytuV9n6ers9VO4fQHL8gKYh32LhcHXa0E5 8lYrNTw29GKbvVIF5JHCoEGzFVXy6iAkXUL717DokrdQLHat3kbK46VQf2Ms/dEtyhgV jLboACDWTqumAVFf9jGo6gmVWIWRls11pQwe4GzaaBvmQ46hDy/TAvqFWoH7bRa9m7q1 QtqA== 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=V+COCY1tch1+h8AFER7aKTPV6Dtrz1h9iyiTM5X9pZo=; b=uHAyFGopYwe4cSIe+PtpzFIAA6ZUla0eYxP506ggwHcqnUHdtNQ85UPFqHcrhhufsM 6ep1tfoOgIbIN0X+LjiyWg3h9ZomfRDR1ZHqvOAKckYNNNLTTtJRXEU24qXQVxRTt3M3 c3rclrRtms2pIciWvQ3sAVklaKvMNMaxe9mhewHdRwp05sjPlxA7DoYbXxztXqSSIsfI t0IBuoUlS35azBl3VcqSLYPnz5sJgUQJImEFURqqZrI9B9z7W25/lWR7p+Z9KK2kCwNk z0cOQ1N8fqCXfuXraYQBtZI0bX7OxmVbIbnEj3DW2xWRW8qYcZ8Ia893D7TKqOGH0VYY CROg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=q81pMuSf; 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 u18si3902403qtu.148.2020.05.21.10.13.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 10:13: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=q81pMuSf; 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]:43390 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbolB-00066f-UW for patch@linaro.org; Thu, 21 May 2020 13:13:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50076) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboIz-0004Gp-6z for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:25 -0400 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]:46379) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboIy-0006fA-4U for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:24 -0400 Received: by mail-qk1-x743.google.com with SMTP id f83so7781462qke.13 for ; Thu, 21 May 2020 09:44: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; bh=V+COCY1tch1+h8AFER7aKTPV6Dtrz1h9iyiTM5X9pZo=; b=q81pMuSfHpaSQP0Bg6AOmJQPY1Vlzu4VEsHUhanDswxU9oDMvvuwuHCItNV6UMUlSN WJE6cPs1TGCrcbYeiXqWQBLwP+jrqDLqK2Bx1EDHupkPAN/EZ8jtNlqfB1kfYWMpvlgO LO8wcmOyMgbak/4n5Ha2hcsfA1zukYy9zYxDet9wmyy7AaZ4sZkhcjUOALHD59K5w9bd A6e3bp7AKFZ44F4dimb101S0HIlqh4Wul5Xi2U6R/+EGLIOo/7dNSJ7i3m0kI6R3n7yl YywP9XkFwuzvjbB18qSf6Q83W203JDvYYimzN69TwngzwR8VXqfsEzx6rT4vBzdt1K1t iQ9Q== 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=V+COCY1tch1+h8AFER7aKTPV6Dtrz1h9iyiTM5X9pZo=; b=fQnBFE3HkzlpRu8Tzb8FuC6IRdj5NrKfPVy7xkgBA4uq9qs/D0rSolWsdM6we02F8C D5rTlegvUeN+jttwpiBH5GY6DIDvNvxNnie59oB2bjL9r6JNZD7KvMJJJa8+e0/iS60f 8dz01uRphVaWG9o4O6COjDRKubNVVhHjsfVeUaSKU5po2CDqGqQ5duBVPlv7j5fSLV4N 9/Op1TcdTqP2kN9EzWCJbXar8JFf4AWfZcIkPpLZdMISpMXP21AIsLnW+Y4/0/Zt1UBF PsiRvmRyB4RBwmjqi9dU5HMlR5QaGRuZ5O8uPsWEyM99wk29vH8myOXgeEZTbIvmsSsu KJVA== X-Gm-Message-State: AOAM532+Vn38hGiLqfxSepLfzmnTfBK6G1LiEB7xp4QePkzshKSYWzNN kZXt+ngrPVaYEhdhnh8jp0f0PhNtaojQgQ== X-Received: by 2002:a37:f517:: with SMTP id l23mr10962919qkk.475.1590079463093; Thu, 21 May 2020 09:44:23 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.44.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:44:22 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 51/74] mips: convert to cpu_interrupt_request Date: Thu, 21 May 2020 12:39:48 -0400 Message-Id: <20200521164011.638-52-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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, richard.henderson@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 2b7d680547..e9b7a9f2ad 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 Thu May 21 16:39: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: 187057 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1730665ilb; Thu, 21 May 2020 10:08:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyh1Lj2rw97GeC8+d8/oHinhZxbguv197m1bE5g+mtCoI0MWR0Y8FYjzJiUqrb+9gngMcsb X-Received: by 2002:a25:9b87:: with SMTP id v7mr5408121ybo.416.1590080890297; Thu, 21 May 2020 10:08:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590080890; cv=none; d=google.com; s=arc-20160816; b=d8lDgNpCYuqiOJ+nhWzKJmmC6w8wBYtjSMcOBBr6Dz/5yGBAwFmHgUB2CqvcCH3WcS pk/RWOEGv9cHdlVOAx4j07+B4uv94hPj4cKelP9wJZLch3gCTXf2ZzmHDV7IVtmeK2jD +teq71H8v3gBlPmn9q23MRrDplb96c/V32G7Tb+VMxZngr+EP+xNPPfDMf8+3PsM3MWF zU6sAbZM7MRriY2ds9DJOqis6dHtFZm0qhEXj2Z7lmmNbMSljgunH8QKMmLfLqgABoSV fN+3JD+TsKR7y++HLCscVjp2rjEghjXlsDXhw8T1sL8peWQpuXgX8D14a0VPFzRHBbJz EjuQ== 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=YZdGB26HC+JraH5qbIy0V10vArjL9kiIO6kMJOVC4TSjSwIUM8wJbdATartcUHU1HR 3W9Y7ARZriXUH/D+5HfFXv6mph3yreh3nXSdBK4mz/D/EHGytSilC4eD6Vn9IeUQnF53 CboROZTXQwPl87TylKGj8qYfOFhg3EN5iNGudSVxfY+Q+0EWSYSnR2rUFrP/llBVpW2d BpSxW8NiauAQu0+QDtEWF7LsiJnCdE8QTe9Dy8likXPR0IuiWHPfzQwunx/dw7Ls4nc8 KF0IclBcNLvg8/dPe/FWHnwas9SLWk/SG1Jado0UOp/0Ka4v0qE0PdiPfWA7wTLWQruK IGBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="q/TnoCI4"; 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 x142si5302201ybg.415.2020.05.21.10.08.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 10:08:10 -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="q/TnoCI4"; 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]:44616 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbofx-0002Jy-ON for patch@linaro.org; Thu, 21 May 2020 13:08:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50082) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboJ1-0004I5-7K for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:29 -0400 Received: from mail-qk1-x744.google.com ([2607:f8b0:4864:20::744]:33295) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboIz-0006fx-FF for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:26 -0400 Received: by mail-qk1-x744.google.com with SMTP id z80so7920154qka.0 for ; Thu, 21 May 2020 09:44: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=1YbnvmhNqAhmF66BGNb4cMj4pII5ByUEQJWinpDd9pc=; b=q/TnoCI4H+ymq812X+QylsSs+yotoXQHuK5XQ86dskxT4XUhLhFLdQVMcnjRfoFsg8 oKZVAJCxcTmyu/d3++GU+ySi7Jt0Pab4RI3MMXd4zpB0/07baKfTt1MYNNXY8+7SdcYF X5FxOt+FgsttBlc72MuzGEpTC5XAhRC28vE92qUF6Yrx8Tz/a/wpaso16TwqNZxPtIcN HM1gLuVYeiMfGtxF75GFjk8dpFweDqBie8HTni8Iz/+U2x70fS7SwbEX/ZHUUcAvvLXY ojgltGTB8F0gcASjoYFNTiU4+3S8cS2Tg6fxdQCmJMsPbCKoSFKNDy+Wln+3WkNm045I RTlA== 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=FKW/umluEyKL4BevTPOf6dZQ4V1NmNm6CbVHEFoJ8nRaeIVzEEWWwS9dJd3O6S3hoy adFW70fvv8YHd/059a9wIaTW7eceKkotH1dK2+CqVv5D6ymrhUuxH1KPNDbmYkD5uv4v FbtvSRtmG+k53eYmgwKhfxBRtd5vzMlYukNBNABkOWhuhjjOJVuNAxcQqTrHv0gXaWL9 XCjq0iC/ASTP6JKwSozKsqYOpq2OCk3EcgeTM4Fgir5jcB5opEtR0HXF6ufLan/r3DCF DscWYs+TzVC7hrOa3PAqMSCJVP1alAgbKmTS4PbpGtv0yCNOM/kKo/ZrSkTT7NP4YX2A rzxg== X-Gm-Message-State: AOAM531OONGRHHt9qNimBm2gB5SgyWb1Ywmd/8KppFj6cgwTOUrxRSsF jH4VDnTMTFn3wdX4GVDrp4fLRA90OvBVlg== X-Received: by 2002:a37:4cd:: with SMTP id 196mr10736716qke.455.1590079464352; Thu, 21 May 2020 09:44:24 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.44.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:44:23 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 52/74] nios: convert to cpu_interrupt_request Date: Thu, 21 May 2020 12:39:49 -0400 Message-Id: <20200521164011.638-53-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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: Marek Vasut , robert.foley@linaro.org, Chris Wulff , richard.henderson@linaro.org, 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 Thu May 21 16:39: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: 187071 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1736433ilb; Thu, 21 May 2020 10:15:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy0/BLjcunWoGa/m0CU9q0q2WtCwSf5pLBG/NCTqY2Z9WAn6LdeA3isftPUkdPo+s7Id0SA X-Received: by 2002:a37:4243:: with SMTP id p64mr11130660qka.438.1590081332221; Thu, 21 May 2020 10:15:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590081332; cv=none; d=google.com; s=arc-20160816; b=aH1/Dn6TviMHmDbhma0StKqXkgO8094BgJugUeR80G3bhcdDy4xNJ5rgi7wMhf2H2b YD2dU7WjAXi0EpVpvpg9oQKEz5KiMtgJ9rp2ue0YxOMNBEgaqMSeo+FMKyJT1rLFmkVE OKfA0RklZexFkQfkxhtGfFsfWb+T0BFDw7y82xBkFUN5gG+9hvfvI76oEF5S42lH0nVB Y1Z5nzlBOBV7oZ32IFO+pvypL3ta9Gv8cOp8v9Rf4aijOx+v6yU5XjAnApewpShN4oWC tkQ8H0R8o1MnF6BjLCwIHcsyYSMNGJsjC+n5aTgpSbWKP+QbtA0JHGMrO9Kpon+N6Bg6 AfZg== 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=rdoJqb1IBk9SgvYZUNMM+KSW8M0ZuxcTTKuiIiIMCBs=; b=NQYfeN2LlxBPhDfr9bdu+/5ME37B3UFVosmdo9XnMPLfH1UEC1dJuqKcT9CVOF68iy 2e2M0+FKjw/IqJQoRJZ+HfQxscd8Mu7iTk4ISktxcrG2T6jOCaNpx3gQJUCLdO8r7qY9 npqn+88gYB9BcYenCUrjRP5f0SLFb1ZbEzAWx3aak6EkPG2zHXC4Hyaun9VZhbVHodtL zh+1/RbdKZEp11jh3BAE76KCB0wHpnW171spNK6GmJh0ES4+wQRaDBWGVdZla/9uQbBP xhJ4DtFqiHtLRmpv8mG7mWZ4t7ElA80Bp/4Xhwy40Hlcse9VM0W+HHxxBR02vsacLbkN ao+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=v5ZpjIYG; 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 y62si3882440qka.278.2020.05.21.10.15.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 10:15: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=v5ZpjIYG; 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]:51780 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbon5-0001NF-KS for patch@linaro.org; Thu, 21 May 2020 13:15:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50094) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboJ1-0004Ia-No for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:29 -0400 Received: from mail-qv1-xf2d.google.com ([2607:f8b0:4864:20::f2d]:37756) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboJ1-0006h6-1g for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:27 -0400 Received: by mail-qv1-xf2d.google.com with SMTP id z5so3375396qvw.4 for ; Thu, 21 May 2020 09:44: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=rdoJqb1IBk9SgvYZUNMM+KSW8M0ZuxcTTKuiIiIMCBs=; b=v5ZpjIYGOvlPCrZUyNTyCt6JWDyWc3FctG1uKuwFMq/oFAcQLPRSG3lM8g/KdEKCnU 5j4hCb+6fotCXd6RUDlwoUqAYVHNZlZlP/atalJIJpW0nRJtxemhdeQ/MydYJmzlvGsB LxpjxKjk1veQQqQ1XfO4qrUxjVcwkVpVZsUk+ruwG0wkzrfGxG5dpMgM12g1kT7yF0jo bztlncEi3L0X4CWeHN6ZenhqmP2RU0iFZ4TM1uMhfdtIQg8+Jpn7/E+fZ6Gvw4AqzCR6 YY4+QFC+Y/U4MCaUvpiMPoGXHyjvWg8NSM1W72KZyy8UMzKBFjf3BabvozC0SMUgl02/ nw+g== 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=rdoJqb1IBk9SgvYZUNMM+KSW8M0ZuxcTTKuiIiIMCBs=; b=Q2j0ogNGatzT1ZoYDuMaVBRH/NBK1McPDK6lTga02Ip2nOtBWfBpdA3YnC9lz01nqM 55rHYRFJ4kmYvpnFGdqPAGl6hGCjTkNVqzAeUzbs81BJjQEJBI8JDe/lccoB9vvnqmFc PDz2SeKcxo05RAdH8THjbCEV117cGNdb6uvSvLOM7h48LyTKzs44UwaalWKniPnM0cl6 k0QVpxqASbQvqkusj0iWCQaE5lWMtJ9zs1FuaDT4xdlwIMOmmoXJ/PlD+5VQUHawNhV6 0FFpLyxAD2NOy6FqSp0+ZV2r0bvZanfUYH9xkq0J1/oAR4MDpSyl+0vDaPbQPZ8thjf6 sKOA== X-Gm-Message-State: AOAM533mE5VRdV4U38R1AM7RPTQQ6X+pw/jxNgLSnLA0QxHjzktXA1GP cyD4z2lcb0jg/Dyhk2xiygrqtBzyX66YFw== X-Received: by 2002:a0c:90e7:: with SMTP id p94mr11208478qvp.219.1590079465710; Thu, 21 May 2020 09:44:25 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.44.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:44:25 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 53/74] s390x: convert to cpu_interrupt_request Date: Thu, 21 May 2020 12:39:50 -0400 Message-Id: <20200521164011.638-54-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::f2d; envelope-from=robert.foley@linaro.org; helo=mail-qv1-xf2d.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_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, David Hildenbrand , richard.henderson@linaro.org, Christian Borntraeger , qemu-s390x@nongnu.org, 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: 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 a1c6b8a6f6..40b1a5b940 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 4b1961694e..490644e12b 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 Thu May 21 16:39: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: 187063 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1732997ilb; Thu, 21 May 2020 10:11:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSTBJaD53e96y2BQO07/d3ssqkG4U0MByh9bXnproip35kshFWN0M8hIp0H7rV844e3us4 X-Received: by 2002:a25:7a44:: with SMTP id v65mr17254648ybc.412.1590081068740; Thu, 21 May 2020 10:11:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590081068; cv=none; d=google.com; s=arc-20160816; b=EsK/udrlIAu9Ed86Wg5FcCtf0PJmKCax1q5jqZVry0uUxuvuwHlwodoMMgaIl7AlAS Devthi+kPej8y8Ja+ciS7E5DNMPf5a/LPFJaJQfGZ22z4fDeVC6YcN9+DXcpZgbsqiH+ oKNuQsRrdM347sidtvjCvrFUILBCJj+O914SytdBxhZbfEQ0eph0pQiBNgjJwcF9klYs 5E4VUzhsP8RXERDG1UAKY6wmuNrTUbfaDukO8Tws0fVQcIaLdAkpGuohtwp+aYMUs96k 2RsKlxiKCZ6AMig96f3CSVkMujA9LSwanOjykjj2rrzn6vKmz90HPG+4C8cCAGFdvAB4 po4A== 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=NfKuTrkBzC04N4SbZYUvm9mPAUTvEHT1V9ZI+SvSjmdB9KdJOM8O6Ln9pdm1xXZucX e0BDOEEtvQBLWc81tvloju/KWHbiXO89akfCrXsyRKe4wfhlU0Xdt7y9+welcW2u2nA2 vHgbZ9rzG2Da3YKI7xBCCFzaoWQXT+gGzx2ESQJ1E+Oae1NFFR49pJQzcawAOp6FPINB PY4JuVQk7vFggV4OUy9/zF8y+kAaECvbtfmVa8Ed1RJvwvjZjiC5Y79nofQRPHRxHesS o8C86S1uln+nSCinRq6EH57flCNFx7oe5i1c6YcBRLavg5LsGsB/5G2N9zWT49zQAXR+ rUDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=xo2yYsbX; 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 m11si3922431ybt.69.2020.05.21.10.11.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 10:11:08 -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=xo2yYsbX; 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]:59218 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jboiq-0000iV-55 for patch@linaro.org; Thu, 21 May 2020 13:11:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50100) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboJ2-0004Ie-O1 for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:29 -0400 Received: from mail-qv1-xf44.google.com ([2607:f8b0:4864:20::f44]:38477) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboJ1-0006hF-WA for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:28 -0400 Received: by mail-qv1-xf44.google.com with SMTP id fb16so3366126qvb.5 for ; Thu, 21 May 2020 09:44: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 :mime-version:content-transfer-encoding; bh=E/tQbITHc97dgORFyK3tE34tNsNJB0LGdPZMzeOAZ2A=; b=xo2yYsbXMAYWcZxDsNeGRW8GPlpUHMnVUMqE+npgdAvvBTMJ4zLTNBUeognUwKOa9/ v/HIbnYn5Bn6AwN050T3TEZhj48pBqOUh3gcAwQFluN6qt4dTnyOSO841BOvSNk7odn/ WfpcB+Z8qVUKrsHjOE6eWLk6KsIQZiu0RGKcyrOYCgUxweZRZwc9VAG0/NnmbQxuTinY cElnvomWcGhm1jbv720+BxZRNKMET/FATNZhYODBDYUQsYjeQTRY48Vo4oRs1OCRCwnS pLD01f4u3P2LQwO3NPs9Y5Ys8PurP8bM+fHCJGCdDYfBKjfthe7+Oagmmlez8K+HuYAU 5RJg== 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=ddqNINA2qshbT3rZAVP/57jzw7iTynsupgZzRgn6oP4X61+f1AQG0Qmym6a0ysTOaN E13pZj9KKAzPpuPG9js2nJVVlzxUhk0iaxTntbjmBjR46d4xHVhiBCV22qRFQopP0CBC KcbCMnr6EiEj8We2EKhfYUXcFA1kgQnaTMTxc5TzDZbcrF9BU0Soe1bGDfb5pnFSyP/H 7tV0DlkWmX8jKW3paalf5yk+YXb3KJ9i10Vx+wY1rLP1OVEMGMAtzTOyn1AOWdDalgFZ 9IkiwyqokbQaZlr6iD03URhOPrREVpZjm4gFE1AITABou4MFLWHDVWosBGp2KY2LwFPv p8og== X-Gm-Message-State: AOAM5311A7NdmX0/eQKpygCeOQuSF/L+oie/B6Ls1z2zOr2okocK/iD6 eKdopbwKFkIMbwacbRD7OANe5s6Dd8gc3w== X-Received: by 2002:a0c:b2c5:: with SMTP id d5mr10934829qvf.36.1590079466923; Thu, 21 May 2020 09:44:26 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.44.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:44:26 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 54/74] alpha: convert to cpu_interrupt_request Date: Thu, 21 May 2020 12:39:51 -0400 Message-Id: <20200521164011.638-55-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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: richard.henderson@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, peter.puhov@linaro.org 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 Thu May 21 16:39: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: 187062 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1732241ilb; Thu, 21 May 2020 10:10:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyhGzbwxFIjR7EJgVjEwRjK31mjXLqXUcATOAkLpHtxRrq+j+WW/cIhqqgZpuNgI7bzuSas X-Received: by 2002:a67:b06:: with SMTP id 6mr8334425vsl.18.1590081007898; Thu, 21 May 2020 10:10:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590081007; cv=none; d=google.com; s=arc-20160816; b=l6ahcuFrdsJhy5/u65UM2+nFFoov5RI5ZiJ+4t6uDUOVWnhWdaPeAOHQ6wT3yzCfPb Qj2ARt0927XiyoJAFil3OSSEXUsuYFAYEk5B0mdw4w2NoUMLZoYyVLcWxTvx6T3xOM5b JUPSwoCDy9nCNB1BWxMffZepaH5quJXuwlR4nkKB6x4heHfHJApEzoLc46zz4Zd6BHLN Or+NesJDIWBCaFxxCwij0vQ5fpXoIKfBXxJVX/g6ctKCTkbpDfHc/Ck4EiGqToB6shC+ JWEIe2SCef1nHZDrNQuVZtHpOMM97ePbHO7qZWNx+6TxlxGq1B8S2REB8U8DMEe0YvJT zSyg== 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=YT7tI0bEPSFp09G0bOapp9irUOB1VNU3QcEtPeajdG72ovWhU7XchZ5b5bq2vRO6X4 AcYIDTaeVA/h1z2JWZ1R3AI3HBfCF8EMTgXBVwapLT9Vj88QbcZXSOXYAdNylEPjvz3D se+vHWoxivfQmTbU2DfxAvJmIUrJu1zoiDjS1Q8RqZTtOkahoc/ebf4QCRBo4NPL6kOa BkL1X5OlB5GAedDFfilNXPcBNFE6+GJLwm9iq+JkZTbYXFt3ee6ug8tmTYvaA1rSth6U MpRFHX7OLLtIInuMOcu5dZmhg2+kN9Lc1ME0bNBKhE4GUhJ+I2EW15ZwnGaeymB3GdkH XckA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=SZCbqRKn; 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 m2si714708vsp.416.2020.05.21.10.10.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 10:10: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=SZCbqRKn; 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]:52888 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbohr-0005u9-9S for patch@linaro.org; Thu, 21 May 2020 13:10:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50110) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboJ4-0004Kf-EO for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:30 -0400 Received: from mail-qk1-x72e.google.com ([2607:f8b0:4864:20::72e]:41254) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboJ3-0006hP-Kg for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:30 -0400 Received: by mail-qk1-x72e.google.com with SMTP id n11so2380437qkn.8 for ; Thu, 21 May 2020 09:44: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=TvYnAkjAppdRPxTCTiIdH7gnvDHcZXb4SiVpZ+2G8IY=; b=SZCbqRKnD6kX2rklKe58WjtOJUKa76jLfuo0z0tviYcxZkVDslo0k7VXSOPiRp6/lS Fx1wFNgogr6K1FDXtyargnSC2hM+KJ/dRp2Tv4BoJUF2C76hsl2+JWsajjz/DANcOwdz wSUslRyV+NfonoiDOs2888qJ5Gqu6AGRb4dyPO3B05gO86Nso093Yg/LHdoRZnXhzF2Z QY6karxwYVutqUJ7sWmP6Vhuru6bREsJxnaEJVnr6WPWT1Ai2uM8fPV+s2r30DvbiqnV OEZfcN9QOdH6nhfHdekjn7SCOxO6CkLHyFuQjZaKdsOa5GDHZFHHEVZNKtNmUXGSmLA/ p5sA== 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=rFkT60pBXXoSKgsw/nJpOYXbQnNNyNzrMYOvLe4T5ytiS6mYa25ltuKOQfW9fWp/5j nNt1e7DzgsNx0RCL83i11PXkJR6wxz2JtgTC8+9UdJb8nc4JbNdv9AuhvyvZOS5zRQaj MKqKbiew4LBnfi4G7kyBUhwj3gi64uprZrJAJ+Pi2cso6JcyQ5rkhtQ3reKcJdHt0U7R 7CVsmIxlhx3pUwwNhZ836q9sSVJE27OPMl0qHTJNBggx1U3ycUcKhkN5Tz2WBm2fTTic 9KfAnKRS/iHxHfQyum8lShP7WzW7H80lqXsW4/J9JGgqpE9mR/NDuNUwZCHWu1vcb9lD 7uOA== X-Gm-Message-State: AOAM533igwHPB8RR09uxfE//EHvC8U435LmvCVknABvRk/9BpBhgpBzc 2Zk7PfYymt2kNzaP2Jbs0lIeB32GgjX7Jg== X-Received: by 2002:a37:a1c7:: with SMTP id k190mr10996168qke.166.1590079468173; Thu, 21 May 2020 09:44:28 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.44.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:44:27 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 55/74] moxie: convert to cpu_interrupt_request Date: Thu, 21 May 2020 12:39:52 -0400 Message-Id: <20200521164011.638-56-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::72e; envelope-from=robert.foley@linaro.org; helo=mail-qk1-x72e.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_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, Anthony Green , richard.henderson@linaro.org, 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: 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 Thu May 21 16:39: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: 187065 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1733320ilb; Thu, 21 May 2020 10:11:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRdgm+BfdxFjKQWo1QbH8McjBPx0V4GDQ1mldB01RnmLkWU2wpegrbCnNw5o2qWzKY5Amy X-Received: by 2002:a25:f81a:: with SMTP id u26mr15278589ybd.401.1590081092943; Thu, 21 May 2020 10:11:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590081092; cv=none; d=google.com; s=arc-20160816; b=JAle4rX5PpazoZECXj1Rq2K8gr/GN3PXSrVkQDZOFwEW9euKRPbpWo4queH9zT1itL fRdlseMudQlRL7YoDTqETVDaBowlugJQZZFEi+bm7Zn8B/A/JDG1XQGVaeXBvpmIjh5e o1qKnYXH+ZQ36FoBOo682dv08NqpBwfOJFzT1asQ4PuRIa8QFLfGp3pxphVjuZwKGHeK Jpt8kxvgW3u0Day2oE1SzwbF5j+Fw7nxA3KQeWB4MVaA7tEAc5LJ4rb1CaM5e3oCB1Rp 66blMfeEiL6qtQgtjYGn3JdgBsxo2F7ngykIcjOc2FbBzItkJRCTnIJvDJBQZYvDQKNN RpiQ== 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=wWt9H+yYGHPt/H7RBAn77MW9qAa5zs2ZsTO+YXBaNNEdlTiuRGGR75bkbdCY1Ix786 pLdacyidVaB9nbykdhkGstohbXM2l9X52dWVXMFkno8Kt3sxD+tVpI27Ojo2ZdD79gof +087d4YaxCZuN1/Hm1/hzh7u5sCN613xfaWckVoamDo+VMynaA+ipUbRhm3/1OM9UA9o 59Sr6whWM00cQyB6EheNdsN8a1CQtgRDAJair+KJ0ZnhqK0HEiZma4j10KxdGqsfzoek p8Y16lEUdQJYU8RZvxn4oZMatlCER9CTQ6s0TBTeOpPRL5twwp2MrE07D7+zO6NcpOTB kyKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=DAhu+KMm; 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 9si5559095ybj.366.2020.05.21.10.11.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 10:11: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=DAhu+KMm; 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]:33288 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbojE-0001hy-BM for patch@linaro.org; Thu, 21 May 2020 13:11:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50124) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboJ6-0004L8-GB for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:32 -0400 Received: from mail-qk1-x741.google.com ([2607:f8b0:4864:20::741]:40821) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboJ5-0006hd-FA for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:32 -0400 Received: by mail-qk1-x741.google.com with SMTP id g185so7847863qke.7 for ; Thu, 21 May 2020 09:44: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=cWfP+0MUzrrNImWYZpz2KO/NSgj5qKMFSKUqs77s2xU=; b=DAhu+KMmtFGINUOHDZ4Q4aM3giQponNsqp92LFUNsEYUuNFf9gOFBt/bz07NCt6YW/ ++Qx/BgVOiQ/lqFc69hWm+EIOvTLO6+IFspteIoJR0OCROpruA1x8l1qAY19hJA6aY+b dEPTYRWOcXc1C3kCLZEbv45/vHzjC/DO5vIU+uRZeEVZsj/xyOIcbezLbwfsOCCHQDBn HscOo0j7SNsaQwg5nrEqagLHhTLdVmZLBSTPcIgHEbREvU9mYeM87qf4TnjmGpQdYmLn 2T3sEuzAhX/+SlZ/SGgblnWO0YdzufuSplf4AJ5bs/CEbMVFZf1rzcqHpAjaQG6sAdw1 Aukg== 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=qK44mAZmmT9fa0tAfzpTJq7tV1x0bfeZG5bOVoae2DCho99/g6FZ6eNNQVU4tEkJOr rh+Wjei4jw+pNyW812GvWtEUhaTJQHapIQobNYttb9fAb0WWWP5uEUsWodeRr4nGGXI8 qvHBcZSow7dWaC0GsPa8U6zrMS5jMAsj59LvF7iS/oRJB1X5+Sbcf2YK/QRVGN7wEGO5 6TRc/6ntq9ALJx3O4KZ5pBCcJqIF1rtCkOb2jNPQ3DCna+zJ/PmTInoYkguq4qoAjTOX qejrXlnBqP7xrGxEI4XS8vcc3L0Olz8wVmxsUdvMa+yg9HohdiJe1DnDorXen6VnGnIn 6jcg== X-Gm-Message-State: AOAM53089VQzdrBctFISjoRDA7a6gakVuxZihUIrmxCwSRw9zL0cg25H ucdGNfVsjWnFmRdoD9cOVTPf4Qz0cDWuyQ== X-Received: by 2002:a05:620a:634:: with SMTP id 20mr10172139qkv.15.1590079470076; Thu, 21 May 2020 09:44:30 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.44.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:44:28 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 56/74] sparc: convert to cpu_interrupt_request Date: Thu, 21 May 2020 12:39:53 -0400 Message-Id: <20200521164011.638-57-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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, richard.henderson@linaro.org, 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 Thu May 21 16:39: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: 187068 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1734590ilb; Thu, 21 May 2020 10:13:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzosc192rECCfrPW0DfUieWWGcUM8+u4OlK/qH4MQhcAAPAtX3xtwgJ1gf9YH6nAghJqBLX X-Received: by 2002:ac8:65d1:: with SMTP id t17mr3928209qto.46.1590081185154; Thu, 21 May 2020 10:13:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590081185; cv=none; d=google.com; s=arc-20160816; b=vAxNfUwa4l/e5NsAG1bHqIplVYkNop72Ij+3dJmQqgAno58/Fzq3/uzqEuaXV5jfjW Oi1Eso79z2kaaWTNCfsc/qfRIh96QeI/5YOJbLhVLPRoAHBLgZ22flgayhTfdS+Ls50G yNuavgUETHmrtgE8keFjAjEeRb+4PVBU7SNKlhOf1Hy7F99Auh04zKIt5J5R+G1qQiqZ u3rJW0/9qcLB2RMVWUi3IiI1UlbhGRPPUAs8h854bHdSpFD9P9de9BQrJzlAmMb8+cWT rcKSQaalqYB8skUdaO7XTezO1csqtte/2bgkTMGeMCL8iamTphTtzMu52CdHIyqAKW8u KlcA== 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=dIfMl4sjwnO1/Kwwk/M5+NgoTbsEUlc9ctoS6cufPE1bVPDPpEr17t6av07mNh0cA4 Foa41L9qX+b9CLRhdZcM6sYEOXy4rM15a1lQtCrtmaKcOOWCecSc6teIImA2ongniGeb H6ql2++AopwoylMxknL8upz4KNpGgFotcIJxPRGTjwV98lfPUYTmcM/xE1a2tB2z5jX8 pl/C5B/ip2mJLtMXwGC6uVZ4thv8iySLV1O6liCRCZL6l32apn3UPUijj+EnYG+0Qcjl uhnuFMLN/i54IbZkMvE6lf0k1m20/+UOyEw75u/dgLB5r+1o9mie1bAlTuppKlrdLl/y k26A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=AYshm8sm; 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 dg4si3593206qvb.205.2020.05.21.10.13.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 10:13:05 -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=AYshm8sm; 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]:41818 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jboki-0005IC-Kw for patch@linaro.org; Thu, 21 May 2020 13:13:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50134) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboJ8-0004LX-E4 for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:34 -0400 Received: from mail-qv1-xf43.google.com ([2607:f8b0:4864:20::f43]:41364) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboJ6-0006iM-Bz for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:34 -0400 Received: by mail-qv1-xf43.google.com with SMTP id v15so3358620qvr.8 for ; Thu, 21 May 2020 09:44: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=1b+dD7RxLqaUPVVNgXTFGKKstOqQ+qP/ZFHAKJHyCiE=; b=AYshm8smL28Oeb1t6aqqiZYVQrMvEjRj6sVGSTq6eTH3Ez6KB0obAZIVm/dJrRO77O Z7cgyObMfKdmGt2IgDNnfLnGh6GYZWJHEyuxIqCIBoMYp2LhrUuDBksisUygP0jFIyWf btH/LCjZ8sDGZ+m6miMpOnekuCJFLAcOOYpTxNxCsH9guXwaENK24qiNbJMQXtItblRF qgmWllJH5K88LHXcer/LJWjgs7HnlyILmJpCZBudyqfXkCZSp1Ok+UMQM0fSgV7fwChx D2oumm7Z72Qnv+/tknijNfTXswVssZWw6R6fvCQxui7CKshDxbONJhboyavuAbyFFoyA VVQQ== 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=a5EfG+uO+qHKfVCHOie9v4l6duSWCB7rkns6Lu88cKHq/yJ4MJFhRuLDnJxq91R/tC EfZm97nFmtImWyEOIMcSYTepyxqr27L4zOsezJ2LUnZifMQKbjTPEg/S8gGyXMGsONya 6rljbqcf5EbAJDbr9wHNXTt++e1xnMb2gsORKezpf2paXogj14SNW7DnTKFZBUvlUwzY ZFApwdrntMiAau6WkqTkpcwQv1IsUr3baoDEOtuxPDk3gDyp6aHRubvbPtqitx1AlC9T Coeoad2wUMz+bVTmvY19PVQ6RRPou+Tk1Sb7hzKkfS9OQ12zYV/i2TYgaYD8TYLb3UUV 3Xtg== X-Gm-Message-State: AOAM531Mh5ywzKaHnFECZ3s/Dj0y59YzIpncFRHnf5BR3hq8k6KhNXJQ FMAqguGFfSGmNEuEw0DBdu1kW30TNVrCvQ== X-Received: by 2002:ad4:4b01:: with SMTP id r1mr10604609qvw.38.1590079471367; Thu, 21 May 2020 09:44:31 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.44.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:44:30 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 57/74] openrisc: convert to cpu_interrupt_request Date: Thu, 21 May 2020 12:39:54 -0400 Message-Id: <20200521164011.638-58-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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, richard.henderson@linaro.org, cota@braap.org, peter.puhov@linaro.org, Stafford Horne , alex.bennee@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 Thu May 21 16:39: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: 187073 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1738108ilb; Thu, 21 May 2020 10:17:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzeYjgEnQbtRYbL//lM2iLtd5uyvwjBrZutOuATKShaRQwRy+o1OHnh+hC/Meeno9ezMZ0Y X-Received: by 2002:ac8:341d:: with SMTP id u29mr11536856qtb.282.1590081469080; Thu, 21 May 2020 10:17:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590081469; cv=none; d=google.com; s=arc-20160816; b=ZtZrDDVvFM558krn3W/TXPAZWJWqsmq7IIRdBuKHsnZf+9jS3BPHBBDdkBib6shZQb gRApkghHC2OT0/9L1RKfF/EKdg9bCC9hk/DXCq6d/7qEPZ/9QHpO18tYCTFFgeiCmkW6 XydQZytGKKhRdk+8tAKbItlHwbiBTdF7VDBCp2s0prWxo6zpX6pXF4nn9CBmKg3Jpv2R gP/+RW6ALHzXkafb1sj9MUXuaR6+4+92j7Dq33OsyDOhfPDFNWtYkDxnn011WLGMXf9C JhW9/VlCCRtvLddd2VWinK3YjljtSuQFMghe1MTNqe5Nrhv/2qy0S2fhbYjgSIZtkFCw 3V2g== 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=sPQR/cwIdsylY/GHEyRTlVYUZWvqeHkiBBmB+lye5p6vxd4ruE7jzlH216ulY2JfPs 5DycsXknlCFXCPzWCSuy6aSEVhrJNvhCHR6Yts8hhVeCnLZRA0znacmO5tpN85nfzDft 18OI0fOpsnhjXvfUAb/dtnvgtUYSNflytdgdYBvAOHfAiWnFhBHERnRrf5BMJXCbMMtQ HgwRmmMdoBpOz8mdE0uog6t4pfnWI3Lu5rbnx71uWMqUZuhnQHk4qFHTTRYTFvDyCVPE iEX+yoxGyTQNmSOiUb8XxNxZ550UjNoCSqh/Z79zZzwi6+3MsoKyjLzgQG+Ca1BJSU5H i90g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=MF8FyNqJ; 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 c6si3851527qtq.392.2020.05.21.10.17.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 10:17:49 -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=MF8FyNqJ; 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]:60402 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbopI-0005Qt-J1 for patch@linaro.org; Thu, 21 May 2020 13:17:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50144) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboJA-0004Ns-EJ for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:37 -0400 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]:45008) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboJ8-0006iT-4R for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:36 -0400 Received: by mail-qk1-x743.google.com with SMTP id b6so7814837qkh.11 for ; Thu, 21 May 2020 09:44: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=NQ/BbjaNmbkm5KQOy7Vv4O17R/NYOg7qZF+hAsl6NgU=; b=MF8FyNqJb/RGFP/09QrjTIyVf34prruwqZ1AceBOSuOm48II948vnFxI3xzdmRnPzi DZ7vpfin3Nkm/cEGHA5V00jSHaM1SbzLyUgeh/y4kELaczI5vmcNnFTvDGPblHmyWgZM 2XVUUDlCEmzs6o5EB91D8YsjrT5tR2ijt0fVlWrDKNdTGEQMYZnpIS4ENx3zW5wZ8oB4 zyrLZQRiBpOpJgRxh7kXQUgR81wTWAKlVYsTyGIcKbMZOtnZOBQ40kNvemJZk+zNfrMU UMioW8CgE4Q0pNRWwSOd96K4NEybvbsefSuVVpS8TYGQpGtLYrtdMs9oizX/pYXMdHkv c0gA== 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=amixXc/iZmNttRfyb+aLIBYCS6Bte22NvMY3vQr9+4uJWEnYTvG6+NdWROzvAeqW7V FXFX3q/up+jgE1eKNxDxjuDul5gCtz88f9HUaQM/fLZp3FFow1DQZoQ7jQa67djwHXip YUZOfidS/Ow+lhcM8JGWHI56K6f55z8Iw9mJpaE3wxbiRz4379KLCSzLI+TPzCfP4bCK rfQMWOi59ghwgI63BGDHN+yNsMaMk8jmhQSINK9UmeO0DXD0aOW/KZsSNbXf6osohWTC 5JBZ0MYLd9n/DUbBQSooubr5PQpnGyQGIDfLjTuLcghDefV9UPAdoOgRMpspRBnGC8y0 cU8A== X-Gm-Message-State: AOAM531W9e6UIWOsMuSHpW+G/FkXrLDHfprZA40NW4IGK9LHUhFVM0iM 2jgtdXBg6D+N9iARLHPgpHzS999eRaNBVA== X-Received: by 2002:a05:620a:204e:: with SMTP id d14mr9451256qka.13.1590079472636; Thu, 21 May 2020 09:44:32 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.44.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:44:32 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 58/74] unicore32: convert to cpu_interrupt_request Date: Thu, 21 May 2020 12:39:55 -0400 Message-Id: <20200521164011.638-59-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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, richard.henderson@linaro.org, cota@braap.org, peter.puhov@linaro.org, Guan Xuetao , alex.bennee@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 Thu May 21 16:39: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: 187047 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1726131ilb; Thu, 21 May 2020 10:03:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxb0oAEwFHnnQG5Wh3okDYFxqlDi/lPulMmJt6q0tsO32PDKpJ91UIAKXjYovCif8hJ2smK X-Received: by 2002:a0c:dd90:: with SMTP id v16mr7064996qvk.43.1590080583871; Thu, 21 May 2020 10:03:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590080583; cv=none; d=google.com; s=arc-20160816; b=xh8NUmq7bj6gGrcQZK1aXL/rHr99t+gQrbd4vmJ8RF6wTI959ny7IaLMFbTWN0WEw9 R71RZn5cCnAjZKJ3d1w5WtETeJYz7DUaCXFf72iFavOiQIv5fzEMW4a2WLWeWF2su/sx vZoqhXVbMtIRi74OGbpuQxCuBvtzBA2sorGkkNrrmFVDAUGMV6pEnb6YKFNA8y5lJcuI w8Y2U3WzB+qCmd0ydI+2V4qO7N7JCTQFVpKHhbKHe9b1oOU480UtKUk26J3IUXodBG0C aOmMiQeI+RTOWkZLY13HseL7tF8YetivG8p6ivkQ4MVOuVRk1M97DX7Htxpu2Buj1s2V s/EQ== 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=DUz6IjE+KDBm1v/EkLkpXtyZ6YOnw3SSFHn8L1s2bt0=; b=SDKP44HJpi20fM13IoY2C0Y93LxMfgzz9DK5qB9qUJdgDB2XVn/vvWYxq5aq/g4raA 1pRkOAkfS5ZTHjkfpat8DNOUGVxRmQ0S0EnTuHRF2fXF77ZYUmMpdwiSXc4yCpUmfkXq e8A2mVK61RtBYkNfcH//IQ5LjjZ/DeiuNVhbrk+OnCK2HgOV3yW4ET8NrzFd7rXoRVk3 0q2fKCEiWRjYcbw8jj0HGK1V7vq7mCSq6xFrhqltZlyt+M4j7xgvj3vUZtPbw65HI/cC d5lUffyfL/DlkSjn2UHFHv0nMYHfAlIV2wcDuLfqsC3PcXXHErlP5zqRB47yFuGSiaEw k7hQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=WpGaaZar; 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 t81si4012715qke.304.2020.05.21.10.03.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 10:03: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=WpGaaZar; 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]:51692 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbob1-000638-Ak for patch@linaro.org; Thu, 21 May 2020 13:03:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50154) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboJC-0004PH-Fk for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:38 -0400 Received: from mail-qv1-xf41.google.com ([2607:f8b0:4864:20::f41]:40457) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboJ8-0006id-UZ for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:38 -0400 Received: by mail-qv1-xf41.google.com with SMTP id l3so3360505qvo.7 for ; Thu, 21 May 2020 09:44: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=DUz6IjE+KDBm1v/EkLkpXtyZ6YOnw3SSFHn8L1s2bt0=; b=WpGaaZarln1buUQsPXvXV7MU1b2/sArJI8g/dPlZ2GY3Nlu3exrW6lezhy2Lp3rKb3 uZ6a25KZprT5fFh9P7YuWIL7gQlKdva7U7qzbuksba8OByJMhrAEoGD2nYQ+ezJZElsN 78y6NUVTBTSP04t9ik7Uh1hl+uYXm9nxyIiFIYS96BUbKav/Z2Y/f3HrdcxsLb/HZjgY JA8QT/Wy/IqQrFk6ByAa5yyZiqCBlFAY8Fpfd06Z9ZGGI+kwkbtQvTin8g0zAMASt6K3 sK8oywFXPH9bYkv4q9ZEMJIf5sn+yOvuJdFBVdjzAq7WfjCxCSToYih9MJyh8TsFAAd7 KNhQ== 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=DUz6IjE+KDBm1v/EkLkpXtyZ6YOnw3SSFHn8L1s2bt0=; b=aAgXV5ULeut5Nhgf13rw0700t5bvydMlJ2sRMOK516LFJ1o3LerV6o+p2UgsKpAC9j Z7MWC803b7AhLMhPUQvfCi3WqzknNp+k/WJb6Kx6BYVYfWoahtAvWhqWvFDl+tedghdE KHBich0bgkpZF/0Rc/UvuQKr1EPJSQhwFp4vHb3EiNSw3au+otXX6XtGo0mIpU3LQAHW unRaBn/FELKLqiXpDy+apeeAoV66qAsVqJVYPeFZ5EXgdvUIRYNHXwJMpDmjOJ7tjC3o AtEKpn32O1i2tngSTMyFvg27M5StILMCR2CMS5+vUzvxXHeI7hQhv8B0YLUTYUiLQ/lL ruUA== X-Gm-Message-State: AOAM531fvdiMprVc22U60RjQ1pTmp07RHHuoX89zKofrG1BhbUi1uHNM 5R2G9vjLz/Cfb3JO6YYB1WaJMtsaRJRJRg== X-Received: by 2002:a0c:b259:: with SMTP id k25mr3837154qve.111.1590079473900; Thu, 21 May 2020 09:44:33 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.44.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:44:33 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 59/74] microblaze: convert to cpu_interrupt_request Date: Thu, 21 May 2020 12:39:56 -0400 Message-Id: <20200521164011.638-60-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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, richard.henderson@linaro.org, cota@braap.org, peter.puhov@linaro.org, "Edgar E. Iglesias" , alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Cc: "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 Reviewed-by: Edgar E. Iglesias 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 Thu May 21 16:39: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: 187051 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1727790ilb; Thu, 21 May 2020 10:04:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxd88BlzuLMS8xf7+gsZ/sGdsuyRjq6zbZjfrHHCdw6PKj8ZJGg0PunOxWwM58gDAfRTvA2 X-Received: by 2002:ac8:2f50:: with SMTP id k16mr11923279qta.392.1590080689702; Thu, 21 May 2020 10:04:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590080689; cv=none; d=google.com; s=arc-20160816; b=CwhVX0zzvelVZU2dZVVRYcxdGtOaCoLCPruSVkoVXjjJlMDz7bhbmsJUa+gvGmns6J GikXOODAqsocOvdznxESliGwcy5PrPxogsBZ20dFuDkROr7SnxqYrgqlvbmpgMluXO3R YVCvC/6HAxhb94vvpEhifEUuLgnWBR9xYXQ5vsc9Fa6Q1O1wnek+CBCQN4E490fqrTUN y1a3r5SwGnIMyu9tBsJMUmCj6B4hyvF+hUy+v8Xc4XNxvTFguY6tzsaZp0p7IsNwzcP/ z60nuT1A0GqErYzNsfWfaBuFMsSwo6IUfaIzv9x1GzBOxJmZSKLSfcTjffBW6IEu/KNl fZgA== 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=sh7ma3RXOutsPCVp5vgyQfkJaobdB9KSp9Dt7UwZtpM=; b=I6WHGomf2Jqgdzy75Q/tpcAWbJ457FN0UaYy0dMwavEGTWqHggr0l6zLNjygzmhyDV 5ySwL0t3wgRr6U5PN4ucYIJELBjla76fX3Eindu1Cc6huy2wM948CU//lQJmNfnzSiKa 7ylk45LVNTa0Ne6EnNdPlz2b+NqyCM1k6A+mbf1hi2/p+9Cp9b8aYFEV3wD+H+4UPS47 vQTtFMBLowhXAq8sftGJnrf15BrkAN9ljC+HgWw+IHnDlnlSEug89zoScquOAoi64BME AkF8VXT+tvl8KWyxev6iKgT3Surm2sltGMAtPHntkUxhUX/lSB6IEMCuXzxLoPTIaKC1 k0kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=wbkhvCZL; 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 r25si3591220qtb.77.2020.05.21.10.04.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 10:04:49 -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=wbkhvCZL; 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]:60396 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbocj-0002SM-6O for patch@linaro.org; Thu, 21 May 2020 13:04:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50176) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboJF-0004Ud-Ck for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:41 -0400 Received: from mail-qk1-x744.google.com ([2607:f8b0:4864:20::744]:40824) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboJB-0006im-Pz for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:40 -0400 Received: by mail-qk1-x744.google.com with SMTP id g185so7848143qke.7 for ; Thu, 21 May 2020 09:44: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=sh7ma3RXOutsPCVp5vgyQfkJaobdB9KSp9Dt7UwZtpM=; b=wbkhvCZLW0BSpV2AtX9VeMZE0g8qqRM09Exw85cXX+CGsV8LO9g8zyEqLosyrb5O6l 4VxFF4FefEF6VTqjX2s7saivoJk0R5TSSCIpjsMkIDyRb/PVvHlvGY79msMzyGpzy2AJ VNJ//fKzhVGsZyo10teOYQt2lLtGTJnhxihKdXmj70Wj1oQjC2l3NSwJqCC+QjuceXE1 8eJPv7TdaTLpzq/Q8h+v+d9VVwkgdYcH+iiOq5+oaSCR2Kmw2HMlNPSCD32p5LpaMWZW VqeCXfYwDTbl1MVCfIcUqqH4rJZhiU3Qg7qHRWCrZrzrq6Xshh9PRSsSv1UJ8NeySu0i PKwA== 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=sh7ma3RXOutsPCVp5vgyQfkJaobdB9KSp9Dt7UwZtpM=; b=LyTReodp0ORcT3qfF9NuMN9c77wrBaHeRD2diM9HKVsV7xJRjOjLUC8zCIL5UtqwWq KrgYG17Puh/h42XbgTppwX7ATTZBeQIopmRQyf+Ig0a6x0tN/QFzAmba3HyLECEZvnck S3WTElz53xMcJ76NPEtWr7urSeXehj3+lWAS6MaANrzoe3LqNl3HQo8GmWOgte1YrtW9 fJ08ghejVgcMuf+UVCcAG7kIljLx4zKLBG+BYhIvlew8UQI23DVTxCuGwIjLiSMxEwdb dQUk+EeryXVL0r3N6pho9AdigOOpar8oxGU8/AasbIbkeZkcnhT1KW45zi431fDPbuyD DWrg== X-Gm-Message-State: AOAM531/e3qx+4Wk3ST4YpDbNiJkrE4H9zXxHaiHALQzTchIzLt5Z5GW Ansv+4SQQztaOS6+1aEolOBCC9MSp4GIaA== X-Received: by 2002:a37:6cd:: with SMTP id 196mr1800690qkg.393.1590079475064; Thu, 21 May 2020 09:44:35 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.44.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:44:34 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 60/74] accel/tcg: convert to cpu_interrupt_request Date: Thu, 21 May 2020 12:39:57 -0400 Message-Id: <20200521164011.638-61-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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: richard.henderson@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, peter.puhov@linaro.org 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 42ce1dfcff..af8ecf3380 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -2392,7 +2392,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 Thu May 21 16:39: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: 187072 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1737064ilb; Thu, 21 May 2020 10:16:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz88gNd925zs76PRPjkxzahdW9uKBYNkrhQANJQY91QIgB4hlnB2r0sUfwhs3CThQrHGW6G X-Received: by 2002:ac8:787:: with SMTP id l7mr11508358qth.301.1590081383007; Thu, 21 May 2020 10:16:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590081383; cv=none; d=google.com; s=arc-20160816; b=sLQkHqTRYvI+Z1t5WKh+kmNkcq71NMYAXMQ0XiZTR5cVa/hzgCLQDrs1xwA+PA5kRd wlT53P80aU1PKGcgNfNVfUMyFR3rzfWqgJq1s6qQD9iLdi7KjM6Tp6b1QWYWcxXdeVHf P5B8AgpNepfS57mHS8LaadFPrB8OEU24cgW5IujGhvGpPKmNo51kUuVMgdzJNceuvBhF mruX4mpzusXtLgKntYELxBpKLyH/FHGEaRbHYr7MHVovcu9omUzcQCqxVxXgN1sS8tFr zNJ5VXh0Flu53hZE5aSh3EDxtugZu7GuVMDGXOTXcFQhXBd/kOGpEmlHs9kBCxuGvkEo xHEQ== 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=5ikNoVs9W43MQHNtBQQlhNjgAh1VrOkQ69KYUdVCDpg=; b=wM2Rz9Q2bge/DaTjrUPMOHS8hcv68j2xSClIYIMmR699C3RVz5ldjJyj7lBO1HcMz9 FHU9zJ+TgcWQxg0rMBG5MMCqWfw8iZ44ckpj7llAmb44XHAEEhQO8M0jEHqKtxqoh24e yPo48ePD4A7tLZshpCfVmjdJ1RZTrCEP/d7XinR5b7zh1ZW2wC4UfcH6JaJTSxM9oG5s 4FSptBneVOWtVh0OOQaBOC0f50jjnzXAWnnIFtVOdjr6NdnTk/6gQQvgzLMEXetN9SsG Uxr5bGzxDUGWXZ9+Kx5+hp0IjDUemBcB0LUcBDG5WaEWF7y/IlCfWamKah5DqpblBoJJ Pl/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="hNvaKt/c"; 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 z20si4088345qkg.373.2020.05.21.10.16.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 10:16: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="hNvaKt/c"; 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]:53238 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbonu-00022V-Gd for patch@linaro.org; Thu, 21 May 2020 13:16:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50164) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboJD-0004Qu-4l for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:39 -0400 Received: from mail-qk1-x744.google.com ([2607:f8b0:4864:20::744]:41135) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboJC-0006iw-3C for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:38 -0400 Received: by mail-qk1-x744.google.com with SMTP id n11so2380952qkn.8 for ; Thu, 21 May 2020 09:44: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=5ikNoVs9W43MQHNtBQQlhNjgAh1VrOkQ69KYUdVCDpg=; b=hNvaKt/cGY4AMEGn8KNxL/Mha+loy3VFykuKGtc3go4qnetkx+mUcaxqYPVsTxmF2Z 0JKVAhnSiWWq2dNkLROUxLIvUAJnvj/oIJUDq+2ODlflOFYYxbp6HAzKFOxc54BLWUA3 HU0vZS1l3Y1WgRqaRBsFrWlYr30EStf3xFz1xiNraaH3qhM5VEZaWvnXmFVakAh8exui Z0XMzlv+DCcOW4A9+lyDMHpuedZC3y5BPnk4SNU12w52WuquAfE7LP/0I8plkCqzOTI8 kEezx+SKu2yu1VjUFvSw4CMwMB3AOSSTNureLFGjWizLmPAPoYO9LTylePy2Jt9NNR93 zsSw== 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=5ikNoVs9W43MQHNtBQQlhNjgAh1VrOkQ69KYUdVCDpg=; b=bQwbdE8vNJJUCZg2NqGCcv1zRqPOoE7y8roagNiXF0+tY/b+sjdCNBXv93Gin7VmQo ubAiBzszD3EGpp73R8+L6lhQRf7SZz56Pv5FHdc1b71riW8ZsR2MvG1wbtwZQ8z/eR5y AGbjpCkX7/SIXv0y0mr71da0hTUpdL/LOoNJQfMGR+L8eY2QSpWxbob7M0wD1K0j4Eo1 oiKA8aUDTZyKu2TqSt8RuPXrDxQk8e4QfyvcuiYczmiLp2vpSyt36FXgEzycEAfHlbxs q2YfG7OjcvgrtKGKebyStshnIZyUMCUbMKYfnO/uFmNE/YJANA43gYK4PBnrtTy+irbB qtDA== X-Gm-Message-State: AOAM532mmkwhnDD5MQSHNe2S4XXsMCsN97+zkNpR4qbvCW+OsqaVJLXV yDUNsVCXKF51FB/VdS+08jpyRXERWVw//g== X-Received: by 2002:a37:9e8a:: with SMTP id h132mr10497691qke.48.1590079476494; Thu, 21 May 2020 09:44:36 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.44.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:44:35 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 61/74] cpu: convert to interrupt_request Date: Thu, 21 May 2020 12:39:58 -0400 Message-Id: <20200521164011.638-62-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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: richard.henderson@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, peter.puhov@linaro.org 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 be9efbeaf4..ee20f8e0ad 100644 --- a/hw/core/cpu.c +++ b/hw/core/cpu.c @@ -271,7 +271,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; @@ -411,7 +411,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 Thu May 21 16:39: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: 187075 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1739040ilb; Thu, 21 May 2020 10:19:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzc/VZKn3Lm4siy4onnU/B6sY/BKMXXNbLTET0MsR2T9qsthbEQnGFCimrKMQ7wup7M9cry X-Received: by 2002:a37:797:: with SMTP id 145mr7997041qkh.8.1590081547193; Thu, 21 May 2020 10:19:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590081547; cv=none; d=google.com; s=arc-20160816; b=GU0CXstP8QEZhzVK8+VzuwgZ/WJLTz/mAm96tPz3TZRPuz8OjmqHfJdpRK8q9f4WX0 lRd9o8EVZ8pqOm1vz6NTSiNUuLxY40QdTii1dta6BW4p28g+P0Qe1T7XTrF/bSyhSiJT ih4CNeEbQ/GQkPHWpCu7Ha8lZRFzZTFTaxHMfewsPrvsG35Y2SRfXU0TET9pBVp210tr DekCEdBurSM9iijmraTCFeatDCO8wRJS4C8+CUTRLhUQRd70igS9OrPIJRWSXvcYhjkS 9Ze0mP+uSLS9HgWACCI+3tVT2ArBxcJH92f4JwuPhrer64h5s+rBwGVA6Q3niFTWEZIH z6Jg== 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=DROR1j7T4nvT3Kb9/UW2YDjxvm1xSx4iyEWd3x/xCYw=; b=iT4QElbxhxPoQu8XNnjeJYR4c8a5Fhszjfb8oLGQ2UxqeRg5487Zhw/zhXYxL8p+y2 qx4gzrZsXkqZhbY8G2djD85c4UyaNOJ9pAmlaVVnr2G5J8PYZTzeCf9D55OLb/q7PRS5 ZIYxMVonCBWWxeb9kgLdMzCYH4FD/6xmTWMf/Xda1f/EAEKMrXfXLTWA9GZ5FqMc3c/4 CKjlaIH2AoLt8HF1zR0tvOmBhX9a7kkwl7KJt3tPlhkSqg1CjB7+OAk/FS3WYj2la6Ux k396hHb6LnXi6YwxVEgsxuyCgSdm/htPiHcqx3TRkkv/am6GQzpCGSRSYCLFYd9KA6LR dt5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Jsk7EHgC; 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 i3si3670044qvx.22.2020.05.21.10.19.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 10:19: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=Jsk7EHgC; 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]:40568 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jboqY-00012H-Nl for patch@linaro.org; Thu, 21 May 2020 13:19:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50174) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboJD-0004Su-Px for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:39 -0400 Received: from mail-qk1-x741.google.com ([2607:f8b0:4864:20::741]:34330) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboJC-0006j4-R6 for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:39 -0400 Received: by mail-qk1-x741.google.com with SMTP id 190so7917992qki.1 for ; Thu, 21 May 2020 09:44: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=DROR1j7T4nvT3Kb9/UW2YDjxvm1xSx4iyEWd3x/xCYw=; b=Jsk7EHgCy0F5z0OqfBb9qvVNN1MWfkVXUS5hylU8y/EYU03wvdaRFqRXrbzaapZeq1 kW++2lZfsFYNJ0h2NR0XFTWVobJS3D01QoIsvIDMydnamlic1uhsCZpOEEPa6nSa3Dn3 9zjBSi1O9hOg422U4dl9OYNbZ28soZWNWdtSzgVLvIUZiHKhZgdCt/9cGXert1KBqj0S e8qmVFkOyFoe8RpdrlePkU2jq6GA1YeMy8FZ3/3R19xJy6Tw399OpkVLuwH5Uqv+f11Q PPN/Zgj7OOpGvnokyqjIPfk7UCddI3jA+OSqco6pwAgJP89wOME7jqZ2j2ue998aJtBQ v5Sw== 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=DROR1j7T4nvT3Kb9/UW2YDjxvm1xSx4iyEWd3x/xCYw=; b=XMWHSxuhV7Wfi3yv+90RbgMcBaD/4MqqAMYPIe1yyRWEjPVtztWuyeH/YKuyinKgCn 3uotd1nM5nWsVo69zBd6ewXUAKbzTiYM1f51HsDnSis6h6MnTxJRq7+GzBqdx/QGgpI7 hy+s5NPMGtTAEjDs/n2Y6mS7pPIJ+AZWHuym3xnfpAVUdHABMR+WOmbC3J8uo/uOQB6l KSIB+p4J4fkUDjKvyN6NoI6bFDDJ8+JnL8vUwIb1veVF16qGgm1h3+Pw9X+PH/pwvsQR GEu3cPpMpJ+mQHWyrzHEuVxcr6lPWv+ZZhhFeGbkNi1yzINKi4GLm2a0uh97ioAb0Bal znOQ== X-Gm-Message-State: AOAM531UaonHtgDZ4RpQza/0Wb4RwDtoZFb5s7PwizyRZME+gLyNLuf/ hfwrIpI5cRsWg6sOx0+UzCtafF0ZFxdadA== X-Received: by 2002:a05:620a:14ac:: with SMTP id x12mr10392691qkj.262.1590079477697; Thu, 21 May 2020 09:44:37 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.44.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:44:37 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 62/74] cpu: call .cpu_has_work with the CPU lock held Date: Thu, 21 May 2020 12:39:59 -0400 Message-Id: <20200521164011.638-63-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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: richard.henderson@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, peter.puhov@linaro.org 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 6ed806db60..7bf7700630 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. @@ -799,9 +800,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 Thu May 21 16:40:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 187074 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1738419ilb; Thu, 21 May 2020 10:18:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKYcz1/seDROIcJ0yvZmQYepcHFWyFE03wqkBdNALiIqCRdePmp3ExT6XfqvOelxrCIB/E X-Received: by 2002:a25:8b04:: with SMTP id i4mr16439452ybl.399.1590081493959; Thu, 21 May 2020 10:18:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590081493; cv=none; d=google.com; s=arc-20160816; b=s8fwX9AC4sZ8raIvL/F0/1/kk0f8Rrwb1ElMCwkgI69QUdLPW3Spl1GzbEPVNns3R3 wScGQbIsvEaf/DulQF0NEVwnjhnhSjrzDiO5ijJfFEJfArDxOopzee63aYAipYZCSx2f +XvFjYp39VJuvVeH22sYrPdrN/d2jL57mU6LgC4gMd5MGTStn86QunKeAfbCKPVH1Doc YiuE4kVjpC2zljSmssXwnMZ+RbvlRkTB2dqek/WlpNy3CTczpwRM7c7DmjGQdTVOXsxS aPV6w+6zj5xL/hWWh+bSyxFZSQLOmRb8WFc3/PHEEJQPdpI9kDvQcvScUi+49gxdDCuM mPSg== 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=f6jTs4l1FUMMcryMnS/4lJD5Ni20LOW4nBzyszoy3L4=; b=NFnnDL/KqrFVpdYefW5CP0nAR3A0C7mzrMPWpsOI3y4Pn1ps38gdmy3yS5WojDIdzB yTIDXDS77HkhhOD6UdxVU4w3dtuYO7CJnhqQpAu0hNNOQOIH44oK7/pT/tAFOWPu47rO fNQsWJJZwyRm7JIl5F/H675ayfCbmsPDTTuqlh27iMJtQga8FLpqLc61BZQyL5gIvfEw 8q6jiT7utvvkYo2KVi+NbnXJR9/CQPR5UoT7aIau4FQDgWvGsELq1YJYmJOZ8i8OAU5x MlHZfuLvpiI4GdDBN2Vwx6MkLVu3f7roTSFRzW3I+MBOFeuCcOhuK3z1YCKkmqWuLSqv c1ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=U+GT93lC; 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 w3si2335304ybg.154.2020.05.21.10.18.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 10:18:13 -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=U+GT93lC; 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]:33518 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jboph-00067Z-B3 for patch@linaro.org; Thu, 21 May 2020 13:18:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50192) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboJG-0004Vu-9A for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:42 -0400 Received: from mail-qk1-x741.google.com ([2607:f8b0:4864:20::741]:34331) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboJF-0006ke-98 for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:41 -0400 Received: by mail-qk1-x741.google.com with SMTP id 190so7918081qki.1 for ; Thu, 21 May 2020 09:44: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=f6jTs4l1FUMMcryMnS/4lJD5Ni20LOW4nBzyszoy3L4=; b=U+GT93lCYq8RuQBsNpW0FvQNeYBg/ZDm0UBcKUlTv6NGzMx5QowNjosWOW4Hh6fFBR o5qDdlykIEaKgxcHDCZrh0HJ16sSegni6A1tRjV5ajlB8OSq/P9VYMlC97qb/fqIg3of S0nXOoxsvgybjD9x4aHyL8bpD+6ECZ+AiciwPI+wF3l4jMmaNOVjkZIKKXOMOCvo7pMC wD/EOQIucPF0VtHzaL9kiB1ZcSUCpn5DVo/M0XlXjCjoUXRSOay/HD30DSnsGFQmSGkv UsihxjAu/dVejODKWx423p61s7tP4sKGJCz6oVCbzwZ3QkmTiXLwaMlKsr/dPAdTR3lu uBwQ== 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=f6jTs4l1FUMMcryMnS/4lJD5Ni20LOW4nBzyszoy3L4=; b=WBvvlwrGDB1Gx8EyMZzJkjDUmReYOXutqoCGeTSsUhU+HeOqsiPh5/rapK/2dnY+Si YQebIMUPPhF+7cqAUj3S8A5xmQ7oLWQUKnHqZoCZHHNp2rGtsiLZOMmgMSLBfndV9IAG /F+Z7kJPnuLgy1MWxPD00nx4O3KYYrWaVijlW8POLuYyy57tTBXPDHqkqjqnVWH9mFxn VXp/Etoerx9pRbgZ0g3dRKWtp7MvvwPegym5QpTg6J4SnFNPQG2aLkDgd7SmEdil37r/ C7Y+WwLQprlW5wFlMS6hyncVC1cKLeYMYZuGmTTomvuQmk8VUJGA+tENA2aWS2sHxnM6 puOA== X-Gm-Message-State: AOAM533NlcToEzmcSqsNOJ8dnl3GbfsBQOTbkUa3CzsMmiGKgQREb5fb +Npf5Ss+qhi8NOOKorv4oPR2EOs5d4J/NQ== X-Received: by 2002:a05:620a:a83:: with SMTP id v3mr10997896qkg.84.1590079478970; Thu, 21 May 2020 09:44:38 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.44.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:44:38 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 63/74] cpu: introduce cpu_has_work_with_iothread_lock Date: Thu, 21 May 2020 12:40:00 -0400 Message-Id: <20200521164011.638-64-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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: richard.henderson@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, peter.puhov@linaro.org 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 7bf7700630..9766477e62 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, @@ -800,14 +804,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 Thu May 21 16:40: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: 187055 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1729871ilb; Thu, 21 May 2020 10:07:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyEFUppaXDNTsqXRtR/MC96XD5RLQeKJcwx9k7nt6opj8oByEjqA+6fGa1jMx5DD2OROTGi X-Received: by 2002:a25:b90a:: with SMTP id x10mr16768580ybj.355.1590080835162; Thu, 21 May 2020 10:07:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590080835; cv=none; d=google.com; s=arc-20160816; b=Fc/kgu+jEGefzHvgGupmR21EwXuM1Ok1Hnuqa8hCuohtl0Cta5lhdFVwfWQCToAJSq g37yXYMj6ARQqtqG08WBaRHJ63aJ5gg0+2Vg99htjqqyeqo7+KH+yebRSZrk5pRHianw nV0/x4Sha6Yq3EvkIzpqFBgozH/N3083c6Z4z6u+qGb0x2jMzuVgJvxwf6NlD6Q5YWSf UVi1HO7glULLhBFCf/GahKqMg42vt3A2iIMckiC7rRqAb+CAdG6tViwwjskEMRw5tTRE fY7J1MHannX02oCHVyAQ+28ZdIr/nMKssIZFuUXMpC/Ez1EUcIQzi9Gi53x0YjWoEI4O 1O8g== 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=VF7BD2whUFR8MWRbhBIqKLqcFA5T5WPcm/utxP5IxZE=; b=bZKKd7Ygn/xaUPEBz+OxdyCM3lkNLjsNBi4Jf6r9EkAGCHfMIZ/ieLapQf+ycE+zBZ YPcLJRXmQTxn4qFV0F79DZ16uWl4MzIf0GzelA1hRzaVhxsR5fKVVVwvyuBn71egcx9t aHD6nfX3HOPxVD2jJ889vKVLc1eM5BTH6/czd6gsqCBoPIxolRJ1IRWUcKMcsLWLZQfv GPudmQrl8P4pGoFWO/FXV/9aC8iduoKIiMDwExXsQHt8q2kKYQ1QKMuzU52ajfUYr2/+ cqTQesHj4S6B5hsI/1IPlsc1SNuWI0UMW4h32ZGzXyjT9pMJ4SeyCyYec6My5+lpuJSi hEHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=cKtTSVcT; 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 i19si5292591ybt.400.2020.05.21.10.07.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 10:07: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=cKtTSVcT; 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]:40676 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbof4-00006U-IV for patch@linaro.org; Thu, 21 May 2020 13:07:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50198) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboJH-0004YG-3G for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:43 -0400 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]:43435) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboJF-0006l6-CD for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:42 -0400 Received: by mail-qk1-x742.google.com with SMTP id i14so7816886qka.10 for ; Thu, 21 May 2020 09:44: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; bh=VF7BD2whUFR8MWRbhBIqKLqcFA5T5WPcm/utxP5IxZE=; b=cKtTSVcTuHFg4AgrSgyFw+NjxSSeQxb4iUmg9alZt9c42owUxVIqYidjp6XfGiUdI5 h3/wEWpa8mFUoJrbDC2e2VK/E3vorawcAGDLnhCtANxr7OptRUtvGnXfYVRww7+OBHrU ycSufMA28vVlidWfKqP9PEfKp+WYuLf2n+H0w5DpQgzblvfy0fmm9jL2/EUB9kqo22ww vlb/Vuw4V1lXgkyDTv2IIHyNPlrF/0hnJCqk2RTpyIduaUJFN85b0eVaaVmDlLUuWAbn 8vDgWEDpF2Ol65IXhFbkLlwNj9MQISmqyvEENh3pP+8HhLUzU0IQPPN9X2wnhwDl+zYZ ZlLw== 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=VF7BD2whUFR8MWRbhBIqKLqcFA5T5WPcm/utxP5IxZE=; b=ad0QZ9HzFC5XUUS+NQd5DYwWkvGvkI/ERtYEdKBZJrgFr4esX35TXsMSWPHcDGzX/V KEIEGSJK3l+lhQnC5ywgBCKpiDRVRU1wp7EYxlYDccuuma/tE7c5ktX/Xqr4Cpd3hxAT LJAB2DvkdVSXyY3aEo+HkEkONyFwNtGh1kB3A5xfU9E+gCIh9/MruYnfoF+7Q2ZWwIap CxIDreav/Epqt+bVeBUC3WKWtDPKy9C7lp6jmizewZyHOnlxcRLCvxNEcyssfgp5MF7+ 9VAoyh/ovjNwWAkCbUEtkLqz/LbbRb+ETe9JAnWEQyO7H+zA9dsftbsJwKChDvfjjkwH SPwA== X-Gm-Message-State: AOAM533BuwWlS507EfihURL1hves0qwfXtKlfIrlwWIW5pBXPOGg0N/M b+ImxX6ymfYDOco/zHf5jGgULal4tp/0yA== X-Received: by 2002:a37:8d85:: with SMTP id p127mr9864351qkd.35.1590079480259; Thu, 21 May 2020 09:44:40 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.44.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:44:39 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 64/74] ppc: convert to cpu_has_work_with_iothread_lock Date: Thu, 21 May 2020 12:40:01 -0400 Message-Id: <20200521164011.638-65-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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, richard.henderson@linaro.org, cota@braap.org, qemu-ppc@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" 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 e61ba39982..0aeddf3eef 100644 --- a/target/ppc/translate_init.inc.c +++ b/target/ppc/translate_init.inc.c @@ -8539,6 +8539,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; @@ -8581,7 +8583,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 | @@ -8701,6 +8703,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; @@ -8751,7 +8755,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 | @@ -8901,6 +8905,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]; @@ -8968,7 +8974,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 | @@ -9117,6 +9123,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]; @@ -9185,7 +9192,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 | @@ -10655,6 +10662,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); } @@ -10879,7 +10888,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 Thu May 21 16:40: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: 187059 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1731056ilb; Thu, 21 May 2020 10:08:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMVbHdac1rY7qHuIsVgNVtIiwDyqbdx5CIjIsICayqppWwJg0sAyOiDOKPo1AQA4qsyWbz X-Received: by 2002:a25:2442:: with SMTP id k63mr4541162ybk.319.1590080921805; Thu, 21 May 2020 10:08:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590080921; cv=none; d=google.com; s=arc-20160816; b=OfKKjLHnWvq/VIdiajWo0eqUKSGzlVQylJWB+cSGHT5EothmkvD+aJ4Yv0qlN98AFl RKftz8uFpynLPLYqkcV7J/Qr/JZbcqHiR4lV5NYVYAtCjCVpp/H+T8iOABLmfoVwu3WM AiFISPaAXdIbKA2fqd/Djyuvs8SxkWaOmWPJRnu5jPOvC/TShVCiBm/H2EeUA/BiZC0N tp1oOMcgyfHY01JC1sS8Q/QPF/LDVTzqfHMpdX8O0ZCsw0aXjrp4wNICzejg+//v278y AlgA86ATDsLP0RmzmO/d5wZEOoW/rTP54pPb+QP0dNIn2JTLT0J5V60i6A6yI+BaF7Pb mxkw== 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=JmbCQFDsrvBNHJypgsW2I/4X/kswj1hPk7uGCkcJTNUXP3DdJNTVOq3rItfzxIw850 Ju6CvsbzfPRTHSI2ETrbYHKbakzj5LLcYbzWc86f4CLBn3jOMfxnC5k0b8iCYgHJqxFU 3NcDdoeTGi/Gz0H/zXWAyC0Zej1rodPDCCHEgB2lU8uXJrL9drZ3pGl2suGxCkNu3uN1 1aLWHmotaSuDUhmKitduuEmWP+pYQiYl2HPVCSZTHoThyoh7rBoAfZyHp+C0QtLK3o1H yNzXlkBm0zdl7XzhAT6Mf5WQxGCQjNX3tEwLeVpK235W+C6YqYqEqadpGpLPToeQn71s sAqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=w6ewQJaV; 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 r8si4893091ybs.10.2020.05.21.10.08.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 10:08:41 -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=w6ewQJaV; 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]:49154 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbogT-0004DG-Ar for patch@linaro.org; Thu, 21 May 2020 13:08:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50202) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboJH-0004ab-SH for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:43 -0400 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]:33301) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboJG-0006n2-Ms for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:43 -0400 Received: by mail-qk1-x743.google.com with SMTP id z80so7921281qka.0 for ; Thu, 21 May 2020 09:44: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=Gn2vKDOISxQzKy44RYpzzeOAg/5NGEBTOA6wtcYZvN4=; b=w6ewQJaVNHlfqxUwmcl94B40fhD4pjmyTDUwV9aACZqsZay3ux3wsq6a9AedtIdZ4O 9TBgFrhwzNqBYP8y1lISG4kf3zfd6vpiBY11hAFTCoTPzeCEVCDriJ7s2PnBKZszu1Gz PFOKQi8J4XEkujUsy4qrCyJbW/Qachj+BP4hUAD3Rx0KOghPOIVK6hcPjW7ag9+FKIW7 y7reI1ZjXcm3+QnH3IpHMc+YdbWNN2+v/TIbR1vVP/JwLe7SL4qvvrDjAoGUwQ2clk7Z pVnDGNF+Wwwlji3Z+xE1CpSPz9N3b98mgXi0YqUCl47NyHLOqMN2jpxK8CflPflZ1xoz UT7g== 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=JDCrlwHu6nngK9OgD/CeifUm+MPmPzxShbf2BwOzgY567Bzu8g1miikzTuUzOR4C6I RkX29sP36m8tnwjFi3s/2IrzF5ytVblBkqLytQTot4lmtOVS2VS9hwCnxmvgj4F+JLal ulcuNy4MBJ4Cdb6ClLAFNvcs6YSDAu9asVR/FK1hqiwq/nwltwZHaYOw/jOWw+RqLv1R YbyNW6vmJDleGLsbG1S8SZfOCxy/mCf19sdwQQKLNW8xxk1kbrDmYwPY1fxwr0oQt2Wz P9A/ilvk9NQXDyMQR0Gj4LeZXryFRZNzQi/2x2/bxIQWJ06Lf7vvJfI3tEVOyQ4eRazJ QOrA== X-Gm-Message-State: AOAM533HSRgAEbf2f2U54h2vJrynjmYavU68v2ZEVQcIDCWIeMXQmc7E nXEkOfXHb6LQFri7CsuVdzHQsAPcNfoa3g== X-Received: by 2002:a37:a42:: with SMTP id 63mr11126690qkk.399.1590079481587; Thu, 21 May 2020 09:44:41 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.44.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:44:40 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 65/74] mips: convert to cpu_has_work_with_iothread_lock Date: Thu, 21 May 2020 12:40:02 -0400 Message-Id: <20200521164011.638-66-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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, richard.henderson@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 Thu May 21 16:40:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 187077 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1740462ilb; Thu, 21 May 2020 10:20:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx33AdtD2VmWlKUJR3uE7IW5LY5eXaNbDBJbF/FT0igNT2yuggwZQdVsBsgtBNdKeR42Tp0 X-Received: by 2002:a25:8092:: with SMTP id n18mr16454487ybk.99.1590081647968; Thu, 21 May 2020 10:20:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590081647; cv=none; d=google.com; s=arc-20160816; b=beaYAehCoa29wC9NXfKR/qSpJIWZEsrOwPgGGxQoUDcF+tdikSIba7hpk0XKzgZMtz 4+pdgINGrBGBOfDyl4DRX611q8yYbNnhlQrQonWf9wMOLotys5Kc4zTP7PqOr3yzEsKf A5V0YOpGe5ZNuLWBqDpDWLkdITFM31iUqZ8Y+iITglrPH44i0U/O0oq1UfkSRtATQygn rZLYNvXwpx3sq5nWMBi9Qn1EPL+n4XnWGHU9aiqh/nN4vRcRi/3zvnUMPMZKFOQesftw ZJR47u32rxBWBQKlaLMrXppsYPmV1L/OrcGhUII/Z+HeTsUQe8MowWmyRa++ayLeegM2 uC2A== 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=JFBVbjLhWvz//NfxtqcWhFsd9jqQkkiik7lq07yLP/0=; b=NE9soSZ+jEhh5HcDM2RV8oyMVgDudNgeyaUeyncvVHnrS16m6ceW5gB3880bZetFNA fQeRuY6RFph3m8M0L8GernYjyYDOaaxQtdeOwSjVv1N/1xy3xb5b/+JPR2u6PxNeUb9w l4cDIGWS/rXwX5uG68MxHIYf5cQPfbFueWRzUbD/rr4ZGT9HIGc5IAob5hC2hOItaSBH 8CBtLfy/CAvvqs3uTFj4Hre3QFsugi3arbrmQ/atAzvC0huMravCv14GsbyL++YjSaTA vnSPGkj0ogmhlJM7hyyu5SMYUklO4/yCkHKr+DEq1U5lyP7uGuyjieIk8Hr6OVMEPfcw JK9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=FTMsvZlO; 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 6si5121311ybz.343.2020.05.21.10.20.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 10:20: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=FTMsvZlO; 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]:49290 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbosA-000546-Ai for patch@linaro.org; Thu, 21 May 2020 13:20:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50220) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboJJ-0004eF-5b for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:45 -0400 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]:34595) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboJI-0006pe-AF for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:44 -0400 Received: by mail-qt1-x844.google.com with SMTP id a23so6026633qto.1 for ; Thu, 21 May 2020 09:44: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; bh=JFBVbjLhWvz//NfxtqcWhFsd9jqQkkiik7lq07yLP/0=; b=FTMsvZlOso8oYjZX/jmcx9fwfOIyj7GdWbF+mpCOnbWKcNISDe51SA/G+Sd61s5Rnh TvQ1rDtZsDu2dJIOjrM/lO9l4o+pyLWX/yLm7e1A2iJveDcBi0lbflWV+NMLLjRrQ0kh S1nB2vn0P/goDYLLn7jSp7Uq0ZpwaT1YY9KJSSzVEedjixm8hmGmZ5xn1rYxYi34/pgM UOQn0kWKPsi5+cyszesRgHLvrwMjMhoMhbHKP0agP4Os1Rdy91OvXo5F8H61n48dFV0U YrQxXG0QdhR6ZCCC3eVRMZb7pIlVRlLs3ypdfrP4jvUPInluw3hu6DkZ/9ZxDGxkz3+v gBcQ== 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=JFBVbjLhWvz//NfxtqcWhFsd9jqQkkiik7lq07yLP/0=; b=kteZZKuNSMWkYt9QF6DBocro41dG6mOTIsfbuLXj2p5E+mYT+t9V+KMBA5RKOfJnLZ 0ffLjz4oah5pFpksoQUKAvnvrPZVJEfegL19ZPKnWbjGJl+CZtgqBObdODKn/eVuzgDb ZYmV0HDD6iXgVXtAysp2/He+dDwP8GdtTFF+5E9fX2ExF6tK8ZXJRLLcVM6d67isJca7 W3DpS3uCy6DCf76a/YiecjWPL4m4wGY0cmVqWqcFJCETPwZ2i4bhshmguObT/2OLwRzQ JKOET8s9usREeVIbbqRYu9wDQXDa6k2s1EuzKig7LyPSTef5tC3Gp0VkE8TtcCccuVhh I+0w== X-Gm-Message-State: AOAM531fWwDNz2alCxo9tl3uklzCxCV/uJF2j2GMC8fZJCFNJJJLfWBJ VoaSOlGfBUD+OU6Pr9ryRDYzaIvYpvPRDg== X-Received: by 2002:ac8:3f5d:: with SMTP id w29mr11407970qtk.192.1590079483088; Thu, 21 May 2020 09:44:43 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.44.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:44:42 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 66/74] s390x: convert to cpu_has_work_with_iothread_lock Date: Thu, 21 May 2020 12:40:03 -0400 Message-Id: <20200521164011.638-67-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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, David Hildenbrand , richard.henderson@linaro.org, qemu-s390x@nongnu.org, 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" 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 490644e12b..e9a014bd02 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) { @@ -491,7 +493,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 Thu May 21 16:40:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 187076 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1739519ilb; Thu, 21 May 2020 10:19:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3xbUaCSh/wzqmN/j4+hA6vgdL9YncCgsLrBGMZa21IeyKlPR+kFWqM9Vd6tYY88ER6sZE X-Received: by 2002:a25:ce01:: with SMTP id x1mr5312279ybe.241.1590081581593; Thu, 21 May 2020 10:19:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590081581; cv=none; d=google.com; s=arc-20160816; b=iCIRBFKrRRAPacbVi3M22Fq/mRFhg8DTWeY8ZNfYmMTf0XEfLot4g2/MrnX2LhxOPo iGxcgQYsDY4Xh6ejnqvvraenKYBVxKes59/DzLJhk3d+OjwVbgOrFhcbIdxR1MJpngo6 OHltFai2lyC5O6Z4W2lIqf+RF9902ooEHO9wy+oF8qgSyg+JKTR+uJ7ITcjRm8Uevxyo 01U8naS3OiCDrmX0vp4sfUBSVOjd7v93MZYJjah+dG2OjwHN61ZPhpFk8qfy5r8bgp5s 9Bd9upahUz1CuHjWAr6+qwaDL9fYKuvYJUZfWQRKBCYFx+IF7LmpL9AGW7c+WSjWcX9T HAEg== 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=6TzpYxGK0GGtfS/yX1tAPOw7mokCgDn/OgQamWItqo8=; b=TNtgvgKGkiVr10pzrHsNPemM+XqhMOC/GAkjw0HNzp882r9yIvDD6Wl2DhI6MiatU7 /QXRpp8WB6nqS4vrfHJD07+ppsXhjLCG4xey/0WkLuB0BUFb+tbAU8w3vDzWANzErQMP SnlYzNfp3ndN/e9AeQXdOWPvJwdjCsqIUOPmpjzIrxqPfpZ492PRJeHobQQVfz8UL91U ruUh79leHpgywfqzSGAhAcVTAnzr2OCLkKquz5JOP5dwJK5cN0PoBs3riU3SzjP/6Yb0 lvJCu1cclRFWXmyosgj+CppBO30xS5KkjgicHh73sf0PPS1mpoGmzxf4WsjLcumhjKsc PFKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=OETcZUng; 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 m191si5543809ybm.346.2020.05.21.10.19.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 10:19:41 -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=OETcZUng; 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]:41896 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbor6-0001ae-Vn for patch@linaro.org; Thu, 21 May 2020 13:19:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50226) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboJK-0004iL-Is for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:46 -0400 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]:38358) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboJJ-0006ri-FR for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:46 -0400 Received: by mail-qt1-x843.google.com with SMTP id i68so6009353qtb.5 for ; Thu, 21 May 2020 09:44: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; bh=6TzpYxGK0GGtfS/yX1tAPOw7mokCgDn/OgQamWItqo8=; b=OETcZUngW8+ch1W5uE52zNiye3q1W86VbkyEv5+fZbPKIvyJ8FqVOOeZo6eM67GIa3 eUf4HSTMgUepe8mDcxX3dbJUgBKa09kkL6HRaYKXIY3yOdIu7KB02ecI8czeI62YHRPE oKQ8N4VxjagC99xTXzKcgulzWJmJkTPuxPT3r6o7kLOTz62sQ4VeiX5UTaNdhciNdY+1 4GcWSAU404xmKt8uCXIiU26rR9816/ZULVQamL5aihOYVKGZa+qzDmtKV91i8iR7f6uZ x4/RiSIJFqMxvMyllcrFu+dHqRKRnFTrum3UwYRf99Dg7rKOOX566s9/cqJM0lW6lw0g XC0A== 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=6TzpYxGK0GGtfS/yX1tAPOw7mokCgDn/OgQamWItqo8=; b=of/8UV8QSooBxpikm9mbIacL14BQ75BtmlfczKEWCb7MPuWpHTbWaVe4C9+fQTVGFJ bc1Mmg6S4/7Et+VgqBYn3cJSeSYUL5F9DZFd4PdO6xQEJQ4sZSofF6/Wx0IXIYt17tM3 wmXftrzenQitKqEy4FarZ5Z0RV18opXxZGiU65AkDL6i33++1uNbBMUZvItYTka4XMZh R2hzizWanBRF/S40BIst1h90Y3y/b4NMAb0Es4C0eXAtl2ecdkTqeU1OqKd/QWb5FS4I xp5az1ka+/s8RqGTaCM0vGM6bONeZ9MQI+kIPoDBpMhQ1/4+/TqAZzLLwM5m2J+ZFGi7 MMHQ== X-Gm-Message-State: AOAM532FSXqgXOdDd7H8q5f7f477m3Z5zyzgI/tQ9XZaJkt0XkLM18hZ Wy8yAagjZCABjqVumQuvKB+cAQKLX2xELQ== X-Received: by 2002:aed:3047:: with SMTP id 65mr7307271qte.277.1590079484343; Thu, 21 May 2020 09:44:44 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.44.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:44:43 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 67/74] riscv: convert to cpu_has_work_with_iothread_lock Date: Thu, 21 May 2020 12:40:04 -0400 Message-Id: <20200521164011.638-68-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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, Sagar Karandikar , Bastian Koppelmann , richard.henderson@linaro.org, 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" 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 059d71f2c7..87827f69cd 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -323,6 +323,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 @@ -524,7 +527,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 Thu May 21 16:40:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 187064 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1733146ilb; Thu, 21 May 2020 10:11:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxk9JWeCdhVl++TorGogBiBeiTKgX0d9noD+ufMnGkNXCO52dAvuJMMh7GbYL6kY80pPldU X-Received: by 2002:a25:af52:: with SMTP id c18mr15716466ybj.24.1590081080601; Thu, 21 May 2020 10:11:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590081080; cv=none; d=google.com; s=arc-20160816; b=KRrPRj3d1Sj7VBstCTvyh9pU8MfDjTo11MVsFI+oJqc7KrCH6mL1neBX1Ix7ywghi3 rBE+CD5C9mtsN1Quocqg/O1SKxqkYUe9m4gl3NwuqGxfzyiMkQCSh9a9LOVlv+1C2jdy agcWmSUWxqaokePR0lcDsyT9JXsz948+V0Htq9PsrYSnOqw4HHkwbFb4mv09u9MSPYDM nJBIpgFCXrjNPMedYpw/WWWgAZerZdPocgNbSxygCeAnQkdF8Vx8jJj5aCfy4Zp6wTTO afgrSZIkfwbQ/yKOmFz3Aik3/VrYQwhGXhwEH0VLEr9log4xqtjCTFrN4W65/ilDb/59 7J6Q== 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=vT8+jeEfPYnnXoMaxUNSUP9v9T/rplYoYAVMsYp4llHmqj7rN2vsMaidF+nDSVOkvN RiT/d5ambRwTey54SoUVNBBYHiNYc0X/7Wk6OkTVu6NIwTHSrdVsQNzLp29/SUYcnjAW NVvaNGSKi9sGwBFt2hMpJqgwVYLT1K47+wK+k7Ze1NmMGg+JwWIUvZfl+4NRCnCJGim9 P0dzWzoN5yed0uceIaqUAbmabfHH808ZsJJ9Pontd/IBbPorUW6xTqeIz6gWwTTDG/KS 3wjc6toLc53Cy2VSmj5cUjA52zu3LJVPwtJlEQz4Et8Utpzn7njG8CDdr+DYR0ifH1tX nLxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=WOlVPG7o; 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 w66si5442270ybc.388.2020.05.21.10.11.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 10:11: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=WOlVPG7o; 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]:57786 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jboj1-0008Ic-Vm for patch@linaro.org; Thu, 21 May 2020 13:11:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50236) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboJL-0004m4-R9 for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:47 -0400 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]:45697) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboJK-0006tD-PV for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:47 -0400 Received: by mail-qk1-x742.google.com with SMTP id i5so7791409qkl.12 for ; Thu, 21 May 2020 09:44: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; bh=xM5F5VKH4+4sC5/UG8rh4cawXyjUH8jNOSP42/FFGNs=; b=WOlVPG7otck/gVRhYO+Jc23elD7wfUNztElUGh7nG+igheI00J51UQJQnwIRTmqjde r2OUVB73e5ZfrGfinTwDfveRWcJYSCSCoZN330heJ9DkmVi766yaIN4l8bbsY3sPCjTA MZE1wRYzk+B9NLd7PmL1Ow+QnpgFTlPX5YnJEuz2wQMVuGX7uXw9dT2Lkk3+y5uK3ckN NEkIg55JonbPVUg7Xzaj7yrGU2VzMXBSbOWxmfKiq58HW6DfBfs09/DXG+6JAMZKNzvN sD66XKl6u9uVYSCM3Ic74b0h1cdpHZIHCpQB6sNC3uiNaiuQloCHOd7nQm67V2cNJSZo rHmg== 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=k+UW4guuhHqbjOjoLUGsUuycQXrqQ3EAm0uiCMVSzPDfuZ3PD+1RZPOcAstJe0Ppih gTli3o7qTu45BvaCLX39Er5yil11d/8gzhIgsy8OQOl+lORT8lebg6fm7H2Vu3Bjnc3u DZZGue1gF1I5qcgxFIUBiNDpDKizLN5vS91nXUH9KKtmuMmMqPuhLvXCA1144Sbjb6ex CmBYqARUHssmQkrEIMOUWY6sxVS/ozlCTNQZBlsWt5sw32R8OAqFq7TdrUW+cgAM249y phSzdq3s4/Cn7jVysswkjcpGJ6HdoWtR4LOEpSA+xKcJXoOclUgOGc6MEFthtnjCNJki /rkQ== X-Gm-Message-State: AOAM533KmkmXFDK3TctC18aKkwDR01kg+V5by0J7s+gowITT4jLkAPV0 NW2DPEc7W7tNGm7NCOadSz6g2S3rV1WNZg== X-Received: by 2002:a37:4e81:: with SMTP id c123mr10463609qkb.467.1590079485560; Thu, 21 May 2020 09:44:45 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.44.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:44:45 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 68/74] sparc: convert to cpu_has_work_with_iothread_lock Date: Thu, 21 May 2020 12:40:05 -0400 Message-Id: <20200521164011.638-69-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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, richard.henderson@linaro.org, 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 Thu May 21 16:40:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 187078 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1740485ilb; Thu, 21 May 2020 10:20:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFjzGZvMmRrlvRvTvmRh/R012pzNhTcZaWUoE4stJcw4YYi3d1C4Vw4fQWTvtrSEiCUh3J X-Received: by 2002:a25:9709:: with SMTP id d9mr16467867ybo.85.1590081648860; Thu, 21 May 2020 10:20:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590081648; cv=none; d=google.com; s=arc-20160816; b=knpNDg9Zw+fdkhPCWVddckfx3hRNkZsqP6CvS/KH1HuXik7fPbtIQmBgN7pNLjhLoi N4K67BY3T1RYRtLuaCyB0G8pOCk4o9KuBq1P1DZ6u0YJhzZw+/wIOASdZRoFL2vs1fNF +btUDF3fu02ic5AStb6uisx0LYjSCiJ+XUTQiVGPhoQyLC1gGtZGQsceAItdiUfu3nUT ae3Yptdp5iNsOX+3T7k82gpcQ9igN/i6RamO8W1NYH/Fd0Yusyjh60nslRQbSziYq9wT LAh+3fewu59KHKgQ7Wo3gJEYn2UZEPH7eMyPIn0KwkfJy3tl1+cwp/pWtmvubsGkwPHJ BT2g== 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=hXrShJR+Dgd/X8NGDH4LXgSiU1YJGB4lxp2i1T5Ndg8xhR0fo2xZWbGb1D6Wjbn6te DPtK3X1KgWsEdeh0m6MEnoGcqoCxPIB88ELxM1dmM0tdblvbSiOkQjzHqa17emjvBuwW syN5FHomC+o6a7jehzLf36lEOAU+KoFWs/eEyQphZI8M7E2pJImWtHzOBWHWX9uUP95v l4D1CzuT10pJbxSk/GGuOFgymmZnZ45IvcTmhdBKiS0QeS4t7HrT4+3IZ2vi8YAEkmkV Zu2Vp/etNe2Tjo/UISlttmL4eF7lv9LWOl6FGCIuJ33zSonFfBuL6SKMGw4XMVHT7E1X ZP8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ssOVXhEK; 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 a94si5792050ybi.171.2020.05.21.10.20.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 10:20: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=ssOVXhEK; 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]:49474 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbosC-0005C3-BA for patch@linaro.org; Thu, 21 May 2020 13:20:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50244) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboJN-0004pe-3n for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:49 -0400 Received: from mail-qk1-x731.google.com ([2607:f8b0:4864:20::731]:46885) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboJM-0006wx-5H for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:48 -0400 Received: by mail-qk1-x731.google.com with SMTP id f83so7783071qke.13 for ; Thu, 21 May 2020 09:44: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=FcchR0Kiy3cS07PsythDlOBOqbmqT9MEDX8/TYIcoYY=; b=ssOVXhEK6Z62VXfIfsH/COP+Fd77hFrjpA8KjOFhyLqtpHqSG3Oyh0sIOHsjrjPUSL nyjYyXPxfHs8Wo/8OP+sUkzB+j25EH09I7m4C+pGWfjuSaVl6NDVULdvZu31A0q1lPgE 44HIUcYV0ahm96G5y7TrfLwcOjOK3HrJjZoOuZWtqYuXtaVfnsUSBPr26kzJzeREt65C D/pCe+2bEuT7uZg1ecmRLZ6kuzKdiMwKpANF4Wm5ZxmliBx4Go69ALhBnSGfrt+LD5J1 /yzUsOnFotN9/mdgRdiecSHFFPtQCIV+oXh86YMXJf1hSs9odlX0c4V+MpUGB3FLupl3 9g2A== 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=O5Alz5hgoAkwdHfElxmgqpcO6xakJR/8w6S3PqYQYHfR5++CX9ukp4of1hhbTYfq0y ug536XbHYRJYFcrVzRq8CxGucVNXStUS8CLMBKhilMd1nNBAjKdG4w09W9LnqD8NE5Wu wik5gHX50fQyXzme0v5wD530BQUWy/teNiaG94TH6anQdjwIJILxfqNUs6yiPDqV3hBx 0clN0gYkw5qXDkOMJKrxEdKRWjL1Sp8FKU6c+WTNMbvW+X8AUtL3T7l7m7QqaNeCFzbQ 3yCl+xrO7r9Gq7z7JDakhys6fvjwB9wdtrq+/Kr+544cNoZ0iELdyH3H6HdDmN0T7bcu E7fA== X-Gm-Message-State: AOAM53122MVUxav4yPPJ/Pq8IAD62GMTdsCZPrn0VyBq6tlgnrMIRn29 cJO1NW5XaMeTkz2GxPnpqTbkzNc2SvCCrw== X-Received: by 2002:a37:46c9:: with SMTP id t192mr7541261qka.3.1590079486957; Thu, 21 May 2020 09:44:46 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.44.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:44:46 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 69/74] xtensa: convert to cpu_has_work_with_iothread_lock Date: Thu, 21 May 2020 12:40:06 -0400 Message-Id: <20200521164011.638-70-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-1-robert.foley@linaro.org> 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_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, richard.henderson@linaro.org, Max Filippov , 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" 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 Thu May 21 16:40:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 187067 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1733994ilb; Thu, 21 May 2020 10:12:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzi6joqPWdK5cF0GyrwTvzsYKL78w5mBxTyyj9vx6Y1ztR4hs6GbAAos7d/z+C7YLoUhInd X-Received: by 2002:a25:7a06:: with SMTP id v6mr17081011ybc.152.1590081138447; Thu, 21 May 2020 10:12:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590081138; cv=none; d=google.com; s=arc-20160816; b=bRgIzVUAG6dT8Xm8pr7n/AyRqS/5PhEO1Gi2Q/ILyJSpfzjTPFqtc7PJhZ3VxRZHGs DU+qqWZBZSERRcIDkIyUEdwjq9XGEIPmZurMBI/AWpUepEzSYUjLUV0GnJTDUPSB/ngp jPl8JJqTxLOhe61x7qVzeVkcba/EI+aWGHBxW6aQnyL2hdt50Qw+l/h0ThSliaN7NvWC wxa0Bdbt42IQQSF9sj50pqmId7Fz/6RGPdFiK9K0B7qV+4+TjYCLrRPVCC8eGBgQDrfE v/V5+fai3k6rDvdxsDRLCbojMDeR36zCblb6afMNZAlHhZbyT3V61ST535n0k2ZvWCVh +NfA== 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=wDuYpfs9QlEw4aXWAwthoPylqu8S5OXh9Q7CXYLnZi8=; b=psv7legq+0W+a4EUDCuvIGVbeYlj//KobYUqIOJEI2JKVORyqEC/emTop3DDK6OQUP 8QkAq+f4bRhyP3DKBqRZSA0lf65f7ixUhCrbF+2uSuqyAPwlDgAz0hr2Dg9AUDhBFpwm XroyssH+tyewLKGV46b3gr56YLoO7iM1yFCFOuUcS8JHfTtWnhhjpfPhxGKnyGwPxm/y fB0uWhvMgCF1AW1Z+Nvk3HIVj4UC3buRn7JBS4rZjNQBT27M6INIgvN1I+Qh/w/9qowH QcwMVY9MyQRhmKHi8Y1Gim22+Iy/8DywUZFdyfMBQmU3LUeQhNxJBM3RWynXqX6JPAtc GJ1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=CZjevvvF; 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 p132si5728957ybc.196.2020.05.21.10.12.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 10:12: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=CZjevvvF; 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]:38024 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbojx-0003h5-Tr for patch@linaro.org; Thu, 21 May 2020 13:12:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50250) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboJO-0004tf-Jc for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:50 -0400 Received: from mail-qt1-x842.google.com ([2607:f8b0:4864:20::842]:36688) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboJN-0006yJ-HY for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:50 -0400 Received: by mail-qt1-x842.google.com with SMTP id v4so6015583qte.3 for ; Thu, 21 May 2020 09:44:49 -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=wDuYpfs9QlEw4aXWAwthoPylqu8S5OXh9Q7CXYLnZi8=; b=CZjevvvF6bG4rCc0U5MLQJHndBYJxGCsV3rZ6cqVid5/gU7z5/OLRRXWDlHzJEYLKg MqGFVdFeTgG95hEhesAEUceMWkuoXakdW7it+cVZ5h69dHCvFwMaEQCPbg8A+5hKcNcG PlczMlUEeDA3YFl69KyA+c01SQjvMbmAqmEAuuP1JTv1CkCIoWySh1tT7TmCpzcSMX6O fkSzA7zgf284yCKefG6Rbg3scpsfGMtvtAKkyVXe/ImUy7A74ez1sljGsXCdO0VgXjpg 2makoZ+nIuJgc1D6ykPsxl33oXEG0s8hC33OOOi1A6I/Gtrj88YUtnh2EjaYIuwYH2oc uSHw== 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=wDuYpfs9QlEw4aXWAwthoPylqu8S5OXh9Q7CXYLnZi8=; b=CcXS9E6BAx2Evo+4qB17bEaCJVlXU0IJaLwi9AQloC5fp4/8ndGnh9R2nlx7h4D2Sd ZFbVzl9Z1TXONOSSqGBxFpzp4VnT8meKwVa0if0dDmfYAuwyYhPXOrdmi96zpxXQuNpB 7ucfPCkMLeo3GXhHWGV6DUUNezCO7hKaAF0hFmH5Ev24tAx6pbE1T+0rEq/cVTZOB5/F T5rQcAew7IHNWOJEsgFiUvXiUbYBKsgDKdp08br86PvKjGplqAmjY6KYtXL+UkBL8LW5 YIVD3EVREXoV8bokxX1sgFDjVaxtyhTvSAuejtzDSY9QCZko7HQaOWJImfBlv7MAlHm3 KDQQ== X-Gm-Message-State: AOAM531CW0KuKDOgvyMwtQ/aeJa1MjiZcj+QlLST70KXo1NovrPs2DTw Nqusu2qsNQtKzbU6OM7QOXytv8Bw7fpl8Q== X-Received: by 2002:ac8:393a:: with SMTP id s55mr11528006qtb.48.1590079488317; Thu, 21 May 2020 09:44:48 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.44.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:44:47 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 70/74] cpu: rename all_cpu_threads_idle to qemu_tcg_rr_all_cpu_threads_idle Date: Thu, 21 May 2020 12:40:07 -0400 Message-Id: <20200521164011.638-71-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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: richard.henderson@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, peter.puhov@linaro.org 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 ff67fa9f5f..bcba0552bf 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; @@ -641,7 +643,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; } @@ -1300,7 +1302,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); } @@ -1656,7 +1658,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 Thu May 21 16:40:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 187070 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1735522ilb; Thu, 21 May 2020 10:14:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyi61sQdS2myVy6v/qprIPPMS+KgleNd3Y/e4E0mKq//AmL+BX3eBaR9l6j6IWDxQE30ESQ X-Received: by 2002:a37:84c5:: with SMTP id g188mr10269579qkd.344.1590081260704; Thu, 21 May 2020 10:14:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590081260; cv=none; d=google.com; s=arc-20160816; b=otjWgYGwwUK7qGIIimCj4rGNkq4mwmtf37diJQHWdxVpgFtdHBRcDXjECCVMFMIakQ YNDGa6tYbWHo4E1rncdwDFI0+xm7SAHy9hpV4p1i9qGsxZCefGYtxN4VOhfF/y1BUq9g SNPHVQMMHdVrF3pWs7t1r+tJCldGPMyuCPOlSjkBI+rZa16/ta2hbyIcZV9LLrTn2vlO d0mkEJJ1Z3IomHj9J09yWRvCiCgVwD0lmskQ3PJF66Br1k6CVLn36C33BhZr0FxRMYCQ 6ai5UwLgG8nG27PX7gQysXer0gk94PqHFW2a+0OxhLxP5YtxKBy950EUxNGp+XUh/IKV 3/8w== 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=xi82Dss/1dzX4RRWOX+gmxTFQne7MTM9AwBHg22gc90=; b=mhWgUyubfBdIqm9Qc30b1mxjaqQ7M1Ri5B/9nhUibOZa5I5kmGOC0Hppd4PYnTQzkR ONzrXeS8R/3Gl+cBDzChsMzG5JWglAXRknzoMlJhAJkWnlZpyDinnM/Y+vQxGmC1Q8Rv 9FxgNbXzMtJqLu1dxP0hedjZ+8yIKwmjzv/jgUYna5i6b5ZrJ3Tq6scTq66FdZ4SE42k FBEWtNv0/td/puwN3Swnw6A2z91IHPki/Q2z5raB5T+K8rJnwoLPjGv0Wmf9rLed3i74 7qWxkffOOykqp7HXyfbhzkNdhGdGi+6dDpWn2x3EBRK2fBs/H6pC1A3AZTUlEDy6yevt NzFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=uew8HBlH; 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 q3si3478801qtj.382.2020.05.21.10.14.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 10:14: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=uew8HBlH; 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]:46866 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbolw-0007il-6a for patch@linaro.org; Thu, 21 May 2020 13:14:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50260) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboJR-00051r-Be for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:53 -0400 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]:45013) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboJP-0006zh-BC for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:53 -0400 Received: by mail-qk1-x742.google.com with SMTP id b6so7816050qkh.11 for ; Thu, 21 May 2020 09:44: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=xi82Dss/1dzX4RRWOX+gmxTFQne7MTM9AwBHg22gc90=; b=uew8HBlHDGKl7AHSLrM6zhF2B2VIbz40qRDe2F8phBk3GmkTTJCRJL9m79oi6yt1b1 8UXDL07aXRWPRUdhDQJTV99CpolE7sCPlZY6w4lHdgKMTS8a6q9iDCIdotFbq3No++kh oHGEEA3H1rhrnbSP04fG0aJkVvpJalEnVBgAGYoN4QAbhGnrDYvVi+rx0sClfAyyUzLc PntO5yUXKv0a2O5WOd4EIftxr5SgTqazxjlZfbYwijWrMECVqmZ53Z2hbSOSA4bVYgUg 6PZ4VZ/bXbDp0zY7PwdywTfM4+sz4Gfjgi3oBNxNm2yLUadiZD46hQXffXyt4ehWUWSO b8Wg== 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=xi82Dss/1dzX4RRWOX+gmxTFQne7MTM9AwBHg22gc90=; b=PLRlbeEUOVmSgpwZ/PYxQbw2ER7x6QV6zKeZ+o5xjJPitXXG7gx0bBZEV/JtmYwu5W G4c8+D0Z3iMf/2iFkmPms4GHLXYH9c2CF940b6xWFaD8cGCASSELaa8z7AoI50tUw8hn zXi6vNFyFXc0JL4OoJJgTh/UBh0qpkPrCC46ocZboShTKQDE64iRfsGkqlbDgMsYQ2FZ uQO3HGrZbnsh695QrhjDLdXYBxkqmYzJVYGWq/axu13qjqAFWuBm7EEhI2kpgkiv4ezk ACKJKeqceY8pXBQlISUc1qIitLpmy5SiTeu5Oo28IobaTyBViATnGTKyc3PjILX9z4Pv U81g== X-Gm-Message-State: AOAM532s3cMXcDo8wzWilRlVYsgUa3/YHLPnB93om/OLX7djp8iHJRYM ej1ogmo1l58OdHbUGgTFP7pqVWXnTJJLGw== X-Received: by 2002:a05:620a:14ac:: with SMTP id x12mr10393538qkj.262.1590079489618; Thu, 21 May 2020 09:44:49 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.44.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:44:48 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 71/74] cpu: protect CPU state with cpu->lock instead of the BQL Date: Thu, 21 May 2020 12:40:08 -0400 Message-Id: <20200521164011.638-72-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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: richard.henderson@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, peter.puhov@linaro.org 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. Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota [RF: Adjusted assert and changed to use timed_wait] Signed-off-by: Robert Foley --- cpus.c | 288 +++++++++++++++++++++++++++++++----------- hw/core/cpu.c | 29 +---- include/hw/core/cpu.h | 20 +-- 3 files changed, 232 insertions(+), 105 deletions(-) -- 2.17.1 diff --git a/cpus.c b/cpus.c index bcba0552bf..1dbb2fb3f9 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; } } @@ -730,6 +743,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; } @@ -1066,6 +1081,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); @@ -1078,6 +1094,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); } @@ -1179,6 +1196,8 @@ int vm_shutdown(void) static bool cpu_can_run(CPUState *cpu) { + g_assert(cpu_mutex_locked(cpu)); + if (cpu->stop) { return false; } @@ -1251,16 +1270,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); @@ -1278,39 +1290,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); } } @@ -1318,12 +1351,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); @@ -1346,6 +1382,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; @@ -1358,15 +1395,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); } @@ -1374,10 +1417,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; } @@ -1394,7 +1443,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; @@ -1405,11 +1454,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); @@ -1418,11 +1467,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 @@ -1462,6 +1511,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); @@ -1542,12 +1593,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); } } @@ -1568,25 +1622,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(); @@ -1613,7 +1687,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; @@ -1624,6 +1703,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); @@ -1631,11 +1711,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(); @@ -1645,11 +1728,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); @@ -1681,6 +1768,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(); @@ -1688,12 +1776,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); } @@ -1701,6 +1795,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; } @@ -1718,6 +1814,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(); @@ -1725,15 +1822,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); } @@ -1741,10 +1844,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; } @@ -1757,6 +1866,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; @@ -1766,29 +1876,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; } @@ -1816,14 +1938,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 */ @@ -1832,9 +1954,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); @@ -1850,9 +1972,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; @@ -1865,8 +1987,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; } @@ -1973,54 +2095,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); } @@ -2040,8 +2177,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); @@ -2225,9 +2365,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 ee20f8e0ad..2288de90f8 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 9766477e62..8478628fdb 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 Thu May 21 16:40: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: 187079 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1742013ilb; Thu, 21 May 2020 10:22:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyHDfcbmFpuLjYJZsyPSppCReiqzLXkgWqYHioT2jvs/M+0Tafh46gnI2eTyw2Gi1NV9maA X-Received: by 2002:a25:be41:: with SMTP id d1mr17573427ybm.462.1590081776115; Thu, 21 May 2020 10:22:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590081776; cv=none; d=google.com; s=arc-20160816; b=xsFQlggcYCF5GEttZJkac2LSaspfR3mQip6HpRmLbbYrLbya1aSFsHZtN3i5KXWAsd hyrtxwXZq9Tf0FOJ+kWP+H+7fMB4RZ3b7/sQdVaJxK+zIYdyMEjFzq5/2h8mDWroaaZ/ /FaQire0rVEXYfyn0n7E8uCYEJrKL/mjCSTIXL3HgwSGNb9oZXcu9izMqTNNKiDC8ppv eOGwfQXJOQRck02cWguMCeHfOqKHqkw3sh8MCasTgpWZnAIxshAsp055tHMqrtH9DUK7 j937oWXkQ+XB+fWrqKBlfuAdb3PcBiakGUQcO9lMsnYRoc9HByZrAMaRh2oq+wvcekbG ARkg== 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=PofzzyIN8ZoMX3VcbhKeSDmt2Z4USbgC222e6DzhLWQ=; b=qCR0G5UAMskDWNHPSY2el+E2EW+IxWcBM2nVM/oCCm+JUjbAotBGk9dIUDh8IH7H8e VRK43mjebYDcfTqw9omo+AxMwUhjVLJpUCpz8EGATDEcsGfhvfPIVYVQHt1dXiVZNX4Y J2jUjbXYB21DD8pRmL6fFLq62gPa5I9aMurjXDm4F2fb8O8nKCGhYWPPz1cuZ8p2op08 mNwEf+12tqaBgb3jaTtAp+/scYMvAZSBUUtFzH7A97ES85Kp8Q0OIkl/c9i7WYWEPUMX XBjDLoLRydYIA2yk7Hc9rTH1izag/YqWx3oHF3DLzfIzyLdE1pwBPsiQoxJvIrAZtxcM HbEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=D7TRfDNX; 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 y7si5457741ybs.53.2020.05.21.10.22.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 10:22:56 -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=D7TRfDNX; 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]:57230 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbouF-0000yA-J2 for patch@linaro.org; Thu, 21 May 2020 13:22:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50266) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboJS-00053q-4f for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:54 -0400 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]:36690) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboJQ-0006zm-99 for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:53 -0400 Received: by mail-qt1-x843.google.com with SMTP id v4so6015721qte.3 for ; Thu, 21 May 2020 09:44: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 :mime-version:content-transfer-encoding; bh=PofzzyIN8ZoMX3VcbhKeSDmt2Z4USbgC222e6DzhLWQ=; b=D7TRfDNXXyAbBnWHO/BW6jNN13ajx8i1EgERkdVyXr7GHH7kmYc0qcFfaEv5z90mzQ wuvWFcuTFMYe71jc8dK6Y2eoiVzeROO9SJ9UUrEn+f3GWXJtoDS2vX35PSfUxnt5pjqj mN+dngBfIAC/cBXTS6iZr4GQwqmbZtdKo4nCDSs0SFAXFIwu2016qImQ/07+1jtxPI8Z d3ADahoV8cHN5EuQ/AODEBRx1+bgj3hHTM7JXBwTn428UCS2ubzjGjZg1vUHrNnoCpkT iTwapSBkDSCLFB9eswwIDfEMcKt6soQndSmfdQSUjpSLNSZwFz1S4760QCUkkhgHpv2J fosA== 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=PofzzyIN8ZoMX3VcbhKeSDmt2Z4USbgC222e6DzhLWQ=; b=LzEeLx75ILLDLVcF/5JjIzNMJnmKM3udi1zMIwTcOi6vzaeyJrz2p9jOk0BTm5HZwA 2eKISy2cGBVAWlkgQiqoOm6W1UQCTryS7re9wiYuSIGfzIlOctNwrhhyNZ9nEHy7rlhI pSzsMPlmDLTXmutfEsBnu6f+WgPZMUkbBF/kG6A0lhbAi3GOgGP7wG0u75EOMjkLQI54 dArk9YyoKnwC8BGZY7/99eFra1QlPDsUVLRYeO57HK6qLRRFyjB0vsTbiPmcYtc2P9eH 9PV5OKpuBJnz3iVY4HswY5IOKCmn6uSDcVCaYJfB7cs/UG8HbuXaEKyRjhOkQroWqZz6 HRyQ== X-Gm-Message-State: AOAM531+4Prox6WkOvjhxFcgSYZmPn87ykTZDK9R5KWI7SK4yUtYa052 0WjMWYJA0fvXQz7xZIPw6NnVZMR2yj+mZQ== X-Received: by 2002:ac8:6c54:: with SMTP id z20mr11450617qtu.76.1590079491175; Thu, 21 May 2020 09:44:51 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.44.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:44:50 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 72/74] cpus-common: release BQL earlier in run_on_cpu Date: Thu, 21 May 2020 12:40:09 -0400 Message-Id: <20200521164011.638-73-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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: richard.henderson@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, peter.puhov@linaro.org 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 d418eb5aef..7ccc7df876 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 Thu May 21 16:40: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: 187080 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1742960ilb; Thu, 21 May 2020 10:24:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxkXGca1lvBThjMx2WtjWazLZRn6X6FK6G6iDj+yhdCXVZm+zArsb7U40y7/HKefrF6egtE X-Received: by 2002:a05:620a:22d0:: with SMTP id o16mr10448339qki.345.1590081853345; Thu, 21 May 2020 10:24:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590081853; cv=none; d=google.com; s=arc-20160816; b=KlbFTWLZoeebmX4uaubFLf6RxppIAg1FEDRhWQ37E1hJTh3scls5ksYOnTXFLOoimm apnda37YHZFS8SBw6sAsr43vsiU0Q2XpMgQV+VpXXGqhjjyPd8+WkpIR2Q8mWgpMpBU9 6nK8p9huOwPMppEhmYQlW+sgd2VdLnj+pqT/2CPgqfldccsREcAMwUY8hzYmdMbHgW3r +lI0wfzQem1uX6AGhwsLG/kqplysAJjnwKpESuyKc+9p5kZJzU8dnep74lVPiiSYDPma KZ4DEbfnQMLVF9NjhpD5ICXbqZLB/SycjS6+3HEBdQDb3L8E4GOTkBjGc3ajrYoHZq5i SFIQ== 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=GxlpAA+PZ/IrNPvmGjLlDG9tH8eZcMlAHM/CkfDCuY4=; b=FKS0DDLAWEPYmV8E1mM3EWunNNaL3nIgS462gjcJoc1n5HdwHK2/kd8rnW0u6ohbe8 kRN0SiS9EB5NBVHChv6OG/I5GC8WhnBmImzLMx3WwMQi3t1Szlv4aJzCeAIlyVYs1pIJ XzRIFBh7+8K1e/BkOZ9tCxBysqUMeWoe+6OTCCJwRbR/EZzLSWWmOhi1RWlB2SB0tBkl nmlwPtMrW/H6qRZVxFGH18BIyL5jptOx6omxM2BjAaNkG5kFGAld+f46qHVweG+IDt7K /ZBNc2wd2m33OZ1fdg3IgrVZqNVIcaCGlaNGjRbaVNsmlG6pFjUjCRuw9gdtTu4ky4cn fzFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="veO3K/vj"; 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 d29si4177553qtm.327.2020.05.21.10.24.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 10:24:13 -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="veO3K/vj"; 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]:37716 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbovU-0005Ys-Sk for patch@linaro.org; Thu, 21 May 2020 13:24:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50268) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboJS-000569-V8 for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:54 -0400 Received: from mail-qt1-x841.google.com ([2607:f8b0:4864:20::841]:39771) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboJR-0006zw-Ra for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:54 -0400 Received: by mail-qt1-x841.google.com with SMTP id l1so5989489qtp.6 for ; Thu, 21 May 2020 09:44: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=GxlpAA+PZ/IrNPvmGjLlDG9tH8eZcMlAHM/CkfDCuY4=; b=veO3K/vjcVpuQ+C+yQY2XAkmnfKBO7Fk/QZ6Uq7Ad74lHb6rjDuwWx3jbsLltck3Ef IuVf0lyi1gbyPazl0nzvdZFR0CAFpcRet/R1ApaXwdbTLb2bpwAStPS5/A7pAx+H6YeW 8KvyhX3H7cg5fO6ntD2B1rV3hf2ge+s6hXr+dhcEAojlBHDwsNtGlsrqvNM5foLRsLhL dmjV0jN701NWNAdQA8B9Ys1P0vio0BgTBYyFr5p0XSNi6b0RbScbN1ct+Gq1HSfjSAfU MYxcLwRMpegzOBs0kBOFbE9dLQ/dYAXjM12bfNK0fFAFxM4xngkSobQHZGyxRP+vniFy gaaA== 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=GxlpAA+PZ/IrNPvmGjLlDG9tH8eZcMlAHM/CkfDCuY4=; b=SNdGzfjV3CyPgu+cu6T5kOzHhj7k103pF7XsWdrmgd3fZWKu1mb9Qththmt4SEGLXj 4rCjwqE7t5BRdlHy4BQN2RBzTzat2Q9JXORD1I6VSuRAk+z0l+seem7jEMx2eNVqMNFd epOSLMhxMNVZNN+tmqkWc/Jn0rCzoEYJpYEN2hSpKC0vvPNran2ls96v9wvz0B6OwG+M kR/5jB7bWAqN6ssTkK4EsAs9Q8rwHW/9OiAKq9dUlY4JmJQRXybDPFIAmVyZIuuwuV8g Fet8c1tCgu9+hcBy0mfUkSlhrIPSuT2iie3ypay/pQ6tOhWpc+e8ounZa4LLasyY8pHR wiIw== X-Gm-Message-State: AOAM532QymB8PiqrWuz6KJNizrnUI4oUolaYxI0TxM8dtmpuTUGOqsIw vmuuxtbAaKokrs0sEGbQoABCLz0vEarIug== X-Received: by 2002:aed:35a1:: with SMTP id c30mr11738669qte.228.1590079492546; Thu, 21 May 2020 09:44:52 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.44.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:44:51 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 73/74] cpu: add async_run_on_cpu_no_bql Date: Thu, 21 May 2020 12:40:10 -0400 Message-Id: <20200521164011.638-74-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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: richard.henderson@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, peter.puhov@linaro.org 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 7ccc7df876..651f9b31cc 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 8478628fdb..b061618666 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -889,9 +889,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 Thu May 21 16:40: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: 187081 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1744169ilb; Thu, 21 May 2020 10:25:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3O2Z8gxxzdwalavrZ6WITwXyli2/3RlWIGM3CaZg4VFW3UAPtJ5rlxNGGKpttNkVuYXpH X-Received: by 2002:a25:348a:: with SMTP id b132mr5508275yba.491.1590081952857; Thu, 21 May 2020 10:25:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590081952; cv=none; d=google.com; s=arc-20160816; b=y/Xpz+LYksVThWcfqi5FWB4cbwUsYfGNcgctopmYzRAWPzFtXC0zsE8l1TQ2OaOyAf on0ZAtmEjvWN3HKvGVA16nzkcNxGcmt2VCmCey5SCMbovh9wUVqv1tU+VyVK7EOMNN4T 1wBrICql0EaVgeyuDcbnEtp6lyh7LlqraOJZNIab7fqn71IBRfWbryXS/B5nBX49B2N+ BVl7kQu0av+YT2+L6KOJbpxNwZRfqFC/fmg54Zsj2O72vU9ZT3UsNyoSTg/MCHKHIGDE tPgzUlv2//1vGwRbXUwuQuFr65RBUB3n4AjIEK9lHz8CAeAhr6Z7Cuh5VWBOeFy3s3x4 j9RA== 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=Un0q+TORCXPo2kVgpbtgd18wfbS4+otCPFQoRusR5X8=; b=DXUza3GyfMNdjxBl13pX7WuiCpyHTZmc+pvyekUZKwrbZZoZs6Uz0B6l9aH0adJ0Eu 8i1fhKh2SKt6sUXSAav404Tx+/sys0bacHWx564GRLh4Zc4qmkxyMnwXYKU/Rrl05NcQ fCAkv4BGe74e2v77DtHY8S6LL7zaItwOsJ8+nA8WQZm7bYL+9btlluMumPyuT9G8mldZ 6mu/XGF8cS5Uq/JcuphKr0nm7D75GVI3ztbxYgpImNGdqaVw6zOy32UblPXdmQUbu9dy rGTV6/viSXCT1MbZ4AUTETuiGS9CdstNkFB2GkVGecI5Dw8LEEIOJGgnosZMhfBVfMg2 kGww== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Zuhg0Qro; 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 k9si7949289ybt.454.2020.05.21.10.25.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 10:25: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=Zuhg0Qro; 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]:43994 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbox6-0000RF-CK for patch@linaro.org; Thu, 21 May 2020 13:25:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50276) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jboJU-0005Bk-Kp for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:56 -0400 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]:45014) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jboJT-00070A-9a for qemu-devel@nongnu.org; Thu, 21 May 2020 12:44:56 -0400 Received: by mail-qk1-x742.google.com with SMTP id b6so7816260qkh.11 for ; Thu, 21 May 2020 09:44: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 :mime-version:content-transfer-encoding; bh=Un0q+TORCXPo2kVgpbtgd18wfbS4+otCPFQoRusR5X8=; b=Zuhg0QrosnDSJQQxuQjaE/0Eu0Js7LvHll0Nvbo2CnQtqJVgS+XrY6NeZ7LnkEqn48 T+zYdv2JQVHfhRdFU28o9OsIloC3ngptnf8RMaWErOGe4W9kF4y7Qx7vEcjiKwdGC29T jGhVIo6VQRIuMRcLHUVaMlBU6cxWMlgKfOG4E2Bj0PJd1NFQbUziCU02+IsapsMZhVny O2RESxqHKCLGIShZNIPbvlGwfgTNzJFubrWvZV8/oyIJDPQXBtpVWGLRC0NZDxqxAJuM NIHb+7PqRHhbxm46gw0Nbnl87ZbVQ9gdVkxvp35bk5ZQkvNDQa5dNUhy31L5pSxNVNYN UzLg== 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=Un0q+TORCXPo2kVgpbtgd18wfbS4+otCPFQoRusR5X8=; b=T0v23/QoqMWsQB0WuhBgmc6jddcEU19q1lrQFlHUX/ccNJzldD0aK6GNuNaX5QdMVj XcYTC+bVkF6xmQuPdFu1TR6vCNwJw3RiKlJPKC7OHHxey79Qp19SfsVLbaaiKHOHMH4L n0CNkyEBCcbX9jijZLJkcucxQCEzUsDz2xMtYYQtfq9MpFHuzibN/GxQ9ADCC99ES2GY saP2K3DC4VGsHYecuaE7XvvQ5qOrsc28rfpsUaEV2bc5E5X0tsq/rWDn7p6pvx1IgBhh 0sG4UjiWxBpm3ZsySSU9Qmd/Wd5xBYETjr4oKGweG5MWNrAi6GHKYZod+O2Ieus0+X14 oohA== X-Gm-Message-State: AOAM5331HJKBjXpP2iY0Q4HoIJbGwxbcqJv7p3PFrRU3Ah5M3yQU+Zn5 z8WXjBHAAiJF19FJYY3VEPszxDe49U158g== X-Received: by 2002:a05:620a:1524:: with SMTP id n4mr10997938qkk.490.1590079493846; Thu, 21 May 2020 09:44:53 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:1944:c530:655c:5583]) by smtp.gmail.com with ESMTPSA id x24sm5923829qth.57.2020.05.21.09.44.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:44:53 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v9 74/74] cputlb: queue async flush jobs without the BQL Date: Thu, 21 May 2020 12:40:11 -0400 Message-Id: <20200521164011.638-75-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200521164011.638-1-robert.foley@linaro.org> References: <20200521164011.638-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_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: richard.henderson@linaro.org, cota@braap.org, alex.bennee@linaro.org, robert.foley@linaro.org, peter.puhov@linaro.org 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 10-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 eb2cf9de5e..50bc76fb61 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -284,7 +284,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); } } } @@ -352,8 +352,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)); } @@ -547,7 +547,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); @@ -555,7 +555,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)); } }