From patchwork Thu Mar 26 19:30: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: 184857 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp445893ilr; Thu, 26 Mar 2020 12:37:30 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsrLu43V0s1B7OlRphlSAE2Zhuz9OM8XObhqXXEXlKhZUxIGwNwYVpVDuk2RGEWZJvzWugP X-Received: by 2002:ac8:32fa:: with SMTP id a55mr10337923qtb.192.1585251450361; Thu, 26 Mar 2020 12:37:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585251450; cv=none; d=google.com; s=arc-20160816; b=pSvlIXVj34ot0FmThduDLJ/hHjaEJ3ba6n2vyGwKTXDDPMLodAv/beEWoOG64WOmik xK4VWn6xvN4vsb/Isl3atFJ2heuAQYWt148MCNbVRFVK+KYRK4KY/8uLnnSF9Bhq9kze DS06vpW727aBMmilB967wRWiCAWouzDp8ifp1cOVnY98/CzB2z2lo7vf0cxHu99hWkNS TliAU7wzqKseEANz/Vyae2Yjm8TptiY5d4fo9FUPHgqodCmZATD1nhNxn/z475L+2/cP 8UA/HKsRVTdkAV8U2FA5DLPEf+4JTmf+PmidfWS/QtbloktF8U1GrgN3HFHmJJ6OcVN+ 1Eag== 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=KjFm//DWMi6cEsZVv5KoKUnVyxoBxmxtsqRICwgP0/8=; b=GikI1qFwKIDxTlq2cM+ojURGIPiw8zz0oC/fwtnnDOT16hZqPeyvSNDjR5ScwLAd/j UnypSalmX8KGTDyaVnc5F+iCO99iS7cP+NJ0+yLL2wHe6VYWlHc7XJT7Sbg+LbE1TSDw 1ZTpOIzrOI60Jh3gNSsJlc6cBWCBPcKSG56cteKAhyCeuD3XeKmNxcs9JVA3Yvp1EJaH ax64k37Q4JJJol0Uk785+DKHBoLGQUOJ6BRBahkzqeRD+UUeLj9wf/5U3lR8Ejcnvzyd zOScSTmZepybwdY6EYmVSyCZTeN4iV7Lq2qfui0DhQdkBve6yHX29jcMfp1s6sD7Ne+L 2Z8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=aSlGMQPl; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 x42si1954760qtc.227.2020.03.26.12.37.30 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 12:37:30 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=aSlGMQPl; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:58072 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYJl-0005KD-Rh for patch@linaro.org; Thu, 26 Mar 2020 15:37:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58305) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYJZ-0005GF-O7 for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYJY-0001AC-Dw for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:17 -0400 Received: from mail-qv1-xf42.google.com ([2607:f8b0:4864:20::f42]:39781) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYJY-00019w-9B for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:16 -0400 Received: by mail-qv1-xf42.google.com with SMTP id v38so3695257qvf.6 for ; Thu, 26 Mar 2020 12:37: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=KjFm//DWMi6cEsZVv5KoKUnVyxoBxmxtsqRICwgP0/8=; b=aSlGMQPlb5nN8SVlB/gPsmL3JQwCKOn5KAj18XjH1V5OgPpP38dD/uqga8jCWaR/Uj jwZqWSzx7NhhTnqV+rQUcFGFUvieyo92dPeqGtN19G1+MtXm+/Q+hNIVTM8jFptpCAfd KAdZw4c1hH5IXo9K6aHR+t5ujINHigNvYlHLrlVZFO0cmCxVD+JszyZMWj5WhwDuOSGi duPyhIJY0UbZtPDDzzpprfS1cVcsy9JtT+DE6t6Cyt/0RyTwvURVdhj1+RQuHWPZU6k+ qvGQubtOUVZhe7jxnCbE2CnKw+KyLkljGwd6wM8j2mDkFhqpPFq68kbvI1RgE3dSwBBa ophw== 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=KjFm//DWMi6cEsZVv5KoKUnVyxoBxmxtsqRICwgP0/8=; b=b+3Djsl1XW/VqfBHIdNcXIbaVUg5rIYHK44MQkPBBOZUL0wzVsckhLgthlKqZhPLw5 xbi5DLY78lar+L9TbuW6WlnRHh22OinrnxfvNBV/oWF7vAc0QpcUW2P4fc0dl47ze3OQ Oqg8m0oUHyLdH2kwIww3+t97InO5OQcTsVrpikL+2XzcW+l+DWcR47zp47o+QabXyXM8 IfmIrCSaors6MBZpasIQnbWDg2XeoUwb+5y+UVn/BHK+ezBH9/5W8vIrkrz1xF1xjCAE iNnKiGVAOKeKOpWHO7sVki2PcV2jS+QAv9efim8AmSC2ryWoBLWP8sbjWBultF8XitND nP4g== X-Gm-Message-State: ANhLgQ2w9NsvdrriXoBUJCiXbt1Aaas5BNzx48gM7H3Co8GJZatcqKat q9LfZpsKiZA7FZwug8Yvm50wZXUA+D+oYg== X-Received: by 2002:a0c:aee5:: with SMTP id n37mr9662382qvd.173.1585251435240; Thu, 26 Mar 2020 12:37:15 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.37.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:37:14 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 01/74] cpu: convert queued work to a QSIMPLEQ Date: Thu, 26 Mar 2020 15:30:43 -0400 Message-Id: <20200326193156.4322-2-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::f42 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, "Emilio G. Cota" , 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 eaf590cb38..3d659df464 100644 --- a/cpus-common.c +++ b/cpus-common.c @@ -99,7 +99,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; @@ -108,13 +108,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); @@ -310,17 +304,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 ef441bdf62..151abbc04c 100644 --- a/cpus.c +++ b/cpus.c @@ -96,9 +96,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)) { @@ -1490,7 +1500,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 786a1bec8a..2fc6aa2159 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 5bf94d28cf..398b65159e 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 Mar 26 19:30: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: 184860 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp447603ilr; Thu, 26 Mar 2020 12:39:25 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuPrAZrvDM1ACDGv6JyUihSYg5z7sOikna6phaSaWbVwYwc5m7bFIBZ+vNzdIHsqaf9rmrm X-Received: by 2002:a05:620a:1132:: with SMTP id p18mr10090968qkk.147.1585251564911; Thu, 26 Mar 2020 12:39:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585251564; cv=none; d=google.com; s=arc-20160816; b=JJVO6LzNz27fys40A0tGnjaKg+yr/OPoIY4GU0PCPccvGzKSVgk1jcieyFCnREc50b 7YrQoH9xcdh1znOrNPnSmOZl8U3vOtVQiNcEe4fGIm7s2qi5H3nRMAXinlecg3jB450J ilums8V51bf+sJEygMng94DybMaUXiSG0sXkbTwdMLnlu/yulVlnMK3xsLUADwr83LcO ACeMcqdLyC0BQPzFNkWf7foGM+wSKTNLJGkXBqoMh1lmz6kF8TSMdiZj8LOzpy3QnN75 w4B+R5iG2Y4c6WuszdmyD+2nWBJJiKscH45xooRFUkBgElRLnAUbpOveiK7rp0/MAstj bEOg== 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=2J4Nmd3k9E0GONt6majqdtko5Jz0lmYrhFciQ4irEcI=; b=j4omxA75K6Smq+o2RjcWttSWJpvWZKdaHmelt887+i1BjkQyPKuuMNGGvGAS8IbzQt 9KMQOkFCmibDxMwSUDhNLRYEpGn6iHN+ZH7L8P1tDmQiqzwAUBhV/B9m+cvEBLmG+x1S Ak1yuSB+ukRsRfHBkJV2ndH3G5atRUyILZB5dGwN5IyX5/HuQVsZHCPmYDgaVJ67fdLb JBIuDQJPf1IAcbE+jSjDv4fgLd1RjlA1qdFoR17yZO7m/Pv6BujEKTB9l5NRMUOXhPjD Zs4axP41dZ+3vgPbjgaqdK8nha/6dgbOuCjuRNIeL/S/4Km7gAXQ2BC+Twx4m2FXsW30 D/8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=cmnjJcDo; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 s7si2305870qvk.118.2020.03.26.12.39.24 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 12:39:24 -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=cmnjJcDo; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:58582 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYLc-0000Oo-B6 for patch@linaro.org; Thu, 26 Mar 2020 15:39:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58332) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYJm-0005ed-DY for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYJl-0001Gp-5G for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:30 -0400 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]:45598) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYJl-0001Gd-1F for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:29 -0400 Received: by mail-qk1-x742.google.com with SMTP id c145so8134433qke.12 for ; Thu, 26 Mar 2020 12:37: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=2J4Nmd3k9E0GONt6majqdtko5Jz0lmYrhFciQ4irEcI=; b=cmnjJcDokVTArINkDHRw/wftn/f6oxWmGiX848zlcTpKfSfjUrM0PefCcRZtAlaWq9 1xN7LTW+qiXNMVGeGu8jjrBlfUtZwphnHSAHekNlgTYhoUSrrYIIvCruCqvbc/MeYMSk dECzGA9iQnUKVBevF67Fbq/jm/TEkbDZ3ovGQmUF719kqPFiQZwHEC8vG/uiRHvyQGhh +zKqx0Y/wpaOCHD8tViosnkW3oE5RMWKSaPZyF1DWm0rlqrts856QrRw7ZPTofUSlzHR PQXR7bJ868LYy/LMVt8iiBtambg/JTq9zEDzdL0nxAXOJaYOQPU0pCf91iFknvausdAa pAdA== 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=2J4Nmd3k9E0GONt6majqdtko5Jz0lmYrhFciQ4irEcI=; b=bYAplXVWBKVcpln53V852utJ2UxehdCxUO71HDOc1aMlNOZX4MylzsAGvPN1ItviMd tvDKUBeR82Pi4P88eyfihiLVa/V0tzH5tPm+Bf84iuw0+fHTpgLcFAdmPqtxOBuuDXf2 w4lYzb5GCBAQsqCdz4u88TucIbXzL1ujfF862GSzLpJFk81hTuT6ajtHbSaA+Ym9WR6a QLz/nH3OFaOCj9gP7MAWiX649B8I/SVDfMD3AAQFMxBa3KMAA0Sue2RJ3hPxnM0WQkVm Jk4KH/RnhK5sgIrqEt/X7PK1WDeQCBPS3Yf0dOTmj/ywx1GZWWWLbzMzYd+ph/Hs70Kj Sxag== X-Gm-Message-State: ANhLgQ3x6dvC9vSchcspRZP91mMTkdqyAodw/7gFs3dHXroFn14rMPVQ 1qQrY4i3fpw+/A+J56ldC361nDSv5iFiWw== X-Received: by 2002:a37:844:: with SMTP id 65mr9449566qki.15.1585251448086; Thu, 26 Mar 2020 12:37:28 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.37.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:37:27 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 02/74] cpu: rename cpu->work_mutex to cpu->lock Date: Thu, 26 Mar 2020 15:30:44 -0400 Message-Id: <20200326193156.4322-3-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::742 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, "Emilio G. Cota" , 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 3d659df464..f75cae23d9 100644 --- a/cpus-common.c +++ b/cpus-common.c @@ -107,10 +107,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); } @@ -304,15 +304,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 @@ -328,13 +328,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 151abbc04c..71bd2f5d55 100644 --- a/cpus.c +++ b/cpus.c @@ -100,9 +100,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 2fc6aa2159..bc0416829a 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 398b65159e..0b75fdb093 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 Mar 26 19:30:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 184858 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp446163ilr; Thu, 26 Mar 2020 12:37:48 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvPQmFvyi4U+h00topbpPW4WNkZivAHMnH4W+w/Xrub4H2Jw8L2fFhqLaP0Po59AhboNZ8I X-Received: by 2002:aed:3981:: with SMTP id m1mr10478270qte.35.1585251467930; Thu, 26 Mar 2020 12:37:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585251467; cv=none; d=google.com; s=arc-20160816; b=ivjFo0bI1uQjdZ9RSaLsItWFYzAkLHYH8bagycDh2OJ1df5kHD5LEoBZaFRAjWQ0J5 2uDawmbAD9yC/9jRMQ3fK+QzOTxUdsvGtP0weN0tPpzGKXZUMXosQWCqqH9GrZrgWoSk lfRBL1dvg4nhJDxw75yYs/YhIEtQObJE1QzfCmtFfGIQX4rbKQX+KoJcwg7rgcfDYOgC b+4j8h/C+SI1GEBiYQEWLP4wiZExtrd2U9CfJ56UCK5t247yYga5gFUILs5CPmA0/8fq TIOcf7Y5qyFzeobDHZBKJCsdjwsnFWGM6CIu4gtcLj/59AlGSAKb9P4L5O+qUZeVC3rb TAMA== 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=DCB93cdn2Qb7Y87FHZR+VFQPG5cNVFn4rY2y2Awttv0=; b=xZm7+GEBjWRjc1jdiHSHYKe/Lti21az/K+S38Zxtxsz9c1llH1ra17jUH2Ho3hNhRm cbTWxbUDi1ndc1mRy9JZcagAXco0jOSeYguTVJnQq/Y2RFGSJAjJfp5/nBb90KLTKdrN SQtYriD/6i9r7zzUJf/lFsfrwkb6X7HbcYGrgdou0ukPzvrgVvvSyuLeiq3ulRty6Z0/ kb9M7U6vKfPIxaCYzNbZjm8ODiNI6bYGRLXEeMa73s0wEopTp04YVFcnyyaHO9RxfsaN 9Hm5W7L1fCompadwe/TYAgfXhwtiPsqFszmcGNr0HMmVxxanfA3cHl6d1wDqMqRMggN0 QKCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=BSVbA04h; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 z83si1991464qkb.347.2020.03.26.12.37.47 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 12:37: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=BSVbA04h; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:58092 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYK3-0005pV-DG for patch@linaro.org; Thu, 26 Mar 2020 15:37:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58346) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYJq-0005mQ-Ua for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYJp-0001Is-7q for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:34 -0400 Received: from mail-qk1-x741.google.com ([2607:f8b0:4864:20::741]:46256) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYJp-0001Ic-3j for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:33 -0400 Received: by mail-qk1-x741.google.com with SMTP id u4so8128772qkj.13 for ; Thu, 26 Mar 2020 12:37: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; bh=DCB93cdn2Qb7Y87FHZR+VFQPG5cNVFn4rY2y2Awttv0=; b=BSVbA04hoBpnyEpcPrEsizuGHI8Z6FthobjRdk6PUDHAwgkmGAFgvbFf6TtKOyN0x6 6sJxOG45lUQ49ZKSEGmR2P6DtHE3gqnFbX8kR0Uzb7cmzIgMShpUVzJklXHA58Xht1Bu 9K4LZ1OFVlE2cx3etGEDEMSouhoalxWpU0Jnp7IfaHhjWaSLBpLPsG+61vUp2aE7uzKh Gco4/nH9+M8YE1f0x/JPTzD6pKAjpcYZLNtDDp1DSq0rvue6Z0E6Ze6fNfYVBxeblTvb tl4qmRXBCQihaq6+NRltxYIInIzY3IIYF3cKh348CYCUZ1FAbQ09qCMK4RGJGqn+HBLN 6GrA== 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=DCB93cdn2Qb7Y87FHZR+VFQPG5cNVFn4rY2y2Awttv0=; b=eHX+F8p7sainbncyemNgxpvrUHayf5xJFwFmhaKaOt/Qq3H5o5HMrKl7TfXN79/RED 92twaAIm7ORb1c5D+BPP9aoaXvPXVhX5BHQrJ71UObq45PEtkUBYv24xKRTppfWox49X m9mU/YnZtqsFfLxsv3YR62G5J7TtYO00RosmPdwfaS57KsJSgADuLlvGqd2ops0wHskj YCQMsfR576ZRsyMPdgUi4rCdTTeBgL41YXNAb/g7MAFY6BCr4vlgfnn23OydFlVPUfMx Cn1fgftLOkaNC9iTJjTvxUVtxx/VWorLVv6VbUELeCsfu8wNpz9kEdoifx6csWGMVpSy MZRg== X-Gm-Message-State: ANhLgQ3R0YPHwvFY21ukqZrE85JcQBTRzR2KAjazewHZP6b8XjkHxVDm lROhFJYN/UqI+4j9VTl4oth1O0eVF7LT+w== X-Received: by 2002:a37:b17:: with SMTP id 23mr10522631qkl.326.1585251452089; Thu, 26 Mar 2020 12:37:32 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.37.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:37:31 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 03/74] cpu: introduce cpu_mutex_lock/unlock Date: Thu, 26 Mar 2020 15:30:45 -0400 Message-Id: <20200326193156.4322-4-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::741 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, "Emilio G. Cota" , 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 Signed-off-by: Robert Foley --- cpus.c | 48 +++++++++++++++++++++++++++++++++++++++++-- include/hw/core/cpu.h | 33 +++++++++++++++++++++++++++++ stubs/Makefile.objs | 1 + stubs/cpu-lock.c | 28 +++++++++++++++++++++++++ 4 files changed, 108 insertions(+), 2 deletions(-) create mode 100644 stubs/cpu-lock.c -- 2.17.1 diff --git a/cpus.c b/cpus.c index 71bd2f5d55..633734fb5c 100644 --- a/cpus.c +++ b/cpus.c @@ -91,6 +91,47 @@ static unsigned int throttle_percentage; #define CPU_THROTTLE_PCT_MAX 99 #define CPU_THROTTLE_TIMESLICE_NS 10000000 +/* XXX: is this really the max number of CPUs? */ +#define CPU_LOCK_BITMAP_SIZE 2048 + +/* + * 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(); @@ -100,9 +141,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; } @@ -1837,6 +1878,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/include/hw/core/cpu.h b/include/hw/core/cpu.h index 0b75fdb093..4521bba7a5 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; 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..ca2ea8a9c2 --- /dev/null +++ b/stubs/cpu-lock.c @@ -0,0 +1,28 @@ +#include "qemu/osdep.h" +#include "hw/core/cpu.h" + +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); + f(&cpu->lock, file, line); +#endif +} + +void cpu_mutex_unlock_impl(CPUState *cpu, const char *file, int line) +{ + qemu_mutex_unlock_impl(&cpu->lock, file, line); +} + +bool cpu_mutex_locked(const CPUState *cpu) +{ + return true; +} + +bool no_cpu_mutex_locked(void) +{ + return true; +} From patchwork Thu Mar 26 19:30: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: 184861 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp447852ilr; Thu, 26 Mar 2020 12:39:39 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtwWqErrG670igHgmHhxjgOaDEx1e2epdV1Qjymi7LPc55poshnYIuEAPeboGEbTEkxOLvT X-Received: by 2002:a05:6214:1863:: with SMTP id eh3mr10236860qvb.71.1585251579130; Thu, 26 Mar 2020 12:39:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585251579; cv=none; d=google.com; s=arc-20160816; b=URNy6nAMCVA8MzhGCRGLSt6iNAajNdrcjg/73xDh/R6kNr5gbpoBB9yIdAhB/svoA0 sPFhhDlZLpWjAENvHI2B8pnxJbkq4fdW8hFbGBrNcA+uGoAGeJTwuwGn8t9AOvfd8275 /dHkBt8Y47VMRSHJHEyuA1EOF3wW94IrsSG611RLx7CxxxwEQEguVGtP+DsIfwl/dJ9H FOI1vHI1+AUez6kzEemy0Mh9KB84Lvqc9ZHEb5vNm2FqFCjl9jSsoNG7/LZHhkqJPnuc 1zcEZZu6gjlybiSkCaIXr+jmX0AK+zkNoY1yDJoClU7PVgu5sbJy0WiLcZKdOaAw1AxK ym7w== 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=3hREnc0W2bwPSyTBH3eADGzgCMYeIoOKwLln3BCuEfI=; b=RChbiRHKTyrb+NEB/3GubGEh0jydUz09M9nrqFMSwwXoWhgmNdz3sxfTsp3uj/KtMg KYXHvox8Mtj5l4liRzP6vdn7n57jZ3aBkrlbyOX/NV8AVcW1xtrH3ZVh/vu0MJjTI+J5 2BVhgfvKVkx4faFTasNVoaOP3BWCD18B6XHh4Q1DZauGQk6dSPVe2DmAjbUcYDrVC9pf fcx52suogzNSoOZ+TdXf/0REpwtpzdFpKeldwcySNKhT42Sd+QzMViVrBxG2z9+rvFgX WPtsuIOUJUZNmP0v28oGgAK1Th+I8p+qRU7CudO2cBFUkkh2WDs4hjyOjAdNeS3pbXFY sX8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=vLtVk9Fr; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 c12si2060510qtd.389.2020.03.26.12.39.39 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 12:39: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=vLtVk9Fr; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:58634 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYLq-0001Pe-KI for patch@linaro.org; Thu, 26 Mar 2020 15:39:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58365) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYJw-0005xv-Rv for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYJv-0001LV-95 for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:40 -0400 Received: from mail-qt1-x841.google.com ([2607:f8b0:4864:20::841]:43630) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYJv-0001LG-4Q for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:39 -0400 Received: by mail-qt1-x841.google.com with SMTP id a5so6512831qtw.10 for ; Thu, 26 Mar 2020 12:37: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=3hREnc0W2bwPSyTBH3eADGzgCMYeIoOKwLln3BCuEfI=; b=vLtVk9Fr4EjzAz5O9uxawwiQhIfYLsJNgTGeuriHcPeMQB69fnZPRLPQhVyDBhSpJz Y5JQKRQwv13H2lw0tG/YKcu07k2nUKrlfSpdTGvwEFDnDQiAY494J53lEN1c7DYZvCnM 6UL3NP+yUDdFTZ90oPQv24u5oiCL/RFUs1BScZ/Dy1WPYgynyJwWavYOqjR89VHZuPaA Le9NIbH4yYAl2exSbjk2tnC2rmxIOHsiSbsowvOaxhzPsRZxWu3PWqVaMTF8ksE3vEss 0Eb4Onn0/yO1NhXOWVWcH4CAPN0Ip8rk+vlaupV7Y1L5FVo1/0pQdqVbYltzGzneDKaO /8hA== 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=3hREnc0W2bwPSyTBH3eADGzgCMYeIoOKwLln3BCuEfI=; b=p6ZvST2qYltSMJ6+E/V8IVHMbtVscFL08W+e7MESKuNP9ZZ6hkvULbYKFZqcNw7htc /ZrS0W6HmckSC0hrKxqLQB7Tbhh+hKZ0X0vvwuqDfMJqrtOUPO8W8OjKa56g6X6g/7aV 8+JwKZZggYJ+MLbnyYWQflKjaEmMcMTsvKm9QmYK1bj9pBkZIOcyzT6gSAqqEckI9dh8 X0uvLTuiU09lg1Bz5SOm7sXoU6Rj7mhLnINF04eOnA5NObX1mecNZhKAcTl5PjnATHIr 3pyQK8C4wRprwE+vwl+zi8jZcjo/ozkOgJEgEFgDbVRYlQ3sClffdDmFC7sdz3GKoJs9 nvEg== X-Gm-Message-State: ANhLgQ1nccNx8Pl2Oa/Pb00mq9E7gWQAZ3k2oZv73wSvtQ+MO1IhrD6s 4ihhFwmZGtm/l3mYVvbDXvyTD8zy1gaqqA== X-Received: by 2002:ac8:2f88:: with SMTP id l8mr10238328qta.139.1585251457982; Thu, 26 Mar 2020 12:37:37 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.37.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:37:37 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 04/74] cpu: make qemu_work_cond per-cpu Date: Thu, 26 Mar 2020 15:30:46 -0400 Message-Id: <20200326193156.4322-5-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::841 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, "Emilio G. Cota" , 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 f75cae23d9..9031c31005 100644 --- a/cpus-common.c +++ b/cpus-common.c @@ -26,7 +26,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. @@ -42,7 +41,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) @@ -105,23 +103,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; } @@ -131,13 +143,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) @@ -303,6 +336,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)) { @@ -320,13 +354,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) { @@ -336,5 +380,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 633734fb5c..e1f3327bbc 100644 --- a/cpus.c +++ b/cpus.c @@ -1191,7 +1191,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 bc0416829a..6594323d77 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 4521bba7a5..9c3ec715e2 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 Mar 26 19:30:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 184864 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp449282ilr; Thu, 26 Mar 2020 12:41:15 -0700 (PDT) X-Google-Smtp-Source: ADFU+vu38hr5HtelfS6G//TbUFLywkUxqzOvaL+B8nQsSsGzLgEb5tJQj7lPO5mWwuHUp1iQPuCa X-Received: by 2002:ac8:f4a:: with SMTP id l10mr847764qtk.146.1585251675556; Thu, 26 Mar 2020 12:41:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585251675; cv=none; d=google.com; s=arc-20160816; b=kahFVK7B8Arj/j3TzCam4+w/SP26XB+BBOKiU+CaauH6oUqlv4AMkdg5/PxAz/pzto EXnZwjxu19kJX2bxetlkSL5VWCIP5i0w7lng1JompUc5AwrlEfkx6Yq7OCdu0sFxK6v/ 6B/oixUjDYKg6jqWG0Q9nx4eBhjRgHBnlcSdDQfFATZ2YHZkbgM/bvbWsy3lBaDN4guz U1Zv/IarQXWKfhubD+9uCnhZe+sMQfCIw4NdIZfTJQ2NhxDfpO9GBtjfFmWiWvnIg5Ph o+7/YHyXskM5UWiugeVrLN4nfk78wm7kvFoZSjrtFw74f/62dX9viejt7xGOobviiaer 3TSg== 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=YU0MJsBdXP71+ASBscgMltueTCsYgt9Kz0FY+8TmezY=; b=r6B1dprQw1/CFM9TElV6phBQ4RkZL3RVbOCEWQEvRE1NJUklnhbCFwm/VcEPMee53K a+UMGYQrKsMlXTo+816GSqo1fL11DX53vQefPlpWihAXcL5cxthio7+A+Y4uymDkKN2N NamgRvmiGBuZBbMMHn4a8MymF+xOuKi7W2QjE53Urm9gpQW9sTjTf0CsaSij2JCOzmU6 R6y2g+CtVOM4Rgi73b3oBo/RXUZ9YmM4sHoQ/rZYL7mxVKwTWI9dZDNjXZlMMOuom+Ij l1vTF2ANwtqluPAf0/jSG5A8KifsMye+lKpHP3yFXAsbJP0JIFXrMAAmPfvOqEYqHrET 14pQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="qRPUtv/a"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id w128si1960116qkc.373.2020.03.26.12.41.15 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 12:41: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="qRPUtv/a"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:58680 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYNP-0003wJ-2P for patch@linaro.org; Thu, 26 Mar 2020 15:41:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58368) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYJx-0005yc-6B for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYJw-0001Lx-2v for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:41 -0400 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]:45601) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYJv-0001Lo-V5 for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:40 -0400 Received: by mail-qk1-x742.google.com with SMTP id c145so8135247qke.12 for ; Thu, 26 Mar 2020 12:37: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=YU0MJsBdXP71+ASBscgMltueTCsYgt9Kz0FY+8TmezY=; b=qRPUtv/akgVcHvO+hR1YAC0yYSKT2HKFgxWHIoayjmuKTmJnCgBp3r43j12XDdQzcS UiJ2Ej9GbopPedr4MMOM+JFIDTnlXG7rjwfOCQdZEK9x3RM9OIXEPBzA3mt6QFvK9aag 5wbmEnx35dNMQL/GaU8cYs5t+1hOCNmTudBV/7v5XtfpxyxQoHS1V0IMJ69toq4AmF8S To1JDqzasMS4juzMFKf2h6cFMlqJoFGReR692QhrSxbYEhkBDpWVG1aiNWpNuNbaUxEy 0TVO1vKO3R+hk+aDACh4Jltyr0rzQUX1DUB3D1TDBAC/m+vHoK6EOYdz4r6yJOpwHDI4 l9qQ== 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=YU0MJsBdXP71+ASBscgMltueTCsYgt9Kz0FY+8TmezY=; b=lCy4rS6/1RgOznUjLUqyl7xytdLMtjJhQ9XOLeBWG6uPoQd/mS1TGbvys0pVqWF3Vx HbypAq8eBdG+uZycqYGzgWUVSMTC0k3NYhuR5HoN05G5SjVM1BnAzczfvyvGLYv9dBp0 AqsTsTIpr/pfoj8ySoIHN6jiU98zw3I16oZ2nzMrcEi8Sx4b+xBQCTk8iVc2AJOuoUxA vwmPCQgmd9Hka/1LZTR5V/J779VU13UOqqShpUppXBMNaYgFfgRrjScaniGLmj2OfCeU aRkksPPd36NTBWjNnIHX1iBPRq5Tj80TcDLXZ6MskfKgyLT+0Y9N5wBr2QoRmzIZawCU pBWg== X-Gm-Message-State: ANhLgQ1nLXyZ9WEK3lkBWGcCLGTmaQDZtoNCNOLL92zib5IJZreQqQdW gooXsdeoSHMN3XRAuVf9ix4RGTTP/FsEvQ== X-Received: by 2002:a37:a4d6:: with SMTP id n205mr10319510qke.352.1585251459236; Thu, 26 Mar 2020 12:37:39 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.37.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:37:38 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 05/74] cpu: move run_on_cpu to cpus-common Date: Thu, 26 Mar 2020 15:30:47 -0400 Message-Id: <20200326193156.4322-6-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::742 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, "Emilio G. Cota" , 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 9031c31005..bf5794cc17 100644 --- a/cpus-common.c +++ b/cpus-common.c @@ -119,7 +119,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 e1f3327bbc..ff8f37cf88 100644 --- a/cpus.c +++ b/cpus.c @@ -1189,11 +1189,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 9c3ec715e2..9c6a426c35 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 Mar 26 19:30:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 184859 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp447046ilr; Thu, 26 Mar 2020 12:38:50 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtPdSkPNoiyTEQz4rmwBrl9n+VkcvM9HZ8z1xfhwPXv5tI2QJ/M4QfIMKY5pr3U/Ri0890Z X-Received: by 2002:a37:6592:: with SMTP id z140mr10132056qkb.257.1585251530486; Thu, 26 Mar 2020 12:38:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585251530; cv=none; d=google.com; s=arc-20160816; b=w76nrQhwQl1qQS7vnD/R8VJ5/rC8LRo2s+2ZZzy1VNXSrq1MRo+KhXEpOV7bYgj4TJ nD+eblAu6KIeQWGIBjlgTZJenV49xhxgx/vqam69l+NdbrOxyCwYIxJYCXUNyBVmAQLI r8PjzjSIMIutFZm8GHVQRnVa7Ozwxkeowj7EkSYzB50xclPNe8tA1hkAVmTT86dQ8Yr+ THON6A416hvW1xmcx4JJ81XjsGYqvWZaQ+MhtNXfG5PV0Zs5+245r+oGjay1/jmNPwSc 7kMvIFX1eZKJRUTC5VBCYEQdMSdBY4ks9Bl5lkYjqDwVNsaBltoXSNw1ZPbVhNton508 x9Nw== 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=Jjmk8HMVsaMAjw4OpmNeL2f8ls8xSfNsLsqnnyNmPuQ=; b=qSy2j0GWZ+WVcKQoou+rxAqK0/YTA2ueq4yTJtF/xIcEmDNbO6GAOL1wGTCfeQFvUT +noikhgzj9ZgkiVNYd8a9/CuF7OBycMc84IOmao8mvqjyU9Cue1KT6bdolUpVKlOtWXv QoB1cjelOKP5NCsTeQ4JplBJkahNCcmrFomoL1ycwPjtgvskCxmeXrDVaxTNIIlVngjG mYUyXmND2+2jelujRbe5tVX5XIkKt36RmAY3XSAtGKpmnDR4L/MEqI59NaODN/W5BEVm P72da26hfBrCAuxR9rF7B27dIkFBj8X/8pc9yFELKgnp5sqLE1GLJ7HThuCP5BAw4uae s5iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=rLimLxqz; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 e24si2054448qts.40.2020.03.26.12.38.50 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 12:38:50 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=rLimLxqz; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:58332 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYL3-0007BS-UK for patch@linaro.org; Thu, 26 Mar 2020 15:38:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58390) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYJy-00061Z-Ie for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYJx-0001Mn-EH for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:42 -0400 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]:45602) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYJx-0001MT-9o for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:41 -0400 Received: by mail-qk1-x743.google.com with SMTP id c145so8135332qke.12 for ; Thu, 26 Mar 2020 12:37:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Jjmk8HMVsaMAjw4OpmNeL2f8ls8xSfNsLsqnnyNmPuQ=; b=rLimLxqzAGiQnmDaz/CubO/0wZKhPAnzFUe5PvwwJRvz5PfYW33GroA8H403Azn/kk SYLK7FIg5UkDYHUOAIcaUwWvBtbbCC4sA7rhmL2vPsyelMPbAY5nwkIXxrE/0bLNR0SS v4IN4AY10MnYUePV3MqcA5qVG/HL3dP7P4GjrH9OGPjEbQYnP4SRrtv8r+o9ogJvrcsv yiIDnXOvbeiaLmG6xdcFCbttGrU1UADJBO+x59ZXbU3ftHfUi/7eqvtBifJF5o6Dz5np CvtLb8E6P7k0n9oZIqxvWidLRSPhAfgkX9Q4Rm8qOg5JekLGwpVfgCufqxFQMeTxTiaA rTzQ== 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=Jjmk8HMVsaMAjw4OpmNeL2f8ls8xSfNsLsqnnyNmPuQ=; b=Z/+ekdm4m002U+il+qCD7iIvZUQtXGnVVGPvpX/T2aAUhpUulJGHAUmnXKEGLACLVR LULrJFk9znOTppUynIiHfn4/VTpMDS7z0FdMVysOhGVRPICk8ykpO46GgzB0ykSYcLsa gXHerN3pyCMxirWzDqLdL1cH6F7DAnDzd67aHYEIzTFQ031M0sKRBbDcPZsmSI5xt6Vn atN159akWfU0jI6HoNLtM0foEaB/g/4wz+mA8zg7cQ22kz9jSGDnwds5LXCejpHJkNe2 mdHIJ+CrlkuJax87eRDzJTjcgWn7LFjHk8S3cQeWLbdLL7p4nBaceYLeW85zvi3LZGyz YrqA== X-Gm-Message-State: ANhLgQ0E3q39a5FUqh/whb4aeYEXFK84qCsp8tOXsCzJORhbWcrL7/GX AsfMPgUf4/ZheyEm8ibvJJOxZAp+X22tPw== X-Received: by 2002:a05:620a:120e:: with SMTP id u14mr9313433qkj.23.1585251460510; Thu, 26 Mar 2020 12:37:40 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.37.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:37:39 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 06/74] cpu: introduce process_queued_cpu_work_locked Date: Thu, 26 Mar 2020 15:30:48 -0400 Message-Id: <20200326193156.4322-7-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::743 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, "Emilio G. Cota" , 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 bf5794cc17..f4a0f9ba3b 100644 --- a/cpus-common.c +++ b/cpus-common.c @@ -333,20 +333,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 @@ -372,13 +371,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 Mar 26 19:30: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: 184865 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp449347ilr; Thu, 26 Mar 2020 12:41:20 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuWeqYnuZLuxblVnOWrnsXO2TxOE60crfm6OAhH7u0x15FtJMgMzKoRd/94AdblkWp6ucwR X-Received: by 2002:a37:db0a:: with SMTP id e10mr10090735qki.273.1585251679879; Thu, 26 Mar 2020 12:41:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585251679; cv=none; d=google.com; s=arc-20160816; b=jSPSoC/5pDv6t0+dBIX++FA0HcTpxOQAONWkntahrakquvjySz8B2CAgkclkE2Vrpc YygDFdhF7mvY/uztAhseH4fbRqErFun++NdvbqHIFtumb2yCkyz9NqQbHZJxRtFoED2W q5CeLlrgiViBzWZSbWHvc5IYOc/R5gg5Ai8XEJCYBbSEZULDzG1ajTo2xYG34XRw2ORC 8OiP3vI0zQ7LZVSUnEDF5LSJmbYTGVhEZYMaGa9DtOwHNdlPZ3I7YMcMlnrr/oEdLtnK 2aI3qFjYjRJblvBifHrbelZnbIW1HNQ2tZnYVMVvkiNGxcEGGYQDX3xUHrNcYdoqy/TO e8zQ== 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=8FJa6mBDpBCOXmQOSkwzK/quZgmaJvgZHIzCu9P5HcU=; b=Q81LZlBoc7KeaSXRwBD6KJIiiwO9P/F+UmW+wJRSGCeF/+kUlKfD6NauIcyBvIBgFU YbWtqUTud/hZcgN1y9xhDFDtGnMuSrLIlUY0pD5dRAivcy9aoCbzxx+dQcpVVi+rRPpE xMJBRZr3jt00xM5hOtY/X0yKA/AKfNbwdhsUzwXrCXQzGxELiKWD+grpOgEqa5VugIYn EWJRyTXZcoKrJ9iUQUpJFodSGixjTe/DuyNi1wY2Z8XMbHZjyF3AY14EoJJrqYabv0Gl D6oDcp73QJC8H11vNy6JC+mO2rehBwAPwiC22XZoGeDvtBJ/FOHmIR/3+f71Su1mjTqf uGIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=KPPuOlNE; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 b1si1964227qvv.217.2020.03.26.12.41.19 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 12:41:19 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=KPPuOlNE; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:58688 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYNT-0004Tx-B7 for patch@linaro.org; Thu, 26 Mar 2020 15:41:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58429) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYK1-00067G-9d for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYJz-0001OA-Cn for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:45 -0400 Received: from mail-qk1-x741.google.com ([2607:f8b0:4864:20::741]:41667) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYJz-0001Nu-7U for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:43 -0400 Received: by mail-qk1-x741.google.com with SMTP id q188so8161427qke.8 for ; Thu, 26 Mar 2020 12:37: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=8FJa6mBDpBCOXmQOSkwzK/quZgmaJvgZHIzCu9P5HcU=; b=KPPuOlNE3Uewn3fqFlxZdm6R32Cqn+Mw0p30jIoDMJw/785y4rK2LtHKy8t/KW/5b/ KvwIeQtcxSCztbEl8xxeCW8jo77MfwZXuR6vdkMyAQFq5RdG9cOHiYAPtNyz45bAg/7Q z3kmgelomvziGYFD5LUWnTH7DkRix7zZ0LvHa9/7ewGG0hLsey+US3dkiJgbxM2S775D tyhoYIpWUmt43PjryNxSXF9PkSaRyj1hfzLlSL3m3nLyw3YE9RdWZTE+QJIx713L5eII QIkZL2NK2HiTThUrG5QOx0L7MlTVdL8fQS7QNKvKJibnxFXsJnRlhmSina0jpomYCgGk Pnfg== 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=8FJa6mBDpBCOXmQOSkwzK/quZgmaJvgZHIzCu9P5HcU=; b=mIyUcMxXBXJQ8unVjynArVeUiw/ycjyfmg5Hfo9QSCTkh2wj/sVWGUHPj3tiGfB8ng EdYUqW/uWcZa64dw3oFEhWq6fFVPe5BuCPtAN+HXO/1xRDOO7jeJwUeX5D48tbFjH6AY Ajdy2NOKmEVYwRsLOe+QW3FX1MpRcQKCqbQDdTLi+Jz1VJPTZoQG+t8ewnLv4RYikLdQ qyuVngKD5tkwooLNFz5QzAIbMG+qHRgcjd3IwQcVW49jzb3939tzWpOgXAq/q6kSqF4k SrMSashJ1Cf2XABPzOFA1cUwqH8ygN56V3Y95FV4b0xaMFC7Nx1cX6YefGaz3vp0V3bp qYow== X-Gm-Message-State: ANhLgQ16NhH4pgMVwFau1B6n+JY2QCJQPWjSUfKNfpN3sZjd8PxV2lo2 iXQ4wDUR3yzJPgdYqkhEOJeq2DFiDbsUiQ== X-Received: by 2002:a37:410:: with SMTP id 16mr9847528qke.485.1585251461830; Thu, 26 Mar 2020 12:37:41 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.37.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:37:41 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 07/74] cpu: make per-CPU locks an alias of the BQL in TCG rr mode Date: Thu, 26 Mar 2020 15:30:49 -0400 Message-Id: <20200326193156.4322-8-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::741 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, "Emilio G. Cota" , 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 | 13 ++++-- 5 files changed, 113 insertions(+), 16 deletions(-) -- 2.17.1 diff --git a/cpus-common.c b/cpus-common.c index f4a0f9ba3b..9ca025149e 100644 --- a/cpus-common.c +++ b/cpus-common.c @@ -163,7 +163,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 ff8f37cf88..f27fb19b7c 100644 --- a/cpus.c +++ b/cpus.c @@ -91,6 +91,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()); +} + /* XXX: is this really the max number of CPUs? */ #define CPU_LOCK_BITMAP_SIZE 2048 @@ -106,25 +112,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) @@ -132,6 +188,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(); @@ -1858,8 +1928,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; @@ -1878,6 +1946,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; } @@ -1885,7 +1955,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) @@ -2121,6 +2194,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 6594323d77..d67bd58827 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 9c6a426c35..3f7727ec70 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 ca2ea8a9c2..31fc67c3af 100644 --- a/stubs/cpu-lock.c +++ b/stubs/cpu-lock.c @@ -5,16 +5,16 @@ 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); + qemu_mutex_lock_impl(cpu->lock, file, line); #else QemuMutexLockFunc f = atomic_read(&qemu_mutex_lock_func); - f(&cpu->lock, file, line); + f(cpu->lock, file, line); #endif } void cpu_mutex_unlock_impl(CPUState *cpu, const char *file, int line) { - qemu_mutex_unlock_impl(&cpu->lock, file, line); + qemu_mutex_unlock_impl(cpu->lock, file, line); } bool cpu_mutex_locked(const CPUState *cpu) @@ -26,3 +26,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 Mar 26 19:30: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: 184863 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp448590ilr; Thu, 26 Mar 2020 12:40:29 -0700 (PDT) X-Google-Smtp-Source: ADFU+vt8K6IhbpCI0NFjkz8DXTmG+pe38joFK3rGP9Wf9LLH+0ajpzgz+zxz7GJ6GI8avtJwyNLu X-Received: by 2002:ad4:5012:: with SMTP id s18mr10421124qvo.162.1585251628742; Thu, 26 Mar 2020 12:40:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585251628; cv=none; d=google.com; s=arc-20160816; b=sdpNfxqJLbBN5jYcELW6C3AEMrKlOOitGH1tUtKBN3N6uJJf+MAmL2yhtCQfWJ4g1H c3cS7zoAZzfB3M2fei02Xw79xUwUbtNPbmgA1yhuAWPebDGWN3lnVCYB/jfSjIQPv1rR 15imjWW4m8OcDKxouz2wNwJvb0bTVQVpmkZM8Kuoo2QWnJC8/Xm7/BEL07kVp15FptIU Kh+LPpigJq/domrez7Aw/hM1D8cMRyzEZQ7nzi28Ois3GSckSzOL2OaOSE+Hkl50YtrL cCfWQGIRyUU5/8P2CmbrRRiwfgASO4lt31Aup9BUW0XXpacs+XQuelp4wZJOUv0YvRxH a2Vw== 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=szWcK/jk6A8jtmjPo8N7E3iuGdCAMJBIe2i7BuAPe0iJOn/+az6G9Wl7unHTaDB7xe X5fbjoX0x4f45xgfYSNtikLHYDpPibE+2OMIXvaDHcfLE5VP2YuZ95SDB2ob7WSd58EU k+KEhwexYoNWlNWB3apfBrqrb/+UkeNNj8uK9Ohea/LEmUzTgb7t2YGdibNqlabokFlw PqGSH+SRxt2CbvBST8yM4auvee5Mh/QY8sjAu9qImfe2nrNo4O/eVNGcqUR+9Em8nsK3 QJL2tzaglFE/wqVNsVwKmqze/J/B5kEExKs+2L8nviHSDtbwLSQa07ZzfeEP04asmj7O ZMEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=PoU98qel; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 b126si1929085qkg.207.2020.03.26.12.40.28 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 12:40: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=PoU98qel; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:58652 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYMe-0002XI-84 for patch@linaro.org; Thu, 26 Mar 2020 15:40:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58428) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYK1-00067B-8a for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYK0-0001Ok-5t for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:45 -0400 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]:34715) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYK0-0001OY-1N for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:44 -0400 Received: by mail-qk1-x742.google.com with SMTP id i6so8205090qke.1 for ; Thu, 26 Mar 2020 12:37:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wu18ytPvx1d0kVanWp/H7LPvrM4VUoBEe+P8kb9ryLo=; b=PoU98qelE5c7Q3AyXhh58/Azbvhdnb3oeQjWfDvCS+PSJ0PPMNNTk4gT/itHENC8Df ogfbcAA2j+a4Evcca+338ude7PtEKVNVp1jE0TxJDiQNuZQyytsluMyhYmLYO/2pdYHl JlE0LPpMCKjiXDMZ4GYFwR1ynh3FLftmeS+oTkfJ6vVSuMS4RjhLh/HNrkptztYsS+CV IMtGFjzLzm7zzylFK0WUiposvC8+TToLJ6vCwBoFPBNg/EZpBBaXpXynayXHyIz5UbJh wAlJ2bOpRc/FdumalUHpBOH1vM8uHsBg+zwx1DGqwI8RUW2DY8tQHauzKL/ogjmLg0db 8DQw== 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=hm/f1lGIaazZTD+Gq40GP8nQGI1G+qPb3n+XxhgXR3Np4C15k/Z3ADry5EIoBxVds1 l60fif++mYn2Aw+RyuUQZwROStJibtsMN4Zqf0TZ59DIU2SpE5oWlW3yFXl7Fvjv94TT K2xAcBgR5cXouxwKD9c6KOrX7Z95bNQpOhfIG1Y15ZfIfx8DZG1h9RmtHgeJf+jDnU6L wU2ZRGO09rZMuDal5vB9iZGAWeDHTmyjj2dLIMNn2ivEYyT39Ane4bPh0/30O6VCi+MS hHf9zIbsHcLzlMXJK04xYG91ppNe9KboIL/Ll78aqul1vGHxspTLqDNcBOk4a66gukDT b2uQ== X-Gm-Message-State: ANhLgQ1jRMV7n9r9/rV51BbuDrP772cRp6LpJmIzkuy+BwhVBOVQLSBP v5Fa0Ae6KpzelNa2w8BNbLAVHhZg2aJSHQ== X-Received: by 2002:a37:b4c1:: with SMTP id d184mr10451802qkf.452.1585251463106; Thu, 26 Mar 2020 12:37:43 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.37.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:37:42 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 08/74] tcg-runtime: define helper_cpu_halted_set Date: Thu, 26 Mar 2020 15:30:50 -0400 Message-Id: <20200326193156.4322-9-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::742 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, "Emilio G. Cota" , 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 Mar 26 19:30: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: 184862 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp448056ilr; Thu, 26 Mar 2020 12:39:53 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuZnM9feshJ1Nkp2o/ytvUKZ9EzF0zq9FmiDozqnd1v79ic7wLwWWivHWZSrg3kKiJioYsn X-Received: by 2002:a37:5647:: with SMTP id k68mr10350541qkb.33.1585251593258; Thu, 26 Mar 2020 12:39:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585251593; cv=none; d=google.com; s=arc-20160816; b=nAEZqFnKUNMYk5RTKYHI32iaMgglYt01kRNQ87mmj+duBQapdCKFnjQYla9JRpcoLO 12YtLR+xiRr0ynWnkMZqdlwb6J1v5/Xe2Fn6B39B0p6jycwwmVCv2kTYPbl7iTwlltmy 1QzQf/P+/C3JeRA8ck1eyNVdZRGyCjNLYIN2YgXFNO/ePH4sLVqiEJUtKqZn/5Hx7fJO hfTrHNgfkKhemtTOmT9lFnJDmwULlT7B7NeVjeUtfLhN++KbkQ3DQsUrzbPqsYzktwaB 5tbRkxsHFz1oRZEHV3iI1c9ao09ka5aLPDCWG+irWvnmBsXCjLxPfLXGn5chh3xsyqvp AXJQ== 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=MXpQV9EpBjzND01X5ptnGqVZfb5b+aXFoE3ZFX11iS4=; b=zRBmdUafuaOZIykEwExGWOcGi/rFpNjyQ+9j7PxgWn9XiEmYc+AukCJ0q+mDMAH+o1 9bJ4XFXP94dJGL2NmhysaskwpAofeL+NU23KO3eX5FveiQ8dqSWXd+arXnJRc4I93LeN K40sRGCSE7PxGByXH9OBM9xWq8/nyFg+/wtxrMkJLc2sR8JO7xw7n1iQH1ko8Bwhc9+x p6Df1Omh+30njQAnlVkBBJVipTV/cUSyB5bsvSr6PSNF3UDVMUVV8EweAkwd8gJJDfUs KYdcOqqCsgfAmwDgKnRahhlnk/ck+e3I+eElm3MYIIFsD/ENkItexZVPCM2CmJ77NAga pJhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=CsBbrh29; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 y31si2040216qtb.94.2020.03.26.12.39.53 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 12:39: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=CsBbrh29; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:58638 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYM4-0001bP-O3 for patch@linaro.org; Thu, 26 Mar 2020 15:39:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58453) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYK2-0006Ae-Iq for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYK1-0001Pn-ER for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:46 -0400 Received: from mail-qt1-x842.google.com ([2607:f8b0:4864:20::842]:33122) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYK1-0001PI-Ag for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:45 -0400 Received: by mail-qt1-x842.google.com with SMTP id c14so6572427qtp.0 for ; Thu, 26 Mar 2020 12:37: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=MXpQV9EpBjzND01X5ptnGqVZfb5b+aXFoE3ZFX11iS4=; b=CsBbrh29KtnEN++gMhFFDxPTM1Lu0CcAYVnK0Qd3yVSIdNdIgBKXrYyuaYXvRpojG5 HOmFY7HQHye9HMFCIJrBMJb6yoUZ8A0miqXpmW14gsHK8dfo4d2aQQHzsKs+5Kx4Y8mD sE542r/jsugMbZK/QAtZVjXA2JwDoZLx/K38Rbu5in8NulOkEzebVcfyRs+n7jJFQkHC 4J6bpvsPNcKoWFgxQoo0H2qL4WihF59qJ39hkU8olzyFd3CLWRSdZYLCV5hA3oQz6mzl BgVvqdoh+X0AUgro9iDYsPxZ/UIyyYfCcfDQmwB/8AaCrXsNk29kWoIyaSwozji4njOM pxZQ== 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=MXpQV9EpBjzND01X5ptnGqVZfb5b+aXFoE3ZFX11iS4=; b=IuIdCCbxRqxRxnHRswWlaw2qn3CxzyPiHeZtpKE3rhDrpBK46bEwaDvdBwgwlIjGa2 J1MzaxpheeVLRH8SToOTyvbjxPwXm1UgCZkqWzufbDcYkYjWJfrwilJqy01WdV0mTRl3 spq6MKUCj96lTHsPtHxtyVd4RgBtoKshVvDJ0p+5IyFxbTj2U/tRRiuNvAlaE5rpGN1F eCpBMdNC+UCjGeFtju9pRmlF0HpEdJ9e/DbvXl3f0UTzV/heK2jd3xFIxs7UMJF4IBnK lZlSDiAiiDVhXd6hiDO/e5XDIf1O4IuHGw4OvaSEmnywrwX8T9G00vQdkMWIoAMOpJ+b eYzw== X-Gm-Message-State: ANhLgQ3kNvp5xfJVfw0OqZuOfJDOZg75Wwa5PIB6PxAOABHZRwyVDnSr zDEqwq/0H4fpn+zKnbFwvhRbGSGjg69kiQ== X-Received: by 2002:ac8:7684:: with SMTP id g4mr10303802qtr.339.1585251464500; Thu, 26 Mar 2020 12:37:44 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.37.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:37:43 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 09/74] ppc: convert to helper_cpu_halted_set Date: Thu, 26 Mar 2020 15:30:51 -0400 Message-Id: <20200326193156.4322-10-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::842 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, "Emilio G. Cota" , qemu-ppc@nongnu.org, peter.puhov@linaro.org, alex.bennee@linaro.org, David Gibson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Cc: David Gibson 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 b207fb5386..ff1ac82320 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 */ @@ -3602,8 +3601,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 Mar 26 19:30: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: 184866 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp449718ilr; Thu, 26 Mar 2020 12:41:51 -0700 (PDT) X-Google-Smtp-Source: ADFU+vt97qENe8Gxs1vvWmquhoeo8IQwnrYTRNi1Jw7eMHykJWIo/fleeLdou3cBK8eO8J0IpXGx X-Received: by 2002:a37:6509:: with SMTP id z9mr9924572qkb.462.1585251711369; Thu, 26 Mar 2020 12:41:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585251711; cv=none; d=google.com; s=arc-20160816; b=hd40hYxPJrsZwQeZPaQ/hC3vTUkxR/g8dy0DrDT9VM47xi+IED5gLZK9/pMnrKBWpd HPyVl1457p8xP0c8H7t7JjAJ/2sifnCXYH+4T+BxHy6ae1XOVONiXzkpfLCoKECIuTPT xXmZgsGlGkm1MvLjw/Q5GMEqNFKWKt83e14LAsprGRng5xffxQrqeiXnA6Rr8d04e2d/ k84GpytIdA+zNl7O0K8YTF/FhCkB6W8SRpo4QZ2GeqvMVMx9wAVJCFx8AF2dMkAbnpa0 vTYKdFRh2IeyGUwIVsESjqBwCY/T1045TnWAbthgO18EkG5PyVa1yHnC2Ay1owF8a+sZ E3fw== 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=XCLLvEezHgHKSFK6DwhVUYhogiImN8ODX9NGIolvDha8VSbQZ1h+eLsxmZ9o/qnOrL 3PGhkxQ1YGZDkRmOvTUduzQPIXgz+95Yye/cMr3noxhg0pbuQDx2I/SWxIO2F3PCW7Ka Xi7PJWl1ctP9vonySvSZVrEeFdM9ouuad5pBWkMuVS0ZrZQ3DhdCreaakZ/5IRu+riGJ +RDGWfcIj7Xoc9gFUgF9pIqjbgLGy6AUFzK034MEj8iLPW36JLLeIR/BX5fyNnPs6HHU yfMQZLtJM30V4WSDcJTKJQR4fsrRlgEudCFEuQeq/9lzUNsh2CH4RcLcFnMj6/wkm8O9 T7GA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=BtlKayHq; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 w1si2061355qtk.25.2020.03.26.12.41.51 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 12:41:51 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=BtlKayHq; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:58700 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYNy-00051t-Se for patch@linaro.org; Thu, 26 Mar 2020 15:41:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58482) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYK3-0006Dw-SL for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYK2-0001Qp-MY for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:47 -0400 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]:40087) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYK2-0001QV-IJ for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:46 -0400 Received: by mail-qk1-x742.google.com with SMTP id l25so8183547qki.7 for ; Thu, 26 Mar 2020 12:37: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=pu4aLcXEpuJ4ytDOMXC0XbbDo51phtIicVpeJSCDXFU=; b=BtlKayHqFQQ55nfGp3i7vRGrV+mifLzZWqU0R+K8tcx3vlsbCbJNG/wCujZlbFe1ov jM2NwSXEB/I8w9t0IpTKU+vzmjSMgcddKLcoLaIh5KzJGumF6eUnjuaIGKWgP9UGh3Zb zAoG01Et2WqsfcrkVZBqTCsBZCVxJy8fs1TlaoBjPJC0dQvi5QrVAwa0uPAtz/sQbgLR nkyLuL328fJYAoXpf0xBc8jwcDELG10X3PuF/yDitk5fiw90ViilX3Vch7DY9nL/0SFz OwIQrhofDX0t5BWPuLB7Tlf2do5bsmFTN2vgfPjNn8qIUWWshH4ZpNhSjt60ASfZ0Oi6 VK5w== 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=dqXdVm7b/NA0Wr2N5pQtCtgpqrnNdn9s9SoHdWbIzOxBwzP6tfAEWU8p0sF8Ndg7nH qZnwBHV2n3LE/rs9MU+BJg/GycGl6+lV8u+AaZrfSvOXP71raP1H3etnlvxu6L3UG2zq PyLbJyFMtevhL/sHcNoXdJwlmbWgv0htR7aXawno3fM/yB6CLjuJzN/IiKshHTWR1vIT mYVoA8NBRcGGc3BykRrBwYGIlk4y0OGJcW2jQjcod/ljOlTFPsg7WDtlRQAKoi0rXKPQ jQmpGD2UspKFegk8pIsMzjxJC7e7IsRe6z0eL9KreMp2V/gF8WNkbmx3/J8Usf5/fM7d aeUA== X-Gm-Message-State: ANhLgQ1CinaKlY9/qH6NPE0cTEZ3VoVsScjQ/BVliC2ZIouZvm7edRK0 m8mMbOvRSCbB4jjfkfn3BwlTO41S0vFGAQ== X-Received: by 2002:a37:7002:: with SMTP id l2mr10334824qkc.372.1585251465839; Thu, 26 Mar 2020 12:37:45 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.37.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:37:45 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 10/74] cris: convert to helper_cpu_halted_set Date: Thu, 26 Mar 2020 15:30:52 -0400 Message-Id: <20200326193156.4322-11-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::742 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, "Emilio G. Cota" , 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 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 Mar 26 19:30: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: 184867 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp450721ilr; Thu, 26 Mar 2020 12:43:00 -0700 (PDT) X-Google-Smtp-Source: ADFU+vt85xZBOCGfjp0/g091q5RRfcryyUOm4BHjwbHyDEuAx5KCthU4cOmN+k52p/BFTBOHZoCR X-Received: by 2002:a37:aa92:: with SMTP id t140mr9267800qke.119.1585251780657; Thu, 26 Mar 2020 12:43:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585251780; cv=none; d=google.com; s=arc-20160816; b=aT3DV9wNLrooAfLEukjNcaF+ycHmFKRstZo6cLtB3FhgEoYPzSrJ7QqXDe5bEbKUOp I7WnWO+trqgWl0spddErFesx2PU8EqYgCvXZyGgDZDbmuFC72+UXhGl9mehyL9GfsC1e m7viLKHQ6K7us/skK+TOrjeZLilkcNe4NJ9fTUh/P93sT0VVFWUUBNStmjyoYYqAYWox DcG7REpQxhW4G9MH3wbT/NCwEkAeLKCSg7TXwO3tV7tvRdA7Al4Ut5iLlBFTHTbYM2ls xqDH1I2rbhCdyMMi3m/qnfasecTj5zcO8GO/E+EOvsXXwhavmkzUTQtyVAfKAt71SOup wbZw== 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=O3Fk1o2aiTTboeufwkA+tdGLWZa2Z4ezjS0J1l/8RiVthTUWvK6ahdDPFPKEKDp1GS 6GHoskl9cV1kEKXU3/iqCHNkLAUOVa8q0G8vQ4T60AJCfBWz1v1H3JoMYp+wIUXwR+Dm oeUIf0r3s4M5FWYXDmM/z0f/3rsbyuSYKVfF3pSxAdMyreEVMgrMr65uyKj7UxN8WHPP 9JkYazjlSrx9zfPITteapKQLqquhpY6JM5FPQRZC2Aarfk84ezhPJ+4J9HHMxJMieoaJ iXDQqd/3Qz+x0gLMpqituXh9050FxNhAS3T9GzGAJcPM6XCDbkb90vzVxJWR8Htc3OHa +/sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="V6m31ra/"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 a53si2059371qtc.271.2020.03.26.12.43.00 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 12:43: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="V6m31ra/"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:58730 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYP6-0007L4-5Q for patch@linaro.org; Thu, 26 Mar 2020 15:43:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58499) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYK6-0006Jx-5C for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYK5-0001SB-3I for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:50 -0400 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]:36775) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYK4-0001Ry-V0 for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:49 -0400 Received: by mail-qt1-x844.google.com with SMTP id m33so6545086qtb.3 for ; Thu, 26 Mar 2020 12:37:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wrWqzZuurKLoDMN6QCL6bZgCudK/zrEU5r5KFbp+gtw=; b=V6m31ra/vKo4TCES2Z1DbKUzapR/nVGPwZjNsvgkgOc3jp0Id5Yt4xNrvJIqjBXEke CIQoe14Tj1EpPl+prQMEqUtYlTddpPdGCMStJ4P65AA5W3ed0/4z6n1xfNXrSk2GsLCW Y+BoLTlETZy1NNKD4uhZlcAlZ1GfrwDbKt76KVRjOvbbwFAq3pKICFXMwelhV+t9b8Q4 oU6moHikWlFwULb43qCV4qj0zypkroyEGzocLxkRRmJDNn8TAuo2/apnx26j6ZG0pwJG 2iODJg1Si6F0RLTXind+iwFilEjl7uFId2zLg+EldCJJTYGAwbyzB7sylTdARqiBNtUv yulw== 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=tOmSiBoIE2KBKJdQcgnSktNol1Os5Fggww4p14NRZAdPQ5rfPe1EI6o61EqcQwPO6t NCXTLdsmxaanCk0LR1zyqmhoSfF9csFEsx+wHYY0BAMYpVJ9pN5HdIRRYPWImKzI1YA0 blgSoeoQxSUMcPtZIxNj7nWvQXk4ra1CUN1ON6ZduFgWfPb1RaJZGY5SeCKUfq6HJeA/ 6ZP1ktsFA4dd3cMCGWe/RAnjgODkWFoGXSLxGuN6LE3Wam4VqLrQ+4AmVJuMQ9Yw6LTu BQ6Y66VGVczZN37DZoel3Ykbve8Ox6SZJRNYx3vmUGTAs71/RNTp2FOfzS7lvFuUNId9 k+IQ== X-Gm-Message-State: ANhLgQ1suPaCMvzPSFhYtju4hTWDKPxhSC+oBjUW86NtvlqbkH1dZL+K CqbFqxtGJ6eJLfRkD/x5tiJeFBs+sDjNrQ== X-Received: by 2002:ac8:4e44:: with SMTP id e4mr10068176qtw.313.1585251467241; Thu, 26 Mar 2020 12:37:47 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.37.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:37:46 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 11/74] hppa: convert to helper_cpu_halted_set Date: Thu, 26 Mar 2020 15:30:53 -0400 Message-Id: <20200326193156.4322-12-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::844 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, "Emilio G. Cota" , 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 Mar 26 19:30: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: 184870 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp451411ilr; Thu, 26 Mar 2020 12:43:50 -0700 (PDT) X-Google-Smtp-Source: ADFU+vufoSQr6HEAU506hboXeu6VQuTLivm3LqFhadXgLNiw5wAWUXgynx56lW0r2zdafxM+fiOM X-Received: by 2002:ac8:304d:: with SMTP id g13mr10539787qte.221.1585251830806; Thu, 26 Mar 2020 12:43:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585251830; cv=none; d=google.com; s=arc-20160816; b=RZN7BtFB1HqCZxRyaCPFdhV9vRxxEtWvL/baW/jQSYWMNm2xV6VfZ1/QAjWOXlxav3 fmhWEDgncXm/WIgSZVm2+0oQMrclMfr2G1byuG8gayCsPSLargZvB8Immi+6aX2bSN9n XVt81gcuKruPt/kFPJH8gsErtwRUjtAUSAF5b3RzEfxcUYA48RhgiPZFqUy+s3xsbMJ8 B1NSD72m9KdOCanbg58QURzTKB4acrnE+gP9JUt/h0QNZ3Ln6vSlo4gCB+Zr8Ij9NmJf Pan8zntbfO/lEsa4AT6GlLqhdrDgbmaj2gZ1viRizcOGTCwVQKcWtLXvdpVXskTCD6XQ ahNA== 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=97xhNcyTh5DcJuk00OWjjs6901pDVYNbXDltjgblU0Y=; b=v+RwMnbOMk2/JN51SWMWwkbAOI3fk+Fc8Trpm1j5VyGX7bDFB/B8uCrQGWOi9XPqbw Q8x7gK1+bP1USBLDNZ4WVOHy5fHT3t2DpLKdfgb62sPTwFXFmvOlGapZj1oz9JSOZzZf 9BDP8QrhBfnFsU2DNdUplLvn0f5qcOFG63KaLlBNjFl56fPbog4rhsLQ9eawbqsHX9sp u8wlUjTZ5in7jQ4rPqJeyCkSAVU2s0Tp4Ke//CZjyiA7tgr5vv1xy0yzvw5fnGu3VDZI 79lk+MlTzPZHRVkEfginPx6njTkAlaaQkhVDRrhHw/2bwBCxjDcBJYUAkq0+O/o0n4o3 B+rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=wN1R3Hy5; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 q128si2081153qke.319.2020.03.26.12.43.50 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 12:43:50 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=wN1R3Hy5; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:58758 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYPu-0000nk-AW for patch@linaro.org; Thu, 26 Mar 2020 15:43:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58503) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYK6-0006LA-Iq for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYK5-0001SQ-F5 for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:50 -0400 Received: from mail-qk1-x741.google.com ([2607:f8b0:4864:20::741]:39013) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYK5-0001SG-BD for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:49 -0400 Received: by mail-qk1-x741.google.com with SMTP id b62so8192558qkf.6 for ; Thu, 26 Mar 2020 12:37: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=97xhNcyTh5DcJuk00OWjjs6901pDVYNbXDltjgblU0Y=; b=wN1R3Hy5doDWbp6cKhMKpQbu0ZhsSBmsMoRR82mCRbLSOvkBZYhKhzKJhFwshMJKku LZzS1e+L5/73whb1nwanySG7EH/OQW5dVdP6relBHIBdvO6jQEt4HjMgxRgrBFzWrFIw i0pGLNUC91HgWy4wa3bCjCbmguNXZJGY/3hJ+bAcLw3Mgd/RxByir55MvFvHAUekvjvC OXOL5b8V5VXxoudm5rp0QkQVwqzTJvYS6C5vubSvMLj0TQCVyL7fzQK9Avg8+TbE/G9N ZQOmstWUDKT2xoT5y9zS9W32O8k5YMufH4IySxm+CryfHoekCAYkfYcTuK9QKXwnrIXH ivPg== 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=97xhNcyTh5DcJuk00OWjjs6901pDVYNbXDltjgblU0Y=; b=QiK9R3cUEMJnKcRPSBR4GUKU7FK6mxB5j1c46qLpQbpOsTID5KpYiPdiyNDmJeeKfE ARrK2L7XEHP6wI9p3Pra7wAl3GOVHS4NS16Tb5KajgvlxVLMWoVKuIxq2qJIsGOeq0F/ w+z7TPNF0nfBENGo+6BbYVE0PPGD6mRVOoR3vw6wPllE+zz1v75pgOFbQlSfJ5DS1ulC YrwyyqA+3Zot0sWzFK2DY9DewUrMACvUy5WUikFu4AQhQrhcoJ+RCRm0ECKxkVMFdr9m GiqPQxUdBHGkal94SrpSIb5YZB9DZH9EMT+S3n29IpBuGgkehM+0I1lzijs/wWRyG1eA EcDw== X-Gm-Message-State: ANhLgQ2Nx/WH7/Z94wy0w1XRNtuyvSGw8fkBom3NQ38uA8YkNJLfiJFq qfGLFkieBWOkEczibkeqmjoPDzGJL4c+1w== X-Received: by 2002:a37:b002:: with SMTP id z2mr9876197qke.289.1585251468535; Thu, 26 Mar 2020 12:37:48 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.37.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:37:47 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 12/74] m68k: convert to helper_cpu_halted_set Date: Thu, 26 Mar 2020 15:30:54 -0400 Message-Id: <20200326193156.4322-13-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::741 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, Laurent Vivier , "Emilio G. Cota" , 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: Laurent Vivier 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 Mar 26 19:30: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: 184869 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp451052ilr; Thu, 26 Mar 2020 12:43:24 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvrV+8mNMQ5Go+Mj8oPDRVwSioIrlkFYopqgUhANlVVZL+djhtk6U7qac5hn5Ri9t/9Gz5l X-Received: by 2002:a37:bc04:: with SMTP id m4mr9953541qkf.199.1585251804681; Thu, 26 Mar 2020 12:43:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585251804; cv=none; d=google.com; s=arc-20160816; b=ZPxkzCI1plZ9dB850DGxrgXvHXFp2SgfJZutQOew4YHWCYWRSslpYrCUQHwXaob1ba tBC0QuZaY43WyRanpazvmEgN2yVc1WgPblUff0/5U7SqXImvHO72hDoIylDm7lwPbkfh DIPD8cZaDxYY3X9Ix5xhMt0r/mo7DcEjd3eGFJNx6+4Kb660Ub/0Il6vLkhaf7GsSVDL QO2ZalUN/mgiXkCxbK4KGTFI8rzHzLGg0cZm3ds4r6Dvt99+v1PxEI257+0rouAgVO6+ /cHZCh9OyCCcohj0IMQx7s9M8ytPTrzC+x68qp0uGen2f/3dd1hkEP5BE8us/CxIUStt LfxQ== 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=B0277UwAvsbwsrR1QdIxnxi3ZjdR/pOg0d0XQusk1DdhfASO/r29cenWOYXC9Zedqj n1rg/SMeuOaJRej7+Cef31PILL2Dh7jHKqrLQSw+mIIzlgDbWbjz/HEFZ5/3CWJXyfxJ 0KSOoB/UepoF7RfQ/rGbOozKNx17cfLq5lscf9wLB6q1q3ZoPzVLFpzi/T4f3nnLe4pD H4jRqkTXXgyUvLHw7bFFCHDZpPpfwbLwXc5fWGMSvllpZlzFjor4ZSdy4O/bdw3RhlLF B4esBGd8TAvvaMR7pQE9JriBlAlHDQA3Ph/+pOmwqoeKRl2/jtgrO3cXmNctkq3j53sr ycow== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Cc2pcTAQ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 e9si2005402qka.174.2020.03.26.12.43.24 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 12:43:24 -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=Cc2pcTAQ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:58750 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYPU-0008M6-5T for patch@linaro.org; Thu, 26 Mar 2020 15:43:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58520) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYK8-0006QL-IB for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYK7-0001TZ-Ga for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:52 -0400 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]:43198) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYK7-0001TI-4h for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:51 -0400 Received: by mail-qk1-x743.google.com with SMTP id o10so8125700qki.10 for ; Thu, 26 Mar 2020 12:37: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=8O2wd0xMJ+DcB/CefCYufYGHDOjb2p67mBVobEDCvB4=; b=Cc2pcTAQPE/Ki6EFtkI0GW/uf8axCXccKlplmECMVLRW7453alOX6ZZL1095Zdf4hu 29LKubWAFylftnO1O6RQ180ZJ9Nc3d8k24AZ0nT+Fp4tPL7y724Q+5aEQT47A+QoCJli Z8NwYZHumhZNh89SC6C6VV7rMrRMn+q1F2A0LCwOHGMOe13jmhLuctwzzuiZNo01X3na qLSDYykHPoyb4m4rbdPC2qzREKZpin6/ZV931BfYIgCN24F181SRkC7rLyABjtyJGG8P Xa9k1FQJ4uz69WHofmskbZuP0uB/qL2g91aqRdJu5HKh+nATG7ej7Rl4ib+p7Q7aUysw gqNQ== 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=lPxLIW5UtZrRF5WdrW+C/e0cuNS17amAz6eNjWEOXpUHIMhxN+/mexvnRBUUoq6OUZ nVGgShYjB6nRJpPQqKZAP2M/d/alwHjR/bu22hdOQ5/wdWfkKzq9C6ygRTS9r/wDxG7a 5vxMzw947WltFIiThQCJDXw24hgg3pyfiLvYvQ9lpHOsFCKMkIBW9LuKcjs1Mj/gFFCY sGd1AYzQAD4M0PrpS3UbEO2dqItZzJD61Cthjw1OXeNXqlvCpEjGTbED5I/qPFB1mMgT 7rG7MHh5KjC/VA7U+ATzJbcOjoBGlDcNhwO5XGbbvTMnD/8K8+0MDY+hpwxl586MnWj0 Z3Xw== X-Gm-Message-State: ANhLgQ0WzaM4UX90W/NnXUqDTmOuw/9G3DSfXtbIDaWHedG40K8WEldn jTLp+psPhUweuZUIsX+0LWjYTR9pWx5DTQ== X-Received: by 2002:a37:a4d6:: with SMTP id n205mr10320937qke.352.1585251469831; Thu, 26 Mar 2020 12:37:49 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.37.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:37:49 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 13/74] alpha: convert to helper_cpu_halted_set Date: Thu, 26 Mar 2020 15:30:55 -0400 Message-Id: <20200326193156.4322-14-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::743 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, "Emilio G. Cota" , 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 Mar 26 19:30: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: 184872 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp452148ilr; Thu, 26 Mar 2020 12:44:43 -0700 (PDT) X-Google-Smtp-Source: ADFU+vs+lecTjESGWawSC+9HMAGRICcNcOQosQ/TXxXB+uAcCI8tdOq3M2H/z1eACxXKKdN6sKoM X-Received: by 2002:a05:620a:1025:: with SMTP id a5mr3501175qkk.365.1585251883356; Thu, 26 Mar 2020 12:44:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585251883; cv=none; d=google.com; s=arc-20160816; b=aHPNWLlLS2U8kNMiaxPF84QwWHEf0pIktsZVolkmVJqyNY5g/JigZzwWS2gGB9IhE6 GHoOVdj2jmVz2Gy2w7jQAuYz+kzeM0LCajtQQRLo1LNJWIkmlxInurXTgav4K8sEBT/q eAjtefoKlIZ0btd5VQitRLkC0OeTo+NjhZZv1RmB7D1ed4OPxMvQKd/nGTL4wbNisClt 9PaLX/ZQY+VRgwCdrBJG4Ya8Z4JPtOe9UolbteYcJuahdp+YVFZbak4raS9hGswEIay8 EoWp/9D+Ir4Roa+VN/jLW08fsR0D6F29Fep42OZoLO2p+K9Sq4mhW0oiMmvQhIeIyF5h 7TrQ== 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=klf9qVFdgtejUVaZm03YCM6EuSDU/7CS5KQfsLceHvs=; b=etYWBjw+w8J05I3lr3T6LTMrT4ONmU/0WvLshOgpVQpGX2jAZq7k3cveEbdL3hwJ0e iUKq1RTaPFylkhXeM17CGqNtLDNSXGb7PFmnDuePCMz1nLBMZCTGflfK6vJKRjzy502L GshU2dEMKlCi3NRDjuietVk6Z53AP9diYk6aRDmuXYXTV6Hq5OtgsrKSNY2v1Dg65L+7 pwGjIHq3L0Nun1qR5DdgUUTF7IO8kcKCqhc3zix7il+M88oNZV/LyM5gB6Eto3/HHqO0 AgsArN5Ewf7+OS+c3oqT6YObi4j/z46LOqUMtkKEkpf71fs5rc7NM7tLTM1rgx26VHXj kjLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=CSydcz3f; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 s57si2102895qte.37.2020.03.26.12.44.43 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 12:44:43 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=CSydcz3f; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:58782 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYQk-0002Iw-OX for patch@linaro.org; Thu, 26 Mar 2020 15:44:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58540) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYKA-0006Te-Q4 for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYK8-0001UB-Me for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:54 -0400 Received: from mail-qv1-xf44.google.com ([2607:f8b0:4864:20::f44]:42843) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYK8-0001Tu-Iv for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:52 -0400 Received: by mail-qv1-xf44.google.com with SMTP id ca9so3690098qvb.9 for ; Thu, 26 Mar 2020 12:37: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=klf9qVFdgtejUVaZm03YCM6EuSDU/7CS5KQfsLceHvs=; b=CSydcz3fPydfjRTN/2AGoGyuURZiJwJhHIv3PLzipl14r0ubkUqGaWAIXZanyTynj0 KjxEy+5B9W4c0ORKEUeQHpmC7E3IGMdn2plQyNjf40h2t0wmgjUnv3f+XzOb2eZaIbyE jfvFiXJik1t9meSt4Sup+MpIejanl1/Fdx9D+832gSZOiq1AeGIaz1pY6tfclkJuSa4Q /3LHN6/ESDT7PyyL+sxDCF10khi0Dqoxywk2rNpf1gsRHvAOvAvEchttcNYgmjbsy3pb TlAN7ixwnyo2y/1l0wUSEellFvvOFWoP3OSYEZF2b21OuDp/Vg9GlmMEOVt4RlGlOUe3 y75w== 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=klf9qVFdgtejUVaZm03YCM6EuSDU/7CS5KQfsLceHvs=; b=TxcgOsNcefiVO13xD0r1VIz+qfCeWRkkgGppQJURyNvXjmkuipD80MVaduQ3Svri5h V3nl4fbfzo0hmXyh1WBMivTS1ybhwwTbalA/0M0JmWdXReoY5Kl9jEFzrCd0ZYXDXn2Q 0hfx8Mm+J+8oL9ndnbGHoX7b3WDSvhFOJV7Da42Ai63R37VTX46omHjB8Efo8wyncPTc Wh68IPG6rN+elw4LE60yCcnhHmZlB/AdZkxkU8mgtX5Q+cjyAGaiZLSlnD3Fom1CM/Vk 7RnTX2ifqY1JSocP7AXe5a1oj0FeeHjnUtQCyc4EENO6NUhGFdCFgB3P4PLj8IeGrd4c zDdw== X-Gm-Message-State: ANhLgQ2196CXDP6MWPvlMGD7CkzqLmTyAEXunutoBMT/C+uWZOxZJKZO HD7sE44zk377WEgEo5xv/pYT3GdolFweTQ== X-Received: by 2002:ad4:46e6:: with SMTP id h6mr9918078qvw.208.1585251471034; Thu, 26 Mar 2020 12:37:51 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.37.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:37:50 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 14/74] microblaze: convert to helper_cpu_halted_set Date: Thu, 26 Mar 2020 15:30:56 -0400 Message-Id: <20200326193156.4322-15-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::f44 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, "Emilio G. Cota" , 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 diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index 37a844db99..deef94a471 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -1236,9 +1236,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 Mar 26 19:30: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: 184878 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp455755ilr; Thu, 26 Mar 2020 12:48:21 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuU5PA4fbX55Yj4EUcsWgNmWpwj4WbOdI2nw9dmWC8VlwOm7S+AF0Mw2W8nzcRh3ZgSPcxV X-Received: by 2002:a37:6215:: with SMTP id w21mr1765572qkb.149.1585252101628; Thu, 26 Mar 2020 12:48:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585252101; cv=none; d=google.com; s=arc-20160816; b=MFky0FClrUkCHUHGW0kUnJxV3mJyVcTOa+kpyQYZIFbJGDfbB3R138nB+5fHAPH2RM Wq2p7IH5FEwP10maxzU2264+XqoELXACmNwCdJLa6mskw0sJY7Gmg0HzbaudGcNFkqq+ JluNwAwnqs58XtoVfBrf++PsLMuSlo41p4QXtmcODec+arNAhDUUArxs+bTRdtGM2p3/ XxnYU/WewCkiKqCaLhOnLMsfPEe6MQU9vhyLOPGy5xeZbICl6CiEejREm+TpZPpZqrwE VlOL9GF1mAiUHvV+bT9TCWTjAULxM9tw6GY0HoklGeI3QgQ3C7xM/UYgRiMynyZDe4e1 OjBw== 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=eDLiMVv+D2ZXvXpFAK7V65+ch4hZt+k/wLuboxFFAO0=; b=SQn84htiBLgagT/p26FrNlRJt33jOQVhfluFcnKJPjbJlaiFcUiKBuSTKLrDao7h+E CJBq2PjO1BZujF2LkdNe2rE26uZiFn8RlTGWg4g3ViBm4Sph/SCGK+Ls3GG5OQvICQA4 bXTlGyM6oAzZuyvGHUsH+/M/GVYi0XjoIbVlNeLI+fm1Qsn1R5VI5Ib6TYJmUd9+Yp7u CRP5aPz4gmrg9mTUqlNTiH7xgkSMgzfapRm6/IR6phhcC3am1b7oHTsramhhIZtKgFzz pa7vPwLDh/dDqgZzqjcVpEx8OXonpGB/h5Zp8acBzImmUCdqxbOpqibJH5P7qJ6KbDn0 n3SA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=YYT9Pp6W; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 q28si2073393qkq.284.2020.03.26.12.48.21 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 12:48:21 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=YYT9Pp6W; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:58898 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYUH-0008PS-3b for patch@linaro.org; Thu, 26 Mar 2020 15:48:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58555) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYKB-0006WM-Nw for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYKA-0001Uh-Cg for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:55 -0400 Received: from mail-qv1-xf43.google.com ([2607:f8b0:4864:20::f43]:37204) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYKA-0001UK-8e for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:54 -0400 Received: by mail-qv1-xf43.google.com with SMTP id n1so3709465qvz.4 for ; Thu, 26 Mar 2020 12:37: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=eDLiMVv+D2ZXvXpFAK7V65+ch4hZt+k/wLuboxFFAO0=; b=YYT9Pp6WMOUvmhMslR+1NSHC6ths3u+8qk/dHvbW3+zTnssXCynpiZdh98+9/qhJeq IdkYE8WvLEKXlQovJgJR4hKGx+6nIeZmxFKtJxMbc+vdPnTMTDgxmREqqhIihU73t1Y6 OYUXga1Xoa/4H+VrkjhJyhn4CKWxUDI7jgte6L8/mZXANZRBKh3TLhUUAFqgyOhDTVa+ MCJF2KlXMVFeX26c23+DI7gEmrQUhX4iReaV0KbZ4/IiU58hkop4I5oogKvhGXcL19wr eSUTShcXIh9Uw2yJEGNSXc8AaQOQIv6bvnjfMvwOnbJBPEqShjnZfyPVkh/WojLqntNP bIQg== 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=eDLiMVv+D2ZXvXpFAK7V65+ch4hZt+k/wLuboxFFAO0=; b=Jw9rkkBZUvYsBqnrzBBBIBG7dxQXtDg8DDC9FqCxLbg7GmXcCmwkjSLEjgh3VNVH71 twvKlJIEyXcy18soOcLHb+fkQpxZxuzJpbOONzbOeTJ5eVLKh1cxUl72o1jOaqlbND48 3rdzRY5avsrE6Cs0LZRRU0BgpYsY7f2LgXxXzvdQJ6dyIYhh/kXATe6Pc0F+0mJroPOn 7C5DK59ODnMn/nDwOpZ7AB6igQ3dmA/bcS0w1gyQUOAdnHOG/Q4AJt3KifNJx+Tpczeo uCqbMNluESaLLdH8zGE4m+CIePnDNpo2GrX86VHVqiYXXlT2KnaSlRAS3b8GVlpN1v6j 54ew== X-Gm-Message-State: ANhLgQ2wjiulb8l4KTZ7fNc0st0TmLlY7HER+kHKF+Sxo5/FjuUZfR8y bMSXiyZGqwoSfb0L7Bh2k/9VOXNPudwfUA== X-Received: by 2002:a0c:ee28:: with SMTP id l8mr10065622qvs.196.1585251472299; Thu, 26 Mar 2020 12:37:52 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.37.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:37:51 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 15/74] cpu: define cpu_halted helpers Date: Thu, 26 Mar 2020 15:30:57 -0400 Message-Id: <20200326193156.4322-16-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::f43 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, "Emilio G. Cota" , 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 3f7727ec70..48b46c90ed 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 Mar 26 19:30: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: 184876 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp453617ilr; Thu, 26 Mar 2020 12:46:09 -0700 (PDT) X-Google-Smtp-Source: ADFU+vskdbkW5IgHRMRLLhn/JUdiH9qlG+S2MxixNhGmRKWNMcw7gv1QSH/NLnhXtaSJJ7HU0K1T X-Received: by 2002:aed:2533:: with SMTP id v48mr10458373qtc.39.1585251968997; Thu, 26 Mar 2020 12:46:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585251968; cv=none; d=google.com; s=arc-20160816; b=aUI6Bqo7zwgdsJFhzp1gC729h4N27i+En57Hf5sV+pdv1wCHpkGWUwGP8MO0lDTMqL H/p0xPMBpq9Z0iB787ZpUwLIm7Sz9GOWXZ+zvXjKgMMUQ9mIXRGNnBYcXPQhcFjjgQtG g5+WtR4JLkOuz2LpYX9Jb/9fqzo+LUsYkeNjOD/2VFg5Z1z32b9mVE+X44AhMz5/x2BM VagEBVoXVQnULFysWmdkjP1CxeYesoNRg54uGcIp6Prhg2us0gBgTwXWHSpNy0DNWZ7w NDFjpoAJD+mc+f7sL7vntLGMf9Nt4tEtqywTnNxLgm0mqQtvq/HlDATfjN3zbGBnCxFr Ssww== 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=x0knOmXbiywkc0u53k2H9djkhS6pVpLyLL6pGCdXihMkr2UVluivNg8gufwhBipvHe sPahNzQYciaINOdZS7k0f9KaLZBUrkZNsmTGIRMB3F+gZTM4LcXlRvDFmpOdQNaABGMy bpJmah+OpZsTg3imbZ8kG6QfCYKwN54foMABevlG1jrCC7qVyCzgOrJInPHZ9jJTb/vl d7MdwzGq2e97hwXmbmFyLTKVo/ExGKmywXLF2j48ime7uajjfuryQYH1QzJ0EUpXL1zQ 0jIh6+E9AdOvqdQzW6tnNxx02ugMkbTAbXh1uW6gz0H81HM7yPdhkRAaJUk610e2axFu wTeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=gsC8RzGU; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 v29si2147577qtv.35.2020.03.26.12.46.08 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 12:46: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=gsC8RzGU; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:58836 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYS8-0004pU-Fz for patch@linaro.org; Thu, 26 Mar 2020 15:46:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58554) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYKB-0006WK-MZ for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYKA-0001Uu-L8 for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:55 -0400 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]:34949) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYKA-0001Uc-H6 for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:54 -0400 Received: by mail-qt1-x843.google.com with SMTP id e14so6560270qts.2 for ; Thu, 26 Mar 2020 12:37: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=5p5QVMZ54qL4PKza/xfxsC7DswUaUr8tRQACxDFIq5U=; b=gsC8RzGUTyXSQR4RxqGvgtbU+GedsxhCgLCACtiD7u+2ik/z2ZUdPv7m+wfFDsrDMb gFfXJqQsAHKqahTFGfWFD0UdUduk+7nJPkxieLc9PuAHE/GVJsKQPdOCxd51grTzCqx5 SqHl8StTHeiibqfC2FBM45o6BmdJRj/cim3KeH3bNXveAzhKi2S95X8DggOyzOfctdmQ H3L0Xm0N3ZsmDcRcThcdOBgW/gmSy2DF2pq7sIICZKVGSuQELEk6YnCipkrXffuyHvgC t3V27a6pQOOheVTC6EQSx+9jNGXXRT1NWHTTdxcFzdRfe32wWoYKpAphBIVs732nJwx9 kVug== 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=sUzHkF+s9w1zRKGgXK09tX4dCci85HQuFmudkEyu0wCjxuR3DvoxSBkSz7vdW8JOLP FlYZamdFFPFS3wkD8PbA4XIIskq9vbmjyICrlqLwtVErrmTFvtOUdSddO15tn6EoyLso zXwl4sarbvxH4usIvoftbt5TXgLn3zRXz4WAFHEP9ig7b2LaMqpVPqCey0kmG9lfSnqU OKyT89YwNumJOD0tWVRZEVPET9cymnraIRDkocTEOKlGJyUePMjsR01vuiEVCtX7u8Mc ZVrD2iygs3PjJwsqn8g/s+lOMpFbn4L7M68d+fa5xwtA3BiHDUVwV2VA3bmi/tZ4rnrD s7tg== X-Gm-Message-State: ANhLgQ2DmkCAQ2GR7xb20CJZjwOeMCxzLkBEJspD82xy4HaHTQqtyENs mQvDTcTrgUvx0SdaFRKtcfaBeC364J6ECQ== X-Received: by 2002:ac8:68c:: with SMTP id f12mr1873056qth.100.1585251473638; Thu, 26 Mar 2020 12:37:53 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.37.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:37:53 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 16/74] tcg-runtime: convert to cpu_halted_set Date: Thu, 26 Mar 2020 15:30:58 -0400 Message-Id: <20200326193156.4322-17-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::843 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, "Emilio G. Cota" , 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 Mar 26 19:30: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: 184884 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp457580ilr; Thu, 26 Mar 2020 12:50:26 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuCvkShXQgMACEu9Pd76pghRN+QVDMwBGjS9vH99afmnbb2n041sb6QyrRSZ76bYBifIOkm X-Received: by 2002:a37:5209:: with SMTP id g9mr10452554qkb.237.1585252225883; Thu, 26 Mar 2020 12:50:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585252225; cv=none; d=google.com; s=arc-20160816; b=y937qP2jT//wuNQUzwCZTW3ye1Sir7zj6kg+muG8aUcfi0/OXni4/OZRAuxz2G14P6 1WHDOAvH70vWBXWX0KF9WMTO59Ll7Oos3LtSIts4rr4/BBjQHSOzRPDpaGZ99leqq1Je abvupYZ/TaIyh36wZjCTbl1msttvPjSFw7F/u9TNT1HksiVzkWuB5R3kjdPuagpdJFk+ kfjKcXrDCSkHVn4oJNJxV++Kq8wUMTYQhky+zR/i7bIPgoA6shmR3mWPn64P5lkaczsm vGTKOd0ahVqbIQYfRCMWcrzGNQ49roMZyrcSdsY2vzFIGb2RlaSKo85ZkPchvP77yEXM NW+Q== 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=Ja5jtqBc7H99f27FAjdrB7FncoyyAxec67WX9+PhDps=; b=ZUhco4U1sRGUkVP9/SkWkANqNkuwSApIb2idxvsFeeet9P24Yj6pcu/QU7HIk5YWk5 S19QhR9OBuwnw4Ip3OvdYbfxVZh6DcA6l11psYh3do8clcNdN6jUfFdfR0zHq1AMMSFn e6EcI8+SV5RhPtYui4amKPZd2EEZSaKsbYd4GdQG3/RuzW18IqpPjUmuqE5tZwPo4mHb ZFdZbrrB2tIHFfssQchBjwWL6R0rqfqY0L1Jm2AWB+xCPeqt5k14v7L7PP2wk4cvDgXg h5YTWNFsy8Ox0u10cDm4TSOCPhI6sToCn0TH7aaJ67edjlf/m+ZMTIPZERp+fe23ksag 5cnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=NQfygxxJ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 p21si2075853qkj.34.2020.03.26.12.50.25 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 12:50: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=NQfygxxJ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:58946 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYWH-0003MX-B6 for patch@linaro.org; Thu, 26 Mar 2020 15:50:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58572) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYKC-0006ZZ-TA for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYKB-0001Vf-Qg for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:56 -0400 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]:42621) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYKB-0001VM-Mg for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:55 -0400 Received: by mail-qt1-x844.google.com with SMTP id t9so6522247qto.9 for ; Thu, 26 Mar 2020 12:37: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; bh=Ja5jtqBc7H99f27FAjdrB7FncoyyAxec67WX9+PhDps=; b=NQfygxxJFmusy3RgjUq6zaZAmnBBDKaMp47ANLxKsvYwyQyB7p3Sm9NZa37/ruJdmY 80uErA9Muspj+zA9p8glIeK9uzQr4AMhnVT4+ZleafJJ7/fsjgSLQkxm3AV0n/gsrhe6 9g9KWzJvtX4tq0LbBO6IquZT7NvoGIVLDaP0puI9l5LeMu3pBkbL8G3O29r/Ib1x/UIw cHQ2nxzWPRR8L2sA25XRHa1NCv01Aj1QeL3M3InKzo8BToNHabemn4e1whlwi1x5ot5i MsEDRaCWQE2TphWcNPGg92SDU8QnhY+96P+DobOGrIyUIfILpbx5Jbl/H21DIvqvO79u h+ew== 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=Ja5jtqBc7H99f27FAjdrB7FncoyyAxec67WX9+PhDps=; b=bz/km7Vcn8rrEPAUUXNvo90HZHE7006YZHOicTBcvsHXLN2E3fSY9XSiPi7gQ1sh2a 5krRi00WIodOl1YTQmZyAhxop91I4LRuFcFZv9zBzXyeaw9wxSNdIcdpFPZ8b8jroI6U +BeN6Um49o9mrG7ZqS2xInIweiWoFaPL4XzvD7Jt0oqWG8pfxi78bq23LPf14sl4iUq4 BtikRFEt55bViMc7lBn2+Auc9mk6Pm4PjpiBI8BTdztV4zLVFup7JBk/9YC0fkXaJ17C habXEgJpwmA9WCXK+TEaZhHNNT6l4Krsp5IWOcuiU56grT6ApQxEHX6G6Yw8OL3xH5Et 1bCQ== X-Gm-Message-State: ANhLgQ1qTYyCvCZmrvkgyPEclcgHoOcR9UscAEbA9JjIGbmqSrJ/YLIA oukmgllwGqkXPkYqKwaln5nnTv2Fz/6+Vg== X-Received: by 2002:ac8:748d:: with SMTP id v13mr10390444qtq.390.1585251474881; Thu, 26 Mar 2020 12:37:54 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.37.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:37:54 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 17/74] hw/semihosting: convert to cpu_halted_set Date: Thu, 26 Mar 2020 15:30:59 -0400 Message-Id: <20200326193156.4322-18-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::844 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, 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 --- hw/semihosting/console.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.17.1 Reviewed-by: Alex Bennée 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 Mar 26 19:31: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: 184877 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp454874ilr; Thu, 26 Mar 2020 12:47:24 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuS4wB4D3pzPXPQHurhwIbuzIYcO7XkULv70Qm/U4NTEt7DGiwg9VS4n1kwYpOC0VMO9H5B X-Received: by 2002:ac8:4e8a:: with SMTP id 10mr10337967qtp.244.1585252044739; Thu, 26 Mar 2020 12:47:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585252044; cv=none; d=google.com; s=arc-20160816; b=ScnXSvpu/q6Qo4ABb9IJ95E3RZOd+VzpnPO0UzmJopXKGOPdNFJ7YjhT5MRq8bpVR6 scKBUZxr3qH0XZjMYS+uYlTaAhO7JBsVk4yo8P7wCMVgxba2EmhPyr/J2HcqFUEPzC3q L6aZwpST19I4quvVFPWH6kBdgSCr5yBnLRQmoclp++I8UcbH/6effb8lVE8cdQ3hbVap 3ZVdC/5zhOvzwfyWkI5saBd+fqQvqeU6lUIID8v9Cp3FQNcuWSKWgGuAJm9I7uw6LDPl lIwKa7TwUGYJQeDDnpX0GBGRYihTPBiy9rSR1CsdS2Rxp7p8U6sYS5VbBWzob/BimVQI HimA== 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=/m+IiebGsEqbgq5gGcyp7fO4NhJnxMLvbJZusMVHD1E=; b=vyPaGps8vov4m3fXd2rx38sRfB530Pm/JAFUm9Zkz1ejK38nEqUb9/56JE3Glyn/Xq w4L/Cw6BF9XrzjUlqCOtSPDOvyAsFjuOV4L3o8Ron1DuEgMSAAwy8kslrHZmWJIpnBlY lgq3uYK1PoQyW29HmCLlxE6QQ+e8xWp3rBZ6rJTELg5ibQOxlQQoQ2AkogkAXLVGdr6L 6nCVecuaU1UQsK1Eyr9elCE01Okl+WK9H7atOHFdc5g7m3UQwt+sKZyeo8Hj+UJVt597 1KfPNKiSGQMAcJJT4DLLNQ/+SDyT76814Nl2zQahR46+GYGDqwqGeSc/O0wtUM3XnnS8 IisQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="v7/zUnkg"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 p16si1230893qtn.363.2020.03.26.12.47.24 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 12:47:24 -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="v7/zUnkg"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:58864 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYTK-0006bU-Mb for patch@linaro.org; Thu, 26 Mar 2020 15:47:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58614) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYKF-0006gd-HC for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYKE-0001Wy-0H for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:59 -0400 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]:46721) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYKD-0001Wl-ST for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:57 -0400 Received: by mail-qt1-x844.google.com with SMTP id g7so6489255qtj.13 for ; Thu, 26 Mar 2020 12:37: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=/m+IiebGsEqbgq5gGcyp7fO4NhJnxMLvbJZusMVHD1E=; b=v7/zUnkg75DmSoSn6s2WWDbBrGYmW6rd5cDhHhnJh2xXkxKzWj2vUqvO2XZUqNfg2A 95XMrI4JyvBqu6wVWBPQl55XnVza+/EujjyihEJvhVVaJC5Ls6PReHWWjCmMoamzo2Wt UrwmNMFQf7Mz6gGFhOl8J2I642o7AKf2shGcEOZ9xbsC7eZiU/My23hDOr2iB7g4UEPt NCNPCuvZ65jfQebTYvIDVhTKtymbcNSQCV7cn0brmsPXEgDtxF5PFBzGjr3vuctHkZi/ LDa1g+brfnJQOv/MYkOgQdA/j6SXV20abNP9RAL0+gyYtexKmTmnVREV8ZhPVF2ZfvPq A1jA== 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=/m+IiebGsEqbgq5gGcyp7fO4NhJnxMLvbJZusMVHD1E=; b=apP9GVgk0qyWB8aV27u2pFXt0vsDaw8HixgZ2zaP+D455FDp8sUXzLb/juKvb8e8sE Apcvy4rt2gk7AOyBbelws/xE5EsXRHjry5oCODSoUK7siWpi1i44nrmUHFvjwdUQVRk4 hNG1x11LlNmZ8hTmccQk6npYvJWkvDyvK2ovXvTzTErn6rrZtbKzCNvIoakUE9RMQ8vm c8vueNnSdFaHpf4n1t38Li2lfAGa3OJsVLph639wZVsdFZB+68BiOkVRaGv5qVLkTU6T wzZRULINfga3gGziyzh0p28DKHqBpiXqcPVzytryK5pnZq4NPMWCysr3XkTJJUnwLPtZ DcAw== X-Gm-Message-State: ANhLgQ03U4LQBohTZc0cwCSoxKjn90afb0DNhFtEkK1ReoiyrBki7zl9 QuTS3wfSYCNw40a/UTZZT5WC9Nk350zV6w== X-Received: by 2002:aed:2f01:: with SMTP id l1mr10266198qtd.37.1585251476384; Thu, 26 Mar 2020 12:37:56 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.37.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:37:55 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 18/74] arm: convert to cpu_halted Date: Thu, 26 Mar 2020 15:31:00 -0400 Message-Id: <20200326193156.4322-19-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::844 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, "Emilio G. Cota" , 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 a79f233b17..9fa514c999 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 Mar 26 19:31: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: 184868 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp450798ilr; Thu, 26 Mar 2020 12:43:06 -0700 (PDT) X-Google-Smtp-Source: ADFU+vup1NqGB4/zEGZGa50hUu3cVSs679tVDAnHZYbxUeTBEQEhZvaT6ble5KyLAW+rvG6o8Vbf X-Received: by 2002:a05:6214:12f1:: with SMTP id w17mr9728039qvv.132.1585251785944; Thu, 26 Mar 2020 12:43:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585251785; cv=none; d=google.com; s=arc-20160816; b=jyarXLJOM+XV4gIUp6orSvFVFTgwTKoVQOwQlyAcqJvTTu/9+jQgJZkttb+RRAsqDl sxJOVWepKQcvX/zFr56fcEJGH+/BJ9gGRcTiGs7AB3h+3vBDsXiDZFQZQxLcn309Dupp Go5bkC19asqFW13lCC7JdQh6ELVwwy/ns639+X/0visbwBqXkruxm8NTCI23xxlhzJKe 7DVT/qloy0OnSKrJy5/JTm8ffcl4bz8RmPzwHSLqZeSbRp+NqI+aAGmnc8JVvMWEVzTa phFGA9Ox4Zp8f82FlBaJfnXd7az9NTDU9PLdOPqY7h+LtuWt6swgDhPeLwZouNBktTAS sIWg== 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=XakH+TNmxNVoVBGsDu2qbkLdzQw60VegxmdgaqwgAj0=; b=kUHgsRQfUyyP1Y+2Gx6tNbW3z22xNdj4yS7AuZtXDao28W00OnRGrlH3f7Z1gMFUJl lEJ2s/73oXIa1UmiWqebBw/3LsBSPPUleTCfjUoj89uScjqG4Up1oCJMRoqZcN8TCHFC qYxT6x1WHr42DptN/Hp+X4UG+LX6TP2FUCLLBensS7jt7p0hDCegt7DvgqNxozj5IjKD vY74WDcRgwylKsstKXrOQ0yQN/dJcnodh8nvGQYjeoXrX9AF1k3FM0xHymAEMKiUgsf+ x26l26VoOqXyfKfOsNAdG/1P6FntD0L1SqjN57BuUsVyZN8oBAys6WL8zcYQs3IkclM+ bbPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ucBFN8KD; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 z22si1978892qtu.85.2020.03.26.12.43.05 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 12:43: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=ucBFN8KD; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:58738 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYPB-0007r8-FN for patch@linaro.org; Thu, 26 Mar 2020 15:43:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58644) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYKH-0006kJ-6M for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYKF-0001Xx-09 for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:01 -0400 Received: from mail-qv1-xf43.google.com ([2607:f8b0:4864:20::f43]:38472) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYKE-0001Xk-ST for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:37:58 -0400 Received: by mail-qv1-xf43.google.com with SMTP id p60so3704686qva.5 for ; Thu, 26 Mar 2020 12:37: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; bh=XakH+TNmxNVoVBGsDu2qbkLdzQw60VegxmdgaqwgAj0=; b=ucBFN8KDccyVpspNP7rtzck7Rw9u7FrhI4wFb2lIroO4nSZRIobjSJD5dxabVFFlck YSgD6Dja2hLVCAVpC59fLtoNvW7EJZNS6GuuaWRgbu+zzGlR/CT0ox5BPZMAmjyBIBmK 17AV9TtSdEKcfQErm6RhzhAb45blDR+7nlcHjpZy8hoWCKN2bKRYhGJGKZLN19YdCuN0 Tt6tMc42hLwAsS0M6vQjo26BNgFOhwl+/gD2RHKBjfY+fz0MTiR4jWv2300c8motJaL2 gdtv/fq7guEmfIjrG0UKoeEGAqB2KJW7Jy3/wo9A/dutXaldcYAxSx6SAezkxrtDgBc+ eyiw== 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=XakH+TNmxNVoVBGsDu2qbkLdzQw60VegxmdgaqwgAj0=; b=SNd8k34OPekJPDMdWS54btkaajpk+pPLgHwpiJwiquZkMGSrZZYy8d5bhQomN14lNG k6U/Po5b7dUwe1Vo0z/cSfeKpMJpH7pOwyKZMysRJ96GeoEWJnK84I6I1OUoqxhCGJir UAzChu5N7BXH/qxnTnfoSfrjBBqMBcP6fu+Xwx/iv2ci6ohbddlIYjJua69/SJ3w/m37 vexsk1YobpEaCBFDgm0yI9/gyU93x8Q5DKO9dA0dVlTsv4WhTTC93TLpOpKd+TiIeGIv XbxQNTi1r/D1L8rtS9Gf1MIZyaM8EVIkj/0rWyXcC272jq5+vPlu+fChjhYel84BAgZ9 O4AA== X-Gm-Message-State: ANhLgQ24F4bj+o4wz9GCuVb+IGghbzIwiRD/TdYqXVJvkwghermiJ5E6 LlbWUOQQn0Dtnp08uQtiHytfw9mClxRKqg== X-Received: by 2002:a0c:fb12:: with SMTP id c18mr9819739qvp.171.1585251477727; Thu, 26 Mar 2020 12:37:57 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.37.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:37:57 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 19/74] ppc: convert to cpu_halted Date: Thu, 26 Mar 2020 15:31:01 -0400 Message-Id: <20200326193156.4322-20-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::f43 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, "Emilio G. Cota" , qemu-ppc@nongnu.org, peter.puhov@linaro.org, alex.bennee@linaro.org, David Gibson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" In ppce500_spin.c, acquire the lock just once to update both cpu->halted and cpu->stopped. In hw/ppc/spapr_hcall.c, acquire the lock just once to update cpu->halted and call cpu_has_work, since later in the series we'll acquire the BQL (if not already held) from cpu_has_work. Cc: David Gibson 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 854cd3ac46..77cc1d245b 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 ac1c109427..d655ce588f 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 0d50fc9117..a9485000e4 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; @@ -1688,7 +1690,7 @@ static target_ulong h_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 9fb8c8632a..84c26edb60 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 08bc885ca6..e686eda0f4 100644 --- a/target/ppc/excp_helper.c +++ b/target/ppc/excp_helper.c @@ -276,7 +276,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) { @@ -1075,7 +1075,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 597f72be1b..13c6626ca7 100644 --- a/target/ppc/kvm.c +++ b/target/ppc/kvm.c @@ -1340,7 +1340,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) @@ -1349,7 +1349,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 e853164a86..5c2f8ffa4a 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 Mar 26 19:31: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: 184887 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp458948ilr; Thu, 26 Mar 2020 12:52:03 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtixLxD2mcdhL+WVG1gK1aU4jquls+jvB4G8lYHOOwHSIx26SquxafFvEPxqAudY1PmYl/S X-Received: by 2002:a37:8d86:: with SMTP id p128mr10577622qkd.250.1585252323411; Thu, 26 Mar 2020 12:52:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585252323; cv=none; d=google.com; s=arc-20160816; b=Dj50QZ6Upqj7mEtIn7wXP3kI5AucN2KxxcC6Cnu5janfWaJIOqcAx5B8frMUMFTH9V BJF+Oe7VipG3L+S9g39WhJqymMefw0isuRl2VREySzibvZFPIrrOiJGZQvq2rcN93UWI PC0hmh7iWiKFUbOpIWIiCiS3w5qLgkjhGpiEG/cW0NAVBdrTzCP1qsVXRWuwq6f+5pEm WneWAgSbkaNo8h4c+c93oG0UelFNFV1hiXOcGJPz7knaBL3qxX8EcHkFoNX1E1G/NJ94 WiaJs0hU/sRTodOUPhk9bTssgmmTJxgJwdE/XYpujVHEiPC9Z/zBAeAttyRCIJX5t3tz sF2w== 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=wBvwFY84rWz5t+YyezP1h7NT7Wtc7ijXZNBfdMJ+x9IxH3rPj1RPGhtZ1+VYc1SYiM YAeyws05fdKjvb2QRqeZ9GcrDTNZUZ/YvaAWZMWMU9Hfr068bhIycrYeqUQDfmVyK0fu YkefM4lu0rY/cv8I4ipFj5tMrOit95uPtVidMIcpWpMVcd2KMbw+JIsTCjkiJ9mLoo8k wucYYCa1MZ2ha8vI9R6Mef5c9z1zHe42NhkB5934MdFfHtoOgxnY+NtlUWCc4NZK16/2 YsIlRhJB/zFewyMKe58reYPKoS8mYc0a461E6cc0Au+h04IalqNqYJNC/2/cR0k251MZ y1vQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=xlWEKjN8; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 q67si2023371qkb.102.2020.03.26.12.52.03 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 12:52: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=xlWEKjN8; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:59014 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYXq-0006n3-Qz for patch@linaro.org; Thu, 26 Mar 2020 15:52:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58646) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYKH-0006kr-Dq for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYKG-0001Yv-AF for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:01 -0400 Received: from mail-qk1-x72a.google.com ([2607:f8b0:4864:20::72a]:35308) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYKG-0001Yb-6B for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:00 -0400 Received: by mail-qk1-x72a.google.com with SMTP id k13so8204710qki.2 for ; Thu, 26 Mar 2020 12:38:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=B03XAH5wL6d9wQMcetAjOEJJOmedJjFZih4s04YDqvs=; b=xlWEKjN8U6gUtcJFuizFSftU7WxSsbrTQYUnA6l6OKqREbnavggItUTsECTpAwx0HF +ywJyPL4LvlCCe/Wwyd6HcEHKV/1N4SrA0oiZDY18gMOZhPE3qqR1X9ImybUUHo0nlNw BbqQee46nK/gPpcNBUopsJTeP1xZYdx322b15ESj8StM9e6zcnQ2an9cyDFnMsgIrqZL Hk7jiwYn2Gr0Q9oPC8gncAk6d42UpZsaIYFU/cuXoVqQHp6c6bsswHPZ5LNZo18xaN/z NVVqLTaUxCZUpfGw0b+0o6/S3qWm0iBl68h06M7836rZeZhgxGVx6YQ0nbt6jLgOPo/I 8WTQ== 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=rz5x4UwYIy4aAAm9UpGd4dlIC6fftQCaFXDgjRr/sGlwSUAjNp9wcTOM2owCpszAzT VUEzKt1lrlW4kDAv975vHjMUvjwJhIdtOYdimpDFxhzmlJVt+8JE5PkA6YsH3UwOWnEA klBegSeH6W2BqSwHeZdhN908Pn4bz0wmAsBjVOeKIMdzFbY0GjHbbI6m9EbwlnSN7M94 kuDUVhtOc9ZHGIaF2RmXWqhM8oY+9Rai3gbPN9RXdLvkrMzkg4+Ofhi+uBbiFV/30Slm g76UILEC3yot9AC3LXPtjA8Sxw7ou9sHRHv6QRgkei6MX2www4CTfbFSVVvSBbVTGeGv HBNw== X-Gm-Message-State: ANhLgQ3GOrDG9TmLhxzVy7Jg+bTi0EgxSSjsyZqk6lSEKuTPyYKkbklE 1eVX/2JvCyiPc8OkmgAGcRd0QCIAe51uTg== X-Received: by 2002:a37:b4c1:: with SMTP id d184mr10453998qkf.452.1585251479100; Thu, 26 Mar 2020 12:37:59 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.37.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:37:58 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 20/74] sh4: convert to cpu_halted Date: Thu, 26 Mar 2020 15:31:02 -0400 Message-Id: <20200326193156.4322-21-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::72a 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, "Emilio G. Cota" , 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 Mar 26 19:31: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: 184892 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp460273ilr; Thu, 26 Mar 2020 12:53:37 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtizaft3BosiVTSxDZRFfw6llhlmPMoUwHjZYBwYrtTvIxqWdKUeNxe9tvMb7Op20ivP2gC X-Received: by 2002:a37:6215:: with SMTP id w21mr1812631qkb.149.1585252416903; Thu, 26 Mar 2020 12:53:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585252416; cv=none; d=google.com; s=arc-20160816; b=niXtj6VWMyfzoLoN2gHtWiALMOyJndvwXibnIc/Ug1pzx5F6gx2/WVdSxSMI9N2zuO ae7U4+eVia4mJ0rz34YtjwTacY4FQYpwPLZLiJFNdrYFgAfbXBcxc1UJObFf3Y8xxr8H D+/em1Jdx6xxTeKCoOlTkNdxLIWY0lzKIT/5lsIK1eEUdkI6O7PNJ3GovwyjW8XXXupA d35lzCWH7rHBZTqtqdud/jntRMLN9CEEVK7WsRubBNQPMx2TQdkIeMnvQQLTGDIrflSA o/iW0IshaLbq4UAoaR9DJxxmrD0TacmgQDTawza5diFH4lcTQ3bbOpoUIH7D49rFFLCY cFkQ== 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=2nNesVLP0H+hSoPOCqRhlnWjlFx8aHtTYwidsNPlWBQ=; b=xE0Uvoed3kT9YisaCL8yibGjPPxGN5h98dZCqGch70xkWhM2/LmDglinzOQe7j0+ve xrLUln3cCabY0r0Q5y5konxX4WT3kymbRhk/+mdtkyx2zQ77MB/OsFMogB9sZgboOR8O eWkAzgkNG2hsoHl59jHGO2aZvQmyKUxtt/TA12tyjq5GS8k57RSN8iyQlLas17fHTgbB HSI7FlYhAJGbvHDL6FNk8xwsZvi7XF3Kmgvwbf5rGEyzlyqkw/CgSzc2Q4BJDo3/rq86 clUjhtkVnD4lgig3I1v8IvqIfqln+opyT5NYutytK5zysqsSBf680VJv1nQNsP2RUUWb qLDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=CIVwHgfP; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 d9si2014514qki.62.2020.03.26.12.53.36 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 12:53:36 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=CIVwHgfP; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:59072 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYZM-0001n9-GA for patch@linaro.org; Thu, 26 Mar 2020 15:53:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58670) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYKK-0006qD-KK for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYKH-0001Zu-N8 for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:03 -0400 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]:41698) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYKH-0001Zc-Ie for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:01 -0400 Received: by mail-qt1-x844.google.com with SMTP id i3so6517771qtv.8 for ; Thu, 26 Mar 2020 12:38: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=2nNesVLP0H+hSoPOCqRhlnWjlFx8aHtTYwidsNPlWBQ=; b=CIVwHgfPMvVCfjlVDh+xGO9CWtJeAa0bqfNWScau506K0zjFX0XLV0SFmt+6JBfFWS NBa9+yFeHH7R8/ZoX2CV+hXtCNfb+I+HAh02vV95NfegqgBa5/qCumPyfriKdG8JhbJ9 h+L1bfyTCOIHOWKVqm0SoDIpbJUiFDR7Y71k1jTYYYj2mmo7LGXxb6wRhapxDhBVUyZr avVBhjxkB56ul+a6nO1pf4F//502Xt4LytkkN4OL3gNJfAtWlXpL9hBWF7a7UHBKm5wU tpIAXsry+VnyBdI5h5vAnk02SbNQnH4zkPjmZzRBmczOYQCml+cG4EoNJqJ4NbsnccD+ txxA== 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=2nNesVLP0H+hSoPOCqRhlnWjlFx8aHtTYwidsNPlWBQ=; b=oSQtqxqqtGFgnNB90X06OmJfsLhWnoDElJmVw74qjm/BdWhgluQuo0uxIMda9iDxwy upJvHxfDX9ONH8KpWuv1yp8u202vhyP1AuFh5kOR/ieTC9Tgp44CbEcmiOJn3p4/oYXx 9+xKQJX3vKFCoFWbjgG5XlAL8PoI7+OL+V/ghzJMoLDLYeuNODNGSKv3bu8Rmec21TGs DArtf/zlaQmNwUJr1EXLF1PkLo4RT7Vc1u4VhXt/2dq5k5hNEcVNYkT1FDgboMwf/T5d Hsa0VlSfm4m/Ht9A52DvslBAi1jmavyQKp8Pvc5P28Kpgc5P+i9Xk45zUFsIMwk9elr1 HwEQ== X-Gm-Message-State: ANhLgQ2DPz5RFoIAHeQr5+CSboYsk89cdCBbZ3je75uBm38+NCZy6p28 lDPYHs8SDwgLw/2RcuHaoHxhySy5KWL3Uw== X-Received: by 2002:aed:2415:: with SMTP id r21mr1154374qtc.82.1585251480646; Thu, 26 Mar 2020 12:38:00 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.37.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:38:00 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 21/74] i386: convert to cpu_halted Date: Thu, 26 Mar 2020 15:31:03 -0400 Message-Id: <20200326193156.4322-22-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::844 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, "Emilio G. Cota" , 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 34b511f078..280da50abf 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -6107,7 +6107,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 60d797d594..03f3c66cc2 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1864,7 +1864,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 69eb43d796..9f1e28387f 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -3593,7 +3593,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; } @@ -4151,7 +4151,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; } @@ -4174,7 +4174,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); @@ -4187,7 +4187,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) @@ -4198,7 +4198,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 Mar 26 19:31: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: 184873 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp452244ilr; Thu, 26 Mar 2020 12:44:49 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvnTSsSJHQhlrfPffO74g5OV27GJGHk91skzWr1fiQv1NsWn6zRnRNf+n+WIV5Cxql4BiVM X-Received: by 2002:ad4:5807:: with SMTP id dd7mr5296357qvb.151.1585251889052; Thu, 26 Mar 2020 12:44:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585251889; cv=none; d=google.com; s=arc-20160816; b=IGh5pwU0Br1Jxk0wKtA1ssVYQ4oEbVhH9YwU+qtqNEmyccnKuyriBbZIOTckOuTfzi FsQB1o6fHCO/WKz2uygxDsB62NgiuX2lEwEo4pT3Nt89pZc8pBi2Fa6SQXzJOtUUzXuP +NejX1h2I9Z+JEOtYzqNA+ii/ZXDCq4OgyCFDKJXy2y5hp45V3e9bpLxOJLRecM1vwKc 2QHjfwhrdHpE5E1i4US2/ISrVBNQzB7jEvfQRNZlFp6brp+odTo9QvVIwd6NmWMb1bJZ exTP4B98Z4txoA4dQkiD/C5jhZVwT5bfRBxGSDfEaNGHJ2Xeghnx9hbnnCZwBGe0igwM Bh8A== 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=ZXA7kPGx7QTReAIJDnFhdRYvoiCH+hwzHXDgadbPLe3ku1FrS1iXc3mBzS7rTYutt3 WLiIwdlct56F/xYdxAuhyrOT1ZT8mptUXjdjLWp1WrKmSS7mThBg6nD/Kt130VAMCH+u JPTLPTdGE2HLn4/4sVp3jEkCaNAuWNxcxRyzTcUJ8J0VEBn6ly0IdyxfPUMZSqgUfNQq Ix81Hz0NEctM4hNLZk/QFXPDsbwM8jsigyMDrtVJijpd86usNYDFDnhMkMnQ5UUnS9bP m6P/9WOUP52uiuz+55KNaLBfdQ+Z8kCl96W0nlIRE5IttN/ElPYxdVe3NAxoETAyt83r iIpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=uFqvlcxo; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 cj14si2051638qvb.65.2020.03.26.12.44.48 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 12:44: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=uFqvlcxo; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:58790 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYQq-0002uL-Fg for patch@linaro.org; Thu, 26 Mar 2020 15:44:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58697) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYKN-0006wH-II for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYKL-0001bT-EH for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:07 -0400 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]:39017) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYKL-0001as-A8 for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:05 -0400 Received: by mail-qk1-x743.google.com with SMTP id b62so8193688qkf.6 for ; Thu, 26 Mar 2020 12:38: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=KjBP9WZwlnczZ3SxEnPdyurMaB67UgSlf8Umf0tpZgo=; b=uFqvlcxooVEiTGNEsNcsRcXt5/VC1HstqJIHUqxEgyppf7yIbMNyrJInVP1QctuzPw 63uX8s/uSWBSLH/So4Oed3318c0pAXxUPD7ebHDl/yXpnJJS41qaN8cjGkO1FOJzIKNW DPc9nXYY0iKKsyodj0FXRqrJ4PBx5DgVndwaxo1dlAe5NXFueUx1mjPH1L0OCUq66obg 6E12viiSt/Uy1LXbd4NGpV0GtIXie9UP9YhIgV2vTEvEo4CaLwUNeXg5nCz+vNBoz/Sp 9ehmsmSMvWRtC0kXAPNimTkPckoqnd/wdpRKQN3SizerFXKX0XEofCtoC9QSC8qku6sB 2Xbg== 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=WypUmJu4ic0eqUMAUSwl5lFPXGTSqx6fv+kXKDPPfZqYws9WIcK2phVCrNeSmHI8G+ hbVKlXul1DYqvxHRb82sg3tEo40WVbkaEHLzOCxLz5VdrA9Yo+MyuPfsZ/tQd2RrJDo0 l1xjGnlk6sP+FpFjvj5lQDxlvcVXEEG2ue+WZj+BbAmFZSLAzyK2BcyoQABfwdX4s4pJ gqzlr3wnB7DDxSHUU0a7LwjKbjAesEVqZlPNweJq/sWuPBmVyK3M4ve+nW3PMagXySt0 AxDq2lHIAsVwZiOGU/+snzjiTpPb1/os0UZc9ffnFe2yaIrlGmZFGDcoT3oRvj1jSIXh xukw== X-Gm-Message-State: ANhLgQ0N1b9bBKAin2iI85Qu0rZvfQfz7l8ef2Nfr9XPLgNBWhYWwtBW Jj6WCqV/3NFCu16+9Fjh4Hexf+f5KUncKw== X-Received: by 2002:a37:a505:: with SMTP id o5mr10355628qke.30.1585251483153; Thu, 26 Mar 2020 12:38:03 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.38.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:38:01 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 22/74] lm32: convert to cpu_halted Date: Thu, 26 Mar 2020 15:31:04 -0400 Message-Id: <20200326193156.4322-23-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::743 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 , "Emilio G. Cota" , 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 Mar 26 19:31: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: 184880 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp456554ilr; Thu, 26 Mar 2020 12:49:14 -0700 (PDT) X-Google-Smtp-Source: ADFU+vs5QTBFD/5Um8De2iwGlTkfr+DTZfO9LfGwkfz0raPJvbHH4nw1/kx4tct6p40lLGkmUcqU X-Received: by 2002:a37:c24d:: with SMTP id j13mr9748225qkm.383.1585252154524; Thu, 26 Mar 2020 12:49:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585252154; cv=none; d=google.com; s=arc-20160816; b=mXeyBq+xYOqXvJTbp7LsuO4dOOqb+QTWA/I72VKDgk23c/x3pFnTEd/X1eODa1HMiT EA0ClSgwVer72PcAsJaPUgOPNKam4xieTG8Y6lIvQvqTyd2gOVU9JBxV6gNcKCP6ZSw4 Jl/Uav+Kvs2shYwfnHoCW0ugaj+GlyOFpJN7kLu2niRebFFxvxEhWz6zzphbns08I68R g+uzso2I2IuoCy1PCXWa+94GP80cOEWUlRLiDP34iVS7Vmzs0WcVmUAdFrMrV9oUGJ4V GCdjcNstSngQxg75sWLddnm2oSdIocbVLVpxN70uttGi9G10EkruI/vLt+nLDfzqEHMQ Rs+w== 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=4qeIcEWpz8LKLMc/KvwaeZt/B8JbWVxadE/kdF7i8Q0=; b=L7L5VtiLelh3RQAGcBKhN0pTsd1BnHAh2P1ZgoT7MLncnNI2qSJR3SwpPqWuA/ISBD UGhswA3DCmIXAYimQua++g+vwHCvBIpeOPGAIY0Y+gel6VJkaurUGgAagVRu2x/ZDpd4 Vraz3yXvypUM1WXkZWBp3wHFb9gWBjoYcWm4frZboiw5IY6Y5qRzi5tQ0NsOVB7+5eOY S83F7GpfXh2AYtNKrEO1FQcp3IMbd3aAK1lYmUXYnG7+9MiiPkKMwZup6e1liZC7umh5 vQZOuKkZzRAOa8JlMcFQsmr1FeUtS8TS1KTy8RSnFZP6sH1m9SaBAhdVdTw++5reBYF1 Y9mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=UTHcj9MB; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 ca13si2036084qvb.168.2020.03.26.12.49.14 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 12:49: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=UTHcj9MB; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:58914 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYV8-0001Yk-10 for patch@linaro.org; Thu, 26 Mar 2020 15:49:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58690) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYKM-0006uQ-MW for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYKL-0001bb-Gj for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:06 -0400 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]:46266) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYKL-0001bL-Cu for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:05 -0400 Received: by mail-qk1-x743.google.com with SMTP id u4so8131113qkj.13 for ; Thu, 26 Mar 2020 12:38: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=4qeIcEWpz8LKLMc/KvwaeZt/B8JbWVxadE/kdF7i8Q0=; b=UTHcj9MBsYf+7QJwkvCxEr+sJmI3dRAByba5AEmoCeBB8ywc4Rh9Z+UxzC17HO3NvU p6QeKPbba1ry2xUy/JXcQYGmPH25xLnBgs7cK3OGfLbhKqQVeKcL/UaxlGrn9Au1Dd7I Tr3GFvkXP0X2/hos4poYuS8cGBfm4bajJ4CkrxmEYwPyWQT15M+WuX8PoOoJ/8rvf1La bqZESQZUXKCHynOlC4ZxGa5p6sWD9g6hGKapjx7W4foDBYnTgSexIjoqAFHcmQ3CkscI IfNkPOnozCi0fG1PFau/CgEvTjpAxYcVlu/ElEWq3EVIX78CHN35ihDsAV/zyhvDMGIK Mg8g== 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=4qeIcEWpz8LKLMc/KvwaeZt/B8JbWVxadE/kdF7i8Q0=; b=oLfH+r22qV59ew5k1eviVsXeS3bFm+BykHn1/NRnNPhZvV9OqlTxwrR/F5jV/gZGm8 Mz0r9kOrHMWdoo+AqI5aSBLLnL95XXaBFWHAElYGwKpIcUo2TBk6Q6gMnIWqF9gPXeJW BO3xdxcp7HCQamWGVkH0xACL1kaD+bS4YiTUIPsnv1ULSHB3nzKzAyCOInsLNlX60EaV Mz3HDucIDRfiQb14fq+gO7Lhp6PpQlfFrwj288UNlRu3Aa0MxMX0qUKFGgH0/cTqmIoJ skam2BUojmfsS/0WVf4qdT6UtZ9U/sPqHzcIz+YCMFS291NDtnMxhvPQ94K9IV7VPWoE q0rg== X-Gm-Message-State: ANhLgQ2MhczQbmU4/45pWHwACQAzgEJtzVQM7KKgxTa+lru4WYAAt9v8 2w7MPD1b0genkc2XtzV/heXK9wqznvDQWw== X-Received: by 2002:a37:9dc9:: with SMTP id g192mr10247137qke.50.1585251484598; Thu, 26 Mar 2020 12:38:04 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.38.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:38:04 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 23/74] m68k: convert to cpu_halted Date: Thu, 26 Mar 2020 15:31:05 -0400 Message-Id: <20200326193156.4322-24-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::743 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, Laurent Vivier , "Emilio G. Cota" , 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: Laurent Vivier 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 Mar 26 19:31: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: 184874 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp452469ilr; Thu, 26 Mar 2020 12:45:02 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsoAkawJ7HzObIR2d+qPZswhqZtY/CB+CLWsNfSBPkhtIInSooabqNpy/SOpQm9jdbvRN+O X-Received: by 2002:a05:6214:68f:: with SMTP id r15mr9803938qvz.96.1585251902707; Thu, 26 Mar 2020 12:45:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585251902; cv=none; d=google.com; s=arc-20160816; b=SZM+BvzIljwkYHxe3M/RJj5zS4rT1Fwo+mdOMqwIxKA0Lkke/nN0EPt5oj/5UhjS2e S9lVtjQB3QxvIEFYpNa7EfcYMoPI+EBkOD844wdGZa0swiSeERVizacrT6lQs9AvvgKV URKRpzy/B38GX8M2mBpwtl9l5BSTLhfiPmDGdraUVOrsWF3XiCmXOlfsw+Atd6CKHVnp AFQCUry5A0GnZIR0wMp8wKk6TwKFNKlWHV/ED+aEZuZ0WR2ZHWDKKueGcthBvCwAbSCD Jx/9OhttzQuVjVbGErwnwloXeLu4AhZlhwgn4ULU7crVJqWqqQaJc/e+kdu6EYUYupcW g19w== 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=pDJJ2qo4ToCWQzF/ZnHJsHUzErpbCIWRBaIlxuRz7R4=; b=rWAYWWQPlXh9xMLQhqJWj8ZwQ6Vpx0OQoB0lA7z3Lz4dbEzTi2DkFOed9pkWlUpjya 9irag8lueveld7Ay0sdPAJKGRDfGexbqK6VCuFTxwrmAPOfWyvfrEdLQvH52tcXSEJvy UkLBNyCm6KZQd0yJ1DhNlD0it4hEJr5A6tIXZUmHgZaKdvkNP/zxKDC2PkCR7FnYv7vF vsewpD/BohuTQQBjjiVmxo+xpGKW2NywXykWL9lowuxhK2izVZrJGD0ute2OnWRtCnqS MHBPCezPfXFuBo+LAdc+J7K+CP9aW9vzl1AeME0+8Jo08oA/Lc2TaILEelxGIttOAKd0 RVjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=j9Am04Jv; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 c21si2127843qte.256.2020.03.26.12.45.02 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 12:45:02 -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=j9Am04Jv; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:58794 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYR4-00036l-3R for patch@linaro.org; Thu, 26 Mar 2020 15:45:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58707) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYKO-0006y5-A0 for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYKM-0001cR-Rq for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:08 -0400 Received: from mail-qk1-x741.google.com ([2607:f8b0:4864:20::741]:43201) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYKM-0001c7-My for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:06 -0400 Received: by mail-qk1-x741.google.com with SMTP id o10so8126927qki.10 for ; Thu, 26 Mar 2020 12:38: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=pDJJ2qo4ToCWQzF/ZnHJsHUzErpbCIWRBaIlxuRz7R4=; b=j9Am04JvMNolrvb3mKz6ykoWMAWIaNd9NrsJLyGDzlqml5mhZvRuAz+8RvBFZ28BVE EC4LsdjWXcDqUF7NqEkwtOdJKacrgBM/A0wMRxsEqKRUGrawn19CDfOBgfvKedPPdv+5 nNxiMJlL2sU7ebNL04248ozRp2EgPB7Nk1HQojWxhOpX5XVqI+PZwSxV2xbgpNiX8wNv ihViZ9t6Nzm4K13Kewsosm3CBD/ZJqUve2gAQC0pFGf64GwiJYJzkdcUMc6WxDVez+ib s1Gb4EcTqKK7gXmcVOr2uc68znDPVquyiYio+DxLUc+cfhVfcVWDf9pqmsjD1NUIsn6G bYFw== 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=pDJJ2qo4ToCWQzF/ZnHJsHUzErpbCIWRBaIlxuRz7R4=; b=ohTIUcfYke2K/8pU9dj6pSfrroBTzxehhGXQNackKbno0tPMaM2jVoSJZKMZlwL1Ky wCeQdwZwy1qvtTJ0TddpGpx4FyblXDewPhzc0+vH1UclZGNIA17+ayxdoKa59uyz43Yu Gz6qw5uVImw4opT02qcBphIxmDXld+iNJbs3zsz9vFOBWicLrvOqM5jMCB02/VxLBiIK atM3RJjmx5VYOgRB6EnAXX1DgArPTq8hwZggwfoe/uB13epAxJ5L7FNy3VYrOZ+jXc4c 7wvHKYVx7o/eSxb5WhL8bQAqGH1JGi/wMw1woRs7MEj/f5Lh6ceY4kJIlE9mkU3nE/QJ 5qfw== X-Gm-Message-State: ANhLgQ1jvIvfUgloLNmp63KbEWyGOTC1tWQ1qx1qYRl+NXyude9RSTaE BfMVosjP9s2opzBjvZzllFQHVWM4o7R2IA== X-Received: by 2002:a37:a4d6:: with SMTP id n205mr10323144qke.352.1585251485871; Thu, 26 Mar 2020 12:38:05 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.38.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:38:05 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 24/74] mips: convert to cpu_halted Date: Thu, 26 Mar 2020 15:31:06 -0400 Message-Id: <20200326193156.4322-25-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::741 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, "Emilio G. Cota" , 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 d745bd2803..753c498cc0 100644 --- a/target/mips/translate.c +++ b/target/mips/translate.c @@ -31301,7 +31301,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. */ @@ -31309,7 +31309,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 Mar 26 19:31:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 184895 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp461694ilr; Thu, 26 Mar 2020 12:55:16 -0700 (PDT) X-Google-Smtp-Source: ADFU+vs3C/KHOT9QI89tQx4tv6eDP4I57Qm0USUjFHPvpsNDL1+iGD0IrLjsvsbw6yZOe9H8UHGj X-Received: by 2002:ad4:4766:: with SMTP id d6mr9545362qvx.136.1585252516545; Thu, 26 Mar 2020 12:55:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585252516; cv=none; d=google.com; s=arc-20160816; b=rt+KgVQ6Jc7DdZascGMmPIdaggLEykyVVjJKCaYz8Dnb+nQrYH5m/eiJ2Ds2Rtm84r k70WwnEpAL9QtnSExGeyaOKafcbsftZnTG0R3VOg5H2IXtAJyl1W815ztdCycR7lwa6M fK7qwtWhAOfQb5YzBXcGFOI2snkObGCZT8xDs4bnUD3dhy8TOu/ohuLQ1IlbMsGxOt5x E8g+jDnZ+4egNcE8zkWYzDR+pQUydAA2Xd8U4QmX24zfAyYg2AmNAzCCWUMGQhFL5yfK nn9o+qK54p3lt26OLZ++grlHM47jJxsHpwZzyMp+1jFkvq0ZwZCU0A72TwR1fwLbcmPl 97iw== 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=vs48eZedUxWQlFVv5+3u2EpkTD6vBEvp+vgNyVuojZE=; b=o0R0VrFWpHa3NaFUnOjYnS+aUVbEdIRQqMSQsFZ7m5rLUoERPAwSBYFblNE+TjWTBZ Zu3u9jbyMmpbNVOKqMC6hDQvfCwaNUyOyeNlIETwi8zZmIxknNlgVAb1VZOL4vJ8e4uG Xjtfbzr161eELNhWXqvBGWhQY7IbEMtGZSuxzFKUEhiHJ7DERzlLuQkhddwtaTWFPUni 8PrfgFiCRAFECZf+lj62pOte8eOCjMhV8Qz83tZqyUGkiEY/TjNv+xHA3As8NWVVb2Jn vVYntiXdepWPcwXm/jrA9+iXJgAObKst7mobcr8QpUY+MJ21jfnPpzjshSW+br57Xglw qqYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=G1OGeqdw; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 f38si2048535qtb.307.2020.03.26.12.55.16 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 12:55: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=G1OGeqdw; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:59126 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYay-0005ES-3c for patch@linaro.org; Thu, 26 Mar 2020 15:55:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58726) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYKQ-000736-B6 for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYKP-0001db-6U for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:10 -0400 Received: from mail-qv1-xf44.google.com ([2607:f8b0:4864:20::f44]:32889) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYKP-0001dS-2Z for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:09 -0400 Received: by mail-qv1-xf44.google.com with SMTP id p19so3716859qve.0 for ; Thu, 26 Mar 2020 12:38: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; bh=vs48eZedUxWQlFVv5+3u2EpkTD6vBEvp+vgNyVuojZE=; b=G1OGeqdwAoyTcOcVZHtjVJvwM+S2EhBldzEufL9tc5GL0FWo72epLg1aLV9WXH52na argT5URRB8/pkbkAlvFuX+V7XEwvzP6C48U0uvqS/iFKg0s9JN8S7gJH6VFvoX1HF4Zw rw2M+mnvEYXX3lvIHUkR4pD1Zf5xGrMW+AOVJZPAZF3uUkpTGQhvuaEKuS5H1jk8mcDv P1yCHdrKe6jRMrnxDHOXJTPoDj1xg6YHSlLODwnXqEjJQE4Q6dseoN2fAWRRiXUFJCoy YEqiKfLlW1c+usR/80NYRT1w3Blu6zfp+gYs46Dac8+xrGR8IkenlKApX7br2KsfpkcD IY0A== 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=vs48eZedUxWQlFVv5+3u2EpkTD6vBEvp+vgNyVuojZE=; b=VXq37/TzM0zbVAB3ydsQpm17Zzb9KCHDJM/bvg/L99XbTy/8nnmCNuYL8QYO70zy5H /jl/SDxe15rHuq8gaJ7FDxHrTGhJ5OXaNjHYb1U3udrSVNmmSrYnrTVQ5XnYXeWQKfGx SoMsctx27iW9GzanOZfUDQKVSPhr+684/QvvM+pNZyqVK4+W6A8tCvMApvyYaAF8UnAo yNuP4gMyzO0cFIO4b+Nn64ieyfprvLTLZgxwQHw4WgOXlm1dr1ZqU4hV7OtC6gr0SowH Qk+yCMsaEUHzCzXOjPrBrrrBpTwKn2zm2JNSyGWgF7JetP2+Li3p9uuoPoWeLzYEHYlD G5Tg== X-Gm-Message-State: ANhLgQ0awSoI/aaG2xgUg0ITg/2zr13qCAEOvvZqIRlUCP2V1B8ObQ80 J5i+hU1sfOB7GWIjwmFXRPJzQnMdqHrFug== X-Received: by 2002:a05:6214:12f1:: with SMTP id w17mr9696480qvv.132.1585251487334; Thu, 26 Mar 2020 12:38:07 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.38.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:38:06 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 25/74] riscv: convert to cpu_halted Date: Thu, 26 Mar 2020 15:31:07 -0400 Message-Id: <20200326193156.4322-26-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::f44 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, "Emilio G. Cota" , Palmer Dabbelt , Alistair Francis , 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: Palmer Dabbelt Cc: Sagar Karandikar Cc: Bastian Koppelmann Cc: Alistair Francis 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 Mar 26 19:31: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: 184900 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp464699ilr; Thu, 26 Mar 2020 12:58:40 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtXQPMzN0MoNV4tNsfP9aI7HIEoc0hWnjfTAvYjN/mkqGzQ/21SfyCBORdARfAtNuf9a777 X-Received: by 2002:a37:7884:: with SMTP id t126mr10316934qkc.288.1585252720340; Thu, 26 Mar 2020 12:58:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585252720; cv=none; d=google.com; s=arc-20160816; b=S3WosW82OqeqrH/KuFPEfYxaGfEsZr955UFkodZi+f+JLPlxmI05G9UwQ4i8aiVZAW 9fEvNKu2q4tqnDwILoxrsvgp7IphC/Geu0QxLf6UvUso8bUiJmqnd77oirQXIl7h4XIM WlHib9af/oaAL3GVxIHLG2jAx/AbBwih0l2x/CwbyPSgHNrSTVjH7slPhfUYnmUsPJHH vYP6OjMFPif+PluyBLKkzqtBdhKOn4RHTVBEn1lGm4FNYyk8qkP2gmEaSr2OWA2EPd9R FTexTZtWZGRZ3CBUR3dls5Wq0C58YiHTj7dpGmj7FPfQ/7KQGx6Q7FgRArHlfsuNEMcb HTPA== 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=s4mQ5k/NFT8aD81RSmqYx0sDT6UNU273vdP3vhK24kE=; b=Gyfw60kSdgrFUlokRGFYJVOv+HuccLwk3CJyoT06avM+EaAUPPGW4SGmRkG9nsCdwx Gx2QmOQiWEPAJNzqX/hbItbq8J2kiXG18aXCPUCRFwhQh7sUsEbJEdNA2R6KH+bnI8by UyAsIdtDeVzdB5ESl21+HhP5AoAgfjp8VYNr9o5y9KOoYCunwPmS4iG3NA9c6yvxmSgb EBdQHLJ3lMptqc8GMiVkSN3+zziF4uxnic4uJMUzPy8ayA3R1KuTbOkbstHEzNoLssSM 4tk6a5ktk3BuQVa0KWbBzskjNtHK0h97dvkddZmhLO+FsTvityidXOOSyv4CwkU8xaeN mxzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=u4s+tp2q; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 d14si2072530qti.47.2020.03.26.12.58.40 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 12:58: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=u4s+tp2q; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:59228 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYeF-0003eI-Qt for patch@linaro.org; Thu, 26 Mar 2020 15:58:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58742) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYKR-00074R-G7 for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYKP-0001eH-Vt for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:11 -0400 Received: from mail-qk1-x744.google.com ([2607:f8b0:4864:20::744]:36780) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYKP-0001e3-SY for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:09 -0400 Received: by mail-qk1-x744.google.com with SMTP id d11so8192284qko.3 for ; Thu, 26 Mar 2020 12:38: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=s4mQ5k/NFT8aD81RSmqYx0sDT6UNU273vdP3vhK24kE=; b=u4s+tp2qSwdxTNOdNzQk47YjtHGUOt4SfzY2lkPX6WGZiQFqJSOQySONkZLu0CMM4A AwdcJFxb3gz/dzLvAVGKu4oTjc4V2+WEaYissCvgGqxA9jhVUq1mAr6LHR90Y0C8dGAB fj+U3r3rEsmlK5KD7nFo8gYxPUi9s5eyhaDswoNuBtUdbXpTtoASUz2AOdAFwEW79UZc 3iaZAutCxWptOQuW1jYOd3cfhI+9oA6YQO4S77His2vop9tpvvA9NsOrpJ/n/8KXxChC bnMvDQKa4QqVuGBsDEqd6dmv1QRg21i33cEkHV8LaWqFe+D78KcPhWol2y8qziq5ZIbl lIIA== 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=s4mQ5k/NFT8aD81RSmqYx0sDT6UNU273vdP3vhK24kE=; b=fg60ay03iZb5HiHx0lbbJzss681RBAIhvzpomgaXktYI18c1SwLJG147qXGDQPiP4o JVsIE4HQehFjXflwP6EfqfaJYKJNbByMCvTvxkMAi5cZuS5PuLHw8wKCFn9xoKYkwi/s q8jYPXaZxs1f/4pKxrc66o67wjocK3xaRsqqh4wAk7cjxuYcEUZxNRaJDKdtcb5850kv ugFTr/hw7uOCnduVcYhJrGoP5neb85f5Z2ocsRnCDoDioKUQRUN++h8OotQrKodFgyVw GhgXC33CJQdY8bMMvWRF1YFUNpEzDwfUcDvEphgPnh3Hzb8J+8Uucf3+uj0qRB/en1S/ od0A== X-Gm-Message-State: ANhLgQ0QuVbfC32GyOK5AIjmzM+xi0AMua5TV/Tr2Vw6T8U/bIKmgvxE +k4jhFBXpZu6q3uEVoSe1ecgLkkcYlrl5A== X-Received: by 2002:a37:b4c1:: with SMTP id d184mr10455207qkf.452.1585251488931; Thu, 26 Mar 2020 12:38:08 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.38.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:38:08 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 26/74] s390x: convert to cpu_halted Date: Thu, 26 Mar 2020 15:31:08 -0400 Message-Id: <20200326193156.4322-27-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::744 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 , Cornelia Huck , richard.henderson@linaro.org, Christian Borntraeger , qemu-s390x@nongnu.org, "Emilio G. Cota" , 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: Cornelia Huck 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 5f290f5410..9db3a4258c 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 427a46e3e1..7910deed35 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -284,7 +284,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, NULL); @@ -311,8 +311,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) @@ -338,10 +338,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(); } @@ -351,10 +357,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 1d6fd6a27b..ea8596c95e 100644 --- a/target/s390x/kvm.c +++ b/target/s390x/kvm.c @@ -1060,7 +1060,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 Mar 26 19:31: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: 184885 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp458327ilr; Thu, 26 Mar 2020 12:51:21 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuyufMdU2sy9oP61B0a+VEehAB1nY6E9ujN0EjFw546de5bUgvJHDF4FY/YZ51JkNVUA/kw X-Received: by 2002:ac8:75ce:: with SMTP id z14mr10349195qtq.12.1585252281823; Thu, 26 Mar 2020 12:51:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585252281; cv=none; d=google.com; s=arc-20160816; b=WGloHEgHDOptxJdTtgsOBYqPghaclPar3wo+nguVYwoEkXZesuaF7YF+Tb2tLXVNdJ HZsyoEMstTOhL2TCorPxffGpoHEGesp2FMts9eGvK8IKQqF5mFUireKcq0ICLxViX8LM MrpL504w3JPr/ijyJJqSP4epL9Fyf3QRDHHGV90RFefswKcwBuuUVlJPiPCTBTmvPAw5 1yBU+pBxM3skpCIhwdwP70EohAdTwBxR9U78EvKFhUE2p87moFtM/krr9ky0DlY1+gaO O8ykQpCb5dOEugaS3fHVNUNP/sQDlD0Cmf7OZvrPfggKGmPv6eJD1nSCcKmqB0BnEfMX QKqg== 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=WKDXF12eCfqBVh1t7+XUM9Jd9M2ESQhEyFamPNrVDo4=; b=gOaqQCvp34qZpJ8NDBn1HS2x/u8An/2mCVE3rGdUm7sj+6sBUZTtPRl6dVq1uMCKEP nv80cSylMV7KxdO9NjncEt+qEcZsLJnLbSBb5UO68F6AGe0mADXZdUZR1pYKAyiZpI0g TKAUsKm+5tQLPsrcMiFjWMyqoIuqicHtM2kXIaoVZZ7bS0w8EKzmalu6tY+yn5CkpY/A dtowXk0Fgkz1I7UkvAvoLuizGl5prNq8liANtsXwC+yY+VwRSkhSV6abapY0xUOd7pta Mlqvb3jkSwLua1OleNO/ixlqa/8em+o+f6mXWax3TsUidcVtsD/b5/9o86w56wYMHCqX Gh9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=p3GOUiY8; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 v5si1951259qvn.84.2020.03.26.12.51.21 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 12:51:21 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=p3GOUiY8; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:58980 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYXB-00051o-A4 for patch@linaro.org; Thu, 26 Mar 2020 15:51:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58764) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYKT-00076K-3n for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYKR-0001fG-Iy for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:12 -0400 Received: from mail-qk1-x730.google.com ([2607:f8b0:4864:20::730]:45394) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYKR-0001f0-El for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:11 -0400 Received: by mail-qk1-x730.google.com with SMTP id c145so8137522qke.12 for ; Thu, 26 Mar 2020 12:38: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=WKDXF12eCfqBVh1t7+XUM9Jd9M2ESQhEyFamPNrVDo4=; b=p3GOUiY8BPNk0kEheILZlfCInV3V1aOu6wkxcHBiRtL1+73fhHqc6SHWXd5lOTyAuB +p6hft87tWgFeVnhiQjyKzGaYT0VZgfgwKbFSwSVqZk0YdWFYWM7NwHL5r1OW2KUlV98 08JTNORqp/uGzCwmemvMdTWugBrgz96vpYWZFIDftcIO2Q9B7j+ftv8t2GjOXphk8I42 MnLbPTZ7UvUODLg/9QhpDmllEiiHdsPhIGEeMiem1OZHtrdf0dR0xs7wTzhWWJjwhcSV UiLcvB7HGwH2PvktAvqNMwFt2+MJcc436l5CfuC1ysd/DNo5/TuFFUyTBUocyXmo4r01 UYBA== 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=WKDXF12eCfqBVh1t7+XUM9Jd9M2ESQhEyFamPNrVDo4=; b=FQ7NTKQM/z2CN3rkt8etbVR/mCi+q+3M9kH2NwpdmTjXUnrnMFvWn4Upi3e+6mjJbm XIelQb7c8iyropdx6RxUSYe7SPeapYIReZ4n9hDOubm3rGOzT5ERttPnTYQpHY+nBtAx 3ZflrlPEcJrxH2hXw+qAeyjPlWFaQI1DZnMp6pXonMWbtxYHjks52DeFkFumYm1n4tdB Dfgx0frVxe2wkcWrmbLnrwxbyJ+e62XNfRhBxIP18UO7bx8ZnP1CMCpiIeve6oZShdvk RxXAmbGe09xGj9/x9oWJsKmtMyw6dBRBGD2H9xVm+u75J0vQi5GNCSCxMg2QLndbLUTW svKw== X-Gm-Message-State: ANhLgQ044mId4fPYpNiT6dTPX3tlBQaapEfSgF+8IBWp9vmd7zdAVTAS cgZPVuB1VU/TiFjtk7YSPb/nhZ637N8duQ== X-Received: by 2002:a37:7002:: with SMTP id l2mr10338297qkc.372.1585251490553; Thu, 26 Mar 2020 12:38:10 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.38.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:38:09 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 27/74] sparc: convert to cpu_halted Date: Thu, 26 Mar 2020 15:31:09 -0400 Message-Id: <20200326193156.4322-28-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::730 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robert.foley@linaro.org, Mark Cave-Ayland , richard.henderson@linaro.org, Fabien Chouteau , "Emilio G. Cota" , 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: Mark Cave-Ayland 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 36ee1a0a3d..1533ee117a 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) @@ -832,7 +832,7 @@ static void cpu_devinit(const char *cpu_type, unsigned int id, } else { qemu_register_reset(secondary_cpu_reset, cpu); cs = CPU(cpu); - cs->halted = 1; + cpu_halted_set(cs, 1); } *cpu_irqs = qemu_allocate_irqs(cpu_set_irq, cpu, MAX_PILS); env->prom_addr = prom_addr; diff --git a/hw/sparc64/sparc64.c b/hw/sparc64/sparc64.c index 100b2fab17..fe9c678459 100644 --- a/hw/sparc64/sparc64.c +++ b/hw/sparc64/sparc64.c @@ -101,7 +101,7 @@ static void cpu_kick_irq(SPARCCPU *cpu) CPUState *cs = CPU(cpu); CPUSPARCState *env = &cpu->env; - cs->halted = 0; + cpu_halted_set(cs, 0); cpu_check_irqs(env); qemu_cpu_kick(cs); } @@ -116,7 +116,7 @@ void sparc64_cpu_set_ivec_irq(void *opaque, int irq, int level) if (!(env->ivec_status & 0x20)) { trace_sparc64_cpu_ivec_raise_irq(irq); cs = CPU(cpu); - cs->halted = 0; + cpu_halted_set(cs, 0); env->interrupt_index = TT_IVEC; env->ivec_status |= 0x20; env->ivec_data[0] = (0x1f << 6) | irq; diff --git a/target/sparc/helper.c b/target/sparc/helper.c index 07d87efa4e..90dfb1e92f 100644 --- a/target/sparc/helper.c +++ b/target/sparc/helper.c @@ -244,7 +244,7 @@ void helper_power_down(CPUSPARCState *env) { CPUState *cs = env_cpu(env); - cs->halted = 1; + cpu_halted_set(cs, 1); cs->exception_index = EXCP_HLT; env->pc = env->npc; env->npc = env->pc + 4; From patchwork Thu Mar 26 19:31: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: 184888 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp459728ilr; Thu, 26 Mar 2020 12:52:56 -0700 (PDT) X-Google-Smtp-Source: ADFU+vumFex89Ki7QyxxlRyzVT/IVHFQKOYYgoZrDEcsEcSbxGhMIrQ5N8s+KrbfGk5un/EH5r5v X-Received: by 2002:ac8:3032:: with SMTP id f47mr10263511qte.273.1585252376034; Thu, 26 Mar 2020 12:52:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585252376; cv=none; d=google.com; s=arc-20160816; b=UA27jZuI08ZmgerD/nipbmCcJj9NiZf0uQLjaZPW7WW0kzDbMGU/D7B7alX96qyj8v qgFCfNFDdLoVVq472dJ+wVtvjacL5o0BgNTM+rbtdsT8h1C+QdNMaeWqr34iEbS83Ouu l27X2C5EFkq5kAcvOi0pGUWfRScnBaOB9Y01aRMRqhFplKE3N3qGFUyXSFj2MRRureGu 8won5nawiLW71pShRQ3i4BueGXd9iZVE+gGGKynKADqny79sBYYE0gj7ViVCSGxXSu01 zyxrvoIKltB8fKESPG2gW6Hp8fysXEN+YRR7coitrSiBCVTU5Z5PYZv6Ug5o+CRv8d+W Y0bw== 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=q7qiUjPB4OVFC6Nc1RwuXN27rGhJZIJuTp+ATKDGV+A=; b=K+cNDvwC5exFP4GrsobB8hEwFpCthWrWedLM8cAzyMABBfn2JxXZLaRIH/ZacDINQl QhhIHSx4pxzP4j0cVNgBRHWASjLYtzhpTwtx0h3WIBSdtQsbMh0qtZVdsXjSXXj5SKHd pY1bKOiIwkFbIABctFnpMqVRIYOeu2+7ZvfJFzNg+dipOhif8T0n0IZ8VRb0ZBM/B2Mk 4Q+5YlFle5sKe1puN4qlNt+Z4IepHcYZo6/ebSWSE8g1xHm8GRbKgT4LOuCeusSx8t8I hAJADVxjPMD00N7r/+jGCSwOQdqc/ytdc/t9T3AxJCvVAGzIz7/RgUqlYcYd8jB6DBxn NTMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=r8UvewTh; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 s19si2045502qth.161.2020.03.26.12.52.55 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 12:52: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=r8UvewTh; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:59034 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYYh-0008QD-J2 for patch@linaro.org; Thu, 26 Mar 2020 15:52:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58779) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYKW-00077z-Pp for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYKV-0001gi-AU for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:16 -0400 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]:33743) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYKT-0001fq-10 for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:14 -0400 Received: by mail-qk1-x743.google.com with SMTP id v7so8218769qkc.0 for ; Thu, 26 Mar 2020 12:38: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=q7qiUjPB4OVFC6Nc1RwuXN27rGhJZIJuTp+ATKDGV+A=; b=r8UvewThY0KQJHHMG6Q7j92v+zicuYppLY6AJheeJhCqo9c+W2CB0QS9ybHrzM8n/A M/3btWDf3nXluunlcbB9oIhjPtR3hqKCvf/aGDIao9zisD6KI14Wg0qFf+8OYN+OSYwr 2PMoAdU9VAfhrAeQBya8GfSU7z91iZEyZnJRgu/dM/zOJcL/+uJ0AQQ71IJ0HxaYQMZi xzFJzIt2NRniwrHTOJlbBqIcXfl33V83fY/iKwzrBvhoX7d/Yq67cKz96uGsOn5Pf+cU JogpFpLfCtheBYO3Q8MEIyxuqz+jlyg6wigPV7HekD2phWw1AIagqbJ0hfa7G/GdBuDL /Wtg== 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=q7qiUjPB4OVFC6Nc1RwuXN27rGhJZIJuTp+ATKDGV+A=; b=cE7ru/8cM+dQ/UFkkIfIArL4O+Rs3FEfzHiZz37wv73i4unU6aUxo1cLYMrNceFItw Dfat2BZVvdBq1O+u1i2d788pU8TaUz6hDbQIYZ0kOasioBDqu0z31skZ6y8MK8GTdfqy PDr01SD+htQCz4lQmj5FRDWv44En4Z15VEXjEnELg5ty/lwcSFkEPXPZBWmO6vbk30zz HCgN3P5THgmikNzk1NrHpSQvm6Gy23ow1NQ/NGRc4plPWKJbMpi95m336XfxYTPnwKUP C2qtOJL5WMCKXzEeJ3x8knhUnZ8ixostEMxUnnSIHlclZigJBBRTK+2bTXOwaOvvWE7Y ulwQ== X-Gm-Message-State: ANhLgQ1rJHBVGL7YJkuNlPdxSKvgogr5na0zpT/4kbp1qB3yJGshxPxW gdfRUodlI588e2d7et90/DsDgxW2tW7G3A== X-Received: by 2002:a37:b986:: with SMTP id j128mr10011053qkf.109.1585251492121; Thu, 26 Mar 2020 12:38:12 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.38.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:38:11 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 28/74] xtensa: convert to cpu_halted Date: Thu, 26 Mar 2020 15:31:10 -0400 Message-Id: <20200326193156.4322-29-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::743 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 , "Emilio G. Cota" , 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 376a61f339..d5d5ad5899 100644 --- a/target/xtensa/helper.c +++ b/target/xtensa/helper.c @@ -327,7 +327,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 Mar 26 19:31: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: 184896 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp462233ilr; Thu, 26 Mar 2020 12:55:55 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsB32rfvNSY0XtPdL1trBQZXcmAPy/E6jNi3N1ryeNI1zbgfxDRiMmEDw2pMfn/sFLUmm30 X-Received: by 2002:ac8:6f0f:: with SMTP id g15mr10393438qtv.155.1585252555617; Thu, 26 Mar 2020 12:55:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585252555; cv=none; d=google.com; s=arc-20160816; b=b6dWwXXfp5mpzoVWItC8eIqlgubMo6yi//2Xgw2LUEIVtN4/7n7z1Jheb8TpVog9rS EhPHtVwXAzxhDmX2FOilV1t66GvAvVtxY3zOyNWmy3SUaqfaPj4NBugluvR7o3ILz4hg EdLIaScxUSCeF4B3IErT5+6h3ktqPfvPiwLencLZ/ojalpY1LAeOCA0vKp7Qw+ekTMhM E8jvfBjPa5NLFOcaTWfn60LYeiCsFfRJkFTtgafLC/AiPgIu+c4uvLf3rlnydqbvZoCy M023cf83urBNIDAz7VpqLq4iMGKmUnKG/wUYCUpSHouJNgosogZzcEUa19qkeF8bQChH jD8Q== 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=yA2MVFEgaNK4nASIU4YwfLKatFbmzL92LfjZ1EBu5j0=; b=BW77STu0+pn7rKOFK4PTQvib70Wk14vfbU56zjdstUXH8qr9CL5wlFaYRjYna2NNDt aNrDgDDfJNHmm0GKcXJv4puzX5ZFyMNn+dRlyRWlvN+ie8w2qbaQ2UfFYnU9HxeU+w12 ruayr1np3R8AvWOD+GQqCQl7IZXm/KYz9s04yY8o+vJLZR1urrOB9PO52NsRlu/DQ+0s oSY25ehPZaVoN3EpNGDVCX4kEhEvEdUCnWiL/h8BE4cSa6PCGbip8CmthJUSyqZU1jcM YNDIbnZy/5vkGpnnJXlVwQxPL9/law+aNvqPIP32+UAwPUfjfSqgUz0/YEj5x03C2sn4 yv/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="tW6S/bP1"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 n6si2071994qke.78.2020.03.26.12.55.55 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 12:55:55 -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="tW6S/bP1"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:59150 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYbX-0006sY-Bo for patch@linaro.org; Thu, 26 Mar 2020 15:55:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58798) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYKX-000788-Ju for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYKV-0001go-D3 for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:17 -0400 Received: from mail-qk1-x741.google.com ([2607:f8b0:4864:20::741]:35405) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYKV-0001gI-9R for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:15 -0400 Received: by mail-qk1-x741.google.com with SMTP id k13so8205838qki.2 for ; Thu, 26 Mar 2020 12:38:14 -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=yA2MVFEgaNK4nASIU4YwfLKatFbmzL92LfjZ1EBu5j0=; b=tW6S/bP1K8jbImgGY810ZRZ5TTGl80HzzkmPWP2sFPhQ/bjUMQa63XOid8gBfBnbZu ubkStz5VHgUNOWAej8EEDCTEioaMMb7swf0vpXm0rLA9aCj99WWm5/ibM0wfLRR3yz0N MlcUAy0yzwDol10jS9RDJt9WgMY5pGkSzTw/7GdkjmmX3rZy39FScA9SJmx/AWkv2IMt KamhVaYuLi8XOMY0t0SLTg0pCY7mhaDfJTzkkFqOqm4XDIa2IUKb9Tht27OGWOWB44t3 wvRhAJdnqbzelkbACyYquktykQDFjN42qAUJpuVyT4J5UuQGQ41rR7XJTNW0V3LX6hKu /5SA== 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=yA2MVFEgaNK4nASIU4YwfLKatFbmzL92LfjZ1EBu5j0=; b=WBQi3u5KHTc5hEwoNU7oDmxxivlP4hvCfscprNb5iIozfWCXJhDLOykf7nqUDTPq7Z ztWJK9WAXxSybQQEa2yaUEs8WjjeD0IbRdKWUUxZ5XPbvrhHoocAPuAbTCer35QSJHAP 5vEOAfh1o7ygYVCHl7Oei9mV5DmgzWyVxbLqOAabW0YDEiXTiLV6CnfH3INQQ6WDxApA jldM+ZIJrTsYrjeBz1IXcxXEQWPFOlUqJNCWfr1pCLlJcJHaMTMWzdES3D5V22PnP9/w ytyn7PNzRNMOyc37A+LIt/fgm+ELMAqNO55GgIx8BzS144I8EjZP3O+P0vmwzAeKNtWj U+Rg== X-Gm-Message-State: ANhLgQ10jw/LBu8giPiOQRSpCOQ7/AaZHAOwInF8VefCFOpIPBES7wiX XKfY11V50IpphlOhawJ7WSQTJqhLnrd7jw== X-Received: by 2002:a37:9dc9:: with SMTP id g192mr10248319qke.50.1585251493546; Thu, 26 Mar 2020 12:38:13 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.38.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:38:13 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 29/74] gdbstub: convert to cpu_halted Date: Thu, 26 Mar 2020 15:31:11 -0400 Message-Id: <20200326193156.4322-30-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::741 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, "Emilio G. Cota" , 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 013fb1ac0f..d95c32997a 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -2063,10 +2063,10 @@ static void handle_query_thread_extra(GdbCmdContext *gdb_ctx, void *user_ctx) g_autofree char *cpu_name; 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 Mar 26 19:31: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: 184897 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp463885ilr; Thu, 26 Mar 2020 12:57:43 -0700 (PDT) X-Google-Smtp-Source: ADFU+vv4JHENca5862lSVRprrPIbnhaw7U0qq4Bqig8OrJP0w+oAl6z8TL0RAlZrt511TpwoFvPi X-Received: by 2002:a05:6214:10c1:: with SMTP id r1mr10346006qvs.70.1585252663140; Thu, 26 Mar 2020 12:57:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585252663; cv=none; d=google.com; s=arc-20160816; b=09nfEpbt/1r2ysIEtD3yga+kh/UjLG81onjERBlcVXDQpfoEdyZrMzbJmTWamm8dPf QwEFCfxrLSxvbs8jnvTd0JqsEIscDX5A4GiXSqS/+YH7fi5Dlp720mOGjw5Ju6Psf2Rc COaLVfrIk9WZyG0G7bmI+/bbxj6uW3i/dPLXe60Mq4heC9e6mvP8yss4kEObBR0GoMx2 foU/8XiA2dvhm/ED2y2YadC/UUc7daAhB3EBF/GW+VVqPQRVgqTPTcJh+pQ9cd8TQ/jq 4PzFubwCMSby1t2q+LLahsfpzsFoAKyaVa7I1WDPMlCIYvDRu/Xg7RP/vLHSnQx0KDU1 FQPg== 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=aw33pce8GPb5TPOWHRXWlsaxixqd5XpeGpGvA7/haJ7IVx1MNcU88n6ZGaubKpKHNu zY2ptxbpxlZRva1x5+R9WL1ezM4lsM8KGDEHbla0N92jzNxlFVOL2LoalOBFL7FPILka hJd88UpMhtfpYacyxZ3KfqUFy1aSb7Yy7CPGJjsHG3f07jFvpgyPgFZz0mgAuBaXrlYd slDVY3yQt7x+8GvhU5Qlb2r6Yh2elH9AHYByAmOt3iQOpPCvS0yuMn0H/ePeiNTEdxAt 8gmJPBgv/zXl7Tr8VAFF5u101M0x/GvuHS+rVl2zNRt8O5MKhe3Ms7N1Xkgp2q3TGOuN NGWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="Ix/ppgNW"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 f19si2212350qtg.113.2020.03.26.12.57.43 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 12:57:43 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="Ix/ppgNW"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:59198 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYdK-0001qF-KH for patch@linaro.org; Thu, 26 Mar 2020 15:57:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58808) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYKY-00079A-UG for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYKW-0001hb-QX for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:18 -0400 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]:39020) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYKW-0001h1-N5 for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:16 -0400 Received: by mail-qk1-x742.google.com with SMTP id b62so8194629qkf.6 for ; Thu, 26 Mar 2020 12:38:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=O0fBrT3P1tRSLH4phcxb7WjFxDduimB9rIeQgvMHfic=; b=Ix/ppgNW371q67atX1d6cmfGUWOXxSPo7C2SBh2ugKoGfWEg4NUKasXK6aV3spE0b2 KlwElvLOBxB5KYiec8f8eIe54rhl1HC5W6e1OQSPXlMsD1pBJBwcdQ7QUYaW3JDr0l1E NdMxepdRYNBvvnQz0nlFkS30SPyMRJoxag4bXQyzQBx1VJWeCQzYKx/0K6C61Uwc5kjs uMYEKQMWqRleMKWrBC6I0vLmnZv2p6FtZmBg5Xv7zX0xD+AM0eHiSMIYUYOOCpaERYd/ yuZgYvYtGhZY3zMez/tVqbzD3jBoNt66oTAkOJXsYVj020PidgrvKnIB/qdGxjNKfnaK 96Kw== 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=NQGuSk+rGc3/mQzG33uDFhsyOwiupn8g8vpiSJ7CzIa4tXYN6iOiPRQeZ4aNdWLRSj m28ryvMmyrocdleyjHuij5wZnd2PUYKnmm1tfzNXAmI5ncdrUCPnMKQ+67Z1oTml99iz IEOyUrJEfBYqo+qdQQ+N+KSzwoiJzuOgvsCN9anDIffCxr/CYleQZCtYl9YXypbcPK57 p9rg5t2y7aDyCS3E/WUa1pVyKlyoJUGkMIlxnq1KJLdgYdgS0JM+sBOyXklJvDqlUAcf Bovj0n7+303UqMvRiw7KTrpvVODdEXJ4TV5/wxu0/F1E6X5tdfOKXHPVUX9RDAB/ObFu xagQ== X-Gm-Message-State: ANhLgQ3eQQeIDalE7anl90r24EfG0w+WvovRoP96uA2XoIVri5dSRpbq dQxu6nLB/4iSRaUFFe+57ywznF9HEwnPoA== X-Received: by 2002:a05:620a:88e:: with SMTP id b14mr10476524qka.449.1585251495038; Thu, 26 Mar 2020 12:38:15 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.38.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:38:14 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 30/74] openrisc: convert to cpu_halted Date: Thu, 26 Mar 2020 15:31:12 -0400 Message-Id: <20200326193156.4322-31-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::742 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, "Emilio G. Cota" , 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 Mar 26 19:31: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: 184902 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp464939ilr; Thu, 26 Mar 2020 12:58:58 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtX7MyGAEwyutk+oc0c6NI4CaSee74i8qYNEeOIIzIaJij20kXWEFegpjtBf9jywPdFxm7e X-Received: by 2002:a37:4117:: with SMTP id o23mr10036094qka.295.1585252737891; Thu, 26 Mar 2020 12:58:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585252737; cv=none; d=google.com; s=arc-20160816; b=EJewosghQELAuOrSUcioy1/XMXpM+ofpvcY5lhZHACdkUBC9ORGpecuqXaQVcBwvFN Wg1Z5mPXt51uatHSNwTJp+ZNHP/RY5ijnLsVsLIQ0BB/fpWCcDt4vCTGOv+rkYpOMvhl qBlz8Omgmt3ogsFX46oRrY9T5Z8Dzxd4pbBXN9sPmZPnSmf9Iht5DOYostJLMapP6Ohp 16eNIIqER63b7EIFgpkjH3CvO3p8k1b6VeMR2issABOYooVeMe6rBsp+/tyd6OnNszw0 O7VL4rKWP8jIx90MZoZiYCrSpy21Oknq8KXfNjahC4tRUWxmBsmcrBmvJJqb0RY/y4lN JXbA== 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=GyzrZGfGwGNUoS+uuXOQRisV7QLkdfYUSECDsuM3GqEdPzHR+AY7Be2BlBxS8K1kXA dJazQTRAppD3ieLE2BcBIwQP/DQ53k52O+7erkcGhYPUGYwpySJbFYSJrqfnPJg1tvLH XZnDh3egeBTLTDQl9C1WAm/Rpyeo+glaGKN9l9d1IRs2m4UcXFokpPwTr9R/q0GUCOVv KB4dm9m9gA0jw0goWy1w/eO1NR0PpIM14ftoBcMKristQBVQuRYCs/m6071IvDwAI3PF vt+NYuSTz+LTtGHupBlMdHntRT/tomRLgW23EAw/rHsujsPOrmaDn0GRnxcVB8OwnwC8 HsZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="P/kYo9ul"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 q28si2213801qkn.365.2020.03.26.12.58.57 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 12:58: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="P/kYo9ul"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:59242 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYeX-0003q8-Cx for patch@linaro.org; Thu, 26 Mar 2020 15:58:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58826) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYKa-00079N-0M for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYKY-0001id-SR for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:19 -0400 Received: from mail-qv1-xf44.google.com ([2607:f8b0:4864:20::f44]:32891) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYKX-0001hu-IC for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:18 -0400 Received: by mail-qv1-xf44.google.com with SMTP id p19so3717096qve.0 for ; Thu, 26 Mar 2020 12:38: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=pBQreEfimlo/TeCu0za1hNbEWK5jCOhKGwDICZx6xko=; b=P/kYo9ulqhpp050EUJd06JPmSSGs9/dQd6u7mVV6aCajHrvKc7u9Jb/OwY9vaMQCZD a3Ps41Vd32xrllgwiKcjy+XCsoeDBZ/c/hQLIrJJAV/z7WsGv42J7HYn0I4VK3EwrDIB nWvUyj7KEmHXI70uO7gzFfH32mXySbLvrE0mTgas+YziWKDPNuhR8Y4ZjjnCmKNrq/Ei xoEk8kq6/3k+5vlK2BOpSOahe6LUyuR5tEJrr/Ntysmo3mJVX/wMAu2bp/Opom06j4b+ BrAw+FBweGL+GMyvSWDATo8BNKqKv0Z4CaI2pLxJI5fmIK/6DV/f1BqvAvIPBlAAd1vn ujTw== 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=IHZny/dtqSnQeOq7qqT6qG6fzAIW+9JwvFw/0aqrTA0zdNAR1nlBBLKPSGDMRijBk0 v36xMgGRfRTZGFjiwSh5PZHK3XB/NDbUuABcXMtjUkqdRNjPWVgThCgrNtL/6oEEIXJ+ 92bTSDZY7UtgDOIyLFV0jFFIiHAsMHD227WmA+74fTVfMAu9uC2O5L415J73V5YewNq3 SE0twSW4yXPI0ZGKk+wB2ilcS63yeC3h3YHkPY+T2nrq1iNkz3uOpbbz75FSIKxFMhB6 ZVzEmOrnReL8vVQ0cz+d4Y7Mvo1xPktg5R+GF1ootSuiA/CFXNJcdD9q4Pi5B6G/f+YN r9vQ== X-Gm-Message-State: ANhLgQ3GPkyqIpOh4JSzcbCL/cZvvv1E+c5E8mRw4Uu16yjp0z+/0bIG krsJDnptVn1bXRcuXq0CXLpOD6p3BJzVSw== X-Received: by 2002:ad4:53a2:: with SMTP id j2mr10100056qvv.145.1585251496372; Thu, 26 Mar 2020 12:38:16 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.38.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:38:15 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 31/74] cpu-exec: convert to cpu_halted Date: Thu, 26 Mar 2020 15:31:13 -0400 Message-Id: <20200326193156.4322-32-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::f44 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, "Emilio G. Cota" , 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 Mar 26 19:31: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: 184879 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp456469ilr; Thu, 26 Mar 2020 12:49:09 -0700 (PDT) X-Google-Smtp-Source: ADFU+vu0Dcdkoe0LPDLj+tFb2lVgP2Z6mXdjc3hi7WRbTyOKqY7Rkf1tqHXq5RqCTFyLkfPP01Yq X-Received: by 2002:a37:b9c7:: with SMTP id j190mr9777362qkf.21.1585252149549; Thu, 26 Mar 2020 12:49:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585252149; cv=none; d=google.com; s=arc-20160816; b=PV87iVH/ly4cMkYO9xcC+my444/STH616uBnhyJfW3LwLwsmVFXrg/Uzr8M1I3/TvN 3pJ3GfU055BS+L0gHYDvT9P5ysS1nW40Lx+YuUuACW4LVsKmzopBd9ZMimWMztW25Dm3 ZaklVYce3xM/MrySASQ2ltH4de1L/Z75Hej2t+bn5SuaE4QQfp2RhfIQqKZZJ4F30CGP lHxF5ov0SX6QbWgBSaX81oaeeN5ONiAlp6OjjbjzhXtgQDHAkmSH6huq88HMtvVWZOVE W5mTY7Km3cFktDD+iMNd8SWICuVm4wkvS8QkFqDIsfr7c2IkHwqS/HIG0m2ThZ9RA7Mb gcrA== 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=lqZ7VnMREamwmHiAXruvzR+fgaqzM3eON98Z9dE0b+o=; b=sBqkoXXGpnc2nXNLUQjAWeOYRyQZcMsbsCRWP1OweRP3iiNZ9yghK2z0UrevuDLXYW B1HEVhfxbo8mOgI2w+0vrzVRzBjjTPRA9uIRaGSPx2PoIWdvhKjcFEe6UEV9pwrXNR9y P9b9m+FQ8JSVxleJM+SxpXkyjQvXZUYfMevT4L/U5clg9GccQWTLq/yP1RxfHu7fdSVv u+oYaWDWDAXFmZyVHdYfrkrBhgw5mBQKMMPF7eS6AR8tAs4mqvjhI2+kesVxA7/vWVzQ nN//G0xTCDGSh3knGc8R8NMJJXCjM6SPUigtnB5QcZotaBhjU6sQGNjcrhBh6BOq8g+p 2VJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=UCvQhIfU; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 n52si2115278qtf.250.2020.03.26.12.49.09 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 12:49:09 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=UCvQhIfU; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:58922 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYV3-0001i0-12 for patch@linaro.org; Thu, 26 Mar 2020 15:49:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58832) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYKa-00079U-Jh for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYKZ-0001ip-7s for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:20 -0400 Received: from mail-qk1-x744.google.com ([2607:f8b0:4864:20::744]:40096) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYKY-0001iN-Py for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:18 -0400 Received: by mail-qk1-x744.google.com with SMTP id l25so8186115qki.7 for ; Thu, 26 Mar 2020 12:38: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=lqZ7VnMREamwmHiAXruvzR+fgaqzM3eON98Z9dE0b+o=; b=UCvQhIfUcPfh/PFnN4XvCTeZTf8m35iJfoFlILVkw85cSuOWp1bX55OxF7Qa2C9rD2 o4sPh7aO0KP0WF7EV+TQFEkPwJ53WValgNUr4CPMX4sTCXI/Lc9E0sstPekWkploUyay LubC8DjMhNheMrdAhEICkW71sUY/ijsdz9xlJ9ufcK4EXGBdM/UdI9ly0KHdCuCia5w6 4Rlj+6MZ6K9L2sDdIkis6JKrMyB5h7CZThb3Y+Q8U/tEabYfvv2z6H4SxtIfgO1BgXPO 0eqj5+cRAIWQYsP7L/0ml+CTif9YECrmXaGtDzqg+FKtU1QtMWH6e+ti4uiskMpbsR51 9o/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lqZ7VnMREamwmHiAXruvzR+fgaqzM3eON98Z9dE0b+o=; b=OTlMslZQN6dUtCdY7bu3Sfbp+Bitkp3WzCkAzQIUCLLpmWz6Mir+ZKFYUfp4EiH0co NXtfXVyF9BKEOPVc9GpJGBiyRoBysU0r4FbO8d4dTiGF2S6jh+QLDZFRRnZ3sils6Mea eCm4+Uq2rdrzubmfVucuNC3PXkENXRqeqnuV7Y8/PK22V4xAQ2tRvP5lh5sHj+wcjWtJ qmpKxzb0v+lp4sKH/ufHSgI7p6VOB5fKDIDXbZDf8Wl3egkMEyYCM1TqYvCofCbbiALO igiwr7GEWIzhlh2nqpoIHzib8gx/8aTx/2bv22cLD3Svq4fAK98e2r5ewVpYS75nUXvs 4kfQ== X-Gm-Message-State: ANhLgQ2aulDQrqFUs8b9qi1DxzFG9mjCDRKGR7NQX6ue87wy12ODSxN+ 9AB6MXOEGvU4NMMwihDCe5EICJvr5TqG4A== X-Received: by 2002:a37:6357:: with SMTP id x84mr10357028qkb.490.1585251497714; Thu, 26 Mar 2020 12:38:17 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.38.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:38:17 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 32/74] cpu: convert to cpu_halted Date: Thu, 26 Mar 2020 15:31:14 -0400 Message-Id: <20200326193156.4322-33-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::744 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, "Emilio G. Cota" , 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 f27fb19b7c..50ced4369f 100644 --- a/cpus.c +++ b/cpus.c @@ -225,7 +225,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; } @@ -1840,7 +1840,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 d67bd58827..9683d6408a 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 eed5aeb2f7..7d33489110 100644 --- a/hw/core/machine-qmp-cmds.c +++ b/hw/core/machine-qmp-cmds.c @@ -58,7 +58,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 Mar 26 19:31: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: 184881 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp456684ilr; Thu, 26 Mar 2020 12:49:23 -0700 (PDT) X-Google-Smtp-Source: ADFU+vu1iPBzUwiqVHyzUdddvnkyD2rx40RTKP1vPqSY2Z7m3akEoe3+3vS0+dGDQtShKn3LRVHI X-Received: by 2002:ac8:1633:: with SMTP id p48mr10595167qtj.305.1585252163010; Thu, 26 Mar 2020 12:49:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585252163; cv=none; d=google.com; s=arc-20160816; b=bP2+GHfRVcRbV5yUrMDs0c0Ckf+4OcTSBj1iWorRfWg9dbSS5EOTptfK+a2I8i258X pnVG50EvO//M9rqZxhYAGAZwggqBK+3BE+yE42okMdSiNPrz3IyK/b47Nuw9L2w5fPWV p6tTlddPpgNt4vRPhmlzU/ZtwUG+4aQoV+TR1Ww5hRS07bkpfYA/VKk/61WkVbmNmSsA O2W/yJDRgNWaiTSgkXbB9d0ZP1UG73FZANOR0zmljryD6aPLfAq1XZ1uQ9622ymvuSrZ k1tgZ/cHzSDvr4QjZ9/nDlXgQ3LcmW78gDpa9hIVsgGuUw1hlKwCV2RtHPp7pKXkLBaf nxXw== 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=ShxiiQVChFNUTjmYIyg4bNMUbV8gv91VOcC+VfAQzoI=; b=Olzzlvjp1dJhuAxHaQDKR31QhCbX5FLbXRbIb9MsW2b4WDWgI/fsQfzqdep7MbA75X c8gZ+ag9UF9B5jr0AREYMkW2/nHyNqJPtYi9S2IRj6yYjL8DPBa+9B+2T8wAtW+1z+gt skYs6sB5kTvJRk/kk8SZKyODqEiTmboNT52TK7xzwtQmz+I9psi2hpg9NsXAe7sfdIkF igMnaVdCO8qWPL4dSn8BR07Al+AhSZ7BVtkEVtQxV3SjRYuF5d+xqTWHifQVS4nFk3VN F7tY41uQdpc6URGF2aqxUg3vCpNvdQzzMwB7KFDznWm2fvZmd4NglZroCvnB/leRB0vj Pkwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=M5Js6u4o; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 d23si2224695qte.13.2020.03.26.12.49.22 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 12:49: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=M5Js6u4o; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:58927 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYVG-0001uU-HF for patch@linaro.org; Thu, 26 Mar 2020 15:49:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58851) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYKc-00079d-1G for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYKa-0001je-K1 for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:21 -0400 Received: from mail-qt1-x82d.google.com ([2607:f8b0:4864:20::82d]:33750) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYKa-0001j9-GT for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:20 -0400 Received: by mail-qt1-x82d.google.com with SMTP id c14so6574278qtp.0 for ; Thu, 26 Mar 2020 12:38: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=ShxiiQVChFNUTjmYIyg4bNMUbV8gv91VOcC+VfAQzoI=; b=M5Js6u4oh8aYD/tFpbvxD/w5+X/QYDJAeGo+rIjgizoVoa5zFhQoCCNTzqgv6qw2UU r9dTtv9J+G2iFj9Rn1g501SzPYq6ILY2thg+9+68QCLwJxc7eNIg4eEHqp91gwc7EaBy 6/xvkAntXcoM5an4TadSuN2bc2MukxrxOH72j6LvAa+r/B1vjamh9aGt1ZgnQZOit8++ 2dShacu0Mm7xvhlTG1deVm9hF4X704FmKaco1++dVw/G6Sw3jUXaF0OtnVj72HEOwpY2 tRg5YrYF+7m6KeJXru1Uwn/CG0StZd9/Qy7U0l58IHAbR+176EYGrEwYTYinHv0q0QtR Qnfg== 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=ShxiiQVChFNUTjmYIyg4bNMUbV8gv91VOcC+VfAQzoI=; b=YyriN/lgUUc6eRXxeOOKpcqGOZ7kYkxg2X10Elyyi+vnZBvHBrEKshSn+nFF4k0wm8 dpZZ1t863uk+jBYV/hr1s1pgBuQc8tluNxca88icQDdD5YZkmzNh9sFcu+ZQ/qk1Cm0o WET3IYwU6vwz7liDd2wN9WsqHfMAvNewVKrpOzIACD//nfr6vadRGBxDv2vWP2v6J3Bm ikkHGrzf5ImLxfdJXNG0nCPyfwSsAzL31/MZeu9vqbHJrYHnn8wshmpF1h/56Dn6q5k9 BF30CkloKTl8kbPNP0u97n9YXhu3yRf8Fj6jw5RcHA96uW3GSo+M3OSlLV/hgj4Wi0JY yvRA== X-Gm-Message-State: ANhLgQ0amRT1X8bk9S+21kloQohyDqGemaqKqpzy5uU7DWVs0zj3toit c2ByKAfq5HZ7qCS0UZXtiYkrktFbx4/f6g== X-Received: by 2002:ac8:2a8d:: with SMTP id b13mr9859335qta.90.1585251499002; Thu, 26 Mar 2020 12:38:19 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.38.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:38:18 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 33/74] cpu: define cpu_interrupt_request helpers Date: Thu, 26 Mar 2020 15:31:15 -0400 Message-Id: <20200326193156.4322-34-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::82d 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, "Emilio G. Cota" , 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 9683d6408a..01091d0623 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 48b46c90ed..1c3701b142 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 Mar 26 19:31:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 184903 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp465579ilr; Thu, 26 Mar 2020 12:59:38 -0700 (PDT) X-Google-Smtp-Source: ADFU+vv4yeQqN4zi8HjoyUV+J3ir6/gP2M2X2Ge65dgGdytSkPtau2VgIOyazNDuTVgsfwJda2eE X-Received: by 2002:ac8:31af:: with SMTP id h44mr10365067qte.252.1585252778310; Thu, 26 Mar 2020 12:59:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585252778; cv=none; d=google.com; s=arc-20160816; b=b+lZkw2p0J9L3BdLXWl2YPUvRkO1cwfwfoqX4o56A8SXWrWt+1/AHjT+ptJJ3SomjM q8ySRHvYkZk2Z4KWND06aiy5AXpCB7pzh+BF2mwSM6OGPvG+sh7HSCmCHZngrh4VkqJY wU0CL/ZeeuS8EyXjrdiIIqbqdlaO+3K3SjoFXTO7Ri2ig6p9m3Ols/Hikrw7UBfktFTT qCim1CUmtuztKffihX9AHvaeuq5Q7RQkcV3IZVgwAkO9Y1t+tZXttFXYO85RT+9IOnAD ZcR2FF3RQDP9E1g/vnLHuEBQ9N2FaIDU7I0leQv2Dbd3YPGvoieOzTka+yn46WcfXREb eUIw== 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=LFX1h0KEjL3WKeiAHU4bRyv9sZCfiCnhx/ANt9ydhrU=; b=VWXjyXoOG54n10kWRTUZyWl8xXr7C6BtEhw/zoZaRKqQJBEDgugnDK+MobJeUknZUV vcRgiHJEZNeFabjyDL+SLtgwlN+3EIP6HJ/qn38Ij351Q3KUlsDQMTprjXUMpC+790eg olVGyiicTJ/6wVR/e1yZKIzKl8HSsYQ3anjTG+soV23zWyrBAk6xxzDfQgza1dS0W2U2 kjWO97fo8nRBFyWXo8nsR2V4MVqyzPfi+p/Jp4NOz8nqZashjUn9O1r4gDl0nE6p3fmg 4qDsp5M5NXDqWQSYECduVcFG2ZXG6ll7dc0Mv6miOmF+eyL6oARIyMGqNnUru+7XHXaa B1Og== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=KI+AxFJ0; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 l18si2062167qvh.178.2020.03.26.12.59.38 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 12:59: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=KI+AxFJ0; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:59254 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYfB-0005W3-R3 for patch@linaro.org; Thu, 26 Mar 2020 15:59:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58870) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYKd-0007AB-18 for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYKc-0001lo-2s for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:22 -0400 Received: from mail-qk1-x72d.google.com ([2607:f8b0:4864:20::72d]:38192) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYKb-0001jv-UA for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:21 -0400 Received: by mail-qk1-x72d.google.com with SMTP id h14so8189738qke.5 for ; Thu, 26 Mar 2020 12:38: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=LFX1h0KEjL3WKeiAHU4bRyv9sZCfiCnhx/ANt9ydhrU=; b=KI+AxFJ0NJIcOPCrkXLc57VmlOSZqkk5zyA459NNWUzfgQSgIKa2ja8jTRvMMDxuzw Wv9sLvxvtJPg9WdujjsvMV3cPZccJYHG1WCOjIumH/CgXpUwXOOpqyBCocCt0mKtZBbP RzDixYCvUiUMRHTP8XdCIJAe1VUExIn0KNM/DAugMHKrPsDWxDVFHyONgVMpuCvrklSJ MW3gTjX/Yu81z9Nf0VjYrIsos1Q91IMWtFlKSLC7+B/D5B/1d1KviT+Ask3qzxpqA5mV 9ZAj+H9uuYHEui0GxaDOPO1Y7JiKs5lV9W1m2PmKqJ0VWeiHXl7ZQvRaj21lW8IIlXp5 KWPg== 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=LFX1h0KEjL3WKeiAHU4bRyv9sZCfiCnhx/ANt9ydhrU=; b=GUbgnyZVZCvTqvwBVcZ3ozwcUNig0/DpfR1HQFPLHJcPbi9RZrJCYFJ2PXfrG3rtUC usmfxQg0xYcyY/6gnIgiKDmlk03325VEkmrenEoJLQk7bjW5dJT4+0ByOPC2dUtuCcwi 54VI/xH8F4Ln8GiOKJhimOdlMGYmYC6jBxMQRoHUFEEj2eW2zNHJqBGzTKVfcfI9K6Td +6cjn/YEIv96kzX+AefNOyokXJlXRv/Mq56JfKDPvhKdnWvW5251Dave7Q6H2Ca2tdUU QE7w+cS3/35A91P4kfZb3Xquja6bPL59TIIatxAKFRv+j5+po4n5ZWYkNIToeMann44g 25lQ== X-Gm-Message-State: ANhLgQ3o2py5IGtpHAARuOlPiCwC1xGkzWnXGq5A6VrKA+uzP9xCI/G7 t6VLLGxce6H1UpBZ2LjQVBUyDYHRZBdHEA== X-Received: by 2002:a37:844:: with SMTP id 65mr9456141qki.15.1585251500398; Thu, 26 Mar 2020 12:38:20 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.38.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:38:19 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 34/74] ppc: use cpu_reset_interrupt Date: Thu, 26 Mar 2020 15:31:16 -0400 Message-Id: <20200326193156.4322-35-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::72d 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, "Emilio G . Cota" , qemu-ppc@nongnu.org, peter.puhov@linaro.org, Paolo Bonzini , alex.bennee@linaro.org, David Gibson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Paolo Bonzini Cc: David Gibson 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 e686eda0f4..ce283a664f 100644 --- a/target/ppc/excp_helper.c +++ b/target/ppc/excp_helper.c @@ -1001,7 +1001,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 Mar 26 19:31: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: 184907 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp468102ilr; Thu, 26 Mar 2020 13:01:45 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtj7Kwqk3tCmdn48MqKFafdEv0et80ZieIvvA6qbLkG+DNNZMoyK9WFkqE3YvclV6r3KZXY X-Received: by 2002:a1f:bf51:: with SMTP id p78mr8263391vkf.47.1585252905577; Thu, 26 Mar 2020 13:01:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585252905; cv=none; d=google.com; s=arc-20160816; b=BOtm8TzUTlYod3rNyZG/hZOVqY6UGGngpCus7mgttadlZJgYOGZ9XDQS2Wcvde+4KQ LvB8nRKPSrAecZy7d/6xUiTk6kIteYAEjUPBmLM0vZeRzRIqPbZ8y4ZtHykzmFvwZT47 4oG6LuQm7EWhJpq7Y/jCFNS87to7DJtjQ6Co6DUJhEHesDPQmbhPSCF4hc5f54lb9748 SwUpqSlBEaByzFVGiokfqH+IxNnFR1PuNusGyfmzRb9CrY0rHcoxQDHwhGz8UfstVTOX Jv0wSFsHANHbzZ/8D2yJcOxry81KNPoD8LgS69ZCglIeI9Hk6idwjtAQHnjog+llAES2 tsKA== 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=mmiRxRrUzc6n/Jyo9kUg5Bu0NCG0n21LS2Ois1y8SwI=; b=k3WVA4cXpZ5HeW3OTMuH8P5FkCQ3RsqGM/2ZbgzSU5bh5lOtBChRzWRgHZTdbFr1tl c0jBvPre/B8BaaR0fM0zhLMtS4UqWt56MerrI4V8+RdQwjPMGWYr1vtJEH4fO4RIJfuO vkE/KTmEprxeErCDeVqAiF5mcZm1Kc01ekrS1GsN4rIVlMZFEGJ7Tf1Uk1fSq08N9xmp +LK0CC0iIMQij3MuM4SJIipukzli64j5RbVf9KFc5kpuR+1McYkcbhHiNxxD9CxAcEji AjeQCCV+Vy4pn4FeLbfrIXhqGw+RiqzPQDNQ5N9Rt9YNUXpilVskTeDYhSCUgS+InkIG cIqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=DbJ8J4zX; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 k26si2191732qta.212.2020.03.26.13.01.45 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 13:01: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=DbJ8J4zX; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:59312 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYhF-0000Iv-0T for patch@linaro.org; Thu, 26 Mar 2020 16:01:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58881) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYKe-0007B3-HR for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYKc-0001mU-VX for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:23 -0400 Received: from mail-qv1-xf42.google.com ([2607:f8b0:4864:20::f42]:44235) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYKc-0001m4-RR for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:22 -0400 Received: by mail-qv1-xf42.google.com with SMTP id ef12so1652562qvb.11 for ; Thu, 26 Mar 2020 12:38:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mmiRxRrUzc6n/Jyo9kUg5Bu0NCG0n21LS2Ois1y8SwI=; b=DbJ8J4zXgPvllhvqWxTxrIYv/oC0UGXUaJa5+YDuUb2MIqdbHA22OxTA7iD3g8xKx5 kPzcKq6iVLMCQdazeNDVcbN8SOb24XAgcq69aSO+xhppucVL+c9fas6Je4Nn8+3vuaAD CrG0Eko4LRfXquB1c5f2a3rD5cqUnOYlh8z7UWzJFq+UaNh6+XRXbKMsze8NAp+FLFn1 NQEWfj+DlNZolpdTOrUW2dvUwqaG4TQsY8+YHgib8jCXPV8DF5uHvAvLdWbpUqj6rq03 C8KV/3cwCaEGc6/+TC2yeYO11Zn/+jAKghPbU6Rb+EBUd9MlpCT/7KOnvcKNKNJ6aWQg ACLg== 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=mmiRxRrUzc6n/Jyo9kUg5Bu0NCG0n21LS2Ois1y8SwI=; b=ZmA0q43PsGGp/FC+zvdlwJPVq9Mh0P7d1/8oHSCKI2k9H/byY5tJxsIqCptRukvqB5 o8nw/2z4Lp94HodvJg5mpiU/Ow3Rnry5Ck4IZaBLzjmaNw2xinybUj/0JMTAleG00FHz 5d/fT+fwD+vPeze7eUjVIje+wg9YcK9XQ/0XGQdOIdWjZ8uh7cfqZNWwged0fGDaGYnD 4DPT2/ijn9i6xIXEOFOzplLh8tXBXA5uV7YNaXXNdsi2VCV8cvaww1d7CDNSHC/BM5uy Z/MhvF6oeMmdMKoDPEvuRM0YmVwz3Vx9y5/YB6N5xQNJx3meTge3Elr742J8L6ZHQb90 4y3g== X-Gm-Message-State: ANhLgQ1vtSA6pNoKRaRV0xPLsrBetT1HVsKnb4wXZJWdnUzIW5O1jjJi 2U9SA+s7UU5yL5m9lcNya1qkpKnls/CCKg== X-Received: by 2002:a05:6214:70e:: with SMTP id b14mr9826831qvz.246.1585251501700; Thu, 26 Mar 2020 12:38:21 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.38.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:38:21 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 35/74] exec: use cpu_reset_interrupt Date: Thu, 26 Mar 2020 15:31:17 -0400 Message-Id: <20200326193156.4322-36-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::f42 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, "Emilio G. Cota" , 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 de9d949902..a379016693 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 Mar 26 19:31: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: 184904 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp465775ilr; Thu, 26 Mar 2020 12:59:50 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtmeedr1CEiW7plYUQNSoWlzW70o5KLJbJYFSGwewafUgOhJRrtECoKzSquMXaW9295u9C8 X-Received: by 2002:a37:a397:: with SMTP id m145mr9963275qke.411.1585252790846; Thu, 26 Mar 2020 12:59:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585252790; cv=none; d=google.com; s=arc-20160816; b=Ga9wOJa6o29Pqm2pzSSxgmFinQhpUNYEJBxQu+m1QUMUPhY2ilyJi0JhueCFPOogqc 1NjiLFJJT8Ds6LiOIklh2rAwJDCBVJyOxxTHJE0HjcSLn8rLJnMtmHiVvZBYl47TEn6F y1TPF1BOPR7TH39EgMwm499GXZ6gTKk2Skog0M7PTVUHbtYPpDePdGvf2qQNuiaX+5Xs UfV4K/gVVSDDZ9ksEph+2cyJ3DthaftATNcCCuN5QrxyB0lY9hVIqdLWk4b2tWCDVpq5 y6l0PQZdzS8Kj0Jys5qI/THb1ewWI/NGi3wQ08K33Jelo6CA39LFx5MV9hVL1++aJdNo nqCA== 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=j8NGLZ7/SvXTE+Cdm9c8nbCOhjKd8q7CnsDXGNqwiOY=; b=g1wKjQSsTtguxn9hBz4aDzPiGFaqgWSblY3ak2a6ftbqHQfpgWcGEexhLAXVezhdcc MXixoHL/7Q46jzunhjSpTn1r33p4sA1IHHNZMiXvWkS0k4S7WX3vjCb+qmj6kZ6cQSRT Tp8RYlpgd7SlDuZjSGKyCDhXHsmUYgC/OHzsG5orUF1Hx1IXH48GHH3cKSKd8/SHeEI7 q08QcPLQ/aP9ti9R/GTdWZK/pI8ER9ij43A0Ktnd1jRiPnD6ZsYLluSWKx/zq/WWFyjc nN3mJZufPASDBJiqXG1c1gxpTwU/1QkQ5Az0mkYMhx/5NNzjWpqUOSg3MuLRWM7MVf48 lkpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=geQNT4hF; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 c18si2125342qke.232.2020.03.26.12.59.50 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 12:59:50 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=geQNT4hF; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:59262 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYfO-0005hb-CY for patch@linaro.org; Thu, 26 Mar 2020 15:59:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58913) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYKg-0007Do-Nb for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYKe-0001nj-TC for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:26 -0400 Received: from mail-qv1-xf42.google.com ([2607:f8b0:4864:20::f42]:34263) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYKe-0001n7-Fh for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:24 -0400 Received: by mail-qv1-xf42.google.com with SMTP id o18so3707709qvf.1 for ; Thu, 26 Mar 2020 12:38:24 -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=j8NGLZ7/SvXTE+Cdm9c8nbCOhjKd8q7CnsDXGNqwiOY=; b=geQNT4hFHQHp8hBFSjUnLLHB4h6UDutB/OXhpS5Vop0nd6/T0yHpJXwcGEkbl2dUIk BRYbIFUrMHvx8iZct29GdSURYvP0i+zDI/tFvP1GWaU+jPOWH1evihJu1Sb7Ausqtly8 Q7wLwU/eE2pvidLkvWX8cca8g6j7I4nlAD13HkWZOwf/QR7n+e7nmxfqgid9KfNe5JgQ lIyn7aGGE129JqgP6bC/Kn1LNmLnkBR9VHcIansuXyluHoU/oYOPwPIFi7bShZ7gRYEi eo30VH13FTEdpim+r60QgG9uelk/dn/KR8AQ7rmXy2R8b+V7C3WhYhJ2pI3GCXmnEEVb mTog== 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=j8NGLZ7/SvXTE+Cdm9c8nbCOhjKd8q7CnsDXGNqwiOY=; b=tUq3qPAvprkWBDUMScHmgd35tdMIkEW/FAm+HA9xXXAIjtsRvVdaYREsSQBo97MJFb K1gEIr+QJvm+IoWBya3urIn1P72JxQgV/RpBkek/QwF2QAtl1wH9wsCjsQZcCJbxAozr ARtAlteqHxO3OzrdnPWXf4fEEoDy4gAlIg6m6VwX6fLJK3gS2Bym7Wzv+baP8st0Ghe3 0xOegXhBrIbHiic1ohSP1vY7EVlzsr3XFbE9hOml5TUHqafyPjje/IeQ+zP2ZpV+V6jm 8cQWMkMr7hGfCtGZqvqLbW7c1YNTYztgd2gk5cZaPPETUm+lHEVFSJGb1b2koPrmQ853 +WRw== X-Gm-Message-State: ANhLgQ0UY269ihhf4kFGtezwj0SMla+vWPySTbWYtQpJe6PfNBJ/sMm8 9tdYk5nBPkI6UFeyAp7yjVbRdguvkY6BOA== X-Received: by 2002:a05:6214:11ec:: with SMTP id e12mr10231849qvu.89.1585251503259; Thu, 26 Mar 2020 12:38:23 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.38.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:38:22 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 36/74] i386: use cpu_reset_interrupt Date: Thu, 26 Mar 2020 15:31:18 -0400 Message-Id: <20200326193156.4322-37-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::f42 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, "Emilio G . Cota" , 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 9f1e28387f..44a4d45980 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -3657,7 +3657,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; @@ -4020,7 +4020,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); @@ -4031,7 +4031,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); @@ -4067,7 +4067,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; @@ -4138,7 +4138,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); @@ -4168,7 +4168,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) && @@ -4181,7 +4181,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 Mar 26 19:31: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: 184886 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp458471ilr; Thu, 26 Mar 2020 12:51:30 -0700 (PDT) X-Google-Smtp-Source: ADFU+vv4TmlyVXbUZqu/RQnOJ/Hs6w25pt/Yx2QiWssq95bFHMkTNGuPqMzGAOhWEP8yqv2Dcw8U X-Received: by 2002:a05:620a:539:: with SMTP id h25mr9960659qkh.395.1585252290608; Thu, 26 Mar 2020 12:51:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585252290; cv=none; d=google.com; s=arc-20160816; b=pmdpYeC9pKDxYAlxf6+B4gqF95z4Be7z440elIIXMI1IVUUQLY5UDcNZAt+dWwdS9z 0rX2yG5jmeruLUDWzHvttvLHRxbYPCqQ/H6aH4QPolIsKIBqTu80KoXGIl+XFRu4ubBm sqi+b+KvYY6xzJRztAJUfMve2sI/ofagcyD4ZD4Z4DDw1qPurvVENMJD4QbwUzgmNZ7W K6IdtxrDt9GamuM7A+0oc5hWadK/+VU96ST4EGRJ38c+KQdkNL0or7r2eX3VVWXo/vjF mJ990pBOb1Nrf7R8tZpN5qEFzh3IUnU/dVOC709SQb6fxfEOlovwox0fhjqCXdx+KGv2 oPeg== 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=dhKwABjxRwU1BItR+iFdcDqbKoaPFQUDx67bS6N6p4w=; b=qviL+1TJ7QWZHDR6pklG11+X7oEeCykD+F4Xgf+QYXg0X4xT8Vvne0wN9ryuSawUIn bkAXw5eRtUViSK05NqVusM4MiwvLYSj0YL1n2tEO9W+yIr+ZehMFruolFRBdIcTEE1Ol 7Lm6aNK13ZxEi8/F2SqCoqAoX3soxAiRaZYvGF2c53wQu7dOZ38eLGJa8oKxLyRDdBk0 Wfex7oML4bRA2Vzp4lJS5ZBIrL+kkjidDmxhkQ8MTSdkFMnyGJu1YLEJTv9aIuMURirs OiJXRneCnQLgxlOF5/8n5xZ0QT286XRYYCfxXorC2s7OKNT3N3S83ZihkrA2cl2JFfn/ j8RQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=jVdnGHFq; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 a40si2146314qtk.15.2020.03.26.12.51.30 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 12:51:30 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=jVdnGHFq; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:58992 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYXK-0005RB-4Z for patch@linaro.org; Thu, 26 Mar 2020 15:51:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58923) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYKh-0007Dq-7Z for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYKg-0001oZ-3h for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:27 -0400 Received: from mail-qk1-x744.google.com ([2607:f8b0:4864:20::744]:40098) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYKg-0001oK-0F for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:26 -0400 Received: by mail-qk1-x744.google.com with SMTP id l25so8186638qki.7 for ; Thu, 26 Mar 2020 12:38: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=dhKwABjxRwU1BItR+iFdcDqbKoaPFQUDx67bS6N6p4w=; b=jVdnGHFq5RVtmIWLCFS25467xzv0DO5ySf9LfJDJrZSNW5JvM1CPsGdfz6mXweMdok a04buppbKd2UsLHxqBNZksnhcdi4wW3TQjgsqLqxiyioNdL5R1Cu+74VRvC359twJD2o 4BdHaEw8yiEiaowuqu7LWugYtRoq9Wh/j43HRCiaaRqbI05HYPbNjn6xpMRqsERil2ks vHaxPfXbmMHE0TsXAUpKmAFry7iJKiErtpZtSU5FjZgh16HI74o77mJEDl/MmGs+lirs 7F1D9NbcIZ7Ptsh55m+vl4BsslrZS43H4v72Sp+G0PiHIPq0Q/Dc2nakTf98d2qiRqeL Bvlw== 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=dhKwABjxRwU1BItR+iFdcDqbKoaPFQUDx67bS6N6p4w=; b=GB0U2sFDKmMaAmiXijWcw32BCMh19I7G1YfGf4VoArZIX1tst7JFh+PTrCQJlyvxcv xgWBwPiGulsIpwS+lVKckzksOCRYJBXaayJHlQxiOa4+SpR4X41UVHp9D0DG1izdtFGN 1QpVFXfAjHGhogjNL8pvQ4cHJ3Slwe7n/qSuvXfA/CsZNP5tXuhSLGm2SMR0gAZi6JP3 DZuz37UBvxxmyP7yF8b2jwLNwoL7snRmekJLbK+2FHr5Knzr4Xl3W+jZVc5FfCDE2cI1 53M5UJQ6Wpd3K5yOH52LM195Sr3DZI6O5uVg4e1tMs1SkTdu6ZVYRmJvU4mGa7bTdDhc piaw== X-Gm-Message-State: ANhLgQ2EAUSDOvotlSvqhThdR9S5MCpEocF7bJW9GfU3ld0f920Yn8yn zhBFptUBr2jiU89dc7Skta8yOafQUhoHlg== X-Received: by 2002:a37:8645:: with SMTP id i66mr9912348qkd.91.1585251505210; Thu, 26 Mar 2020 12:38:25 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.38.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:38:24 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 37/74] s390x: use cpu_reset_interrupt Date: Thu, 26 Mar 2020 15:31:19 -0400 Message-Id: <20200326193156.4322-38-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::744 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 , Cornelia Huck , richard.henderson@linaro.org, qemu-s390x@nongnu.org, "Emilio G . Cota" , 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: Cornelia Huck Cc: David Hildenbrand 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 Mar 26 19:31: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: 184909 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp470847ilr; Thu, 26 Mar 2020 13:04:06 -0700 (PDT) X-Google-Smtp-Source: ADFU+vt/iuhxeiTdPaUC3HABT9HQXEQ1DtlbTEvFgF+ni1tMUxO6XXc9ARNZUS2QaAgK6IOWGVHh X-Received: by 2002:a37:a93:: with SMTP id 141mr10518919qkk.244.1585253046220; Thu, 26 Mar 2020 13:04:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585253046; cv=none; d=google.com; s=arc-20160816; b=tu5i4tMAUZp9A8Y5RxALQRTsuBo/ZGZrXptvP1NXlLTPCgr5ImcP+JR4VJbjrHdIiQ d5L5/WXAyCkNaOJWwCjQjhODfM/Y/16Ld89Rb6YCCrlOqqoGAV/8J679YbLT/CNSZ2jb r5yxzUeoibovRUEkkDQNa+qWywLY75BM6HeqJLjF6Z+SbLWQDGhh540xi0RbLQXnntb3 fSFaURaJHYc4COuSop287RxAP2gxw2pW8HnVG+G5Fq+3gAFEk/NjLXkmrGo6cd+h/wwS ZIu+QRy0zj96j4NDNJy76vYxgNAhjakk2+FOpcgc6PP6h0kmF+6tROwNdmE6349DOnkv /YKg== 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=giXAOk4p8wHuJtgF5jmj4ixaWLz4h6vqjUrWJuH1CpxU8PsYOLHxKy6JnkQ/QRLA5W Y5FPRSpcbUrZvHjn3z+g7HQl60Phrd6tIdkI+VESQNshos401x6qWHoWxGAfEl0pkIhu tVHp+M7XKhI3deEc/dtHd7EuQpVuFY6hv0FdC7LAcJ5qSMoxNWAiSQWtUADrYgIy2Q4y 3OFBRKPG1/Vgy+4cBfSDj85QoWbqBzfn0bCJlEbQN9bHn4TrpllQmOqjQEt+fHMmXU4j +4p7Y61oaEV9+am9SQ4eUPCpR+BlGwy64LIhDtGNz3AMGuRV2SaAN4jbKAvFxekCc1JB nFIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=xnPgdrd4; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 s30si2178958qtk.50.2020.03.26.13.04.05 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 13:04: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=xnPgdrd4; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:59378 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYjU-0003zs-Pk for patch@linaro.org; Thu, 26 Mar 2020 16:04:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58960) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYKl-0007G5-5D for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYKj-0001qd-AW for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:30 -0400 Received: from mail-qv1-xf44.google.com ([2607:f8b0:4864:20::f44]:44237) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYKj-0001pK-4b for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:29 -0400 Received: by mail-qv1-xf44.google.com with SMTP id ef12so1652725qvb.11 for ; Thu, 26 Mar 2020 12:38: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=UAoGpC+tFU+Lrmci3F+3S0Zh/4YRyJd+sLsoLGG3MBc=; b=xnPgdrd4XCBnujsdtHIjW8bs30NxJVXFvNVCfxmI6xWv1tF4C3acu3/eY/R/A9lbiL bba09HpLfH9rND1SFpn12jq+g9jKzYQB4upYy0h/mqeexNUbGb1b6iVF2zwCy+DOjMRn wj8/T+hNCdIVrYVwGB7pfkfyNaj35FQOGVUlbvFe4AiZLEEiqPez/FInn7GMuyfZWh3p 1tV8HDJcNoWy8rkTErFctDccXreABcyEi7OYgMEdZzW5gpdT/cwzbqtzTAztVnE72Z8T XFCpQ4mZaw0p/uywHDDXuB85ruuDQPhMXzHlIGhIwItVbWJctI9vC877nYFk4WMHKRwW UT/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=UAoGpC+tFU+Lrmci3F+3S0Zh/4YRyJd+sLsoLGG3MBc=; b=RZFQKANQnsdQYu5oh25CpsGS/xO3vwVJYOfYML1ezKiF63GPEpvzM0BI5O2mufyZuA yGJRu92fYQ//ECeBviv2YqKy7/iEnw+Tlyg8TS0NbqtD76OEMq4dkFt33DsNvDBcqlrL cS6G0CDzneW9tedH8QppcBJ6MDD561pVU2gDnkqFuEqFJ+6tZQdMsc8FAq/LMvbkkg78 gC3PsKgNVvous1ZeykA6ZeQHFiFxQlOAY6LbbfiyFvOLK4znpObNgUupw8NKZwhts+7W MxDrHs/tJ76jvQaCMDNauyyFyCqg0I63+q/wta2Z0JrAhDFOnVAs8g+xKu3ZB+uTk1A1 5nwA== X-Gm-Message-State: ANhLgQ379KyTIPnk98j2hBJnIhcSgMmS3UNoTj57ofs9/GZoAgBjI0MU EjAyUeOGemvAzSd7a/jwoXp6UqEZuwsPnw== X-Received: by 2002:a0c:fc03:: with SMTP id z3mr9578539qvo.210.1585251506583; Thu, 26 Mar 2020 12:38:26 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.38.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:38:26 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 38/74] openrisc: use cpu_reset_interrupt Date: Thu, 26 Mar 2020 15:31:20 -0400 Message-Id: <20200326193156.4322-39-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::f44 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, "Emilio G . Cota" , 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 Mar 26 19:31: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: 184910 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp472820ilr; Thu, 26 Mar 2020 13:05:46 -0700 (PDT) X-Google-Smtp-Source: ADFU+vs7lYH8WQnL5nwp4CdyUHIjuhFazo0rk7ppH4SeUEK+cD4tPe5gcvMl1nqh1982nMv/Lxmz X-Received: by 2002:ac8:6d1:: with SMTP id j17mr2166816qth.191.1585253146279; Thu, 26 Mar 2020 13:05:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585253146; cv=none; d=google.com; s=arc-20160816; b=RSyjqTg5hAPNfdnZP2ULHB17XoVL0ez7RyZsN927+I+OR8oLh794J4pvzTb83ZU3eS 89NoVLqDlV/+wK2+dfCa1NFFGjwEFNxyK4FypYHYZSg7QfWpo5K4Wf+WH1HWX8lVIIHR H/hDUtsYNMP+xrfBEpvIpQWvKTcg6aoSFqbzhMbOEsQLOaOEHWco5kp/8WEiDVJTFc0B G5WezTzQao8m+GVPF4qRXHvvod5oDSHCVrN/WmT9KxY0a1UqbIXkNe7o5uHu3WQxaX86 ihv8U2SjdEY256vDFHzTl05/XFjvHZupyJCAYBbUh4QFxdCbaesVgeWj/Q7Ft3+esr+T 14yQ== 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=peeEpurfJyQFOk/Y5mv4nylcNl/81VuZK9r+NVDwKgU=; b=hqX+KMUdOi+ChUjmqfv8IiGVT0KaB78p6UYsefKXPDTcI5PGMSzg62VfsSWMoKa6L1 4jpT+pyGNi5VKF3qbFYBUqykI9O9SBZHvy4nxSxvGT7oF+9QvSncpDYpJvwlOJf3Yv3C ncSzuu7NKMRiVvIJnhm7L28/bahD62JMa+qgMjLmJihapq+EMKM4MczKH49i/SviI1ap MgFpqFDEwSRvV1I/RoirqP2evTA8fi5UI46OUJLAuRVHm0pebmc1W+pLDG/TFdn0U2OL /Ve+0UGCThcb2MJ6D26ARzcAq20+VLlOv9F4bs484A2enNMQ6AwPtuljfCdNaRubdWb3 +T/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="Pu/iQU0w"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 o50si2104320qtk.71.2020.03.26.13.05.46 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 13:05:46 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="Pu/iQU0w"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:59426 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYl7-00075z-PO for patch@linaro.org; Thu, 26 Mar 2020 16:05:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58964) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYKl-0007G8-6r for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYKj-0001qi-An for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:31 -0400 Received: from mail-qt1-x841.google.com ([2607:f8b0:4864:20::841]:43639) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYKj-0001qG-5T for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:29 -0400 Received: by mail-qt1-x841.google.com with SMTP id a5so6515286qtw.10 for ; Thu, 26 Mar 2020 12:38: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=peeEpurfJyQFOk/Y5mv4nylcNl/81VuZK9r+NVDwKgU=; b=Pu/iQU0wjw5Q8m4vkpiyRh6hZHgO1MATDuKPcN52fchs4/yKvslhi3ViUfiC5XVrYv S0ufH3bi5B66iPearsRvFt4wrlX/KecUZxHge8HrIJcx7RPhbqmaRF7OsdDL0THRdqrK +dz4NXobhiU9EmgtJS/1i9UIEIPQL3cyni0YrLKAgWgjB+p+5NPJc9xILR70km/y5u8n gIJNYyT0HUXohkjQA9+v0/6o+HEUIsjFNuJQcds7Hconv0/3qaKjVJDuIXDf3SWivTcq 8Cmo3ie79lX0ebNTQOahscj6lqX7+pjy9rMeuYoWW5yrz5BzR+EBRdoEGT5Nj5BJKzrF SYHQ== 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=peeEpurfJyQFOk/Y5mv4nylcNl/81VuZK9r+NVDwKgU=; b=IY+Fx8+xB5m548W06xeWavNZiXIq//Ub3qYOAzVALnUzyNONj9ip/mFyukofVd2Sjm /RhkbX+D5bPHi89LihLMIQtz9Y594QODKDbY5YOZgIIroDMNjRS+e536H8iup1ZGIfgF fVEZtqVgC7iuVAoHqy8hAtqTfl4+HccIVYsqhhdhJWYECQOa7f5LN3zNLKnR+1DiE2IJ COpj4Z3yqKwMR3Ea+r0zidhV4IUsnjKWeTJuAeHOGlM49STM9Xvwlh3zXsuIV4K22Vat DedM2ZiXu3JJhxjgefLL9iYQ/0xKcmTavEkgz5Aq44grvYfAoYz7Crnzqv87B/mWU+MF 2ubg== X-Gm-Message-State: ANhLgQ0csQNi/tgHJ8rGK8KyA5O4npCJWhzT6BCvbisRAcz5g4IaBvOw nVgjvgcxhASENEhmCpMmi9LgdrgmV7hGsQ== X-Received: by 2002:aed:2415:: with SMTP id r21mr1157382qtc.82.1585251507974; Thu, 26 Mar 2020 12:38:27 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.38.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:38:27 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 39/74] arm: convert to cpu_interrupt_request Date: Thu, 26 Mar 2020 15:31:21 -0400 Message-Id: <20200326193156.4322-40-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::841 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, "Emilio G. Cota" , 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 9fa514c999..e190604ae2 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); @@ -611,7 +611,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 { @@ -632,7 +632,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 b7b6887241..19efdc0b00 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -2132,26 +2132,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; } } @@ -9676,10 +9677,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); @@ -9694,7 +9692,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 Mar 26 19:31:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 184871 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp451587ilr; Thu, 26 Mar 2020 12:44:02 -0700 (PDT) X-Google-Smtp-Source: ADFU+vso2VIy/IoV4TGJSYTvgk9WF331WnMR4ofFTb0E6qPxqG0IF84UYy5QbyJSMmcxRGC8ThZl X-Received: by 2002:ac8:6898:: with SMTP id m24mr10430379qtq.65.1585251842745; Thu, 26 Mar 2020 12:44:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585251842; cv=none; d=google.com; s=arc-20160816; b=rzON16NORy7JTCzRMsrYiioXTFhkGF6GA/speup9yzapUCHzJWJ6cNsOCVE9MgC3fa S2bU3rHH4Cv46tLmzL413hCDsYkYAIPB9GZXpY+AIy9Q6Ey4Xy6xbz5cQ/c5TW38s3t0 5fUBIyfjWiIrlDAZLqW9oFNiYO9MDtKU8OMtkObJPIm1g+XVccXQWL7os+B0bKOuViJw bmv3qdz4iUqvFrUfR+GFuLieVpHMDf5ic2nmswNSSxwfD6jVd6Lm9EWXRpbjzomZfhKM nvqofRJ8Q+IEJWLC38J7ac1a8fGJD+HZdKp6v5QIFO8Hfsua9bDfmOoyW7uqDO79sDrq O6Wg== 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=sdQwRlLLT+5U59MmV/RF+N1c5notv4MIEsZdFF75BOg=; b=x0DOssuT7K+YMmt9fHU96vr41AsQlNf8jnnIyDY4JnECvMV142XN48GNG+8uJU5v9E MejhMOkrFTM2BKXZZ5XMSeFhqOsSmmBTekAgh/aPbWHJLWisEuSL1urAx2i3uB02E3w0 6wB0hMtWy15xjGoPZo02wXsdh8FXKb03HV8XeXiQjsY/EcjzZT/cLQhPArycqO0/+xGc SsErqo1vLLJZe5N06pD+JSHqnSsjy8nZ0wNJrFRFr8wJepWe9MNZTlUHNgkQnn8q3OZz YLKfo+Hdo+wNBfwQXu/TOG3TjGqgnyb9IX/4EyhTE/eBmq57LLdM46cCdlMTLtz6cMNs 5HSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=aP9XFJ9V; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 b11si2021509qvz.56.2020.03.26.12.44.02 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 12:44:02 -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=aP9XFJ9V; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:58766 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYQ6-0000zu-81 for patch@linaro.org; Thu, 26 Mar 2020 15:44:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59001) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYKn-0007I2-2D for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYKl-0001rk-4E for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:32 -0400 Received: from mail-qk1-x730.google.com ([2607:f8b0:4864:20::730]:41515) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYKk-0001r7-6B for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:30 -0400 Received: by mail-qk1-x730.google.com with SMTP id q188so8164811qke.8 for ; Thu, 26 Mar 2020 12:38: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=sdQwRlLLT+5U59MmV/RF+N1c5notv4MIEsZdFF75BOg=; b=aP9XFJ9VWF5r/gKrwYHKn6472A9yf3CD0O4fhxJ5DuOstbCnh21n7LorbfLGPwMfgf su57rhAuOuPM5P0tsMPW84XHnBb1lBucyj7n827xnYljc6x29QhBYoBwXJPKKS75gBFe XWlttnOxWZB3xEsjShRbL2tXLUKhWx7LFTPs8EqwQiBGNn08UzctKYRrFs90GInPuwlT FPHQtQtK0TjUNUjKPf7a0hAHE3yz7XQM/xFy5KVW1PvGfMY6abjwheqzQBGcbKQMJHOz G0nSawHwaoTnQZjmP3TH2V4RIQiPc1YMKi5A3Rz4f5Sgy43oHcRnazP7Epc3z5GfliE9 kSwg== 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=sdQwRlLLT+5U59MmV/RF+N1c5notv4MIEsZdFF75BOg=; b=HjE3HX9Gs6vV4G0D6rtOmOCE9q7ZEE+TRCMOpPmRf9dFs0jIgZf1ETn1dVRmCTYey9 GGTMGuUtHkQLtrshM5cuuaLz8BdPFzU0swCDnp+U/MJOie06z2biaPclz79Uw9eBECv6 aXD08hWFIv/YXwd6wgwR8vVkJqx0RJ7azTpEZejtZZBcbsoTyJcHD01XWDJ30sry+ULt 5WLrke6COA8mnbhWgGj5S2qMW8rTAf5CcZKkDsc/EYN1BGTPaDvfMCzQNS79h1zBs7lv leTa7LsbmDkTC8BIMFtrHQsTHYTTvnH01p/AcufStNFeG+0tr4RrzYG4aeJdh6gcfJVz 67XQ== X-Gm-Message-State: ANhLgQ1qf4vCAKNL6Kdlw0Q/qOimVF6d2AzoiR6Tc9xlFUJDDCm0Ozpk ZHaSn3LgvkbDQwaF5uujDSTdivx3V3LkCw== X-Received: by 2002:a05:620a:120e:: with SMTP id u14mr9319408qkj.23.1585251509333; Thu, 26 Mar 2020 12:38:29 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.38.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:38:28 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 40/74] i386: convert to cpu_interrupt_request Date: Thu, 26 Mar 2020 15:31:22 -0400 Message-Id: <20200326193156.4322-41-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::730 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, "Emilio G. Cota" , 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 280da50abf..bb6624100f 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -7114,7 +7114,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 Mar 26 19:31: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: 184875 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp453563ilr; Thu, 26 Mar 2020 12:46:05 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuxnLKSnWSok/veiWS2/iCn3zfGRB9Wxooaq4ZCduORmt07SSjQkTFENr7iwIrevxt3DxDL X-Received: by 2002:a0c:fd6b:: with SMTP id k11mr9572904qvs.99.1585251965747; Thu, 26 Mar 2020 12:46:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585251965; cv=none; d=google.com; s=arc-20160816; b=kxGI+UMpr7KuMc7APhfYKRlJNRl1hNhnmwpBo9zUrcY8VnLCrRBwUijMxXauepmnst 6s3k4tuWHEnrYC5hdgLW4sMlSaKXrUfKxgAfAq/GkRkIUeep1CPKj+CT3I+ZSp9V4YAE LwG5mRozmXEVCNQSzIH5s2eAgtnP7gHR4tDmLK7pJ/ffRIUGQfpR5dGZh9pfsbqCrVZE g5FC9Py59o5YanH4WC7MG3z9G6iJCJ8yELqIlGXrRFTLEAiMcK+yGqcsjQ+oH+0lRBZi UMAVV/4zaprk1C26/rz8sNGY6kil6V326iJ7/rn/0ycuVcm2PC9D0EytWoBxbcK/ggwp PMbw== 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=idzaW9AuHO1pDNIc/RVr+K6qO48ZZyYm6VEdm3wlJ3c=; b=kSKkNB1tbkC/oI+0jcKbRVoT/hezn1yGyWN2+5f9sHvfZ72xygyeOtRThLFHJjnNIt 30l86ZQPXx6/eOyKdteXn3+iscf/zVHzTsBhKoa6ZbKcovlA2RxZT7xEWVwUyClnFPII UZ9hdz8sy3ep/EFz63+jB1bPoNVUYP0bdK4/OMyoHm8gw8VBtLA331dnOxh+jjP4B+76 igtn+J8UU4Gs46sXbug7NoVqM7v12KrAy+ZoGU9YG64EfOxjFf3UagYS9d1iHO7ThGpl Jl7tA4S4h8KwSnVNL8a6I+/y7HlFz+vLnfvD+u5gMI4mZkbLZUINw4+S96e0bFJ5ytKi RMCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="d2SVjf/o"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 r3si1966291qvk.121.2020.03.26.12.46.05 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 12:46: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="d2SVjf/o"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:58830 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYS5-0004g1-7u for patch@linaro.org; Thu, 26 Mar 2020 15:46:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59023) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYKo-0007Jj-Us for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYKn-0001tQ-3j for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:34 -0400 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]:39023) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYKm-0001sG-Up for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:33 -0400 Received: by mail-qk1-x742.google.com with SMTP id b62so8195705qkf.6 for ; Thu, 26 Mar 2020 12:38: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=idzaW9AuHO1pDNIc/RVr+K6qO48ZZyYm6VEdm3wlJ3c=; b=d2SVjf/oFVzu9txF36Fidwy3HrI1jly0M3OTnLkvltpSppg+aW8f6iPS3CFbDiUrwU CjxExPwTxt9+WLA8Y2r1b7CNcJ+cLi0AEp17HsGSEq/GxNaH4yihaTSRHqrkwMArji+m mcmBDKQPwDT2r97+ufONvZaacG5KJX+SvnbDwQNFJW+ZMNl+otbdpMRo//uwkMKd3bPd hxpqvv3Fhf3j6C8rxtCxuziKHNOtDmShLKpdq+NGYmpOJ+Cor/xZYrvntUj9Crw9z6/T 6ZqiE/KpFwMAxOECG/wqZ6jPyZM8vR6aopnjGrZJTdkMmTiJqj7jC0CPpQzMWy3TkJK7 Bamg== 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=idzaW9AuHO1pDNIc/RVr+K6qO48ZZyYm6VEdm3wlJ3c=; b=fcyiw1DxBiFyNWdPQQCBGSLzhrQNFgk7H8kUAOivC5Lz/EnIixkS2bdnwtPJ7Etvb8 NHNxIR4403AWxJmd8LdyjS/GpfyHH79SJTRVpVjWxJRU8wOX/WpcrjtwOcYAE+gY061X oWK2rZwxVfpjHpqV1Jf7cvkMVU3OBAaaYuZxXVZECAkcIb9HaFF/56TKjBQO5NtzyR7Z yaergBsSPetR0RTmvwSjjjafZpUrYiIMDdjy6dqsx9axQ0djeIpnzfwncv34cLXS4w78 4X3EFnjfj1mwPzX3p83qrTKq38IhfdZSnO9mOLik0onupmf4QH2vqYecoTAqVouO911j txyQ== X-Gm-Message-State: ANhLgQ15x+TvcH7eP++6cY8S4kwuWUoW1CUtee0zcSEFsEFn+KLSscbI NI0KcdCuAKghXxMCOKWNZtXs2HdsHjUhJA== X-Received: by 2002:ae9:ef87:: with SMTP id d129mr10610543qkg.329.1585251510616; Thu, 26 Mar 2020 12:38:30 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.38.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:38:30 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 41/74] i386/kvm: convert to cpu_interrupt_request Date: Thu, 26 Mar 2020 15:31:23 -0400 Message-Id: <20200326193156.4322-42-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::742 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, "Emilio G. Cota" , 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 44a4d45980..e733e112ee 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -3652,11 +3652,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. */ @@ -4014,14 +4017,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) { @@ -4029,10 +4032,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) { @@ -4046,16 +4047,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; } } @@ -4063,7 +4070,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; @@ -4087,7 +4094,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; @@ -4133,8 +4140,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); @@ -4157,7 +4165,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); @@ -4167,20 +4175,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, @@ -4194,10 +4203,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 Mar 26 19:31: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: 184882 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp457015ilr; Thu, 26 Mar 2020 12:49:44 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtTHWdqXE6ydsMvDQ5WKNVbULkE3h5lZ6OaSz9v0IYUMXXKjQtx8IWCitLeD0sa20XhVjcB X-Received: by 2002:ac8:22b9:: with SMTP id f54mr10460266qta.173.1585252184550; Thu, 26 Mar 2020 12:49:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585252184; cv=none; d=google.com; s=arc-20160816; b=qFxyo2JZ34UOwujLS5cqyino954m8MUxiFsEKCTIqTUjMPWCNBFIYj81HgloPcxW8l y5scuY5Y8vZ/ZTYQQ5quh4vmnwATx99e36E+bDK+iW9bL/cCCKN8LffO7aDWrCX7dLuS maVzlMlJG7wBMJ46OVipGpJyzFQFXc9Njfyc+0uKtqekCNSfXMOe34/nRuiAdhYGW0sM wuRqMOSe37PHANKa7qeraftZicY1yTqvOK5rqmdHoSsF1352upLy1qJS8GTUE+BnbLeX fCcAIVUZ9gMQAikjsiuan+LPrV6mNIzxmQi/vHxd/nbYC5keuvwYKnZmQteNFdtZMtog bOZA== 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=U5D3pkUcG//BQWSFTwWE1/sqRrETKDEuvwJykv7vKSmXaYq1YFPjuGiUINJVM5oeI6 qtTlCQ4KRS81/IYSJwrUOGjIS1rz3qf0cYRzAm1Kq81g8SvaWaSgCtke2fJW1OQ0gC3N hLx8ulZy3XWnQsF2igqIqYbUqn6magnocMXFT6mj1xZGzUHLgkNNM3q8hwVGRgDZSv82 o1SqHY+Gp4OwJW8yMQK6581vPljbra4HOzelGlc8HpMseFeii1ZXvgcGCiEW9O4LgbEP BZzoPrSboD5a1nOZwDH5Xq7wPVsnrB5LFh8uzUwFKXal26Wd8ETstGO4azzBO4dERS1h fxWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=HVYmB6wP; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 u187si2055725qkb.229.2020.03.26.12.49.44 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 12:49:44 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=HVYmB6wP; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:58930 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYVc-00032u-4F for patch@linaro.org; Thu, 26 Mar 2020 15:49:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59039) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYKq-0007Ky-67 for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYKn-0001tY-7d for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:35 -0400 Received: from mail-qk1-x744.google.com ([2607:f8b0:4864:20::744]:39025) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYKn-0001sy-0v for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:33 -0400 Received: by mail-qk1-x744.google.com with SMTP id b62so8195786qkf.6 for ; Thu, 26 Mar 2020 12:38: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=s4hrOWLlZCdJWXysypnArxYHpdNRngJdlfVjmEHFHi0=; b=HVYmB6wPvjDbchC+vTqGW66dLrmRcml/Xi7ln9v9js3rGBVa61x7jeBfkCrBPE/2HT Q0h6IUVM9jvsx4lGr+NE/8qtNBr6fQhwHNzui/EVxwM4p8mCSsvhgOBEth6/Foid6e9D TXOMDWZxxJEsQHG9OgjJLPN5y+sSHyz8MrtClsTWKqAuJ/jE1n9Acz/wALrMToj6UYCw jFIJEfMOxEppZb5jAClfK86/PFGSPNvmbySqLAYkScw+231VJceqVSyqBurEf6F5/50Z goI9ydu/DqzhTptHZ0EBr9DSCQsWvV3lR6jHNSyl6pcCxfLhDWb9QkMvROywLjng2AJ4 943g== 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=ceMIuNXKjxwtZGS8/CkoNG5fX7gAFq46GV4LxurSN+uDi+2vocvvo6xna4GXVaQt5q ZzbkSOUGfc+2UmiHRSlZlP5vHZxgiSuaFwi48mJzgHlA+/YVFGuz00rFigKe2lyFLzSg u8LfYWrFaHMKg77L8qzttnEfbi2NKZgrdunOf/Ie9lAdo1SVqGZQk0NIbietQFJiHodk i977+chkyUg0zT+bwILByN8RIeJUjif5jX1zm7itbSehegOr0WXDhzL44PSkJWrNSUkC 0sI/pPRv77CkIBBnIM5Fd2/+EuCs8ovdHNdwtY2WuDs3cUKd/ZYyXTxqzje5XV2/dgs6 OplA== X-Gm-Message-State: ANhLgQ2ztgM2f3AfOKAAYvet3jB/H9izyEg3MCeaYfqKoQNs6M1zvcQO 0K01hfDUPb6qqB70DsF14SacNXPjVdF2IA== X-Received: by 2002:a05:620a:100b:: with SMTP id z11mr9783398qkj.382.1585251511958; Thu, 26 Mar 2020 12:38:31 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.38.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:38:31 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 42/74] i386/hax-all: convert to cpu_interrupt_request Date: Thu, 26 Mar 2020 15:31:24 -0400 Message-Id: <20200326193156.4322-43-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::744 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, "Emilio G. Cota" , 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 Mar 26 19:31:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 184911 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp473058ilr; Thu, 26 Mar 2020 13:05:58 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsovsIN5eBd+d+X7pExleEJlPn+MBn9NwabzV0Hi8qCzIPspqgnsGkmvP5AtaVwiTzQDIhi X-Received: by 2002:ac8:310b:: with SMTP id g11mr10657071qtb.128.1585253158328; Thu, 26 Mar 2020 13:05:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585253158; cv=none; d=google.com; s=arc-20160816; b=o4Fln15ryu2nU3F9kkvlA9XwqVqENQRxloyRuxwj3hKEMc2XFLhtotlC2XP84JrAgQ ycLlgZny8TG1QcSB6/27cAdy/yiphT4PxPFIGxvvxTt2JrRgxfULyYKdiuCzS0SbKblC Uc2ju15N5HT498B7MF939Wx+etIsMGhMV5eVulz0oJXlFMXekogcCPNmbusNNTNvb1o7 FHDb4+XqR80gsHsV1VMRi5aCNke50iaSsxCL+Rlbh8FwpT9QhPCm1a/c4B+YCLYXom5W hsLhx/Se5LGT8ePT017wMAuwdqxtLb9xxJtTa/fICYXyl3v6HLDn6oHsPYKBYAOR+Q/1 LtRA== 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=NJVoFmuMjwpyLwIRTqN9k2PTN50NWPxkWCRUgkjV9m9Vur0bzCdOqsfQCtI7UOtURI V5TC4K2qBv67WylFtqU8syYOKWO86VhMikafIZLjKxyWhihNJ5FSbLffs/PEqjBMTjc/ R6mvarhGbxNcePT+51d18Tq8t3CXPkzRsFCKLY7igp8w6Ui/gWZa1+bgQquz/OSHuUWs PijPZSflchym5x4+JHn0GAZUKnkUeWWX/Vfjgv/VlH36EwfJVP0IY9x4k79nSJrfP4rF W+ZrTChDgFdQ1rpb309Ls5coaPM/LPNVv4516/VwikonWL6vtGT0BuhWbnTG6QAxEb/i wT8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=LGTmFyhC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 w7si1940362qvf.49.2020.03.26.13.05.58 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 13:05: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=LGTmFyhC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:59438 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYlJ-0007aC-SL for patch@linaro.org; Thu, 26 Mar 2020 16:05:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59040) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYKq-0007L0-6j for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYKo-0001uk-Sy for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:36 -0400 Received: from mail-qt1-x841.google.com ([2607:f8b0:4864:20::841]:42627) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYKo-0001tv-80 for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:34 -0400 Received: by mail-qt1-x841.google.com with SMTP id t9so6524345qto.9 for ; Thu, 26 Mar 2020 12:38: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; bh=EcsY6TGhrUKNyVg3Ugjl3o+5XwjzyMO1Q9LTdSRFfVg=; b=LGTmFyhCP6cGKulmIWIURWcNhdogJy1JO62NVUnrl6TPTitgUxFoyWZtejzu2Zu2e3 VRDWMq84SEMv1aqFjZj/VwzSuGjUCn/nwUmSLHI5XAB2cnK6+HD/qFeYKbqGFpPduy4d 8nj7GgMEtITKqZ3QfPGmQxhHYqxDP6r4zCvDccp2hqZJYMt60175g24McmsQoK8R75Hu z2+QZRMhVy/TyHnZlcc407mKVnhTtoFjfe/yNGjYxd4QzZJ7gcmaAAQIsCe1bLgJ8V/M adpXT1LQfH1OcZRSWMKzUzeIBa2FcaVDU8Pd7TmROaOjIPzUwQwRLZmUJ9Qc94hypg0g 856A== 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=NBP6QwiT2Lxv6cMiCxUowWrncBACnpmqXFA7chhwyh5bSybvKfiEts9/xzif7Otz5C aybX+WCua1TK0CMntklvljuA1nNPbiTHXF4Qzk31k72W2zyF+7zm8QhJVWWksAURqdOf mm0bhHukbMmQHzzDxrgy0AlrViixOL9heAUqjQ6GH3qc/2C6tgY6BKdnXFgNucgKHlUb JylHXzzIppmj8vUrQu7J5YotuxLWRUYOv5DmTWkUzMwwFv+JGMCIwSxhuAG9MhuZMhSa ZQxP/510353iUeIjpbCsbfMe5GrokqzEXRJsssvCVw8HXzVa6vXHrjjQFXmtTVWOusx4 XbxQ== X-Gm-Message-State: ANhLgQ1knyRCDukE2i+7mQLbmI/56epY+b+YXz1L0+i9xFNH8d3wQcw9 7zKMzQW7pV8zCvGLAUHPDuPgBlAQiGBYTg== X-Received: by 2002:ac8:16b8:: with SMTP id r53mr10420260qtj.7.1585251513210; Thu, 26 Mar 2020 12:38:33 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.38.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:38:32 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 43/74] i386/whpx-all: convert to cpu_interrupt_request Date: Thu, 26 Mar 2020 15:31:25 -0400 Message-Id: <20200326193156.4322-44-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::841 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, "Emilio G. Cota" , 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 Mar 26 19:31:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 184899 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp464593ilr; Thu, 26 Mar 2020 12:58:34 -0700 (PDT) X-Google-Smtp-Source: ADFU+vu0SYfADkV63FLUO5JwL7hOi2szM6xQBeAVeGljeWQ+XClwyHtUxU2ZVUzuDtHbW6optYVr X-Received: by 2002:ae9:ec0c:: with SMTP id h12mr10705873qkg.285.1585252714238; Thu, 26 Mar 2020 12:58:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585252714; cv=none; d=google.com; s=arc-20160816; b=ojmAesye3XWAWqYnkeL0Q+BtiBJ3VBtPveyDMRGa2qOcSXfXuyQcsC04f+a3goe14G amu3CqLCh9IVSLF6NWpLEAuwuP5Sm808KphjgTjbpqmyUWtzSblIzZSOoccdrh0vK6pn MZJCaKOl6Nryyr4z68vJNDTid9GXIG8EmTahyMzXUat9WSuSQzbpzqo3FEAFPsY/Jb+Z ZdWGeCgEKFQahOnRsnneL7PKOspgG9oDw651bYy1yq8xlPpi7MgWMdAGQP3VMU0rom8m 4u9j17dPXC8p1aA3q9mdO2pzlnJRp0Zz5Jzm1btMGvw9kK9NOrXlpdgOi1XDVPp/6eiI Ksrw== 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=q2NY8tjgMEizAPQJ4YmzCsaU9WBtsijSLhgzIkmmLEAnXuJRcKexUQ7XCgGW5qY7bN 3fCSEZbzJ3N3BIUJHQz9kVtGHy7NAjJ7S5hF49lv3ksqCtgbVTXi8wOgUqY6EdHXafnt WvGL65ZGg31k4Q6GvYiHK3GcdCflCWkYKOcm9cNUlnSsZwj+wmkvuP75ppUeC8dBGzkp /J2bXLKm7X30/PytxPL8FREXpAQRAPbxq3GXPb31qLnyR5dwJNtLznvcWvbxqDI8da3Z WLF6hwZ5UQmNAHRB1W7LxPyLXU5RnVa8UOTyhX0Wl619lIess63Z7SJB5OuJD59JDvkr Z44g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=uwQRFchy; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 i11si1800251qvt.120.2020.03.26.12.58.34 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 12:58: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=uwQRFchy; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:59221 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYe9-0003Ow-Mv for patch@linaro.org; Thu, 26 Mar 2020 15:58:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59273) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYLD-0008Bu-EF for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYLC-00027i-4r for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:59 -0400 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]:34265) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYLC-00027Y-0k for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:58 -0400 Received: by mail-qt1-x843.google.com with SMTP id 10so6559801qtp.1 for ; Thu, 26 Mar 2020 12:38: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; bh=vTZZ/kHNyF+wmPfkKEvG91Ao0Id6+gZs4oPmDCc+3GU=; b=uwQRFchyQb1g3o+w8lemLCYmIwVt8puWVk0h5liY5o2wydx358mCWLulD/hVeNelCF 26uEiUVpFmFZ4LBHIMW5G445iRcUCZQW6+r9IA34tXNE47GJ3ebfxm5tFWKCh2GNPing WPW3+qbJySn187xc+9KJbVeDm5dMBbNK4L/r4J4J4+V30+d55T3HHuGefJM7HWwGavyl r5//FMZ2+6h6eL1XapnljW9yVV0Whf7iqVzmnILhu5OHhubaAM8gFoiYfRSYodsVz/lM Btvw5V3TC2FfNMFXvZ0QCMSPgw30FNohWp3X1YV2vN84HWHp4MkioObRQUPGUFWqtO6X ZkEA== 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=EDDMG7ifpU/YXmBhLkntMBPh9J1agNdYVMSPHeGvc0fxhVtQxbCKeMKOO0OoKgcCje JXuYXBESK4c/t3IuEMrzpHJBr6/2G5U2ZdHfM08ydZXVDRDBlSXPdafD5kNdrjiruaDO f2zl7qpypOpA2cus8XeaAma8r8lkF/chRrO42N49zO+aC1qW4QJicqj2Dlqty0n18s66 EYj+XsfX6EK8aQp/K1BFU2ZxU+hQWoJ/SyQF7lhjerp2X0CwI7ytelbmVaMxKbPWt9/p APSk5nqIqKx4MxCwoz8AbNgB+Dbi/ZlcS5neZdujgDUdemzFpzYuL4oXRevXFpgWOehh EEUg== X-Gm-Message-State: ANhLgQ2HtZVUlhIp3Trtc7HoAA4g26sUJe8w+BBGbc9i1CpHeLh9TgHP hprAwbSMXDqW2PudTqDXQZ48lQlVEdbn4Q== X-Received: by 2002:ac8:ecc:: with SMTP id w12mr10249837qti.102.1585251514388; Thu, 26 Mar 2020 12:38:34 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.38.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:38:33 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 44/74] i386/hvf: convert to cpu_request_interrupt Date: Thu, 26 Mar 2020 15:31:26 -0400 Message-Id: <20200326193156.4322-45-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::843 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, "Emilio G. Cota" , 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 Mar 26 19:31:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 184913 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp473316ilr; Thu, 26 Mar 2020 13:06:12 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsbzLeCE245oT04/2INjcwe0kkqBQ8YKyZ0b1Ltv1m4UBe8iRUQlMrDtEUiFmhGO2xylYRT X-Received: by 2002:ac8:3f62:: with SMTP id w31mr10337460qtk.171.1585253171888; Thu, 26 Mar 2020 13:06:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585253171; cv=none; d=google.com; s=arc-20160816; b=YJ52zOC3AD6jor6UzXluyQiB8RCA8hUvCw4brrL+pPjoq0DfLNLS7NoZErWo3hz1y3 gudd34o82GFCkUZCz52p4JqYs0jRjmNcHsugCD9sbsgwwe6KkduGvAzjCWlc2j0+C3ZQ WZP+L9c4TdicwkAi/gohIyDBm7MA997e7+2EIM+WLQjGtcrrQayXvWM1JlpaVKV0Mec1 7qQDRyePnL5sS8aTugEq397bDGEzQqtYyc3sR26b+o20jQHKp9urQ6hgNNx/VhmqlyQU xcRyEr6sVb+TvAeEr7vEcCHo0cetL2ws6A/6+VSFq1nSqDz1Eu4TAqjXV9hpbVxuQ7dm TCuA== 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=/LwMHVS2K3ViBvzIzyA4NKWMVEXcm6p526cQcn7ef0M=; b=hs8DPrggjyBZ8yj3+Z0Fh135ULTyJWnbjVh9on0W4tTbtaSomz/PGRQKr2jlFJ6Fiu Y9CVejauhou4lhLE8P24Ol0rL1skvGn+9uuDvjVSjeZECGt2ILdj3cM42Dbz0kQFbYWI bIxOghapL7SbCUqOCzZ/lWyR4Tiay8BWClpGcRBc9UyF31Texxuwe0k6Ti/MeRPJCRzo CuUhsokj3Vn0yn90UXpCMXqbjudO6BF/VZbPhGg9uTGfnFF0sq0aNZa0OX2hPOgNBmoc xOLBuMGhcbcHXfHPt6gFYRDhXYKE0/I6mnFdNw8rtFhtBl/DrVlkDB4ubOf99tvtPvxn cQKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=FmlNXFd0; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 e25si2261273qtm.138.2020.03.26.13.06.11 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 13:06:11 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=FmlNXFd0; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:59442 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYlX-0007lj-CX for patch@linaro.org; Thu, 26 Mar 2020 16:06:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59065) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYKs-0007Mb-D0 for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYKq-0001wV-O6 for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:38 -0400 Received: from mail-qt1-x832.google.com ([2607:f8b0:4864:20::832]:34757) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYKq-0001wH-Kp for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:36 -0400 Received: by mail-qt1-x832.google.com with SMTP id 10so6558545qtp.1 for ; Thu, 26 Mar 2020 12:38: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; bh=/LwMHVS2K3ViBvzIzyA4NKWMVEXcm6p526cQcn7ef0M=; b=FmlNXFd0SRVVZ7i48swP8G9E1xRBrUv8TX+A48RWqR47+YC6OasE2cYR5AkNjID8U5 o9F50p9UavJKZ/4zkL4LO/uFZqSgm6yIt1er0hduU/J0iO35vTUNsFBce1L3Ey6nxUaQ Xo5GfgcKe8bI0c/606VnIVenNrALl7Iko4RttX6ToT0WpAJp9rAbmAi4KJA1Vwc4wH4i Ks9j57Oiu197EOIx+WeKEJo7Sq+DOFrC7W/LaK8ZF0GJic8YbWZMpOPD+XY0IEcThrvx BQZOB3Deh3g5iJKf0PtMr11Oh24D+eTff2wSDeheS7RcQhSe1cF4iNi6BrwugKWYAdIK nLHA== 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=/LwMHVS2K3ViBvzIzyA4NKWMVEXcm6p526cQcn7ef0M=; b=KqKCInl3+5J6+dJ1J34R3rP2DyOKutEUNQaQuwKgyxd8Q+v7k/wCA7h5KyEAT3NHpt zu11wzRhUFNFo0mTKDxGSqyzHbQZCukFT4dAg3zqyNJXwHIZAJ31tydV9tbl9i43dxFX +MFTzLRxNvFKATmePTbMs64uuP3laygaSJXAfSZz6AfLt/hSb+7antHiql/dHyjCvmmw wo4iRkSFuLcjkYhzurC+vp7GZaxxDEibxm9X590hUeD14ePNrA7HfBDUrZ56Hp5tYjvP g7p88wmc+0kNRfJlgVGuFAootwm7YVc9bjfKIqRgJc3V/Z+qqmLjtpprjyIbdUL7/NJh L/gw== X-Gm-Message-State: ANhLgQ2ENRQBNFrCHWXhlyRhUUvht8J67qnmPrQ8mD0nrQBATruc6fi1 4oDfm1QqmL564u14HaKwGeJEvnM+28C71Q== X-Received: by 2002:ac8:6991:: with SMTP id o17mr10042670qtq.292.1585251515732; Thu, 26 Mar 2020 12:38:35 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.38.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:38:35 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 45/74] ppc: convert to cpu_interrupt_request Date: Thu, 26 Mar 2020 15:31:27 -0400 Message-Id: <20200326193156.4322-46-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::832 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, "Emilio G. Cota" , qemu-ppc@nongnu.org, peter.puhov@linaro.org, alex.bennee@linaro.org, David Gibson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Cc: David Gibson 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 13c6626ca7..c737b19242 100644 --- a/target/ppc/kvm.c +++ b/target/ppc/kvm.c @@ -1348,7 +1348,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 5c2f8ffa4a..8d2e668ac5 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); } } @@ -10660,7 +10660,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 Mar 26 19:31: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: 184915 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp476085ilr; Thu, 26 Mar 2020 13:08:48 -0700 (PDT) X-Google-Smtp-Source: ADFU+vv6iZAJE4vKovN/EQMEY68gyJcL6sqasZlT6Z/zaTTGErf0qoZ2p65kV2sDAbTfUkNpuVa6 X-Received: by 2002:ac8:4f04:: with SMTP id b4mr10852125qte.0.1585253328269; Thu, 26 Mar 2020 13:08:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585253328; cv=none; d=google.com; s=arc-20160816; b=RYxBujZzNRGyIWaIi5tI4BmvPKX35zCFeAJZbAJImeKcbmIs6ZYR/jinj16CUNL6bE TtSAWalYweZ4tI72C9U90l/yOZpuFXxY37H4u4jXLQslObLSgmO0BYb7Nh4pnw7houpV BJtqCIMU8LgotOF9wIyz1Ls3Bhmm87p9MKhfYkE5DzgP53vLKPSR/Dw0RqWvGN1KxEyZ V2pQ+6xbm/6d3APHjOOgQ+4UOZ1xzZUQ3iQ6VV2lwCawyVliQmWCh1oheTK1Bv/By4Yv z2L6ZpOt6GMdcQvdoNYTlcx0J4hOVgyW9NTcVjuf8Q0WS9bfJzNYbq7SYFAZyfOlghqR mVbg== 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=BxqJ70c6WTdux3CaHVwfQG7oIlIYlOiAdw/xPRNH7uXirzobcTcwvxzirN854lcGWJ ZrlIuSD0rYz4EH4i0+92Tc4Unh+wYefyxz25+ruTId6wMTYBtAbSuLPOTvPMU2wEkkUq kcrCNvdPaUqe7/rP6pFou3wHCVEB16be5dY+hAWWGrg9UJ+YpOBvihtNiQieaZAcwAkI qDqfz1u+jt+WhNqvzA01swfyi8xAo3QzpjMXQgM64zKlqbU8DBefPaSdBlO0dxRDrHza 3WE/xwquJk+yVqWnl5C9tKcLv8684A8ZYARA4NVjXxL10vduFPp4VkIODlOLHh4qPAE4 ZElQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=yYK+mkIA; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 n29si2150892qtc.55.2020.03.26.13.08.48 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 13:08: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=yYK+mkIA; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:59504 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYo3-0003PY-QR for patch@linaro.org; Thu, 26 Mar 2020 16:08:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59084) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYKu-0007OP-85 for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYKs-0001xX-MA for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:39 -0400 Received: from mail-qv1-xf2c.google.com ([2607:f8b0:4864:20::f2c]:43163) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYKs-0001wt-Ag for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:38 -0400 Received: by mail-qv1-xf2c.google.com with SMTP id c28so3680806qvb.10 for ; Thu, 26 Mar 2020 12:38: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=cJAv+EbsefdW66yr8LjRtj+7g6Sr3jeK6hHxTVUkhJA=; b=yYK+mkIAI8gfUQUJf6GA8HLwESGtdMYI+FQJ4IMa56GU8IUy/8seB/tgP0dDv0LGyS ++2a+lrsHX0zZhlhlW5M3Rrc82iw/1UIoItCagjyV/38AsynD537sZglK+kvmf1y55xG j2Bxq06TB9+Sm34cE77Tv/O0wDz8QMuYiD+cp5/Y80aedE4+40KcWbzScBxdcdG5GCZd +duiC2IBB5VdkQgwGfnE6YjOJlx0xUgI+CjSy/SX0mvH/TQLmABbtpgLa3G6D97ccsmP C4Itj/bzHII1scJXwcsoI3FWxjg7aL9xF3UNwrtCAl0kZgFT/MCvV8cZL+KCL1KrGL0T y3tQ== 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=qAbW+M33HDZ5xnthbIi/wuo55ql339HowGDuq+pLe6vQmBKl8/QwEmU3/LU5BebYnJ cgC2Vj5WFPi4wTyYZLzmeC7+2B/ICqXBZIUcUrOiR5fEpmkXq0RGUWzYlEakUcgZOhay wyc7M+PnE3T5htJ2bfLyFuYVJcNFGGzQ8cXP2y2QeuWgNlwrZpEz1EWf/q7LDkPceGg4 xR89FECKgQmEu77OSbWdEZqazpuurLnA+EFT0TIfSjdRxrGaGS3NAga/sJWKynzxxiAZ VE8zGJKDLoeTaoOTzXW5Wz15a5gT5wqkjbafBD2XYrxt+ns6dIvo+eSUGrcaIs/e/kvl vwzA== X-Gm-Message-State: ANhLgQ1Dodpcd4eZyySxp8jTY25swNlxVHJkkv7fPplRXvv/Ekgzx4of xPsAFbM0XJoJnmsOZgVW1gBvIDZlfbF63g== X-Received: by 2002:ad4:53a2:: with SMTP id j2mr10102341qvv.145.1585251517048; Thu, 26 Mar 2020 12:38:37 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.38.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:38:36 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 46/74] sh4: convert to cpu_interrupt_request Date: Thu, 26 Mar 2020 15:31:28 -0400 Message-Id: <20200326193156.4322-47-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::f2c 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, "Emilio G. Cota" , 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 Mar 26 19:31: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: 184917 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp477348ilr; Thu, 26 Mar 2020 13:09:57 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuTuHU4lw6TYWMe5bDHAre65/VDPjmacKgchpdcYD93DIGvBn6iR1QaeRLYQaMqXVctiE5/ X-Received: by 2002:ac8:7cb0:: with SMTP id z16mr10292548qtv.59.1585253397116; Thu, 26 Mar 2020 13:09:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585253397; cv=none; d=google.com; s=arc-20160816; b=lHP62stxiAIAbCEvUpoFjouTBcbZMrtd8ZYJ4kjL7PjvH1kQauKcDiTbyY0lInfNnZ 9HVhlUcObj5wkWgXS9hXEUDUeuWTxT6Luf5bPWbqo2m72a7JkQLhr9cl3xislVoS6LlY 80igDU2uH5m0Hyc0VY5pzq7faMoEO1iS3SuDbDTzT7ezxZcqHdIKaTEUP+Vdvfu6utU8 CzC2eEOEnflO7kj0jS2IJwC6fa7AdIqRwT13kjH5hqadEvjgVFeOe3bidWDg6+YzN19N 15MfMWWqNErHHPFrt+u6d5rz2L2HS2MLrb8aRn330zmBSwj5V9w5Es6YL9vCVW4suhZZ BISQ== 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=eaSFo4N2nDLJhQUIucKSkpZmOx/9O1iMPVZnOaGju0LUy95jHFWIWLNVNw+FSZgm4N XILpREBCzVniLAdYFNNNO4/mTmWmT2vCMvQ40No/ui9e4aUhMMnN1khnGaWunIl4tmk7 PRj4YRVKKZRdp5v2xA74ZyJRdN6AtVGf6afQlp5Aykyh85KGP9ALuinwYiLEX+Y+Wigm kfiuvDaIi/xWS625rbX23uiIA2mnga4GxjvKh5UXcnjV6Sg8wZTxZA+L7e+wHB7mHSe7 r2jy07whpl/TDkGTynAyNN/PkFujM5QOkDn26MCcRUV1UNk6twiD1I7FstX4syjLDoNA qwTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="nW/dDWJw"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 16si2187001qkr.164.2020.03.26.13.09.57 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 13:09: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="nW/dDWJw"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:59524 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYpA-00059M-Mf for patch@linaro.org; Thu, 26 Mar 2020 16:09:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59097) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYKv-0007PR-7H for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYKu-0001yJ-6k for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:41 -0400 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]:36788) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYKt-0001xh-HP for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:39 -0400 Received: by mail-qk1-x742.google.com with SMTP id d11so8194266qko.3 for ; Thu, 26 Mar 2020 12:38: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=SQwt3BlCMlkRrdpIoHWlR7VL+MoMENIbhHHtRYB6xLo=; b=nW/dDWJw0d+Y1YRC5HdCl/0BDPcFXbtoPb027+TPPp21NlY8jzSE9jKIJ7IwpUzz5h +SkWjk5ULt9mES8H66gBZLwrZ6TBHiGlUcj/79+qIvR4fCoZDIjHyLpiDtSVS/DqXetg n0ssIzkIFGlc51IfyHAZQuvcz+ZrtEHFH0FgfrD80UbXm+XIO5lhHUCzYEuGI5Ymc2HJ STuR+7LBgpD1wW6oyO2v31TzcusT+iLYmYYDEZxiPA6kIOFzVhgFihLCfStBnuJBjOxH 1Xb741Gwpa9ZEQT5MLTYEC0D3YtARluZTVcitX9ItY82hw/9GFGih2a8m5RKXQ2VygVM HWgw== 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=OV/OiJNcZFgwDua+0bsr58jlAsWFgPdLHgR/SI10E4PaED6j23UOpZWsCOvdncFfUj GA+FoFZv1WzMsMvKCiGgDpV4MWoZRorEhQNZWIj4yZBB9c8660aIVmUPbFrbKSd9QRsP ZvwNuNNe1vOWh3rchBhFLQTrS6jj32HtwTf2TfOYWU9cdCn4KF+US0U32J+AUFUA0GVV epTIu32VCdSLEfFsHEagPW16PTeFq+yZUysmL6XcTADcXloM3oBWdmts34WjIZCHTZeY aOkemLVQOgSEx7NLkCtChTBhKzfr2hLl7CE6FNYeDhxPbpsHTbwHknzFc4j+hSXEmDXc 9X6A== X-Gm-Message-State: ANhLgQ17Gmf8A6cFcxHf7HqXe2Pc00xVFzOtSw7OS4xRJ46glj/nxiIQ rlQxWecr5/IfyresKD4OLhtbEq8xjm0Anw== X-Received: by 2002:a37:4785:: with SMTP id u127mr1228692qka.135.1585251518391; Thu, 26 Mar 2020 12:38:38 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.38.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:38:37 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 47/74] cris: convert to cpu_interrupt_request Date: Thu, 26 Mar 2020 15:31:29 -0400 Message-Id: <20200326193156.4322-48-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::742 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, "Emilio G. Cota" , 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 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 Mar 26 19:31: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: 184912 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp473068ilr; Thu, 26 Mar 2020 13:05:59 -0700 (PDT) X-Google-Smtp-Source: ADFU+vu0J/RMLJL6X5YBZQG30sKjbNgrwad7oETAvILnDMa+xBi1v2XKw8Jy/c7JHbKeocO5MxEZ X-Received: by 2002:a37:9e05:: with SMTP id h5mr10015185qke.71.1585253159496; Thu, 26 Mar 2020 13:05:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585253159; cv=none; d=google.com; s=arc-20160816; b=ERSEqOauHAy1bgY19xOLO2ieoMv/oAVpDxXRRrbgfhwcJZs+4O5NB+QSCqIfos62mt C+OoCRSpjj7LeWX69dZat3FtOHCtTL7gbYtM6s/nNRH29XT/O4G9KGH9B/4O5H7+N0CL 4Vx/NrLhmz2aRSDNzF1Ti60xvIlDfxT/jmC8Ma4jU0goBY0vGxhoPCk9bozSxBxJx7Hw gBZqY49KY8gbH8q4J8CAQYdt5KPlN9wrZ8GdIfxwq3H+EKIObAfXI50O0MUlmzbNPuNz ZsC7ELTGl/Yn/n3NQDRqj4iOfthtHwDK/jUVWNOIBOftIl67UwzkFMYums6AG7Ej2jnr ljJw== 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=uCNsRKlfVGTEtHZSDAVs50v+u30iejtdC2LFnaGJmreDdwoRtO5Oqxp4yl842WqNdf gGiTbLB3x7VzgX3YjirTy3Us++IGQpVSNIHy6kEZ+Q39tR+w5G7uziI6912xDI4O1jOn wZoS3Bu7V/muJW8SfpRr9f83bTB6yKvI4tCc36LSxVKIyrg2A6fK9F+B5tMw6QBhGtfO iXqAu1BN+XwpkTr0Yk+UEzfkRy9qVDD3ua3Z4bqtOnh8mW393gdyTFMikQVJFiQ+fXQy sIEiWXPP2PzNZriIbtpDgwy3om22bSaVPniQMts7UV4ocLf8Vs6nn2NoxWddcp1MzYCI UAYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=BrTs5KSf; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 q7si2045796qve.108.2020.03.26.13.05.59 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 13:05:59 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=BrTs5KSf; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:59432 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYlL-0007IM-1C for patch@linaro.org; Thu, 26 Mar 2020 16:05:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59109) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYKw-0007SD-3O for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYKu-0001yn-VZ for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:41 -0400 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]:38435) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYKu-0001yT-RS for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:40 -0400 Received: by mail-qk1-x742.google.com with SMTP id h14so8191082qke.5 for ; Thu, 26 Mar 2020 12:38: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=oS4OFCHOXLNPVShms1TjWbnrC15wr+ouKwB5TcDXaeE=; b=BrTs5KSfDqJse3PHhVXCvaWh8fmqrKi7jif0EFXt8t06jcgtflX/qboikphU0kQmXP 1AKni0uOnBCkDlwBa3Y1XeH2nwSHAET9wEbQpHE4SMUMiXg5ndbeWtEkvJjq6GYYzO/W ktbnpekNRF6N1wX3x7fl5PNj/ekLwh5qpVma5CEKQBpqiIiBTK4jclg/sLHHbohfIejU 8aHK78tUfUktdyVLAuxPCsdqjjd3ko/f6Vkq6OQEGGMuZvcqN9akmDEMOsaJYrDjGNuF d36FnLZk5xBtOqnY1q7mEIiiw20Hw3JJiAHx/6mxEJ/aG7Qwz/TxFIz8tkffRVjepJu8 NZmg== 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=oyBHP+YGY0+WyLQQlY6evQkg/HWXiG53BvhGKpdy6IbajeVLDeTdgH5xkQ3OHVLdfm NQn1AJXNmLnN9PDvP2chfvXjagDFB8ToZbWKGR1XO3dSpoEeatqs5xHn3SacE0ts8p5E Yu+xRVhF4XvjhR9dtd9Gl9HhDd/TrFTGfloFSyeBkChK7Sp8kmcy2dg4xGZN3URxJhGx oDlKYAF4mp4GVNfMQtC0PBfNn63iBJWG/M+K8/S1N0vdM20KFP2Tkzu/k7BifYXBZoRU 3d56Zforg1hy79l9ob43pDJ5hkakTBP80NLELvao+7TXLwuS27fSC6Sjp5RWpaa5/J+k 4EUA== X-Gm-Message-State: ANhLgQ2mOZH84kh4gkeVgOYcMuC5CT4iFLO7FVe3GTxnIKX3AfTf31mj 45IiJagw6k4Y9h/v4vxI6XHJian3jA/65A== X-Received: by 2002:a37:741:: with SMTP id 62mr9728414qkh.422.1585251519725; Thu, 26 Mar 2020 12:38:39 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.38.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:38:39 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 48/74] hppa: convert to cpu_interrupt_request Date: Thu, 26 Mar 2020 15:31:30 -0400 Message-Id: <20200326193156.4322-49-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::742 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, "Emilio G. Cota" , 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 Mar 26 19:31: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: 184914 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp474531ilr; Thu, 26 Mar 2020 13:07:17 -0700 (PDT) X-Google-Smtp-Source: ADFU+vu7o+pdgKAXOO/oVVS8B9FlY2LKZfJ9kIG9cCql73Ag46ENdD04RXh51oGJ3fKgwzyhQk7V X-Received: by 2002:aed:3284:: with SMTP id z4mr10712720qtd.22.1585253237221; Thu, 26 Mar 2020 13:07:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585253237; cv=none; d=google.com; s=arc-20160816; b=JB+zkjkkK7JQDPDNaf2tKfUAIhE+j3bpL0HbJHd/mwyVzvyQ6Hl6QM+43FOKItHC52 wcqjYHuTs/iW/AZOclDkU/oKMHJjby2lVpY63s/ZyzvpmK04RZLWYMiCVPZNWfwBgJq4 mVsDi0sXzesJ3v10ZBkos285RqechyHUJySnJo/BJn+u/7pcm4nKCK9b7fpRWkqskCA2 KGlRjZ7SfxzQJsbA7SpRNK19XjhuYEhzXL4IC0a6C3ZY7lEhnAdSUbjpWtu3+Kh+iz2Q 25r+DnI59u0jf6UoyXREsjNybKJ2F1avjuJGkRCTkq1aLLTVSCzj633ENLWQmUzTqqT6 wQuQ== 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=BQiMm2timzwAh4hCD72ywMzmMndytHp3ZaLgUspGhUTJ5jJ+VdDgqWQQvsuhIhTDge Tb2mfPF1UQBooVdGmefpwLe3hHuULjWlO1HJOhe6ZgX6shS+l/SrHJdRyQAuyuCF/c0s sk12a4LaBJqn5PiKHMO3H/QaWixnb5j24KADBT/IRFjKpjykarq+gkqlIf2zAas+hdBJ OSbyvFu/ZWgLdDswmgpzfFtEhlXC8CQnhZ6A8Z8tZ9eB5YWAvgfhB01hoAO9Nv+foAeA RPd3CQpHEJyYPgdNQ4UtHlC98Ijg7/PxNqU0/KRyo/hihOknO3VE88MEqiKEccR1PNaB I/aA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=wTE6qICl; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 q6si2052420qve.189.2020.03.26.13.07.17 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 13:07:17 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=wTE6qICl; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:59472 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYma-0001K9-Oh for patch@linaro.org; Thu, 26 Mar 2020 16:07:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59119) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYKy-0007V9-B0 for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYKv-0001zO-TL for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:42 -0400 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]:42242) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYKv-0001zE-PB for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:41 -0400 Received: by mail-qk1-x742.google.com with SMTP id e11so8143101qkg.9 for ; Thu, 26 Mar 2020 12:38:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=leGMjXpK2HH4jKgWKo9xRsuJr3HkPgiK0233yCfpGgs=; b=wTE6qIClP3eBP7ZZPOPSKZoaEQ6IrulwXyPvoluFpXrk9V/SrDEE9uxS0kcTvOItbc 6GEZ5obQ8hOEHkH891GV50s9vJhjb5Z4kpLQ54gP2V+CTM8OaUKhDuerEXwc9DGTfzQF BcG+Fsyq6YlPN3ukZ43huNvp4lz9mN1qceIXBTOjVNoOMC4z3lLv9caxMpdHsEObtQNz 6tGOB2TWVSdnf/6WVrujSgEcTzmZnRSJgJw90Td51hxg2QuMzdF3JhstMh5i9Ox2rBtF p1rsJQyCUMmgKDyRe9/MzVNUSHFC6FBmFGVqdhaDTKvukxKOR4AJO2qNXUspG04KJhcg Ti2g== 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=fJPR1wC9+5lHzbTvP1//LQBmHHctOG88cnknG90RpD7XwlBGt1A/sl54mwD/MBEU/U Kmtp1XdIP+Fdj7eJMnnmf3DPDQBzEvZLtO8bLpOKZD9ozTz/soVxFSV3MCWkzzp7Q46/ vlDJMAuX+oIjrWP0a6ZBWXSQ9F7V+7/FhPTLUXYpoUEYsRfGU7sQnnUwjHFf9hqX6Y90 eTWaKekOv1LtrIc9uAENqlbf/5lhLtHODesBXniJV2CXHUgpr+GCwec1C+MAHA91za9w NGqjucLGLb9Q0Q7cjHRCKZFpNWGleWm7gLA0aSF0IJIA9Imf642eOOkhf3hFJzzvc4i1 kl5w== X-Gm-Message-State: ANhLgQ0dzrNEhvID9n5/wxVIgGEgq+F92fXgb6+aRFbBf8sA3StlzEn8 F5LFP7e+1YsnQJPuor+6uxblkBVCNNBIHg== X-Received: by 2002:a37:8044:: with SMTP id b65mr9108183qkd.238.1585251521031; Thu, 26 Mar 2020 12:38:41 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.38.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:38:40 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 49/74] lm32: convert to cpu_interrupt_request Date: Thu, 26 Mar 2020 15:31:31 -0400 Message-Id: <20200326193156.4322-50-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::742 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 , "Emilio G. Cota" , 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 Mar 26 19:31:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 184883 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp457548ilr; Thu, 26 Mar 2020 12:50:23 -0700 (PDT) X-Google-Smtp-Source: ADFU+vu+OQj4MbV9ty1iw363SvdoSF9RKaaTkMz7IdmvDMpSDlc5wYutgTSzJP94DFHmgA27IGKH X-Received: by 2002:ac8:6898:: with SMTP id m24mr10478231qtq.65.1585252223330; Thu, 26 Mar 2020 12:50:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585252223; cv=none; d=google.com; s=arc-20160816; b=0O1YiPATrgc7muT0gEHft432ezU8BrYWlj/4EovNY+z9214ep6OEs1FSEGwpDzUvuy c1tD6ZGutO+8IK96PxKGPPcQezO3wRygJ6FC6nm27CBntuHxg0KXqeDyEiUbBbqvVvtL piSrc5/gfrLzn9k/LjE2lU1tcBZNbz/eOz/LTl6ie0XQxvi+77TKz82bF0uGK8VFjFe1 IN7TuUjaxH6Ssbivp/1whZtsoIqxE4xxTkTroXF66I2moTxuu63KLWZknM5fjJ8nN3Dx leXdkXteHmDKTUdYbW7HL/pop/qmEkAddip0bg30wPJHhhxnRlpRA0KZ78ds/YNNmIoN oHyg== 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=/Oka1mxILvyuoj14dGrBGiB3Vaw9bR7aF51DMk7Mc7Y=; b=YyoLe0tzGl4PFo/D4AsYeQZJVzAFR12l+xuRnR1dlSvoLIgi+S/ygPJHRGrc/7kjLL ZgpNJcOsviFqQcwtYyL0fNDs+TAbGh8kIJyYyNlOtW9e6AM7nMSGcNxnJqjWCuUQrvw0 4hY3eto7xb8IdZVhlORavLSLffWby25lAMzxXj2mOkou2GWXLAGySysQ6czncqRfX/qP s6c3RfuJMN2+54fgoIIHkxxqoIB/jB1r5yNJ804J9KlX4aFVDYlIwVVJDm0PDeygtPlk 0QfKFukKuXGg79j+oR5DaliiJNMU6NfzR32d08hzof9mF2r285yB8APs73mlmB3SZe4W FDSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=HRM0aHtX; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 h32si2012151qtd.357.2020.03.26.12.50.23 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 12:50: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=HRM0aHtX; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:58942 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYWE-0003Ds-Ou for patch@linaro.org; Thu, 26 Mar 2020 15:50:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59137) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYL0-0007YV-DW for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYKy-00020e-Cm for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:46 -0400 Received: from mail-qk1-x744.google.com ([2607:f8b0:4864:20::744]:37531) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYKy-0001zr-8m for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:44 -0400 Received: by mail-qk1-x744.google.com with SMTP id x3so8183740qki.4 for ; Thu, 26 Mar 2020 12:38: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=/Oka1mxILvyuoj14dGrBGiB3Vaw9bR7aF51DMk7Mc7Y=; b=HRM0aHtX9XzKKaBtcp9xrOqzXaPK85Kuc0zw3RVZe0EVdYJ28xZ9pGheMW9LZkfEA7 Q/i2UW95LqEBxmzgUAufKTBnAiFvSNwY1GxM4ziwBARtk7dSfAf3xxTyb/PY0s7jw1Em 3OJ+P/fdtlrdWQIGNqXvrxgoYDVK1THOVvSPkSEdNHoLQm5Tkp6jBCAKN16pwMtnS9l6 bumCj8khBLapy0IabiyYoOESF1QOs8K65rs4svHNuYhr6VufMrw+v/wkQAtnPyXIi6xm sEzDnxHIV2tU0a6W6tTGORbd170mVrIEYq3IwIFZ5idteNnBRo8KNDwxXcgM64lriID7 DcbA== 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=/Oka1mxILvyuoj14dGrBGiB3Vaw9bR7aF51DMk7Mc7Y=; b=r7dzyas7QEOO/RAiM65DXZI+QS+A1zZfcGHBqOs4/BX4D0cyPnqrCYKmleLvW0EX5t 6YNihOiL2oNoIzExhNjXFVtc2Io54wm2ZEI4e1RnWi65mPwmOevaArKTmd3ya4G6+D/T 4vD/YlKu/dH3klK74eBW9+cogeQo15ngYqFw2kjJQ0IYNvxTv2BxpGPwQbz5arE0xu5Y fZpa/AfwjXLXnWVRBYUp8AjWuvUe42CLHdB4XpD0Inbvh0Y5TXCRaHA/FOd9Jj6mhuKU h+0Gd9A/voV8SllZig4nr6fpUg2GE/7RayWGp4AT/8TQBciLsDv0807fg9Ne+aRroZ6i CbWA== X-Gm-Message-State: ANhLgQ23Tn6cS6Jt4tmGxh2ZFBjsDcMFrIeufslh+jZPWcX+UugorPYB VJDXZvND2u0BNvcq4XGBvVTnUtxYdesbhA== X-Received: by 2002:a05:620a:100b:: with SMTP id z11mr9784686qkj.382.1585251522276; Thu, 26 Mar 2020 12:38:42 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.38.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:38:41 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 50/74] m68k: convert to cpu_interrupt_request Date: Thu, 26 Mar 2020 15:31:32 -0400 Message-Id: <20200326193156.4322-51-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::744 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, Laurent Vivier , "Emilio G. Cota" , 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: Laurent Vivier 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 9445fcd6df..c09c7a9b14 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 Mar 26 19:31:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 184918 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp477527ilr; Thu, 26 Mar 2020 13:10:07 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsct4zOdbP+IhPiOQ0p4iPy/8bBOd9M1NXSjHzD4ioMxjq0+jGg+l07EpXk7Brs16iPKa4T X-Received: by 2002:aed:39e4:: with SMTP id m91mr10773349qte.188.1585253407049; Thu, 26 Mar 2020 13:10:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585253407; cv=none; d=google.com; s=arc-20160816; b=L6r+Eli2+RFwO6G9HR697XGO83MLXEICOWiI2w8JijGWS3VQtPu+VcZkx9RiGMkFkW hXM+Y7Eun+CjJkOqSnMvWL19h5CRHMIGjCqffY/CxoSdiuqs+Q599Q4ePrb2YpVYLRWP lKRBxpwy1t+7ssRd8bRBegzfpD+L36CDtjCAxntuXhJE9ZqmrCJIWobdwEAvLWSSe7iR Es1J7H2+0ZOxZU61G3SsQKO/3FyOl3GVY+N+IDF1bEH0G+9hRev5iaNbXmZ+lMiiNee6 fy7Yc3GwFJGyYwGfTITZ+TzO6jqGhUfDv9FzgvX4r/l/5mWqNyCUz5kQmyQGSFqQY9HK TVdQ== 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=xq8ApT5EcP3xa2J8qpBR+35XXt1M3N3ZxksLFgnzhgg7+yP7eCTFvK00DThABM2Dhe KfJkIoKjOLUDyzJwFWHKM9JD06PEmjP+UfZZXSRB3tqUbWS2wYh73742EU54l9c7Dkyd V/LYdm5jGNQSQx4ItYaQlqWXL5QdVXLz0izZlS/lizyGDGsiQe+k7rfYmP3KFD7yhnVR UGG079A69VNBl2V5ndkOqaKEEQAV8ndK8kOvN0V7KzOt031GTCapLVw8Ktsh+ZeBgiEN BRzk1lQ7/J6PAPL9RITkadX8a2hLlmIdFmBBzjCNeBoAWuR4JBoXFA0dIPYicQpMJmSf XG3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="UZ/tHUYu"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 d9si2057818qki.62.2020.03.26.13.10.06 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 13: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="UZ/tHUYu"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:59528 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYpK-0005Fc-K8 for patch@linaro.org; Thu, 26 Mar 2020 16:10:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59138) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYL0-0007YX-DS for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYKy-00020n-Ha for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:46 -0400 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]:43213) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYKy-00020V-DZ for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:44 -0400 Received: by mail-qk1-x743.google.com with SMTP id o10so8129723qki.10 for ; Thu, 26 Mar 2020 12:38:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=V+COCY1tch1+h8AFER7aKTPV6Dtrz1h9iyiTM5X9pZo=; b=UZ/tHUYuZJcG4QN+Up3UcXS7s3NnhwffMRiF8DJri/BZgkWstZbv4UWUVdUawdgKVV j4FsMgYwQkcXJdVZ0ncDo1IUyITkxGpeuEx7v4ogFtAGl29oWnwvFdu1Pimn9tu/3Ldu 4Nzk3uvhnz5ED06pgSFKHi+3VD6Xg6mhytjIzMFI6/6+BH+4QB4+X1Wr8PWmmV9NTIxv IkFFWAHUaKDIpwxb38FlJNrOBu493dA8fmci0tDKHKkLrv995ZkLKbK+kjMgxY39VxGU NXUonOnupkBzk4maFQgw01UFu+vuYqL6hK2xU4Wr0wfbmUqlSwzJu3Sj84W9YaP2gQ22 YC0g== 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=sTE/7pdU0oRuQcqSV3UJkH6INr5QHyBy1ZiHNaGFu9MDMQeBVutyZROZkRLJrJvSp/ x1yUrLBxvA9fvcdWA9RgPsG7ypdeUKY5cxgwioIk4rKPlbdqL2S9fLtXZc36lCb1RymO UtWV/PVU9wUuSU15ssuwZxcYeHO6B10mcxCOlBih8lE+ucNEZCPJWzEfo99fSpOSwWep tJCJfvWOddI0gbnVMK31pqX7zLIS8CNstc8xxZsTOmpH+VG4/FuvJbqa8o1muzjYHO/a S1tTVqPyWHMrUc2JbyEAPejtHq1CO4XRYGSpl1Uq6iYlKRfLWVYtIc0b/q5L+EK9JiY/ mk+w== X-Gm-Message-State: ANhLgQ1k2mcJGdjVxokgHtWOK/5ODnLxf27zuL3FDIn+BJHOcC/cD7pv xeks0A728nMurgG7wlPdGT9wf0xaQzan3w== X-Received: by 2002:a37:844:: with SMTP id 65mr9459076qki.15.1585251523644; Thu, 26 Mar 2020 12:38:43 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.38.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:38:43 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 51/74] mips: convert to cpu_interrupt_request Date: Thu, 26 Mar 2020 15:31:33 -0400 Message-Id: <20200326193156.4322-52-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::743 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 , "Emilio G. Cota" , 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 Mar 26 19:31: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: 184890 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp460079ilr; Thu, 26 Mar 2020 12:53:21 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsuO0ON2XagjC9aP/atoseylveK6FFMp5yhJxUAHEvRGzK/veB7Va1TSH+vQ5I+3BDdyobh X-Received: by 2002:ad4:458d:: with SMTP id x13mr9685000qvu.155.1585252401584; Thu, 26 Mar 2020 12:53:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585252401; cv=none; d=google.com; s=arc-20160816; b=Ln96YijXY+7I0+o81//FLckZ//kT/okDGt7k4ryxVetL0f/4EgYLAhPu05LMMYV7Y8 Vpsuzk1YZ5n411IctJPvr3eCvM1KFp1aJcJNuFrnA0mKMCbWFqzDlBpUGzrNgt4l4yoH oXhqBScnGPqyQn82QuF/3kyzCEso2sKJ3KzLvUNjJLdF0i1jqZtOjqqQhaf5Pt2t3HrV Bv3juRhxzZv4khUu04a+spEoATIhGOb3yh536GpI9VJIWwiP7SQu42zanq3HPDlv3I5a iI2IhzWrDjLYCG/w71CSaBxKtdJce4vnKhryw9pzFcS9VxQMAH9qFDyWqMAFfNTACYoL eA8Q== 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=KiC/TF9nELDH2WDNvXbAEnplUTZTjGesnDNS9gHFXWuG+x1+2uEATIRisWzjVhlyyx lDxmyZ1mbKLxr/mL55+HHQNv+G2A0sJf5NsP8KVQvuYiLTU0hHqCbPfotTuPg9xcA2dX HxPmpSM7X2MJFEHQQq6aKj36zf2/N4PpBBs8GZA+RXsYgRTti5LSLtnZ+URoF2ZxUdiC VACG54DsGbdh4gk0664LErQRGnhcoJfj6S/iBp/1HI5CW9NmUW2g8aC5IzxtS98To7t9 rauQE2bZy+muZHj7ioWZMaeIA9nxoVVusxktgUxLxLwxD+/Wo+dGVX50s9t+6xoQh4YR adqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=i3pr+Hvv; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 k22si1970490qkh.206.2020.03.26.12.53.21 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 12:53:21 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=i3pr+Hvv; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:59054 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYZ7-0001U2-2g for patch@linaro.org; Thu, 26 Mar 2020 15:53:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59157) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYL1-0007dZ-W1 for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYL0-00021z-Uj for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:47 -0400 Received: from mail-qt1-x842.google.com ([2607:f8b0:4864:20::842]:38432) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYL0-00021n-Qn for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:46 -0400 Received: by mail-qt1-x842.google.com with SMTP id z12so6541628qtq.5 for ; Thu, 26 Mar 2020 12:38: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=1YbnvmhNqAhmF66BGNb4cMj4pII5ByUEQJWinpDd9pc=; b=i3pr+HvvhQIFADoBcT7sx9m+QTpGYEogcCuTQ+bZBNrl8SvOIkdFVNrqnyNessQppy 4ujYK061whwILEBeMvHoS6YbPUSGE5HfSXx0wmeihfoRrOfB+XuWt78VIhnR/6TXH5Rx GprQnMi2/dRXK5DZPb5xpE5YmAt3drMPWLrZ/rKPvkTJ2Y1J4KbG7LJ1XnvxM5BZu0cP ozRMqEDN0lIKjyZYdZIz8Pa39MhTi6TGh85t5e9bZvNY0kt58yPpwuT1H+zHMUh/ugUO xwLXqOtSLgkhR4smttm5pRfZzIrwRbHAzlWLKIE7v5bACrnu+T4p1qH5bBvCFGyNqyND W9TA== 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=bD7Dwik/sgNbKFCa8J45hQByYC3jw0+YgxJ8yMzsQUp0UUsfp5vI1n+FPQnUjZRoJL VxbujDD0vohvQrVxQ9YKQnctb4WagePm6HXU7Z7E0NCKABNlnGy3g+0n8Cl49cdhwxnc LnIPoeblvTYZMiJ444XwRgFjnhurf0sG1Fhs0ZQGCrEX92QeosY5PGj2MNFRlykeXIyd XKGsNuHpNOueIvvPs1q06Svjmru5dHaK00ZiBedPDUjP/0MDXQo4a8fUqX+sQwP7XjOw jBWAqvp+suljb+eQXa4UqbuQUvBw59JBZ5cc8KiEYtqNJm9n8mX5XXLTVXXr4DFsJztT 2RBQ== X-Gm-Message-State: ANhLgQ1xSpPyLxqJXjqb52bF+WH4cS7EBM12qiLpG7547q4KqhEgKOp/ VZeRau3j/w3FojU+5yGpPlBLRY6E208Z5g== X-Received: by 2002:ac8:748d:: with SMTP id v13mr10396369qtq.390.1585251525197; Thu, 26 Mar 2020 12:38:45 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.38.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:38:44 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 52/74] nios: convert to cpu_interrupt_request Date: Thu, 26 Mar 2020 15:31:34 -0400 Message-Id: <20200326193156.4322-53-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::842 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, "Emilio G. Cota" , 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 Mar 26 19:31: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: 184891 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp460234ilr; Thu, 26 Mar 2020 12:53:33 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuSJxy73cS9BLfXkFeDf8Yp9pU1Rh8mb39nN40eaOHxcMYRS+bITOTJoX0m45aR5UbhpJ1y X-Received: by 2002:ac8:35dd:: with SMTP id l29mr10381985qtb.79.1585252413401; Thu, 26 Mar 2020 12:53:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585252413; cv=none; d=google.com; s=arc-20160816; b=h3a9UF12Nv8HS98BxZBiqgk0FN3xog7Om1a0ShzedBguWH2cvvLCKSNI1dYBB674BJ Nz2yIpzXwzxh0ClajztFftDtA9BW26S3P/QrptCrvtahGYYE/a/BC5SvILrmx6gwjgEK srA8rmlwFjH/osDZXpH5YfZFWguxHsuqbnxg2GWkbxrvCOcIe+wgwnCLYeYYFJiwm49a bfHJlvJQcA6cX6v4Gngf4NkHP/GoE/x3P6ChyuBEPq5B6vj+rFPVmUorJM7Ac6ZJ0oUf yNnR8DrkOXG6JuGSH6Lt7TnCCGpxufqVWls8KUnQe2BpL6bqhR+W3p9JTvD5lYGs3VJM rdSQ== 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=cL3PcCCKPMmATpq2MJ8kQxP0SD3wsdiwI8ulUrzN/bE=; b=jRJCPQkYuOvOc8LmkTanx5zg/EnkSCb24TFlxxJcZMVW9ttBuVnI9IoSlwMXaWEiMi b5oZ9W3HByJABhM6ppvzrZoPlhCf9VNTgPKx3enwxCEO0OHfAby2SZJvbB5qSHXNMY0K hpOHmW3wORhpHk5ulbkHqqbgDwqGGCjaPf2xn9t3RPj1+ypIbHQZnoWU+pbPtvxLFtp7 6+aF3LVrymuYQv5wG9Ozq6JqiPUn5Mn0tdjRd/+wSCEsCd9mJGZohpYIXoKAeCOgEVRA Jglbjfdn8S0cl87+q+lak9y1uaqosdYuHLKuX7+uKSckrk9A4+m3yVFDybeNpBLzHE7o hCEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=J31RywKQ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 h15si2016233qkh.372.2020.03.26.12.53.33 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 12:53: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=J31RywKQ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:59062 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYZI-0001fB-Sk for patch@linaro.org; Thu, 26 Mar 2020 15:53:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59177) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYL3-0007i6-Jn for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYL2-00022y-Dt for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:49 -0400 Received: from mail-qv1-xf2b.google.com ([2607:f8b0:4864:20::f2b]:35749) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYL2-00022h-Ad for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:48 -0400 Received: by mail-qv1-xf2b.google.com with SMTP id q73so3706414qvq.2 for ; Thu, 26 Mar 2020 12:38:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cL3PcCCKPMmATpq2MJ8kQxP0SD3wsdiwI8ulUrzN/bE=; b=J31RywKQeAphVm0NnXJ17NcjEYeUOnZ2kK6MKnoRizXkmQRnLRiosS4Cp55YzMV1xd qe6/AuVK8Suc6ONZBNu00NCWg1vI6yEEwz2IAWiz6AsaQR6sRAxmbXTtix5QNxfREMqs EhOsyLqABGoS2kwOuE1Ov8CVuLk4aOY2T0ILt+svePUl1iHhPe2Zcm6vMlN15Zkp0ugb rFQsrYkFA3rgIp6sKnx5pceBW4Mtja/9YF5E5PjlS94UISGMaq2vaaocnRV2LbmGXVV7 RuhWsJLsvRfHLkqlgoBjzYmWvP3vsvjPWvppRDz63RVu5lh5fm2t7FXWhcsbqAHZbB9f WwpA== 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=cL3PcCCKPMmATpq2MJ8kQxP0SD3wsdiwI8ulUrzN/bE=; b=IQ+laGQCbK9bQd2qyuulV0ZxLz/DbQM6527ZTo8Y4OPlAiFIHLJEEtpMx2MbyznTd+ 01UhGXo7l6LJUrXpUNKe41AXyaQ0jdDsfpVVU7nkp99ckQMjrMvIOrm4z0QZbrJ7Fo1c 2LfY76sB3bCqOh/P9Ru75zF/2/+Bo5yJJ91WplFk/LXvWqUpH/NPDW5+7MpzTPw14SlA qRNVXAYK+0OZYoOLmKmGUBqLqqWCYbCv6WuU7SmkpIMQIMoYy4NbN+UIpgfraoOsWiWV zQiLkktaBKmNYp4lbwQ2jUkhCb5heG3vao2Umy0gIdF34JicHWwUSRW+IZwzRANNsek8 RFPg== X-Gm-Message-State: ANhLgQ3Je3RtU974ryQowfdwAhJI3275xVAYVLybdDXRrAqTwi8GKJ15 +bW1rsMXuNDN6jRTGUCtSc9QarJHfpAtew== X-Received: by 2002:a05:6214:10c2:: with SMTP id r2mr10350656qvs.83.1585251527485; Thu, 26 Mar 2020 12:38:47 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.38.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:38:46 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 53/74] s390x: convert to cpu_interrupt_request Date: Thu, 26 Mar 2020 15:31:35 -0400 Message-Id: <20200326193156.4322-54-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::f2b 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 , Cornelia Huck , richard.henderson@linaro.org, Christian Borntraeger , qemu-s390x@nongnu.org, "Emilio G. Cota" , 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: Cornelia Huck 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 9db3a4258c..ebf3fac965 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 7910deed35..f1f206c763 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -64,7 +64,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 Mar 26 19:31: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: 184894 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp461633ilr; Thu, 26 Mar 2020 12:55:10 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsBLBAjUzD7OAGbkE+fd9N16UKtzjNCjxJGbhS3NLKL97FLexy87tbWDd5K486s5eN2WHet X-Received: by 2002:a37:aa14:: with SMTP id t20mr3890145qke.401.1585252510001; Thu, 26 Mar 2020 12:55:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585252509; cv=none; d=google.com; s=arc-20160816; b=gCrIqBHtLpDgLaz8Md9XL6HF5OteeUJg7+v+oVinQ9KrwyyHcnYbiUCprEWs1xmOqo O/UD0AZVuppa5ZG57C1KShQUZp75wO9nngkEDI+DLVvLjwgBROA1jRjqwUblRgxuFWQp dCaJSTVSr8g+UoRtOFWKojMwL+d2pjDls2SR4BPWJqoLfUQsThKThFxqb/nEssFkAxfB trZYv+gJ61+BaAbkhqQP6c4GgzJ7QFeGhnTzbUyVzd3WZUucFqfRGanrlP3RfLzZbhG2 m4yPTni70gOdegFre4kyutaw5icFccJHsQVcDxFxiIFgg3xajGHsPj4bF8qzw/CrlIGN qWMw== 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=yWhKQoASNBGSHFjF4wM5HQAsLUTB9oBcs0o+YZX1d4DLsg3ztje4Zs6Dwf3WwfIFe4 g8RNzsLUCo7fJfvIJd7GKr4fbEJJj+3tJpFF1LAHl845cBBpcxhRLnqFu9cet5B9RA55 7C8AwFThFH7wA0ctYYlSN+1BHgSnur+E8NYaFSe2hHkSyK/CYmd5ZmVOqSRKBOC7qB41 /Mdgb4CbgUGZPWN7F65ZOg/VgEGy66muPnxJxkCh6XP5wVJrNr2f2eQkhpptvVFJylBS O0xVAk7JGViW+Z7DgkIk/ijOtRuPqRHwhecOIty908kzDLKG+L+gU2TzNmEDb24H1AnT I/PQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=LHUFNSj0; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 h10si2216011qvf.219.2020.03.26.12.55.09 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 12:55:09 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=LHUFNSj0; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:59116 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYaq-00052V-Ft for patch@linaro.org; Thu, 26 Mar 2020 15:55:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59193) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYL4-0007lq-Na for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYL3-00023i-M4 for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:50 -0400 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]:45620) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYL3-00023R-H2 for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:49 -0400 Received: by mail-qk1-x743.google.com with SMTP id c145so8140085qke.12 for ; Thu, 26 Mar 2020 12:38: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=E/tQbITHc97dgORFyK3tE34tNsNJB0LGdPZMzeOAZ2A=; b=LHUFNSj09e1Iwyy7HMTWa3Ovt9W1QkOMIp2LOA3ETkRGMl9Q+hGKcY+F8ZN+bOUMfV zXHS5U+3AnGVr2PXZcQOVSBYXgXS7z3vi+7mREwMJo8dt9qy4op07f3vqWd1ihDUW5BD hTkUuJlnA9b3T4WMCgjnoRrpKTzeQeLBm4SXXfSE21k6cxtnEWjHtAm0gzxAXb6/Ff8x qXMWkt7VqzD0riG3S29go8py/1JkxGIQ5dpmHNxp4tOikFEsuR0KNGYiy/KiZT8Gx/ci 18dNL6UXXbzvZi79pffz0hurbeaDQBGu12a9K+YUgsyaS0Jq2fKk1mJAmcs2PDBwYN03 K/jA== 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=nM7cQQWmQHy5HtlVF/6tu8kYUOdd9PNiYBnnXPS/lF0tg7OcwO9h2mS0M5ojn1y71h KpUWSTlMw26lsShZjXmvrrovxZmaT5goBpOlrE53I0ak9SXBwhKi/fHkZE90ltnNNZ0E AD860pZaqutA7COxqCgUXz5tikrErm6cA0yXeWJXeH6VmYA3P9NFQjfi44cvSGOH8KLs JW80eaa79nlShGYSA8hY3sBNVsc4Xr6T3Aix74+kqm7LrLf7lHx0GFRefM8tf9qNuC12 sZSsAqXmYvtJRq7DaDIfohKnb3BxhkOHJqcoUgUC2x0gM3I9NHXB/N+z6bAG4Sl9LIOL bPPg== X-Gm-Message-State: ANhLgQ0/Wj4j4s7MRAGaCNw8ZOFuRcG10K6hxXHWl2dV8Nwo66rfVEgL 8PyZnNiVxh6m85WuZojNYmdp5nGbZJjeAA== X-Received: by 2002:ae9:dd83:: with SMTP id r125mr5093651qkf.105.1585251528776; Thu, 26 Mar 2020 12:38:48 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.38.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:38:48 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 54/74] alpha: convert to cpu_interrupt_request Date: Thu, 26 Mar 2020 15:31:36 -0400 Message-Id: <20200326193156.4322-55-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::743 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, "Emilio G. Cota" , 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 Mar 26 19:31: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: 184916 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp476564ilr; Thu, 26 Mar 2020 13:09:13 -0700 (PDT) X-Google-Smtp-Source: ADFU+vu2UBD4LJoB2I0wZVYiNl63coawPkD5HgfPbIrXVqMNFDigZsujYZgQ7m5bdKiHIDyF+iTq X-Received: by 2002:a05:6214:56c:: with SMTP id cj12mr10277738qvb.29.1585253353824; Thu, 26 Mar 2020 13:09:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585253353; cv=none; d=google.com; s=arc-20160816; b=fq0T/2rHP0hx1Cz3+IxlDZ+SjBmsvav2FP3mDDody3SP+nG1kf0ObEAVVlddEbulZF n5PbFsY2+JSAG4wdL6hbUGcMlUFQgwkU4qpEe2ok6HY40/gQRCb+28dzldDUDuAkS5OX NeHQKdXVK8kefKz1Bj1NeFCPvwZDvAxOXyVt1EimBr8garcwRcpJ+aZh0+OQd7e3P4lJ 7mvi74Tv0bF46LsnX83uTK6OqoGoI2WR+EdNGdUBGHplSnE/6LxQTvJQ5okj/vlzU7wQ MFD4jIgc+xiA39zmdGUSaqPpGgou528+8KfLCG4f1bHfDsrk4OL8jpMuHb6cpfATZ0uf bAqA== 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=0c83ceFvLMw0ck9Q4udEmxeNf4ae3k5Ru0AXELGeJG+DgESyM/IMK7Eh4I95ac3pO6 /oZa33Xdr42KA3oT1KXr83mES1guEPYsM77FHfoWe4k+WdrntkSJ78BWO1IJ9hYHUqg+ SDj1i2PlrCunmo28RaNYbLwLiSF1rE5vtvNNfNzgO5UHnaldUVTxiwkOKQczNZQUf0XG ZIV9Qrj9nzhC1LRyeqgwpY8LtRLXLXWnppm+5Rp6A7nTjbxHAnbC6WGT8gLK7QcAZEzd 3mITgJoSGk+64sAZPHaFzFCGOybvMvO2oVgsYXGDQnz+vCe+B4QHQYVEq+3ajL3W18eL OcbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=bXLf9wvE; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 g25si2023527qkm.63.2020.03.26.13.09.13 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 13:09: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=bXLf9wvE; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:59512 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYoT-0003ur-C1 for patch@linaro.org; Thu, 26 Mar 2020 16:09:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59205) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYL5-0007pO-Ts for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYL4-00024G-UR for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:51 -0400 Received: from mail-qk1-x729.google.com ([2607:f8b0:4864:20::729]:40359) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYL4-000244-QH for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:50 -0400 Received: by mail-qk1-x729.google.com with SMTP id l25so8188309qki.7 for ; Thu, 26 Mar 2020 12:38: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=TvYnAkjAppdRPxTCTiIdH7gnvDHcZXb4SiVpZ+2G8IY=; b=bXLf9wvEJz0IcaMKjjb0mg2gM+JQyhks7b5zuDie1CxSdf0R+VjMTEIgRFrjSxWpmP FpgJN+MW6wBRShptt1fcLP5yJqtkPUSHYByn9t3z9UzSjNf5sOkKmfBtHPA/fcxlhBMR aLo8NAZCgpEtZOj1rDuSlj1gUP+KeVg09eF9XmE8QOWOqAJXaF7+VdV+X/hrtnyHZEzU ZV3CI+nM4WDVhoG9m/Kd2kjb1XQliPwY2Zbxr3PTnWG6iN2/knwGg4rGT84gL/3HhfnI eAp7mEKwo+AYzbv5SVzk25oZkklPQGvLYEthUM60HfRjD51xpJ50usLvo4oLhUVmUe1H FoNA== 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=Vl9ww/YfyuIO/Itfs95C8EwpNRl/C7LE+otcE8QKeKOA2GUMW4fgSvAZXtP6aCUa3q sHZxmaqb3pSwQoaPExr1vMmbdCmhLFuH01OeY5WV5RhN1QVX0B1HdfHMNKMqm88WH7Mw +q2ZYeEN+HQujLEDXmvZhlSN/24poUmoQ2L1a8rAwsvcq28E0r4z3qLp4OuhMp+pG7xD YsE3xhJMiOJYWH0x9hMFChjB7kOSK6lIrGaYFFIr4ZE/69gMx7HvOJw0T/Xt9xOBH/8H y7JMC8be1imLZwus41a0r84uoaO647KU3/rMyKDIAXbOM2Am12CR7zbJ4lINpNBjC2Wr O8TA== X-Gm-Message-State: ANhLgQ2lsftAHC+fdYxxtI+h9ro9P7lKsenZQ36/BnNaSgj8yNFBQJGY VYt0P7XiXXKRgFvBMVl5H8OO290DP9uBrw== X-Received: by 2002:a37:b986:: with SMTP id j128mr10015811qkf.109.1585251530037; Thu, 26 Mar 2020 12:38:50 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.38.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:38:49 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 55/74] moxie: convert to cpu_interrupt_request Date: Thu, 26 Mar 2020 15:31:37 -0400 Message-Id: <20200326193156.4322-56-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::729 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, "Emilio G. Cota" , 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 Mar 26 19:31: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: 184925 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp482673ilr; Thu, 26 Mar 2020 13:15:09 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtX7MeELLSMRcic8gXcIkZuZHDPNUnmyvfy/zsTBQ92m2N1NcHld1LNQvxs/bazBzYYOvEi X-Received: by 2002:ac8:3805:: with SMTP id q5mr10485033qtb.46.1585253709526; Thu, 26 Mar 2020 13:15:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585253709; cv=none; d=google.com; s=arc-20160816; b=FIPNZBsTkbRP0+iYHiyB+pjTbJjKRJilR0Mdvce2FOnz1YL/45vuU8qfnubbvPISa4 fmGjdPXbmDNuOksYQ5x2BiPWUIo08n7+ImmgnDER2PluZwHAkrkk7c1hUCRzno+SwK7N fjbFfW9ZlA/dMaQZiVWe3JLjxGWBtCRSpkHNXUwpqgFlOBRFBdBpg26JrrKphR42M4YK I1zm3RbYV9fKfGzjmSthBC4vo7zikqb76YY4524DYwqg/AF1oX4rsBPdvS8uuF9VdNm3 hnQpNsEonx3375UGOGHGsWCacX4K6hRZD91RHv5Zj6E+fGq2CUkHtGQ8OuWMMPHZ9lwc Emsw== 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=g5Ui26IYflB7RMxLLOQyjjArRpQxbNqKCvou8uKMYcU=; b=wViy38t5hMz/rpO5d5oTi37+2HsGugYn6Korywrp1QDCdPCennlXU7luj45vkrJT+v 9k1eOoV/6WiI32op7LBll0p5gjTAN+1O5qbcizs0tWQpm2RhMVYYLC54Ntj2FLyuUZtn M3jXrwhbJmbirjhPTO+QgF0d33o3Jawzk5nwPqmKtpJYEgSPNvERtBqJ52uuoPzL3RVl 5fiUaagWvvkDIjaF4CjHQpykO17oR4D158cmcetrKpEBYK7gvPhadC+S9m2g12DTtwtA BxCQjfKkXTagBfMjsJiUF4qSrgWIwglMOo5AUl6E57D7czUIPSeE6ITnyxwX5r7ifLmx iE3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=q1Fmcxu0; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 v22si2136144qtj.278.2020.03.26.13.15.09 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 13:15:09 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=q1Fmcxu0; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:59652 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYuD-000505-3g for patch@linaro.org; Thu, 26 Mar 2020 16:15:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59240) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYLA-00082B-IH for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYL9-00026I-C8 for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:56 -0400 Received: from mail-qv1-xf43.google.com ([2607:f8b0:4864:20::f43]:35406) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYL9-000262-7t for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:55 -0400 Received: by mail-qv1-xf43.google.com with SMTP id q73so3706624qvq.2 for ; Thu, 26 Mar 2020 12:38: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=g5Ui26IYflB7RMxLLOQyjjArRpQxbNqKCvou8uKMYcU=; b=q1Fmcxu053j1KdEh9oYBpX00DIb1chbO7U3ErqqW7nwGZ2E8Cbxo3dTtFeeDuzVSpy u0xspx2JKKfJnM6IRUgCm7vl327Zf3jbm5pjyeP+5pZy+HzEwFZ5b5QZVqAvgLhmf4rz dS56Wiyzq16RUPXdRFx4CeSGjsbuvWpIrizyhgxAOnIHd454+WkT6FkylCSqEjAxKsbB 1U6v7fYgOo95FtPL4gJ58PnpFMFAQaD/QFjS3NBjzSy1UACSs7F9d0LwlBAMS6Y9ptTi 7HjzBuOBbh0EBuqjp8gs7MwwFyjTlSt463PpzUEtWPMNy0Mmb6BHVJ0202JuVJYXYbs3 TdBg== 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=g5Ui26IYflB7RMxLLOQyjjArRpQxbNqKCvou8uKMYcU=; b=XwydXkgueHJHrHlZgV71AeWXQZEg6ZxvUUT1ZgaylywrN43NbfzLt7t4sqg6jEetc0 BB/kgJ3Pg8HRBLNDHFPNZI/ORkZ3yIqxUOiXdf8GzcMERaJJXXWB/z/GdPJI556xscLZ 5hGADCC2ktGukslM4mxeuhMvKX5gSomF6DCulTHr3ahsDstxTqQ2BO5MqAaVjwzRiF1N +eyOs7fAzB7Kcfz9I32CcVGjViQ4Z1j+fwEpJYgWNpPwOxVCrAz9klfVSx/K8Cn+h1y3 uws6xvfSxmViuPW/iRolyqarXHJ+BEaoMgyYN+gIylpkfIHW9vUYtRy+OFbKCG7gn3cJ eMRQ== X-Gm-Message-State: ANhLgQ3/XbEdK39uROtumCBvW0svE9QKApm/v8qxjd/Y5Myt0HwJMoTj l9bNGgT7XVFyYo5mBRp/DWbrovle1m4pug== X-Received: by 2002:ad4:4ba7:: with SMTP id i7mr9833152qvw.39.1585251531366; Thu, 26 Mar 2020 12:38:51 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.38.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:38:50 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 56/74] sparc: convert to cpu_interrupt_request Date: Thu, 26 Mar 2020 15:31:38 -0400 Message-Id: <20200326193156.4322-57-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::f43 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robert.foley@linaro.org, Mark Cave-Ayland , richard.henderson@linaro.org, "Emilio G. Cota" , 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: Mark Cave-Ayland 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 Mar 26 19:31: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: 184920 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp478748ilr; Thu, 26 Mar 2020 13:11:18 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtdrH6JLkl1Aoczci9G+kcTvmSrcFrFXq3BTXPJJMgRbHMhdaIdwbecSGSF+xzOqxbsW4as X-Received: by 2002:ac8:366d:: with SMTP id n42mr10463753qtb.180.1585253478622; Thu, 26 Mar 2020 13:11:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585253478; cv=none; d=google.com; s=arc-20160816; b=pchGhndhfn/fVeH3l75OsYGowf63uzaitSz5qo8i+1+3vqvIv2JGjWNUjVl01gPPrQ yo3zBKvWp7E/i3CslDSlzteTxQZiCFrOXzluusL6/BW49MuakCucmnwh/yaUIHO7PzbB 6snuSFjNRTEnJyB0xHN0AEuQI2WHojdhHylcRY0uYswm/tDzGNmIja9aydqsRYhViakm vaIk8/SXyCRsM4GdRQbFvghjcAvs1/F79OoczzwRf+PYmsAz80SbHF4KiyUI/rQJ3WQl d1AjMkirurO/ZNHYp5gX9WiXML3UYpc8jZaYANDJGNTXSJ4d6Dtsad2dOuPyDf9+9r2y 77bQ== 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=CMVE60rGavtbSfBfIxdOFR0GPzd3Bb6IfxGeO2sAebnqqmm3FPbTg+f6LgGkKwapHM 9H5aJaXq5CfFk09suOb8EWq872UdMmcpJp8EFoeBJL9Gb5aGNgltmqcuHRM58XLAdY3X sSi1x4+IzZcEF/gM7JxssTBmJKZ7Ki5bYrJ7Gwg6UfFRo44IkN1JNmDu5ZTJWGFzkg7x s3/rEn47j3EIZHD6wC/1yOkrsfSYUdRnmXksUM6LlJETCj0V25J2p+/d7t724quLaWNJ j85PXIk+h8K1X2e9KzM5xIzmq2e/DFVEjrxcbd57o20YsGCm9cCn8pIp0VafAfMz2Dpy kk9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=oiOP8Pvs; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 h15si1967046qvx.35.2020.03.26.13.11.18 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 13:11: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=oiOP8Pvs; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:59566 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYqU-0007E1-1A for patch@linaro.org; Thu, 26 Mar 2020 16:11:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59218) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYL8-0007wj-T3 for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYL7-00025U-T6 for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:54 -0400 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]:35416) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYL7-00025L-Ou for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:53 -0400 Received: by mail-qk1-x743.google.com with SMTP id k13so8208656qki.2 for ; Thu, 26 Mar 2020 12:38: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=1b+dD7RxLqaUPVVNgXTFGKKstOqQ+qP/ZFHAKJHyCiE=; b=oiOP8Pvs0iAUi0RJ/krm78vg3eL01ZQqQpHl1zVxM/WWr+GURS0LHBv0ClGOlMUZZQ ccl7gaxvD35z8nXnYvevs5ke5j6YloiiWmCl03ffAf6bUAYicK5Rz0fnJiGlM2maJFaX y8eyu2vODfDlS79Cy6hAdTrR1GkOCtQxpetIPADKCnaMEc16+EnNs5TL7gZ5qaMiRCCQ qU1f5/NSx8fmZ7qGhB0PBzZPdoX8mYu/zS+ZPjmdTB8ZN8THWN36C1TR61yN+fcKX7t5 Aptf8pr/IPNfjBaqVvApGGPHluhTw9Kcl1sAuXrajdgditABLNoM1eVbRYwi58zVnuTL 01Iw== 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=tyRju9OOUkC5Vc2CFN+zXvAMGYygZvTawRZlQ+YwwdRwld8zFXIRp2IdZYSzY7Yl06 tDxQwKPhCGwKNs4LL1ySVH2BKb6j+nyDUKBorNpRDi5KrUXXxopi42DwM9M+g0vxWCF9 gRSYcUUsmwcP2r5eS1tNSDz7oUMUEHfJ3ObrTznoApU2CXov4W72XC3YJt7OPy1wGUVN cI1V7TFIXDdIQhKK2Zvn1LPc1LemX0onM7XIjLU/ConFjnP2qNDPp3peobpB3RBq8Xie Pv/abvZJ/5gA4Lg01IK7WClR7TqjiNHmV2Nlqkj1DvbOz+OE8HeCf3RU1ewQQfKla3bx MXhQ== X-Gm-Message-State: ANhLgQ397V9NOiywQ41dKfyn3ro0vY0lPkB4qwc2O5SMS8YHbxP5KZOq 2q3e3/ILFVLpYsQNOsbqINKidgCOAS6+Xg== X-Received: by 2002:a37:b002:: with SMTP id z2mr9884193qke.289.1585251533055; Thu, 26 Mar 2020 12:38:53 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.38.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:38:52 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 57/74] openrisc: convert to cpu_interrupt_request Date: Thu, 26 Mar 2020 15:31:39 -0400 Message-Id: <20200326193156.4322-58-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::743 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, "Emilio G. Cota" , 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 Mar 26 19:31:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 184922 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp480507ilr; Thu, 26 Mar 2020 13:12:59 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsExQ3Y3qJbpy7kHJ0z+bfFY5R2xGjVSZfuImOaHiWgFNnKsz0Gcgw7xfeTb9+RH+FTkXV8 X-Received: by 2002:ac8:191d:: with SMTP id t29mr10749313qtj.40.1585253579364; Thu, 26 Mar 2020 13:12:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585253579; cv=none; d=google.com; s=arc-20160816; b=E5migU/mJFHG/JYNOunBryycv0I0d+m751VNbNAnFQBmwzmGOhO8fZNRxBoMwYXffQ SohhasnC2MefkymbxH6AY4o39uMFDVAnONa35izLAvHRY6szgKTh8nzVaExqcuBIIMTm EGFhiMnxuMOvaqyX7Rn6Yc4HsBGSECyhD7urUFlr6IaIR40shaYwnwWvvHysWQNp1pRB /EO0vPj2r17jHaAcywaX2OnIUmL1f81MObC2BSxxohwT5Z0o6/JDZF3Y+vCQvFzEQxmM XvdorssDlEaj5wWhGc+K57wurm8VLbH5/Ywc+jMI8BPoDRZQ2ywPHIVml5c3r8ZGSf0G R3ew== 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=cEWXcaJneq77+knLEXZMwkgqWPgrR63UIhrxPcFaxiyUbfRxDJw6V8Ard4cAqxIVnh b5ZU8nBzfgmfT3z5HzZnv2fewjVl8V9XCQ9VNdah5JuylJ7cdX4Dr3yTixNxkvWDe4+E iBCl8xvJn8FQlannmXx+2p0t+1t7Pn/oGeZO3pAKwPIuSBxRVPTAzfyBxYoXB2VJ/lyE g/p1PceI0nvea/mT0jm70KOXxczniqy6c/xh22sIYtYa8SGzAVYdXA9d8z+6Y5zpwH/B lyMkNRQqduID5aPa2dHO8nJxkFU+RHRuhpzpi7SMbbNBdmv+Fn45SCFvYwhRgIYbpY84 fkvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Wl0dVZXv; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 o1si2138783qtj.279.2020.03.26.13.12.59 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 13:12:59 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Wl0dVZXv; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:59598 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYs6-000165-Tp for patch@linaro.org; Thu, 26 Mar 2020 16:12:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59238) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYLA-00081k-Ck for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYL9-000268-81 for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:56 -0400 Received: from mail-qk1-x741.google.com ([2607:f8b0:4864:20::741]:37530) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYL9-00025z-3e for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:55 -0400 Received: by mail-qk1-x741.google.com with SMTP id x3so8184607qki.4 for ; Thu, 26 Mar 2020 12:38: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=NQ/BbjaNmbkm5KQOy7Vv4O17R/NYOg7qZF+hAsl6NgU=; b=Wl0dVZXvjbKeAqvAIepWlW6UGUJHBBBX3TFq91rHyH0sCpz3c5NNTs/jprrcR5e5Li CTZV0Xp3oAcrEGbueiOsGBPfCQ+Nz1wt/ZsweApDXjbz62g+Q/aHuJBhB1cM76ZHEGBQ XHb9tVGii55HuEDP83tTBNT1ILWi3BzHaRYiVSAyQVur/B7PU+y87MOMHm6BFpL2bRp5 J1tiFb6S6DmTbUf5NLQ7RJFAMQCMb2ditMkPNwOnx1JFA3jaIcyIE35YDeUTluyGRKkm CQgjhB9PbF6oUKVuBZnA2ZMUWk2Ex2vdow8AxPKdCR5ylAC2AvVAkYtP+p8t9ue6HNl2 AC8g== 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=Da1eBm6YZbeXff0LaatCOwGujwtBj5dSFBfBsvHhV8OWnjTycaSZszz+kB+jPZx4gT eyfzTljVfoJ60K7xYTK9vGDrV2Borm33HEBFsRkXHkEeeMBh4RYybkEiYCFy/btf3snx 8x9dDqu0cMqVswDtykgncIQeb3E8gQH0hqo4M4Ee7rZjkNWRVOvucnRgEM3cY+R2i1gC 9zigCu2rMVwmI9tbs9FrdZ/32x8fkuhIEKJNjlADbwsAWPpBaWxwKv66IxaOKk68liiB o6mw2GYRM5jrjO7eXz0Enis9COWGa707/QSN86dOeEY0vNeQCI028/iPbmuynvSf552U xKoQ== X-Gm-Message-State: ANhLgQ0uy3Jl8uvWBINF3cUO++6Z5XzbMe+ST0sYm+5YPnDPXI3MwTPx iSoB0b0B24jEPzdydrGc8K3b5g5Q0Z00eA== X-Received: by 2002:a37:a0c1:: with SMTP id j184mr1276310qke.351.1585251534343; Thu, 26 Mar 2020 12:38:54 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.38.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:38:53 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 58/74] unicore32: convert to cpu_interrupt_request Date: Thu, 26 Mar 2020 15:31:40 -0400 Message-Id: <20200326193156.4322-59-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::741 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, "Emilio G. Cota" , 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 Mar 26 19:31:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 184926 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp482895ilr; Thu, 26 Mar 2020 13:15:23 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtscwdiz9GhMIewG+NtfCIgcnVdCotXHFO5xW86YYcYca2mLv8pz0rjTrnwJ5J8du8EQbBe X-Received: by 2002:a37:6388:: with SMTP id x130mr10651974qkb.429.1585253723476; Thu, 26 Mar 2020 13:15:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585253723; cv=none; d=google.com; s=arc-20160816; b=qGdQ3ZMZkBpWV1yXOLIbSjQ6/FMauXlosGkrHJ+xGQP0kv6nts/fnpOBjFI3mf/WRA y1oV/0sPK0q+CIjWo34urBabmGIhVbYG4UXMiL64xMoV8UXPVGjtrdL9M5UVRVNRbZLQ p0wHTtYi4P9bn/3RTIuKtyb0BmbFYks7Az5AZ8m0IUsagIat1Sw461eFCkCGzsNRXam9 2990AfGTIv7YPX2LbUyCfH44mRZZfjKqMF68ROzl4GYmVIqVRo+PScbt1WxotINstMaU n/2xzNJUMYptfl4BUZYdGNP8P2wW6ie6WrVS2E9pop8qa+zYWC6oh6q58Z814ZiWPvGP B29Q== 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=YLdWPlJvL5kdzN20NeH795EO1wLm2tjo2zF8M6BgqIo=; b=O3gmGDhq1eovkoVJMY8MiZYnC0NLY05VI6qOxY5L1aX0pMKFtxcoKJ86z1m7Ny0+NA BQzoQGIDpZHiy8FYcvRFBHjnwJvmx6wl+KSOrIseqGEjyFfFZnurpY6QCZ5LwBMIqz1k W50rsYo1w9gKGtY6+VMR58qaPV4AtRfTOFV17Kf0imiQ7wjgeGHhVrNJQYENzO8goBaS DlZ0VcCR8LFns5JGXoOn9PG7sEuif06YPn4Alxd5fRCbisRoe0TJoMCwM1KRGyAi4haz IBtsZ5mHDCKfCHl64hSH4okew8tkuE0AaTWFr4wxS2iNUTi/vxvCMHQcIPfsNlgk7Fjp QD2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=dyPcCQG3; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 w1si2137591qtk.25.2020.03.26.13.15.23 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 13:15: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=dyPcCQG3; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:59656 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYuQ-000560-UB for patch@linaro.org; Thu, 26 Mar 2020 16:15:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59256) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYLB-00086R-O6 for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYLA-000274-NC for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:57 -0400 Received: from mail-qv1-xf41.google.com ([2607:f8b0:4864:20::f41]:40827) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYLA-00026l-J3 for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:56 -0400 Received: by mail-qv1-xf41.google.com with SMTP id cy12so3696154qvb.7 for ; Thu, 26 Mar 2020 12:38:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YLdWPlJvL5kdzN20NeH795EO1wLm2tjo2zF8M6BgqIo=; b=dyPcCQG3sc6xoUXIurf4Hap44sJRPCagIoQ1SbQH26fBIADdRX/wVKBlUqSI+aD1QJ MQQRSzYnKuXNQ8OD10K8yTHeyRB2y6do+LDx4yw4UjRY05Z2Eu59z2qTsP2cWrnsq3to rtXLySD/9PjjxHuoSdsi+C/gQbxfS4wL8a7t2h6TFCpW3sgAuz2SxBc6kgnbzAmknSfr dOXe+Pb+OGLL6sMbXq2+vNGJUk6xOZyxC2D6N6eV0/XyxvNtklzzhn5G0kzmxR+vE5OH ItGaNo9mvBQUHXNahThcmcqrXGsiVFmw8EDMc2i/Guvqvg4qMAQOwreRaYseVlcyEcAL jYpA== 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=YLdWPlJvL5kdzN20NeH795EO1wLm2tjo2zF8M6BgqIo=; b=KqJ0gGA9RGWLRdbFCeczS+z5YZljeNIlOrocxL5+gMZgahn4pK/GCi4/P/tIV+CjGo 3yaOvFMFv2ypCcf0AqmqfgRFbqP5iCoHEuOGAM9i79tENcUUas5Tort8kmLLt+/paOVR XXmENrBq0O9sQqZHuc6WLWQrFojFzr998OyMaSpAD8HvbGjTETIWnZZAnDuf8jdoe7eS h/qnzcj1i5hK4v0ns+UlMXy4WtNcQrYxa15KF7atJUMx8ixru42XD9HIfIHJI6vpZe0C aQk2stUCV7sXGrlbZ0IHxD9+/6ihbvM2tF0D1XEsJfy0Z8hlYiNyW+qk/BAyL85Zc7Vr /QRQ== X-Gm-Message-State: ANhLgQ3P9cQtEA2ypj0/DDDEsXyN2ziOkNuUoUBnaDRplBQMDoXGQw1S Rey4NLUXSTXW0MUcelK6KsbMmWtG0iPEFg== X-Received: by 2002:a0c:e644:: with SMTP id c4mr9845727qvn.170.1585251535680; Thu, 26 Mar 2020 12:38:55 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.38.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:38:55 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 59/74] microblaze: convert to cpu_interrupt_request Date: Thu, 26 Mar 2020 15:31:41 -0400 Message-Id: <20200326193156.4322-60-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::f41 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, "Emilio G. Cota" , 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 diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index a2c2f271df..71e3a51161 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 Mar 26 19:31:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 184901 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp464789ilr; Thu, 26 Mar 2020 12:58:47 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvdH1BDPlQByPGE656QQgYsN23zevM5BDgc9isH6q+PoBYgEzqKICnIhCF6yYkyVN2673on X-Received: by 2002:a37:bec5:: with SMTP id o188mr10332193qkf.165.1585252727106; Thu, 26 Mar 2020 12:58:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585252727; cv=none; d=google.com; s=arc-20160816; b=sZzktELoGoZPcd2+aB7kjREWqlXcrQnJHaai69s71YBEO5BP8OqMOsvAcRU9P4/0gC PuGEqpJf3bH/ZrIS5wplbEjWR2zB4O8wrFunnKbsOPDSs1k+vO0xgCcpTh8X2a4540n0 V/hB43eHMgka3DhIdr5Sy5PYX2ZPqZeghJ/6U3Xj+EiHpwavNNDfmWHR0H1gXIdMsjgY Ba+ovpsNQ+FSkBeKKowCaumV8FxQDzen4qx822kjNfyScExlvB25gIZpwFpK6rRWZZem 3xc3ueNRtX25Xc0yXCaALVABphJakaWB/7xHF6mQRoWd4ul1y9W7hRLQIfRZSIZyGwkC JZDA== 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=SMWSXLQojKe3xf38iwDswTcJa5hw68aVIzkImw5+21g=; b=Pm1ebkd1bpfLh0D07IJFeD+IC+XuPgbyFuxZgqLN+9CjTeVNZeQPmC2XtXofK1pClO 01AbcZ8yf0H09hM1KRGpQuakCx8cDy/gbeexusI7VB5dVELk8aFYF7w5k1hlM4Jj911T frIQPkkh5sgnaVwcLtkJM/ewyyIomF9OT8dET2OaU3hpSLTB6uSDA4o5UmQH+DFs/szs k+F9byu0HJNEZbc4vlhacAdeunzGMD15ajoPxmO5NJ/f71sGo90xRM996hC5FYhtdzLc KDQoLo4iOhyJ7BsRUD/yxXKibc1B1QrqD2RTK3uheeSnDMBkgN4b4zyVJCS0tErRnWO9 rw+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ulsJJuPn; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 k23si2130425qtu.184.2020.03.26.12.58.47 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 12:58: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=ulsJJuPn; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:59224 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYeM-0003a7-Ht for patch@linaro.org; Thu, 26 Mar 2020 15:58:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59279) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYLD-0008Dw-Va for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYLC-00027z-ME for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:59 -0400 Received: from mail-qv1-xf43.google.com ([2607:f8b0:4864:20::f43]:36389) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYLC-00027s-Hh for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:58 -0400 Received: by mail-qv1-xf43.google.com with SMTP id z13so3708528qvw.3 for ; Thu, 26 Mar 2020 12:38: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=SMWSXLQojKe3xf38iwDswTcJa5hw68aVIzkImw5+21g=; b=ulsJJuPn6vcdvI4qE+Zfqur8TMA1wlNwhVQWyZIf0qD8GhP0poGc5JyvXNdp79EYDF u/Fqr35IyCjhFjx0wHIZfneZ8q6oGpTLFes98DH7YGQpZQ/1sNskLgyhOcyQSAK9rr/6 zZ5KSNXA462wOfJIloRfXWIkShAJFo4eRnXkPcbkUCKUJ1bUiPTR3TmHfM+WCVb1k/OE dfZqU5AfCBSTrWF64eXVH4XP/NhyDjMV8VVRDHShGbhofeIz2EtHpTaKubdKe/hlQuNg xrhnZfFaql4ZT+7QvusuU3EqcyD20c59W815aM7pF+Tsy67r9VkA+z/JSyamWDzMMXNn m0fQ== 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=SMWSXLQojKe3xf38iwDswTcJa5hw68aVIzkImw5+21g=; b=fts/IqCsNtiPV6X4BTt1WAjRHpfz8EuJIUgNY1yQinLY+yV4YHeM+qtcaiGFuDYJyh MOl4wT4tk3WAw3dtcJDWYuFC4Hd79zwEzzvTumpggpLzv+TE1Tc0/FTXo7ho1KAyZ+gc UjomBQYY2F8Bl7vfa1yO4ga9GaNO/dsBRGyBhAc5HHA9RZSH65hvZKwV0UcOTga7/u6T rdf7tlpJq7UyoJCzghd9oalVQqh2118X30eHI+irMGivJ6yArPfmaAzuLk41VtE+xb8F Wq8SXbVP1I4O1En0xWTEYEjpn/Uk1/3K4baH7pXNZ89twIizT6Qc2Z747bI6LSl/LTLu dyog== X-Gm-Message-State: ANhLgQ21u/RgvXqg2IZ6ZYZ1AEABCZq4KYMGsHquoZ1pEsKLlt2a1tB4 d2OXjMVb0k8bnJeGe9hd30oX4htf53JyBQ== X-Received: by 2002:ad4:514d:: with SMTP id g13mr9632379qvq.229.1585251537028; Thu, 26 Mar 2020 12:38:57 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.38.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:38:56 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 60/74] accel/tcg: convert to cpu_interrupt_request Date: Thu, 26 Mar 2020 15:31:42 -0400 Message-Id: <20200326193156.4322-61-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::f43 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, "Emilio G. Cota" , 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 acfdcfdf59..79b01bf726 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 78914154bf..eeb9cd2cd7 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -2387,7 +2387,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 Mar 26 19:31: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: 184906 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp466959ilr; Thu, 26 Mar 2020 13:00:52 -0700 (PDT) X-Google-Smtp-Source: ADFU+vubzhCVDbpYy6P3Bs7apx9tkymf6IvSSwqlXWBhxmkU9L6DDmSQ1skdCHSDdg9zljN6BekP X-Received: by 2002:ac8:60a:: with SMTP id d10mr10648817qth.140.1585252846485; Thu, 26 Mar 2020 13:00:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585252846; cv=none; d=google.com; s=arc-20160816; b=ETvqeIaanc+Z69Exi0TSHQs6qQcTzJ2q7QUNw+2KA0H6i0v39V0Zoo7vaSR0mEk9K9 q58Qlg+U6gZtmVHODFCR5MVorXp8DHNy0ywrpxNE00UYZjw/ow8LE0+MtqgMOUKLALfI sCPpD9kSNMh8SKcwoW2g42oCfC6+j7dPHtOfL6ztzVtbCbT6dskKGksGtkq4IhAiH3mD J3Il9zOUgcVGcjkzTD/OwaK20y+qpkZG7I0VBPu4ynLBDjSPrTNUJZ4kILh3PcKaIeLS EmxI4Ki+N3nbCyE2M2Ax5SKOR1X93VshhI3YKGmsULP9Aj014IB0TF55d2N5ULjY3N8d 9OFw== 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=3+dDYhOsrCzCqoW7z+RZ/sAylJhW5dwNkVTgxwH+p1I=; b=tCVzFXJcPDirQmraXsu9QNyRRgeevWfLyaraLB4LOGQKK+A3kdKTidw8Pcokxidj5/ JteJ3ClikhJ8/fu+bwMSF+Wx+tMdfsrfa0/pqFM6e5ukqZ4Yurq13wrPdZYoo33LWDGC NOKiWIVKsLq853dan9K8+h7+WSASzmARFgcTLZlxKXbo/icjCNkur/i1BaEvhnDmdWkt uXU+jBqLcsWqrOuoUBakZMqbSWb+ZdFl8qbfqX/FR2M0bXKvA38RrsYOdaMk8X1/0Yjp rFIE+ckzS1FlspvS7RHzAeJhlIns8+VTwL2+yE/4uLhp3PN/vbetSrUu53lfCycxZwwR 1NwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=sghoYMdz; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 v2si1996606qvt.69.2020.03.26.13.00.46 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 13:00:46 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=sghoYMdz; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:59290 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYgH-0007ES-V4 for patch@linaro.org; Thu, 26 Mar 2020 16:00:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59292) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYLE-0008GQ-LI for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYLD-00028R-ME for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:00 -0400 Received: from mail-qt1-x842.google.com ([2607:f8b0:4864:20::842]:37734) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYLD-00028F-I0 for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:38:59 -0400 Received: by mail-qt1-x842.google.com with SMTP id z24so5299625qtu.4 for ; Thu, 26 Mar 2020 12:38: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=3+dDYhOsrCzCqoW7z+RZ/sAylJhW5dwNkVTgxwH+p1I=; b=sghoYMdz86LO2Hy5B+1LuEwfrk1FPwMEUvptutJ0pBrj6NvvBzHSdNdzbpmPCfh8hu F+so31ao33JJHSDk5CDHVxIgNJOnZkZomGuruWcbr5tY4DbcLqQEpQxQ9rDxMumrZC8V +yV3MKyM//dJkfwSG5a92TIi5yuoGra2kX6CS6+KgXg3gmmVMo+H8G8srYY7F7vyP4Qi YVbJXbRRFnNoYs63HRH8hY2p8n1Po7rDoigPj/sxQYOOT8D/s/9/alDRy6IyUJZfXLP6 zlejRs3ExCg/1DX0Axm3y0RTsFoKtUHAQwEZ64F0FXb/81IPhv35DfXnV4GTfsawaghp Jzgg== 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=3+dDYhOsrCzCqoW7z+RZ/sAylJhW5dwNkVTgxwH+p1I=; b=MahSj656nCNPERFbGsOHSSjgs4XswjE0U9id8u2bb24GmZdSJYU46tRggiMwuk+PbS U2e3SF3XsthTilTnBpCPed9LCj51RYYFpVuKLEdfzwd+S5T05+XYtXOpJmjGvF/NZDqT LPDzmbeu+AlK1hTF1SA53aB/V7pkcq0abnKV5LOZBF33c+3xOuKCEXJUjSZfR68pQ3BH fwvxcTcqm3Wau4bo0w+5Bz9UpB7fJN+iKAjVNR+7mTQZIZgiP5c3+VB7hkQjegbZoUtF BZfbi4z6P6/AA+6gafNyw74nKHsDkUXn7P+K1++jKJLqUvS87mzf/e6LY6R+C0Yp4JN9 JqAQ== X-Gm-Message-State: ANhLgQ2I+lio7VzKES6/kjQcJ2HaAqFq9hEny2Oreih2ga2d+OpZ1wgS WKrbZ1ZhBc/bSlMg7+E4uJqRuM22QABhlQ== X-Received: by 2002:ac8:369d:: with SMTP id a29mr10653729qtc.338.1585251538730; Thu, 26 Mar 2020 12:38:58 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.38.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:38:58 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 61/74] cpu: convert to interrupt_request Date: Thu, 26 Mar 2020 15:31:43 -0400 Message-Id: <20200326193156.4322-62-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::842 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, "Emilio G. Cota" , 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 01091d0623..16caa6c589 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 Mar 26 19:31: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: 184927 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp484249ilr; Thu, 26 Mar 2020 13:16:41 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsLPxkMCVEl1F4ogRABfWJPnt+lLEnQd7gcVQFYGawFXpHAOrpNvsh2ITilbCRG9QsLUJnG X-Received: by 2002:ad4:53a2:: with SMTP id j2mr10360143qvv.145.1585253801272; Thu, 26 Mar 2020 13:16:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585253801; cv=none; d=google.com; s=arc-20160816; b=cZI2ToONmnCA7R9TWzBQEDhBOM0i0fiRI8iHfiPhkLPDTAFAMoEqJ6oR6k4FMYa6KI jAbfflXwFAKYQMKEgwPr/xz39XPLlGMgnJmtAZGuRiAxbUsNfiFMQtRAis0Iq2vK7RzR kVAIcCxbJj04fzZeiw+dnaNgoDwQchCvwV7BMTowmCu+AORRG/qz2sUfdSw6M9m38/m0 KQxbmMYM3LJk9lXzapBqM1cMufLUNbA4dh4XRUsRygH7Duo0vPcyAAQ+mznkOrNR0iyG 5vPGn7tUt+zTkyfrra9SSwq74S9LUbGeg49U6FkbjjQb/6he7VGLZOEnxy/NZy+LPEW8 Ks7A== 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=gacJZESnVEqf4qDD4ve/Hru1eX3df4yi6C7OwVt2hqI=; b=PiO+zDWQpDJ448/lVzmWm0boMXeil259VnAUiL/e9Su2lHmDi8caMPL5SmPzNzEilg oDMBLst3heomYU14lqLs/g5rn8Jxdc62kUgU9ryEq6r0qKKB5ij+6fd3Axa+lkUYL15r zhwbuliYjctq+hO4d7FJg8c51xke6PIJBVJym+E1pF8Mt2AOJK7I99xN3wZR3VunpTao 6ilj5y0TOAxo8wJvyWvzEoyqszq0wK7NDaUelXdUKaFzBWDEnGmyBva4BZO4cnrKppui vkY26JRhvoem1fk6HKFdUtvmMzX9DgmDVISJWq/Bmkoqf90WEMRL9BlBcq4RysNygpl/ CGnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=kBNhzknP; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 n10si2036491qvx.203.2020.03.26.13.16.41 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 13:16: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=kBNhzknP; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:59704 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYvg-00078T-Rl for patch@linaro.org; Thu, 26 Mar 2020 16:16:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59316) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYLG-0008Nk-Ov for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYLF-00029Y-N9 for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:02 -0400 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]:45624) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYLF-00029N-IU for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:01 -0400 Received: by mail-qk1-x742.google.com with SMTP id c145so8140955qke.12 for ; Thu, 26 Mar 2020 12:39: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=gacJZESnVEqf4qDD4ve/Hru1eX3df4yi6C7OwVt2hqI=; b=kBNhzknPUnADBAOos+I/ZAk0539ZD0y9aBnUxRzQUffxPzh1aBireyAk8kPHdMh7Ri yVcUqo21xbeFGC5d+cYmaBTT8jTpuPp582/61fTXXDGzFzulcVAaBlERRbMNNqRAfNMA JtN2B144yFlBo6rHmsDd0ml20GVV1KdzKSHpTCBGSBidZV3uUQM7sdYsB6V+JW1lyYUP qjTofPY0hD8KEKYbU4f9JrxeGV/dcDYfvV+7tmtpq64uKqhvQWLCtFJSeQW9khciCqm9 W97sY8GbtbbONZHuPNTzvvbBGzifigWhXBX6ov5lqNB51KxO/i/FKNbBh110oS/7U0ca ozXQ== 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=gacJZESnVEqf4qDD4ve/Hru1eX3df4yi6C7OwVt2hqI=; b=k2y91F5bL8C3HckzHNXHAz1bhdcTf/i50c+3aCbXSmngDtUM7/MJXxzlzTVnIQ1yQq uZ5CSzzGQXNBBif81XwzKUNkotlq1LAPLOx+BXeRfUxe5LkoVPCtLQvfyIoahCdjGGj1 Fq04phRiQDlAtgRwjYk5dl5xauKLeYQ/J3O6F2hppOiDs6rm0u7xT9e/LLM9JuvvrneB RP3asucs3W82/2brEXuLdxvlfl7Tv2kHRaq0YuPXnjgjLCS7dpwsf+BzRpG4nNtWwOce +lHgX0azSqA46STiGrhDUsgO3sPnPdkmHjCcHhqithXmgx4f3RHiNf5IPxHEXzZbcU90 UmYg== X-Gm-Message-State: ANhLgQ1CA5+jkjJYKaQw/AiWTWvz+HmIyvv/uzdv386GgdSAKbd/uJ23 zrZ/YhabjuNSaDKg1x43QtCsp2NCBWcY/Q== X-Received: by 2002:a37:453:: with SMTP id 80mr10007108qke.325.1585251540096; Thu, 26 Mar 2020 12:39:00 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.38.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:38:59 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 62/74] cpu: call .cpu_has_work with the CPU lock held Date: Thu, 26 Mar 2020 15:31:44 -0400 Message-Id: <20200326193156.4322-63-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::742 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, "Emilio G. Cota" , 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 1c3701b142..a01c258320 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 Mar 26 19:31: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: 184919 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp477834ilr; Thu, 26 Mar 2020 13:10:24 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtIuGlnSbcYWVivdGCviZDjsNeGiiExXrhj4qzjXnZNAbyCA011I+OCaEtieSeM4tyDSfbY X-Received: by 2002:ac8:d8e:: with SMTP id s14mr10478226qti.204.1585253424204; Thu, 26 Mar 2020 13:10:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585253424; cv=none; d=google.com; s=arc-20160816; b=q6BSB500Ll9HnEyNy6HFst8/iHMvgoAGR4okTYnCkpTM2sk6Do3prKPzlXFjV9Jg78 vjcP3yhJJsNLxrWiYLGmQELJyXidPIzF+0MRMmN8D95A+95rP0D7x5em6tItbHZAQeYQ A25JnHYWLTM61Wn9pQBgs4zyEQd7BFRFsRt1rVBxNMKLydmTlN2FER7FlzMc1CIWdHH4 XQqaIRQqtuFWCde1IUlBF3RE7Rg+a4XxNgw0R9gZUyOONP8qlQYu3wKcY1NGL3prpFgd 7P8Zx/mRTFjOUYH6CAOOsjK9rzCyx2B++jk3Z5j3SUCEKOOkY72x3bPoSDdFOJiIQDhJ ytsw== 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=+znDl+e4Ijoaeb8N9+twYWXre7kV5d4tOF3Cbrdh+d8=; b=AESqyRu7PxaBdZwXAx7b/6D6s3FXtjIzYbrUKotiE7b7h8BF+TpP8FcKP+/o7hwB6r oAU/9XxuylJ+UVVClvztydmsclLr8ltZeksB0GwUmiQGmO5UPYD9IspG17WBDKwCZiAr IpgA3JkHR+4UWKwD2ktRAVEQ6hMu8ZZvqyXHRymY+UkvvJNPN0QBhdo39CKCHscokDlq i8LyXK0dzo/3L25+acS/FCi7OK0uFz0I68bW3OSXcIicK7Z1U+ki5bijibTEB27DmlpB u+7zqlchJrVISc9UnVhGIUFiIQ/ctStHirbaEm5fvCr7r/s22ZmCLUKqMyxmu/lNyprZ sSAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=XessdbHN; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 h7si2047187qvr.215.2020.03.26.13.10.24 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 13:10:24 -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=XessdbHN; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:59536 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYpb-0005ee-Kd for patch@linaro.org; Thu, 26 Mar 2020 16:10:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59327) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYLH-0008QO-Hp for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYLG-00029u-Ca for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:03 -0400 Received: from mail-qk1-x744.google.com ([2607:f8b0:4864:20::744]:36794) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYLG-00029m-8O for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:02 -0400 Received: by mail-qk1-x744.google.com with SMTP id d11so8195804qko.3 for ; Thu, 26 Mar 2020 12:39: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=+znDl+e4Ijoaeb8N9+twYWXre7kV5d4tOF3Cbrdh+d8=; b=XessdbHNqdlhsujH92G+AZWufPiC7tjIBNftkvgrRo7HOs/3MnrAxHpphSF7QCxp9J WeK4GS9m0Z1Opphaqsz9WpCnzM73wXaUv2nMA59mOqZiETEiLbPD7mhZrD2o4cf9ASj0 ayrGBtZHCDFaseT85qs3x5+wziNDsPA+zj/T1ruCGwnApwmoH70VynsRQCmbea6uoiyD tvbkbfxMufeZFPs1uctOfY4CGf5EdXmlLRVzyKTwqJNNiz2DOKIJad54PeNUDgyFsgZG 8x9AM5IBAHYuqGJyPRTlyuxRyMxotVtWvnTmo4gs3KdhxnV9Eje2qPrV5Q6dp4o4qThV N3GA== 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=+znDl+e4Ijoaeb8N9+twYWXre7kV5d4tOF3Cbrdh+d8=; b=M5ZIHyGxoaxpHWw6Cj26XmxdyALa5ouf755d+00At0k6IfckuBPJ7qQynIVm6wA3fd YPbSCXygiDK2MgDiNVYmcWnpA9lpOja6mm8p54OBfVsQoTR2S+g96Wmy7ONu4HI53Win hYf9uOv5dxUdlaafUukZNYsPvlXHkq1ab9GZqZ1aKIyCNRlXiMvgGaBibzKIHQaXyvhf 4y0jiYeqWKeCQBD6xTjUAR7issjCnyo1PFtvUG2KkZXCAjgh5Jgmp3q1ihNyiZdSXdJY /nlniUfFDHW6hnBlcsok9GLA+G03f6hqatE7Fm+PBkHpvipORCEedq6JJgNb0jn29MtA IrSw== X-Gm-Message-State: ANhLgQ077cj2aRlyKl9cgvMyr33tjA33r4onvdjLzOBkq4psYU2tb+Hj T7+yxf6YhaPfIGEqi8WON1CFtdrggYbPdA== X-Received: by 2002:a37:2d83:: with SMTP id t125mr10373982qkh.359.1585251541396; Thu, 26 Mar 2020 12:39:01 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.39.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:39:00 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 63/74] cpu: introduce cpu_has_work_with_iothread_lock Date: Thu, 26 Mar 2020 15:31:45 -0400 Message-Id: <20200326193156.4322-64-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::744 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, "Emilio G. Cota" , 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 a01c258320..e3527b6194 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 Mar 26 19:31:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 184889 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp459961ilr; Thu, 26 Mar 2020 12:53:13 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvEd6td+0ncwkwcpTD/mzM/OMZVZU8bVwKD3rxfjH7NUYVZKd6z4qI++j5n8aKqma/o4v3X X-Received: by 2002:a0c:fd85:: with SMTP id p5mr10228997qvr.205.1585252393507; Thu, 26 Mar 2020 12:53:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585252393; cv=none; d=google.com; s=arc-20160816; b=SOd15dXhjN+IT/Rg+LVg7iD6LRX2LGKYIHOa2OT2JVUA4L4byVOZVtImgYkiW9lBG2 S9tSJW0zpNL8qBQ1haO7b1zWgwaBPBvO66PIcMDA2ozDHXpl/B9iAFQGycTurVJtW/po WcOmtBwLIGwJLxBM3EugR2EMh98gT0COHusiIZdf9Z0Zocnjj+GGuQ5gOY+p951C0Bkr X5tTaqO7iXas1oQdD+hsdv+xlHx0g3E5/D/S9yqBwLz2Cz1oD9JlB21EDKnnnlZBb82Z 9ru4onyzk6lJnZi6YBK9iFkhl3MDxmTh1Fm+r8JopSXsD+qSn3Si9qDIYsaq9mbX1Ca4 4fyQ== 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=HScEdvyaqOMlz3W5Sxuj05ntc9QJp9qM3msK7XO5ViU=; b=dSgoBhcfMjvNSGiDU7Kt8tlJhKAyc/fKUK4m1As0LQ9/VTVGk8d1I6Z1RYqGdmihsl 0Z17bbW1p3zNu3SvOQdL7RAZC6d65L3CF/sJq3pJDInRmkEV1HCl4jf0u8gQ5Px33L5i czCJkTTmq6t+yUo5elp6zMtlyS3EmVaOkvgx/xc/xUqqqDnZQEV2j7Ln1MRg6t4OOe/M gZKxNGmozubwpvl4F5qAi8DoD1jiz050I2Mw/aAcNsvU11N6aAWJZBOxJYcszmPqp0VV 21doba+CXAvReqvgo4vCO8IxF+orCY0GyZz7JXzoTE4+Xk3yCApmCNhghCqD7Wh7jURb lvDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=tT9Iurc6; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 p24si2126019qtf.284.2020.03.26.12.53.13 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 12:53: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=tT9Iurc6; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:59048 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYYz-0000mS-1s for patch@linaro.org; Thu, 26 Mar 2020 15:53:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59348) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYLI-0008Uz-VI for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYLH-0002Ab-KC for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:04 -0400 Received: from mail-qv1-xf44.google.com ([2607:f8b0:4864:20::f44]:46580) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYLH-0002AP-Gs for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:03 -0400 Received: by mail-qv1-xf44.google.com with SMTP id m2so3682267qvu.13 for ; Thu, 26 Mar 2020 12:39: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; bh=HScEdvyaqOMlz3W5Sxuj05ntc9QJp9qM3msK7XO5ViU=; b=tT9Iurc6SRrAVnIgemYUSoHwr/iyv2afD6vevGqZDIgJb1C/kERNlaAAI7mYFvv9vX ro8H5JOy6DS3hWaj1crlOEbfeo8IghrkMpJ/GiK2AdPDBSNaw/eDxuHMZSJ1WAb9oPco GfmIHQSFQtXDaDQEJuzkbUFaPKhtOPks27/X7R4OdczDL6pzCCNR8q3Ps9KuIKE5d4FH 1y7BY8OUHYzuyZCMnx0UTFTcxdNpHlLy0MO+bgiil/cdLzDBxknwhPtuL+BQTTFZEYPV va0CnMHscplXU1KRKU5J5nKrCgwlThikQ0tAWAJYNayuiqYzU0l3ArI0fRbmVddPqb4X gOmg== 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=HScEdvyaqOMlz3W5Sxuj05ntc9QJp9qM3msK7XO5ViU=; b=gsNKF4uKBZoiKKeeztbDXTpfruoD3yB7jpf09lLzubN7AtaZh2bV0ZWCiePEUeIPgJ 8NGCKAMco1B5JZFGBU351CPyjhl5I5KqH1+4j3etPX+KsH+ywWC0yqfPIV95Md1e27ZK dLfbVEeeh5i+WgUGNd/Lil7mpZCYtr9Uz9tEmGvLW0tLD/kZtAFvgYapWd0+edtiQg6l Q4dZBMBkutlxzbXOPq/htc9W3+HrHzN4xAtIy+vNXhCUuy8HDUirD9S2h0pqkS9/oTjj 0jS/am4BxL6OuTW5cjB32aLJYgmi27HgRixoBGf2v1uCs3fI28YPFTx2f5aopsdqMtAW cfaA== X-Gm-Message-State: ANhLgQ2XPwS/ZqumIFJ4Pjs7FAYjaH4XWJSVuqNHhVe1KkBJS4hZZrV8 h+0jE9aw58y0/sUy2OUj4i1HaBFNGjEa9A== X-Received: by 2002:a0c:9aee:: with SMTP id k46mr9529022qvf.7.1585251542709; Thu, 26 Mar 2020 12:39:02 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.39.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:39:02 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 64/74] ppc: convert to cpu_has_work_with_iothread_lock Date: Thu, 26 Mar 2020 15:31:46 -0400 Message-Id: <20200326193156.4322-65-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::f44 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, "Emilio G. Cota" , qemu-ppc@nongnu.org, peter.puhov@linaro.org, alex.bennee@linaro.org, David Gibson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Soon we will call cpu_has_work without the BQL. Cc: David Gibson 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 8d2e668ac5..48094f3a24 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 | @@ -10660,6 +10667,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); } @@ -10884,7 +10893,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 Mar 26 19:31: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: 184928 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp485957ilr; Thu, 26 Mar 2020 13:18:20 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuno/wIT42km0vewD1lqhSAsezaJr62AX1ncY6gDoKgNZZSJF9iEE5ESQUFN3vQO4UyNE9G X-Received: by 2002:ad4:4851:: with SMTP id t17mr10571015qvy.33.1585253900250; Thu, 26 Mar 2020 13:18:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585253900; cv=none; d=google.com; s=arc-20160816; b=CfJ9bIGJ/3rAdmR9QKvVEC1IG9S1NZ/Pww+y0F2J8kEPdZtj8GToK0zmapiYEErw/v vG8A/QfSHNfHtBPGHKbmuoO6gZEVY9axT+ENir7OajXK5bmqTRfbFAqCoVSa0Vhfr/ex qC0CdVQzzIHWLyH2HdW75U6UaMHCCCF0LZckn8KyK9O+L/gQKGZ7g5Y0i4+sgIW5xPwG w9nFn5p3K0yttO0tT+q9aVUUeQNk0Pq6xY3MPFbF9adk88Cgi81vEQcWYBAmZDlC+GPw vDIjm6RtWW22/mIF59HBF+V9EnPlmxC/waMZggjNd2nbf/BEADjVnHZuKZmMQZ9rZBWd 7+lg== 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=A8LYPCanbCxxMmUeqKU1uswwKowzVHfpeAv0vQyNdnertjfjhmYNjm57avTkuKnZUk KhZtFvCHAunKUTJ9JyzQ0oKHwfNNK/AOgqyQ6N5trDCO/Kue7kv0e4R1dFdT1wUZnq4o Kxyiu9U7SIeJ6q1f7cVxTXTNYQhRe0N/246k6Vi2Fy23QQDGatJedgpBje8FOOrF0PNj SlTwfcYSyjWDAE3P1HQx7bwSvkYQR/4CremNc9kH4xPLhMVEIbk5UK8tnXudZCWhkJF8 n7hCN0xRDIcTue0y5a+Xhk8xY34TsmCWSVENMigraFtuwExorEM5WX2q8r17M5pUV2dJ vE7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=VYNqj7Ca; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 n29si2172128qtc.55.2020.03.26.13.18.20 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 13:18: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=VYNqj7Ca; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:59734 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYxH-0000cS-Nl for patch@linaro.org; Thu, 26 Mar 2020 16:18:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59364) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYLK-00006u-7u for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYLJ-0002BU-46 for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:06 -0400 Received: from mail-qv1-xf41.google.com ([2607:f8b0:4864:20::f41]:46578) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYLI-0002BD-W7 for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:05 -0400 Received: by mail-qv1-xf41.google.com with SMTP id m2so3682300qvu.13 for ; Thu, 26 Mar 2020 12:39:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Gn2vKDOISxQzKy44RYpzzeOAg/5NGEBTOA6wtcYZvN4=; b=VYNqj7Ca7sixDpGYMj4s0ON0k8TeueL7Ixj2iEQ5qaZdmqJ+aOnfDnSEXScM3dJGln N4cETPw6lGQipk04Hc3L8kj1AFo7mum7mPgSCY1hRBcRZB+dCJ4BdTOxlTXKLDWpg3yt FVyDvd8ZG/da1SsKUXltGn5RP9souo3aLH2dx72JTv7OTNtiRySPBrAigFB9krs0AFg6 cvIv7lMiKw3XRsnEdfRk3jN1JPN9Ho+kT+Nh/go4o18GOQOCD1UIArfFbSkAOH+6WrN/ weDynpi6C9WE12GyOJlN5CKfHUrxd9qd9ISngvrjC6Qr1XEGnY9lqmI6ZJFH/pMwaAnh 11YQ== 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=kkhFYrnP+OEixOcxcfsftS5M39HSYwVWdd6R7pUVgemxeF+lgkpYGkBYEaCTY0HbMN q9h4A+bx+r43SEzSICB0Cri3k6ZW5dy+tZEOFJSVdExiKdvgT4ixzzTUDUTw9yI8SCYN QJNxujAPtrB4WVaOtzXICO8pTJsgMf+RRZXX/BQDfIIvc1NSWD380szPD/ptPhxJ/p2q 79VrP1Qn5sOn+g42tc9MYv3UR/kvX1LNdHprYC4EQlM2uwksEMnKmbsL/e9x5kBTMDRu 1wfqntpEpkjd+4cHSFhGP5EMIl82bYEOvlmu8sZqp/V1YOn8PuptyzptuvvPeUCq2opt WzLw== X-Gm-Message-State: ANhLgQ21X3Y266uIBiSIcl4KxFiBu5dKjUifJ240vr7tMv8hhsCzyYQA 92VBr+2vxFaROvMZ1Ljh97+4tAMCnilJbw== X-Received: by 2002:a0c:e886:: with SMTP id b6mr10019948qvo.31.1585251543992; Thu, 26 Mar 2020 12:39:03 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.39.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:39:03 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 65/74] mips: convert to cpu_has_work_with_iothread_lock Date: Thu, 26 Mar 2020 15:31:47 -0400 Message-Id: <20200326193156.4322-66-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::f41 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 , "Emilio G. Cota" , 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 Mar 26 19:31: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: 184921 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp479144ilr; Thu, 26 Mar 2020 13:11:39 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvq25VQFAWk/ZGjAtQ+vCZ50G6TYSfOszI19y7dgMzRPZ/aIyvIchRNEhFoL+7+QDigelxq X-Received: by 2002:ae9:e892:: with SMTP id a140mr10073817qkg.274.1585253499826; Thu, 26 Mar 2020 13:11:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585253499; cv=none; d=google.com; s=arc-20160816; b=1DtNjccf5DO2RzIGNhR0NZTZc+Va7cAmPfj+sV6DJk9atFPDOmBnrK/W3s+JbTl5VO 5GxE5rPHKSr3VCdUix5BupmdyigHp2NxfOqPMbe6gT4tWVuemcyu/unCiiCwG3SUc7RQ QmdVg4M4vW6HpNOQLETBlDSlWQUnAnFtbIfgDPUERBmHQB5kfxrq0RGYVn3GlsYFzFlf /CBSbJ20kp0w4QrUnt3C4wqBlgBNfgLkfzdJLoD6WovcE84+KtmW316JJBwxNT8mlTlz l0gVVvx4wsjGs61d1T0kNiaMKoAHOFkT4PVEsyWxAxEN3gMWiWRrw1G9+ce8yLsYTtmh aPcQ== 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=1Q+PIOyWcMQmBhTsnZIFuAor/C++2Bjd3Zt2sBVNt6Q=; b=ktiwwekHEtyYpvLTVDUuLrN+s22sM/Mdk+QqNI7WqtmUPVKx7aZm+f/QyLJRD80DJj qpH/CWbh6ncEPaoBc8KFpKejYPZrplZoGTtnl38h87OCEimXepmbttvOwOy/RmouWfEZ msjhP8sJwLdWyqbSJMIznyNFbyB8otf7ZFN+jUdHZq0WfECmfqKZJ0TSInKdUKTo0has KYmLdTsaDruiQNC3UgSKgkDYReAU8iVSo2gxkPDbXHk8e976E4RJZ7rKY5v/w/zVizow dSYo5Y6D9mb7tl6DAqISGNdOfgUUim8Blmbvr1tULtqM0uuRlayHYnOJ73gN+qQUd+SP jYWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=GDuC+tXa; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 a14si2165258qtc.229.2020.03.26.13.11.39 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 13:11: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=GDuC+tXa; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:59574 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYqp-0007c0-9U for patch@linaro.org; Thu, 26 Mar 2020 16:11:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59384) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYLL-0000CC-LZ for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYLK-0002CL-Iu for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:07 -0400 Received: from mail-qv1-xf44.google.com ([2607:f8b0:4864:20::f44]:32895) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYLK-0002C3-Fe for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:06 -0400 Received: by mail-qv1-xf44.google.com with SMTP id p19so3718437qve.0 for ; Thu, 26 Mar 2020 12:39: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; bh=1Q+PIOyWcMQmBhTsnZIFuAor/C++2Bjd3Zt2sBVNt6Q=; b=GDuC+tXaw6A9r5ShqlJOFuGTnKALBxlZi4EPhvU+jINj1KY2Kn2q0GMh6ZFzqDiKDu V2C6wh09IJFk/EWAGI6wkwOjK4WWQMV7Ga+7dK5Meg7hOKq1GXcVngkSMxhh9/MTyzI6 hVvtpzFAcunVYdVxHb20avbHlsgr+9QTK74YVzZQ0Jq22AMqbqclJRWdkB6qGleJb20C EMEuAN+QxHoMjPxH/gs1S2D6iNjf3fRHWCM79PdT8+12rrOfWIG0dJcseEPIua113pJd mpSCPhal1Vbfi3PDvaD/gVOgDD9ib1YXCvXGm5EZjNPKhi4BmaJ6sL37oo+Pzw8ZvSMs K0Hg== 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=1Q+PIOyWcMQmBhTsnZIFuAor/C++2Bjd3Zt2sBVNt6Q=; b=iBX9lny4OdenNdF3TkUYeeKJxL63nuah4HcSf4x6pHsjhHiWOkNg2Apb9y/n7bC3X2 yrOUyGLy08gfR/Io0VTiKczQ5GN/fmWesIZPw3H8lPqL5oKBn3XE6ECTB4507gZ2pRYY VeVXbym09htVXJ2hd3h4ej92piMo80nAOg+2WKvpT2a6NFlsSPZhQvm3DM4SxeS3DRIp 0Y0EFuyvfbt1jM7fWk6FsZxx7RkJqV55M2k6VT7zPyKpeRtqsZqOhqiuJzJR8uNBq38E yto0ZnjaUv4vPIHUuvxU0unapmPghTpi94Xy+q/hio9YKpHmuXVbLUHYi1S8vOpO1/vb Dfzg== X-Gm-Message-State: ANhLgQ0m8nCbouqE5PjYpcYZYHfpMjrE6JkZ0AsciiytqKcLk5maDIb3 ElZ50Fm1loogspMkNDGkHchk50pQu6nBsA== X-Received: by 2002:ad4:53a2:: with SMTP id j2mr10105749qvv.145.1585251545718; Thu, 26 Mar 2020 12:39:05 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.39.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:39:05 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 66/74] s390x: convert to cpu_has_work_with_iothread_lock Date: Thu, 26 Mar 2020 15:31:48 -0400 Message-Id: <20200326193156.4322-67-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::f44 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 , Cornelia Huck , richard.henderson@linaro.org, qemu-s390x@nongnu.org, "Emilio G. Cota" , 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: Cornelia Huck 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 f1f206c763..04fd87026d 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -58,6 +58,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) { @@ -482,7 +484,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 Mar 26 19:31:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 184923 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp480788ilr; Thu, 26 Mar 2020 13:13:16 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuNvle7BPY5oGfQKZR7pkqKQYoVnuUo0PM4cSn5HVjIuajaj64gyeO705nboteEpm2moQ17 X-Received: by 2002:a0c:b757:: with SMTP id q23mr10302043qve.213.1585253596193; Thu, 26 Mar 2020 13:13:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585253596; cv=none; d=google.com; s=arc-20160816; b=zH0lvcXz6vttFIqvATjaxh6AecSMxEuqFl1StC6fMQQrOsZlBXtDt6sx5Pu0hz5htJ 3U0am21huepTdcY/xOkuYZ5FjeaOroIIbq5Kb/TA2d4vosMWVND61qWAi6ZRUJL7SX6s SDuU3+zqvwN9hfT3B/wBTFE8rddMKYxAMEzt55emIGRJ6FuE1fO4fQzBoHXuZ9GB1b3R Lh11AoLKlQi0Trj9K0LyQLL7HIZCWO65glgzuOzLN5iXEDnw6JiQJ/gOTHk6WYRig/oN BjUfEBK4rzvCSI/O7H0SfgKLbBujl2eS0KCp1nx7XKXlPSMftpPCHSOSW/+l3vrPIgrE Lx3g== 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=eeSLak8+K7WugRHnssmk7+JwZVy31ZcBf2Dmq4ryGYA=; b=OY5KHssH0pjKEzieNgpuA7tqcjR/2flmFgsxRuu+gAf7gvb+1a2UMa3cAN56EbhWkg 84L87zgUA3Fb8UJB84EMw+YDsQ9/IwjN41ovgPztjjKMydWtKzoo/ImXDQrBji15PmKU lCRaNCasPJ/xjDpvd/NUStwwxVMtHhta9WfRljuC7D51OpsYh1pnEpjszMn6YirCNP+H 1O27QsSkFoyyPPc2typxc6mKoHTZqQjvfFWD9AUC0SA/TAwjYPeCWrvyRuCG3U0goUCD tUw1i+yZ50B5TcXxCd81IoqiV7EayN0MaHJZMc9/kFOXO26LD5gVCk4j0Kg2U/Fanchf /SYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=IQCr56Tp; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 g11si777672qvw.179.2020.03.26.13.13.16 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 13:13: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=IQCr56Tp; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:59606 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYsN-0001g4-OJ for patch@linaro.org; Thu, 26 Mar 2020 16:13:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59400) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYLN-0000H7-6D for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYLM-0002D0-0p for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:09 -0400 Received: from mail-qv1-xf41.google.com ([2607:f8b0:4864:20::f41]:40828) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYLL-0002Cq-Sg for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:07 -0400 Received: by mail-qv1-xf41.google.com with SMTP id cy12so3696541qvb.7 for ; Thu, 26 Mar 2020 12:39:07 -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=eeSLak8+K7WugRHnssmk7+JwZVy31ZcBf2Dmq4ryGYA=; b=IQCr56TpmVCBKEnOe0s36sZGQuJYgCJw5F4xi+RQQAzQ+IZx0OdCfZkFaSJLP+ktv5 paGiFf+cOLUK4GiecYBIKNiKo+ZmfYzmRhThgZ5EwY1SKwA8WsqsRzFlb5iXxXDATam9 hE9yHABChK1IAiJ0DnO3j3xPBHh6fTJeYm5HUco2Rs9I5kEqgOJXit9/EPe5jZGF9DG3 DnsmVA1Bs0bFKLzxHNFDqXFpFlbA80wANd0c/pIxYoDOiofANASYdcsSAash2zrVT9/J PYYkjGKpNNxPbETvOnKH6DH5a0zjeoSuGm7mSXnPkuC33i6nF1Vv+v7EouP1gln/RqEF J11g== 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=eeSLak8+K7WugRHnssmk7+JwZVy31ZcBf2Dmq4ryGYA=; b=jbu6s7fzFiY8V7Vt6ODZe/jJG+oq2Kpt6SsfcHeY9sZXXxh+d9EVWQrkQ30Z/XmC1s 39dsdItaANFsm7k2LjsMA7jbp/uyJ/fxOLwRXW9ojq1zxAtLkr2Kp6dP4s0peYrA0GNe 1mdx5RV+gvdCRYly8wWo6xHV1RjHi3q/e+eqMh7y8L6vFgrgNI/dq8iZiyIp0m3VxGzx gxAW1R7NtPq+Mqy2F4RTRH1PTNMJPT8nSFocqO2B8jL4k3Rf96rS9a/zp/QBqPyK4m5F ibuVaHMaKGorABmVO9fuwX0HSkOgfIfemEm7/FH+cSLU2OSgg7bHe99FdM7eij5BJThs v4Lg== X-Gm-Message-State: ANhLgQ2a9YcEgnnH3Y7yEuE2gWGF8/nsUN116YcLdEa3Yq0MngG6R436 xmn0G56KlLgeSx1MIooThnlZkxLhubjIzw== X-Received: by 2002:ad4:45e9:: with SMTP id q9mr10083008qvu.199.1585251547072; Thu, 26 Mar 2020 12:39:07 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.39.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:39:06 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 67/74] riscv: convert to cpu_has_work_with_iothread_lock Date: Thu, 26 Mar 2020 15:31:49 -0400 Message-Id: <20200326193156.4322-68-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::f41 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, "Emilio G. Cota" , Palmer Dabbelt , peter.puhov@linaro.org, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Soon we will call cpu_has_work without the BQL. Cc: Palmer Dabbelt 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 4e578239d3..ebc2483bec 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -314,6 +314,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 @@ -515,7 +518,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 Mar 26 19:31:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 184893 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp461278ilr; Thu, 26 Mar 2020 12:54:47 -0700 (PDT) X-Google-Smtp-Source: ADFU+vs45mK905SkeVJw/KKBFOESOKo6ABn94n+eL6cIteHGryzuwASU5EKp8G4G2lgPzPw9jY3A X-Received: by 2002:ad4:4026:: with SMTP id q6mr10247860qvp.118.1585252487367; Thu, 26 Mar 2020 12:54:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585252487; cv=none; d=google.com; s=arc-20160816; b=GP0pXMxrWCkXybzOknoI/ogtC/sdXqiCw8znuPZjX/jFhELCAWYNc47+RIBfzZfClE Y0sub/DN9MUXZFQ1w8IJn3pCbdF1Eioj4y/JDGboS5/m7DoeJ8kkCAyZRsZXB8yADirM wvKvkdmoN0x1DQs46oSEtShiUw/p4951UUQwDfgElKzEnUBLO/qgLVy7rAUTlE6SyVKm TnaHJhSpyfsLDXM1RiugRvi3sEWIul7CKEjy9Zxpps1gL80YDIEBJAbN8fu9id55zU95 Dpaq2RbL5+/vdouB6r9ca3f5P8oHIDJ101dNaS9w0X9VNmMyPGC0Uh6D0z07Bl3EWW54 XgNw== 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=7dmbLyNmu9xq/SS96IeSzmgYogYuU9/UQWY9uoxtTSw=; b=jLhta1/R4swMSKJEFFBw6suklUM5w9b9y0KdsHLEEAnnGp5USs6qmTvplfcfwE4ghO atHEVhHDIy2IY3Jtk2XEVPCw2s7BEPECCTe4fDySf9LeLaLj12Qczl0f1/F5iVQ7q5eJ 65+S2v0QLQ2aP4dH7HSd3KnuRWcBW+CGWHdibph/CkFjKDGtZbeQjYAzktuYCckPD2yE s9b8dKcLV+xauVLWtFeAh0SPMp196GlnEidjEcA4WZaG09vq3WdO5yiwLANgB+LeClER fRvGvzZLPwWwebN7o7gfmnWwFHIwBWvBaMuOnRbpXm26fnClY7zycDkMAx51q0YDzt5y R7sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=nwEmC8r1; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 d17si2252584qvf.17.2020.03.26.12.54.47 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 12: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=nwEmC8r1; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:59106 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYaU-0004Es-UJ for patch@linaro.org; Thu, 26 Mar 2020 15:54:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59412) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYLO-0000L9-GC for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYLN-0002De-D7 for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:10 -0400 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]:43647) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYLN-0002DQ-8Z for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:09 -0400 Received: by mail-qt1-x844.google.com with SMTP id a5so6517423qtw.10 for ; Thu, 26 Mar 2020 12:39: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; bh=7dmbLyNmu9xq/SS96IeSzmgYogYuU9/UQWY9uoxtTSw=; b=nwEmC8r1Q+H6ijAsH9azvUMQFXdGB9y+kaG9fViFM7Kw0cE4tBkXURke/F/PCMl3TU N+AeeIcf+lEIMNKH054vuk+n2lLKBbWc7fL2oGG0hfORkkes3aBNADGAYlOgGIyuTRu4 AVGoaMUwOlFJAbK2EXNRf1BD3ItJ5LTzVr3Gf+Jq8ctcMxX6aBpT8HKM6lWGzCvf06W5 n6jkH3bXNHi1iQs9Oav9a73OP8tEZKNkJQJJY+rOnnWcQlMs/OyeIoxlGU3XNcq1envN nLrxEJldBvEsLa6IWa4MI8z61DirJtu+LJEs6/a7kXJiJTcX8rs7SlpVPTkOtTHeM4De J/5A== 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=7dmbLyNmu9xq/SS96IeSzmgYogYuU9/UQWY9uoxtTSw=; b=GH10P+EjgbxOrWXSB61o2C3O8zvmzCiANPDV4hcvugamhRrbozdjAhUJdiTqeC5H1A 1Q1i9KFT+F26ha8mq45Z3ntqO8sgLY/1S3avOxEgQuy0w7RERQfJUE/V7H8bDK9BnqGO 9xbtsnWO9VMPrLK13hcPmQAyswC4+5LO87UUmZSUJE/VPhx96YD+AU4oO+VkFkYmTSOc oAKieGkoRZ/FMyBshYcgrLuxCx3kbR6ZxyV5bUfMEtySS2HMPajjwe+HKlSwYIpj30h2 gCuyVe7ubQ6YJqCv7If4e2jD/Hu6BVstexAd7o+EmLgvCbdBImH7a5Rzfqga0r0D/fDj wmVw== X-Gm-Message-State: ANhLgQ0lSQLkK+JQxESsinF1YkFn0Esi08bfO4U8Lm2n0ps/JRioPWMA WdHPL5wg9t3UU6cgpgi7fDdL5XYtC4Z39g== X-Received: by 2002:ac8:18fb:: with SMTP id o56mr9704015qtk.97.1585251548468; Thu, 26 Mar 2020 12:39:08 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.39.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:39:07 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 68/74] sparc: convert to cpu_has_work_with_iothread_lock Date: Thu, 26 Mar 2020 15:31:50 -0400 Message-Id: <20200326193156.4322-69-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::844 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robert.foley@linaro.org, Mark Cave-Ayland , richard.henderson@linaro.org, "Emilio G. Cota" , 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: Mark Cave-Ayland 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 Mar 26 19:31:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 184898 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp464143ilr; Thu, 26 Mar 2020 12:57:59 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvgfSwhMYTZD5ksKRCbux9pOdWJKEt9oqBEW/bx4DG7lCXB2arT6RhZaO7CNaDDVb2vUFdK X-Received: by 2002:a37:4284:: with SMTP id p126mr9882774qka.316.1585252679559; Thu, 26 Mar 2020 12:57:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585252679; cv=none; d=google.com; s=arc-20160816; b=py/18DXcLrkj6eKXDOBuAMqD/yUo7nmC8HjFYfI5a27ve53NLhnHzVeXiafMPgqSUz EYyZ47eDOMmApzqhaYNz6wFhFtq5YFXstK4FVorTnjSNGdwlQp804ODm0NZGwiVWUpr1 sQhHEZVIFZnX2BibJvtAh9qHX8TnAj/6QchDPKbK3PXzwvzxqS1XjV8v/l11t0fZIR3O 3r7lkohgLmzWZEDC5UWO/+UGsMV4x5LdB1JygSsj7abSpgCgsUZ5rmOoyFf1rM28x5co /q8ZHxg4zupiMWb1dbfFT3kmkxs3eFU4GaubKBbxlFg/iwrL8IUB3PqMSfhk1g//XSo0 Zu4w== 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=UaN8jPDQ028t3+dW3PQCUxugcQzLgtOs/eaRgjyWY68xr2x3OgyEZ1c/8lDcySi/dp nnPPdpLWEa/c8DMxm5c0FtfkAu6aBSTHbpnrdG4ZoeeCyntaRag2eDpIklxrqEtPLSvy 0XR2uYytUNuEP3xIjT3TXidvjXS4rysjhuXFXU/dC63QvqfInQmINBrNjT1FB2l+nKhy h2ZZW83xrNA0irQUL1NrHkVq7nFZ7+D/GqXj+B3NmNez0OME2AOtC18SNXvInGx8GD1O 2lfoHJcnSaINanuP9eYTP95reL3SxIAdYKIHTpcWC5jB9ZJDJ+nPoJwwKrLmT2G/3rkF d8HA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=sSmTb2Er; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 y15si2080344qtj.183.2020.03.26.12.57.59 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 12:57:59 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=sSmTb2Er; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:59212 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYdb-0002Yn-1H for patch@linaro.org; Thu, 26 Mar 2020 15:57:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59427) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYLP-0000Ot-N4 for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYLO-0002EH-LY for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:11 -0400 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]:44637) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYLO-0002E5-HM for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:10 -0400 Received: by mail-qk1-x743.google.com with SMTP id j4so8132357qkc.11 for ; Thu, 26 Mar 2020 12:39:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=FcchR0Kiy3cS07PsythDlOBOqbmqT9MEDX8/TYIcoYY=; b=sSmTb2ErLMx7WBXRsV87/uGwvDHjPofX/UGkCp7tU20luPN02liTEjeT+g+eAF95LG q7ML2QnFzszAla3K4lxyZ6f592wFoV8cl/JCgvxUMlQK9ZZhuil9GWjioAz1JZlcHmFx /eMncs0GGzssq/fucixb31+XFBMEmrP1kpt4G0DYfp/QWkJXMJZm56waaGD9M16yAIqj fQyAW/uofUUkSp7wXlvRVu4jn4kpgGekoq72XwmfcPnPK8jC/ANGKI+OF6LAEw2geWOI YTXvADlsjepXwPPlrrYMJ75JvZ5/sEHDLRuZxQr4LPFWKnFd7MPEXN27vQHvMfZHOZ8W y6xg== 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=g5ubQHQD3YNvxpvymcAaT8UVLT8+N7PX2Zma5JIbKU4OSZrAIKyplFxTW7YVRbP5OI 7ng2XPE6JrfDaRVLI6hWaMtK50MJ7g0Xr1OzGJHiHAxuborxWO6zwf+2Z0XMR7Og+pSy rJ1bproiknWWCOoR0qJd2rYIv3uSvGakfEHS065rbdN2mWp2q4AtOK5vPuQrHPJjM95U /rYtZNPBBPTTQrdnEAUaA8LPw3pLEefpeHuiwKAanR+P4NMv5VTX/bLI9g9HYHJTs0v+ hPZ1oHMmJkFshaP880xCgecWQc9XImkkpQV8cKGcvd7uJ8LWlz0zQEG5DZFMiGMOwGc5 1wqg== X-Gm-Message-State: ANhLgQ1tC4KBMIEyokBgyP/ZgIb5c8dCAYIv6kd3DGJ2fpGG95FAOzNj Z7WPLMf8C2hvPCyfaCS4Lb09OiwpUOcG9Q== X-Received: by 2002:a37:482:: with SMTP id 124mr9764000qke.306.1585251549776; Thu, 26 Mar 2020 12:39:09 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.39.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:39:09 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 69/74] xtensa: convert to cpu_has_work_with_iothread_lock Date: Thu, 26 Mar 2020 15:31:51 -0400 Message-Id: <20200326193156.4322-70-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::743 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 , "Emilio G. Cota" , 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 Mar 26 19:31: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: 184924 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp482000ilr; Thu, 26 Mar 2020 13:14:31 -0700 (PDT) X-Google-Smtp-Source: ADFU+vs991NjcC095i7cr2ri0muaMHZjoQBv38nOsOmYeMT3vywjIBLaJHHK/+D1x8QROh0s3mkt X-Received: by 2002:ae9:f511:: with SMTP id o17mr10757101qkg.367.1585253670979; Thu, 26 Mar 2020 13:14:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585253670; cv=none; d=google.com; s=arc-20160816; b=RsF6LAgeY/vUoTQxfnDBhkPQkFbb1bL7XNnlvcViNyLTH6FIKA5VmsyKSgOWLdOcBU soJLJmyX6yOStl+A9QbgzLI4vshd/HjZCI7m4Du4wpowmMr1QhlIto45MGe8TM/Ic5zP VICOZBhV8wgWrYvxvxf5Pbvi9SWa5+HrT/+YLnDZmSoWlUFYczJeSIYet4naxVv5fr28 X1uYQbfzU0FLgYDg03e9mXTMVAt99mNwITJsOWWR3UrX5mmGerN+7u+/JuNevKzw8HxG PbBgXIMYO3nHp3W5QYzFjGbm2lDGot+BdmCBhW6OL04gXy0S6kKFbLFA/ORPqp2RmDTP TS9Q== 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=hXS64xfFQVpKibsj9LpVhJbK9gFfN+Viw10h78ZF2Vg=; b=My4kSMQp33GxP9nwD9eufpfBwkqdl+cmv3rCQkqD9PCbtRKefYfvNZMzyjeOR0VuhP +git4wagBEVAnd2f/5d2YH36saMxhYDkDzxz1dyoJzwE2xPpRkZel8cFkdZ+/Uc9M8uG Fs0QdLr4RLfkkSjIZ4NVK8LPHTvTAv/hD1uMCYbLIYZ7LjXyOKIUkxwOoHYZHOfiB5jB qz05eQ7vtyJjiTQTg8poiAfD7pE9K6Gok3Nbx8bB7Hya8ebk5gM378NhyilwRm86g+Ql G/vWRnFj1wlbxX0H+r7YVDPVhD9GBI3WMdzbG8AkZB4xnEzfgJwsyB20eL4uDJvCHMPP vk9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=E9zgmuKx; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 z24si2132505qta.38.2020.03.26.13.14.30 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 13:14:30 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=E9zgmuKx; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:59634 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYta-0003dW-G9 for patch@linaro.org; Thu, 26 Mar 2020 16:14:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59443) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYLR-0000Sw-2y for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYLP-0002Es-V2 for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:12 -0400 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]:41685) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYLP-0002El-RC for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:11 -0400 Received: by mail-qk1-x742.google.com with SMTP id q188so8167815qke.8 for ; Thu, 26 Mar 2020 12:39: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=hXS64xfFQVpKibsj9LpVhJbK9gFfN+Viw10h78ZF2Vg=; b=E9zgmuKxYSK0VF+OHcKpZMN5Quqt4ZtwwOOyy+HnVdwmgxWDlDjrwjYSwgnOO8bvwq LyILHWqzwhVFkJGJNru3QIuWDvrvSaw1jEzhI/w6/SGfNUa1TNbeMMQk2CHlWe6qBE8o otaIjLoKoqZbyhN9MXtKwfckI817FkMl9UVyYvGb67QL7udL+fKpbxeC5rN61HFAPGV9 vTv+dnIfBBQtNp4XobXLlNzkar+MBo8C/yW6Pt5cl8nVnohC2xE/Qkp52qBNrihpgmjO sadr+T6BhVJot1p/pu9kcERYtfsq+K8UTjYEc6XRvfIM+Rt+Ux5ydzt3w5vnkUDlMlnG iBqA== 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=hXS64xfFQVpKibsj9LpVhJbK9gFfN+Viw10h78ZF2Vg=; b=A0QicGhx8v/lnc53JP/BwEzUKXIoFXL2MbMZCv1LM0QXxRZRidhhuRjluaXcnuGMcs SWfLPXT8CNT0VEf/QYbxLEcVAb8ndtv+JDAEZyj1RjefujzXrU62DDzHoF8a7puc4FAs h5gNPbzaHx1pAnR7OiI6TmUSmYmEgMQgWnYocV4/t+dSlDAD9lwvfeQNTHYagg83ylch NMPSqiysDpWGdill8SBZTDQD32Kgr0IgGuVbC24md+QYVdNz9lBTxpDjBqSnE7C/AxFZ D9CPfDO3qwo1vlsB2qGEcDugYkuNg5TJoMiYRxQr9kHEpf60J2CccnaHaOIyuatanUYm 0JSg== X-Gm-Message-State: ANhLgQ1oKS1KW08TFekGBIToUH7MMDo24663eDoJno5mMN1XQRCgh1vS 2LE7tC3EACuKYilECznb9q+oM7AIO2Y77g== X-Received: by 2002:a37:410:: with SMTP id 16mr9858852qke.485.1585251551100; Thu, 26 Mar 2020 12:39:11 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.39.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:39:10 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 70/74] cpu: rename all_cpu_threads_idle to qemu_tcg_rr_all_cpu_threads_idle Date: Thu, 26 Mar 2020 15:31:52 -0400 Message-Id: <20200326193156.4322-71-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::742 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, "Emilio G. Cota" , 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 50ced4369f..05de56bd53 100644 --- a/cpus.c +++ b/cpus.c @@ -232,10 +232,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; @@ -643,7 +645,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; } @@ -1295,7 +1297,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); } @@ -1651,7 +1653,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 Mar 26 19:31: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: 184905 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp466072ilr; Thu, 26 Mar 2020 13:00:10 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvNfAd6tKC+gUw6Vfsg2UZyTUNqSkV192WVUQvqL/P9Oc+xuDb7y9Fcp2weqU88iPl9BSVk X-Received: by 2002:ac8:75ce:: with SMTP id z14mr10412778qtq.12.1585252809905; Thu, 26 Mar 2020 13:00:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585252809; cv=none; d=google.com; s=arc-20160816; b=KqL3Y1/28DHbf9FPrDFTGuzO6QPDF0Ua1ezetpAc/CldjRCVe6oVI2CiV+puaGE9Kc ImKtTjT1u3jNxUJI2lnoy49+2osU4AEeJ7GcI7U2laacfdJ41ezVxxxtjmz30xyIqnYM 5wjzvceB1PvAa6thiSJPbvfhHwqlV16Vb1QXsUdWKGXS0vG58I0vHEnNUswvssrbG0rP gzmfT8HBNWTpciXjoZr2ccHHQ5nv5lh56KCbv9Gq3uyE8efShA35dGqeTq8R8S5pRbQz 0MjuBX/6Cmo7vYc0Nh54VJOOMCf+y8Ij1wdjTOU14OqaNNHKgQpRtwP/AU17jR+tZm+t F9gg== 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=iT2+KNOnPvuJu2Lr0qN3HFjDh2VfGcLYrWgRqkL7cdA=; b=WuttF+1fCXC7jPnVZAMziZ2YA3NItBK5S2cegEtHA5qzMuJmN1fX1Ha5Ju6jB5wPkF UP1iURCVXtlO/zZKrkPJYTzb3S7ipILubPrE6mKMd7Cg3ZrGWk+GjZBGSKKwNgkeTXdA yt3Nmg0MeccrEu5BrnIutgJfNEaiEOXU7jJxNtkFhjVeiGu2cp9ZKDH1Kg8wnUPj063b THZHuJvj41y5cNWPUnOEoRXkOJi6dq3lT8Kw/Q+W9eNw4FcMYuo4Zh6U4JqxPHLkAzqO gMomaZjpeOiwbb94ydaw9u67hVT9EhjDmg1EHABE9G9vfC+KYsV1ZESlOSZqw905Hi5S IPuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=t5kyZBDA; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 d8si2098170qkc.129.2020.03.26.13.00.09 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 13:00:09 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=t5kyZBDA; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:59270 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYfh-0006L3-C8 for patch@linaro.org; Thu, 26 Mar 2020 16:00:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59470) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYLV-0000d2-7q for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYLS-0002Fj-9g for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:17 -0400 Received: from mail-qk1-x741.google.com ([2607:f8b0:4864:20::741]:39033) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYLS-0002FZ-3I for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:14 -0400 Received: by mail-qk1-x741.google.com with SMTP id b62so8198503qkf.6 for ; Thu, 26 Mar 2020 12:39:14 -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=iT2+KNOnPvuJu2Lr0qN3HFjDh2VfGcLYrWgRqkL7cdA=; b=t5kyZBDAyYApHk+f9QWy94iC4b0jgwrPpFn8a7NQChoMGnby698p5cjk+RSLPTcsMd rzlQRzAxOzm/IJO4akRaKP+Bab1D/TKOTL6FIt4olB0akoTW4T6nLqYrb61f9hnKRb/x w34NpGL/iU9HWv7p5LePmSbcr772aXZ2Ev1fJygJ5VJjDA+XAq6Mx8yc1ZWI6CQ0yDOC jyJj7UKuE2VDCHqL/AvVW/Vw4Z+/l2oT8Zm+5KgUFainwG+U/m8ROvcuPMon4HtLn2ZI D/dwhbVw+z8PBPlg8fntBj9H/mwqR2pkEoOtW8/zdQg/9y5mN0QJGTHOdMVjAqWToGaQ g7lw== 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=iT2+KNOnPvuJu2Lr0qN3HFjDh2VfGcLYrWgRqkL7cdA=; b=ei8qw2lbH/Ial01nHtfb9yYOEMgnnumfc7ykPteCn8fibcNeANghOFFIcg5k0tX/zx XpFeptGiZA7yDY0ncwg0GLQvip7g2Rl4w3s+QZxZLDZPpCrdYGqHM3yjJev8T7pW85Au b4LYaee4o6NroOrY3l6i/TuprfC2Kh0YbFJFH1uoYPUhifV2HWvAN+A0gWOMw5Ty8nQV 5gYk2R/EDExRwHtELYjp+3dTyuPeRnVMcQVf7sHfFHeegvLcfAxe6h7bFqGR9ILbNHj9 9vr5Iw11n/xL7Djw67sqo2ejYEBXYPCSsfU67r/RG7iseKvDZpOXsa5vXEBk+runAvBb 7mQA== X-Gm-Message-State: ANhLgQ2hoyG/AWlbCSQpuxPZ5qjguqPmokFSd6bNhAJ0iS63ZaZm459Q 4vYX8OL9dMVw+smDkbJ7+PhDyw7BBPajLA== X-Received: by 2002:a37:b4c1:: with SMTP id d184mr10463385qkf.452.1585251552486; Thu, 26 Mar 2020 12:39:12 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.39.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:39:11 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 71/74] cpu: protect CPU state with cpu->lock instead of the BQL Date: Thu, 26 Mar 2020 15:31:53 -0400 Message-Id: <20200326193156.4322-72-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::741 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, "Emilio G. Cota" , 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 05de56bd53..92cd49439a 100644 --- a/cpus.c +++ b/cpus.c @@ -202,24 +202,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)) { @@ -237,9 +243,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; } } @@ -732,6 +745,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; } @@ -1061,6 +1076,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); @@ -1073,6 +1089,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); } @@ -1174,6 +1191,8 @@ int vm_shutdown(void) static bool cpu_can_run(CPUState *cpu) { + g_assert(cpu_mutex_locked(cpu)); + if (cpu->stop) { return false; } @@ -1246,16 +1265,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); @@ -1273,39 +1285,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); } } @@ -1313,12 +1346,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); @@ -1341,6 +1377,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; @@ -1353,15 +1390,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); } @@ -1369,10 +1412,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; } @@ -1389,7 +1438,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; @@ -1400,11 +1449,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); @@ -1413,11 +1462,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 @@ -1457,6 +1506,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); @@ -1537,12 +1588,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); } } @@ -1563,25 +1617,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(); @@ -1608,7 +1682,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; @@ -1619,6 +1698,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); @@ -1626,11 +1706,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(); @@ -1640,11 +1723,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); @@ -1676,6 +1763,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(); @@ -1683,12 +1771,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); } @@ -1696,6 +1790,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; } @@ -1713,6 +1809,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(); @@ -1720,15 +1817,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); } @@ -1736,10 +1839,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; } @@ -1752,6 +1861,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; @@ -1761,29 +1871,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; } @@ -1811,14 +1933,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 */ @@ -1827,9 +1949,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); @@ -1845,9 +1967,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; @@ -1860,8 +1982,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; } @@ -1968,54 +2090,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); } @@ -2035,8 +2172,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); @@ -2220,9 +2360,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 16caa6c589..df31fc8123 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 e3527b6194..8f70249f45 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 Mar 26 19:31: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: 184929 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp486833ilr; Thu, 26 Mar 2020 13:19:19 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtihAuIwK8TW/OxUwcTn9BaYX+qHZ3EdUf1eQRaT8wfdmG4Tyb3bBkF8zd0hP5BrTnqXr2t X-Received: by 2002:a0c:f207:: with SMTP id h7mr10244057qvk.20.1585253959871; Thu, 26 Mar 2020 13:19:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585253959; cv=none; d=google.com; s=arc-20160816; b=REuavUIuBDjUFz4lQ9wdcMpFwwpJ4/RsUCs3uruiNZniICnJHOLAmR/lRmKAsERl+O 1r0fbEirCignJQ9zozOwwGL3nDdMI3Bhmj6YhkSYQzYg/YxUZyIltG8J14Okzr9qP+D4 N/pKQOjgPcErPRuYGmSl3BRsNNEqNW9jDPhPe6JMHYzdEyPU30ghSYZTvw90R2Zdgp3k 1BUn/pRUGUQqflMAjDJFACU3HBpyo3J4HaiCgQa1rb0gs2ZUe53AynLx5DyqapL5VR5J Tdatxa8mjd2EX1atOfnaib8B5coMfHASbXuumitgusRPYdJ+q1UGZAs6F+l2wXd70ifc whyQ== 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=rUhgLfadfGQvM7gNTBGDLFffVlG6lB5oP5ofMlz9KHY=; b=kBKzKloeKvQ11iaqFYfI/KpTdGYAhrEFTxE114VchC1oVbEHVbtjSdCJ3KjIvaY1rn MMrQM/ZceWYy7EbMhtTZtx7sgtFa/+29aCufSqx0lEM5BzxSPDnHdb1aVTHHOtF7A1PQ wZLnYksYioBi9DabHl7enDBfznUzRKPlKeWx4ugWISu/v51s2WqAbDmUZofv9jqy6u5Z rKTm2vX1wTXXBxvM9Kk8D3fOiahLr8ez/DuSUZS0oHRAn0mLj6DUgC2zrNEbtoJVnIFQ EPxpL2Xw6yWZTMp6Ck1ATvBWA7k83ydidxXrmjW1xnDq07J+T+yRHGcXZAH1qBOIevXb OWzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=sYMBLsJC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 j1si1767503qkm.255.2020.03.26.13.19.19 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 13:19:19 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=sYMBLsJC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:59760 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYyF-0002Et-FD for patch@linaro.org; Thu, 26 Mar 2020 16:19:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59465) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYLU-0000cF-U7 for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYLT-0002G0-KH for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:16 -0400 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]:40108) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYLT-0002Fn-Fm for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:15 -0400 Received: by mail-qk1-x743.google.com with SMTP id l25so8190013qki.7 for ; Thu, 26 Mar 2020 12:39:14 -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=rUhgLfadfGQvM7gNTBGDLFffVlG6lB5oP5ofMlz9KHY=; b=sYMBLsJCvqIwN/gi2ckGzc/7uirPnb4iR08PTPScNMf+Me1O7JDvnpr5Vip7LYYMh6 G/2p7yrTjhuJdjlsRX3lAOp0/lvz0+IN5y7fQtoc0swhI8Y/LWYTCXO53vRzHZ4pNEGf vY3XbWmjZieAW7fv72o360FfOtcypF2n9vLzxFFqe+CouSzWJCwhZxlEl6h3ngPldFOW g5y1Un94Fh3LRmkqXP1zK/meOp6MH7UO2s5ZUC0Dw4LKlomGAkwxL2JltkYqOKK7wEq2 89PVSk4QxIU+qRvjHBmus/U1brX+9vi4UrKTkhDSROqkoMWrhuyRkCVyhuFxkzTm5ICh T+Kw== 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=rUhgLfadfGQvM7gNTBGDLFffVlG6lB5oP5ofMlz9KHY=; b=DC3LsgnJcYEAu36PZ1h8j8Tl4kOECUxjBgFKxX9FaU2AqpWipqOhS8Bkw/CkNWSljj 0lPjwkbfd5vGJV+QLQ1FUKm+lKC9JMRPG0LBQEfAvxKgbK/qPwMU0jfLsFCPrXVDtwII 8bkvyXAAhiO1/AAQTyOOz53dyra2Dvny7s3LvR8eQRE10AB5WwlPuf771kt1D1H/cwAG qCVqQkAbBkwjgyDmVY+G9vfYrYc5z9i/gdttz/vlDD4AmRfijlYgjXPpvTvGk+i4zrGI nfr/RMjg5Qet9UzZirr+G/qFuB+DtVoVjI7Zt8wezxIzdBCZamIIV63fguCCE0hl9rCl SB3A== X-Gm-Message-State: ANhLgQ1FKSqKSyL13XnRtLA6TgRdvxJ/JcBD+CdY0DROHTBraSIEzsLs T3NVdVd9kfMG6uORr+VGwiyKttY6iTYnPg== X-Received: by 2002:a37:a807:: with SMTP id r7mr10566025qke.5.1585251553681; Thu, 26 Mar 2020 12:39:13 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.39.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:39:13 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 72/74] cpus-common: release BQL earlier in run_on_cpu Date: Thu, 26 Mar 2020 15:31:54 -0400 Message-Id: <20200326193156.4322-73-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::743 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, "Emilio G. Cota" , 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 9ca025149e..f5daf2d518 100644 --- a/cpus-common.c +++ b/cpus-common.c @@ -137,6 +137,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; @@ -145,21 +150,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 Mar 26 19:31: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: 184908 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp469557ilr; Thu, 26 Mar 2020 13:03:00 -0700 (PDT) X-Google-Smtp-Source: ADFU+vs2hfKFMSigWBnAnvr2gvA60uYfOnynnBGKTIJbV4Ha0F7fcVB5amadJ1qyL5p/efFSzqXY X-Received: by 2002:aed:3466:: with SMTP id w93mr3107393qtd.307.1585252980198; Thu, 26 Mar 2020 13:03:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585252980; cv=none; d=google.com; s=arc-20160816; b=wJw17TCMA5fQDjmSk3YN6rTvqzsAuO/nRbj7HoUH746kaaf3Y0z09IyEAW/+N2lsVN SKy1DAgRGZEXEy5UA4/5RHNHa72swO/VZsKy/Hbpp5rbsUhtLM7Tk452itvJeAGYMFWt 26aa3BE735oCdq2/kTlKAxHQkCNzImXVLjt5c6u7LjDBlkdE7sYfuXk9qTAa5T5uyGlB 9TU/i4u2fZhw7drZeaOqrGh9UQ0yw7yoiOX73dTMh5Z+Oo8lMLWVE5hjc+2h+V+oNBS5 fyRSVaCtpd8DlYA9stmt0fU24T++NwULfdziqGJto0oqFPSQhN4wG6i3yNVuELJwMCYf S4mQ== 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=DxV2LkVkxZ0JK8RLYAmvvmQ/YQu2Mo+p3eePMYpr0Kw=; b=aTQFG5HWXtnlxhS8h2kZ1sU1PvYk35aQetb2KlxZtxaT+FwVt2QToybsS4D3+t8Drk BMS3d8FC8KJwjl7muvncRv+rG84ELxGHhDwFMuBALDzvtjAj3nZpdDViffJDzJuNe0Lr SfDSjyB8po1luM8O0DbiePfsMCH+OLWPSoAdfOTVlha9RV1CTD1n6Xl2yNFJKOrZeSBw 5S4FWkLjKCnfY6WKun1lzLxfzzKBaz4zFTaDULsjppUQn6w2gP4psfl2cLGQHJFblCfG a+DG3pOMuPC2IXZpouI19lw9j5WKzxcSbKg6z1wrIQ6D8oZsPIK47VX+ao0TBUTkQL1w R9FQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=j3oFF8mF; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 15si2666230qtp.152.2020.03.26.13.03.00 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 13:03: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=j3oFF8mF; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:59352 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYiR-0002GB-LU for patch@linaro.org; Thu, 26 Mar 2020 16:02:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59478) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYLV-0000dv-He for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYLU-0002GD-00 for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:17 -0400 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]:33140) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYLT-0002G4-Px for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:15 -0400 Received: by mail-qt1-x843.google.com with SMTP id c14so6577103qtp.0 for ; Thu, 26 Mar 2020 12:39:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DxV2LkVkxZ0JK8RLYAmvvmQ/YQu2Mo+p3eePMYpr0Kw=; b=j3oFF8mFjFA7gqqrPh920l4L7Ce/Hwxlw5fBhVU1CWgL6cUza8FLHE/QcvX0uCekIZ udC/ttEAQNvrS3AIpeq8j5ZJBHBjThN/9rj5kRtwwMjaDbS16/jWKYMirnmKUN6+cluT MM/njKTrbH49VYyOb95P2g/4QwzIuEGgJ+ulTO/aDfJz8FFZJAQJfcTA72lDDeGmZGJR 3PAbOMwlUdi2KM2ytURkzwMml2eyL/T6fJrTECTz4EU5YXG4+gJVRPr/OAZ4Y/Zw9SwI 3jxkgNpTSVh+Ek0tTcZHA9iyocSGsRvJxJtSRE5Obs8ntoAa0JyOuNSmff9daaoVgAPY pVLg== 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=DxV2LkVkxZ0JK8RLYAmvvmQ/YQu2Mo+p3eePMYpr0Kw=; b=D5F0yl28wqf7EAVWmb15Fxq2ptl5Qrk47EwAI68yZQN+DwvUXHjEwt2o810PDeNger Qy/vFV2ypBKlpGHPDQ1ohkRGs404fHAJKlIHiZmR80ZWQV7GWdI7i+uloFEELmmAz96h x2zCMMtJtDLT3ooUfnoH6vC/y1e2++YG0SY29KmweR2s0h9Hl0WCuQJmNHldGG36ooUd kQyks7Bv/h6KaGhEgwnn/jiXuUujFIL7CicBwKBaq8LD7heKDBHfxja8+SN3DtiFB+pv 49lLP3R6djYCmkJ5E6ZdYe+72vXFBW/Ng5nuG7Av2A8nmWvBKHi9mMOFgPAVZrZwSYLq TSRg== X-Gm-Message-State: ANhLgQ0CWf83sur5vu2jaWMQBZyPtkcZwhkdhx0fqGUoh+yq7yuWF6jz 7tlc0KTr2YFKM1vkf88/EMZukLdCBSt3hg== X-Received: by 2002:ac8:17f9:: with SMTP id r54mr10216067qtk.285.1585251554968; Thu, 26 Mar 2020 12:39:14 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.39.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:39:14 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 73/74] cpu: add async_run_on_cpu_no_bql Date: Thu, 26 Mar 2020 15:31:55 -0400 Message-Id: <20200326193156.4322-74-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::843 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, "Emilio G. Cota" , 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 f5daf2d518..efefe5e603 100644 --- a/cpus-common.c +++ b/cpus-common.c @@ -101,6 +101,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 */ @@ -147,6 +148,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); @@ -171,6 +173,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); } @@ -319,6 +336,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); } @@ -343,6 +361,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(); } @@ -353,12 +372,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 8f70249f45..91e35bf940 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 Mar 26 19:31: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: 184930 Delivered-To: patch@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp488791ilr; Thu, 26 Mar 2020 13:21:33 -0700 (PDT) X-Google-Smtp-Source: ADFU+vty6CwioKnHRfME4/BB22uC+g9j976NmmyE1Aolfta6gn+2n8IQv9ZikgCQnmioQceDtCV4 X-Received: by 2002:a05:6214:243:: with SMTP id k3mr8750858qvt.56.1585254092102; Thu, 26 Mar 2020 13:21:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585254092; cv=none; d=google.com; s=arc-20160816; b=0j38Eg4ZO3EAKlVUG72QDMU8Pl7H/weLyVZdBZunAPJRIgXIID8FhwyU5eZSf2s60K tSnFMssEKe7wWvJj+WpAvOsHl0Y/OcCBSTIWa6pA0zTYtIwXjGycQAkB3/DAmsTTquhY 0qfAx9xrM1WLPjTlVzkyh7G1iW9bLnbhN1jCaFn35vvNAphokKHTo6mLbYJ1yai7F0Ta yEA8pb/KcioXEIYMx4wBNKdzFMJGpS73ftjW0/HThkp1dy28Y8a7lCNuUWR7Mfay2t8b NEMwp3LbuH1HRrFMTuo+Y7E1fDzL9B5XEWWSC7v+LGk8p1ihflr8uL4gqQaeJk6W1l3T ZJDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=8/INgrBRrXZ0Qg0hlrPjtYk/o1iCoQLqecnKNHF18P8=; b=y5+E8j7BofZYncxLy4ojQG1M6F4KZ7Bc/fG8ItKABptamJsSwtZXqbBfZPfP4hj8Ti Q36QieVJhj8MeAVzj6agCRn3ToHz59myI0YtC/2R4UvQcKE2SBJUzNbSzxpmzSwPp2vr 715beAhJKG6Sqn9vMxEGH5vgrtQvl8TZZKwuDVOfhM6scyp9RmQA0ktJXQ+9uknmTsER u9qQG+2xXBSh8oPRQoa6TmDQm5MDHyTWUar+/Wojbb4sW4tzRsSQumMNj2HlEMnSOIkS ppubPwVWC+GjVlzaA2p+t/49OaxqhMNJl6ZGKMDSK8ttdmzU4kLB/K7xm+1jXRJM387p UEew== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=CNcsArkP; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 4si2191807qkl.233.2020.03.26.13.21.32 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 13:21: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=CNcsArkP; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:59814 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHZ0N-0004Vm-MN for patch@linaro.org; Thu, 26 Mar 2020 16:21:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59498) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHYLY-0000i5-4a for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHYLV-0002Gp-AI for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:19 -0400 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]:34736) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHYLV-0002Gc-5T for qemu-devel@nongnu.org; Thu, 26 Mar 2020 15:39:17 -0400 Received: by mail-qk1-x742.google.com with SMTP id i6so8212093qke.1 for ; Thu, 26 Mar 2020 12:39: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=8/INgrBRrXZ0Qg0hlrPjtYk/o1iCoQLqecnKNHF18P8=; b=CNcsArkPLB4nV0TVUu+9o0Ov9HCuKuWCO81KgbPvvVGb3OEk+I7JBFpalb3ThcqAnx AQQqtaLYox4C0dKKz/kZ5qFHpB9KU82Z8Agz3HsMJ45D7yfS/QrrwDbNI1w+AO3mh+ee Tloe0ByuBUdiExXYdTq/+4R5axUp/J5h7ZkUE1jGZ/0fjDEviLBenkJhVk59NlCc49Zw z1+BG0/jYSB0dsZD9EE2iQrY16wXb5cgTHvqBxdMDEWcS1giNJ62YNPe/CGQzR43UNsc nLl6fHHiElaIvrZDIa2akm3ZadWYOwcd8D30kr3mk4pwPkxYerBin2t1VD4MCLRzTu0b H9Ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8/INgrBRrXZ0Qg0hlrPjtYk/o1iCoQLqecnKNHF18P8=; b=PkAslw4BuVM5DfNiVz54Q966GaTtm4myAgJ5m4ucAM48X3IT7djktwDU8kimCoTkbL XPVuY/aeWbGsk2g/NW1bClDWxjYI/aFax8goosrWXoX2hxOvLVx06Z5zA/QWtpJveQzu Slc0AC5AhpfsZ2RLR5kR5itK7rCEWF5J5wxYzKoRdJ2Gebu4BhVPAaxqK22m5TT2Zxlo L6FNvY8Nv/j2D8JobQ0HggZGQIUoAtqTk6GE6nTE26zdmJYiNuUTqavc96F7R3BZe2Eb PQQd8FyoY7GVM2ITg3Ik4SbuO8tOmppEf3TAWLmeBC2a1LOkcryy76z0bFVyh1oJW8jf oaUw== X-Gm-Message-State: ANhLgQ3BhnL4FeKCT2HyJa8VYYdgd+ybZBeji8Z4TL6zvShY9da66eCR JAuTu12vUBq+MBzWqrKsba7bE34FNVsGjQ== X-Received: by 2002:a37:b986:: with SMTP id j128mr10019113qkf.109.1585251556222; Thu, 26 Mar 2020 12:39:16 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:fd55:4e67:1038:8302]) by smtp.gmail.com with ESMTPSA id u51sm2161916qth.46.2020.03.26.12.39.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 12:39:15 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 74/74] cputlb: queue async flush jobs without the BQL Date: Thu, 26 Mar 2020 15:31:56 -0400 Message-Id: <20200326193156.4322-75-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326193156.4322-1-robert.foley@linaro.org> References: <20200326193156.4322-1-robert.foley@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::742 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, "Emilio G. Cota" , 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 E5-2683 v3 14-core CPUs at 2.00 GHz (Haswell) Workload: Ubuntu 18.04 ppc64 compiling the linux kernel with "make -j N", where N is the number of cores in the guest. Speedup vs a single thread (higher is better): 14 +---------------------------------------------------------------+ | + + + + + + $$$$$$ + | | $$$$$ | | $$$$$$ | 12 |-+ $A$$ +-| | $$ | | $$$ | 10 |-+ $$ ##D#####################D +-| | $$$ #####**B**************** | | $$####***** ***** | | A$#***** B | 8 |-+ $$B** +-| | $$** | | $** | 6 |-+ $$* +-| | A** | | $B | | $ | 4 |-+ $* +-| | $ | | $ | 2 |-+ $ +-| | $ +cputlb-no-bql $$A$$ | | A +per-cpu-lock ##D## | | + + + + + + baseline **B** | 0 +---------------------------------------------------------------+ 1 4 8 12 16 20 24 28 Guest vCPUs png: https://imgur.com/zZRvS7q Some notes: - baseline corresponds to the commit before this series - per-cpu-lock is the commit that converts the CPU loop to per-cpu locks. - cputlb-no-bql is this commit. - I'm using taskset to assign cores to threads, favouring locality whenever possible but not using SMT. When N=1, I'm using a single host core, which leads to superlinear speedups (since with more cores the I/O thread can execute while vCPU threads sleep). In the future I might use N+1 host cores for N guest cores to avoid this, or perhaps pin guest threads to cores one-by-one. 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 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 e3b5750c3b..d13feaf3a3 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)); } }