From patchwork Fri Jul 31 12:51: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: 247295 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp3291619ilg; Fri, 31 Jul 2020 05:51:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzfnTUGtQaHVyRHO4nPj9lEgpGxkzPLtLaUyLJaMj3LIc4nufpbICfPo9D5TMBhktmSmnv6 X-Received: by 2002:a25:d946:: with SMTP id q67mr5405601ybg.517.1596199903812; Fri, 31 Jul 2020 05:51:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596199903; cv=none; d=google.com; s=arc-20160816; b=GIGQqSrA6OE2gY5ktqzI6WynzwK/zVZB2thHocRjUswzcso5wgcQgx1yuyzFPw/ptU MSVohCe6X1ddlhG9AfPaNVNecomFYjCz/olAaA4rHnjp+Z1/yXzzOJ1wwQIUDWAX8N0q UalJEzlg7nZQdH4UN+5qchFXITPPeDkdUmSbyz0SS/qX4pgRVlwBfr+Rsy+Ck+QgOqP0 6B0589W2Ky2KBuASLA2Dtsf+pfqunwgnxfpQH0JeI+rGZCbU0tX7CyO9Rj/YTmo1JC+A 1yKoPYyUyM/E87BtTZ87FzuTWBfaeEEJx7Ro+PPee0Iqf81dBudT6k5+3ODFSqvnu69r o9TA== 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:message-id:date:subject:to:from :dkim-signature; bh=tOFYqw6kA0tuZpo4KlMuTovIvhRpkKWTDyY3ER7Gskg=; b=EwEM03w0EPbJzrc8V9op+Robc9Aqvc4vljeLLLCx0ILMudRKY4JhZztlC8HTMeFTHe pZyhfvvxMdCko1q9MC1ss4XZKH7CxP8scWrk24l5TX8lSFln1InOHeg5M/noINyP1lCL 8mh/TWXA77tE+qyYGAF1VJ16mUAJY86xSUxSLAsH3G0hemlk/bZglFJpTDFvoMnZ6ZC6 bppSpq7VYv7ACpoC8R3whcwoMHhh42fcDKQ0vPu0q1VuJwSPK0tK7Zi8TG9nsHY07qao Jqi6/WNKF8QwVk4FDSfrBh5iZgBh3MlFTPLvT3PUamzfu+Z4I0uE4tQdVjqvj7P9N514 GQBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=PW8Sne9n; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 g13si3589914ybc.372.2020.07.31.05.51.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 31 Jul 2020 05:51: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=PW8Sne9n; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:48086 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k1UVj-0004bs-9l for patch@linaro.org; Fri, 31 Jul 2020 08:51:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58550) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k1UVZ-0004a3-Md for qemu-devel@nongnu.org; Fri, 31 Jul 2020 08:51:33 -0400 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]:43501) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k1UVV-0003Ww-G1 for qemu-devel@nongnu.org; Fri, 31 Jul 2020 08:51:33 -0400 Received: by mail-pl1-x642.google.com with SMTP id t10so11960519plz.10 for ; Fri, 31 Jul 2020 05:51: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; bh=tOFYqw6kA0tuZpo4KlMuTovIvhRpkKWTDyY3ER7Gskg=; b=PW8Sne9nzd5sxS+HeSvJwOmUB2qdHbLs0JTSElYEvAbBcI5BafA2xEnvVyPra6bjWr V4u6FgruGLS5ZrRoRoYtqaecDxKWRNDydsaJ3U6Ibk2s9p65XbU8KGWoYAyRPt7eJJuv uTvew/f5iBZw166Uzi8zVHJj0YhiUN/7UrSZkBYVHluPeWnJm61Ux6w3hlfIk7yEWtK4 brRxwIBWoX3UiWVmVklXrq/Gz0wX5gq5ciqwMvUQeOty93IYfeeYsTYER+DgWj5bi/wA N4MW8tH6NMoExVLJfrS1zo1DyLkmnOdjrvyHuN2fXZFVc4rEo1WVYgH0Z6+cKr1QRjGH CbSQ== 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; bh=tOFYqw6kA0tuZpo4KlMuTovIvhRpkKWTDyY3ER7Gskg=; b=UnMqe1mpTFuxD3Mz+HlXo4bX6t4Odjj1gD31S/4HV4+qhHOr4el93EyTAN+8I3L7Pd CpyQ1SlS2uqdq4D7tvike1qJgOFQae7Sp5mYMqASc/13Jp5Zz5LnFrL7cz7Ph9lFC9SE cGC6wceHsSIVolCblZsVLfvAAqy6y1LJ4AqsOA9CPGoTP6mkqrCoHjCDEEVF7fKzGn0m 2O+GFagG9vTzs0kIpGViDrH+S7jZbgEKxVUlIEJZLZ0bb3/h95HAZX7aCFJPHU0TOQ8G QDZRFl0xLJaF40f1tFk92wfkmlKpvMIpWR5mmDYqjh2P3yy+nBpsFJA2McN/aOHZxJ2L Aeew== X-Gm-Message-State: AOAM533gayk4vDoQUX83KyNsSRhTf0sYoSJEGhLX/PEbE+vXIPXYfIpg C8Ow+/ubQdq9OKTVlgk/WjI7oeW5U9w= X-Received: by 2002:a17:90a:bc45:: with SMTP id t5mr3898770pjv.139.1596199886511; Fri, 31 Jul 2020 05:51:26 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net (c-73-47-162-176.hsd1.ma.comcast.net. [73.47.162.176]) by smtp.gmail.com with ESMTPSA id v11sm9733646pgs.22.2020.07.31.05.51.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Jul 2020 05:51:25 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH 0/2] accel/tcg: remove implied BQL from cpu_handle_interrupt/exception path Date: Fri, 31 Jul 2020 08:51:25 -0400 Message-Id: <20200731125127.30866-1-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 Received-SPF: pass client-ip=2607:f8b0:4864:20::642; envelope-from=robert.foley@linaro.org; helo=mail-pl1-x642.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robert.foley@linaro.org, cota@braap.org, pbonzini@redhat.com, peter.puhov@linaro.org, alex.bennee@linaro.org, rth@twiddle.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The purpose of this change is to set the groundwork so that an arch could move towards removing the BQL from the cpu_handle_interrupt/exception paths. The BQL is a bottlneck in scaling to more cores. And this cpu_handle_interrupt/exception path is one of the key BQL users as measured by the QEMU sync profiling (qsp). We have chosen to break up the process of removing BQL from this path into two pieces: 1) Changes to the core/common functions of cpu_handle_interrupt/exception allowing a per-arch decision to hold BQL. The common case and the default is for the core code to hold the BQL (bql=true). This set of changes is handled in this patch. 2) Removing the BQL from the per-arch functions. 1) makes it possible for an arch to set bql=false so that the common code does not hold the BQL across the cpu_handle_interrupt/exception call. This allows the arch to handle locking in this path We leave it up to the arch to make the change at the time that makes sense. It is worth mentioning that we are working on per-arch changes in line with 2), and plan to submit these. In other words, we plan to set the groundwork with this patch series and then will take advantage of it in later series. This patch series is based on the per-CPU locks patch: https://lists.gnu.org/archive/html/qemu-devel/2020-06/msg05314.html Robert Foley (2): hw/core: Add bql_interrupt flag to CPUClass accel/tcg: interrupt/exception handling uses bql_interrupt flag accel/tcg/cpu-exec.c | 34 ++++++++++++++++++++++++++-------- hw/core/cpu.c | 1 + include/hw/core/cpu.h | 8 ++++++++ 3 files changed, 35 insertions(+), 8 deletions(-) -- 2.17.1