From patchwork Wed Aug 5 18:12: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: 247458 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp760701ilo; Wed, 5 Aug 2020 11:21:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy799k/uHBYxiuCo0hB/Dwf9Nw6b9fijrT6lDQ4W40VL995as7/Qz5kxrnimfOHTy0qg8QW X-Received: by 2002:a25:ba41:: with SMTP id z1mr7473226ybj.33.1596651713828; Wed, 05 Aug 2020 11:21:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596651713; cv=none; d=google.com; s=arc-20160816; b=Dia5Cnb6o59koUFIXDrCOGk/8st3p4vXofokzGAcDP6dne2/16iMdK5fGr3rcC4fQE +gaZDyXHp7S/3CLFjDEz0Dg6sv0sRq8bVWOobllHcjP7PQee5k7URDF711qPXwUeSRjx HcNsxBW08JwivAGfeLIPnSGvnQb8gzsgKp9n7Qht3Ujy+gd4iPvniVyZtwaKQXtqh+Pm rhwCFMmo2MxMUP4AFS7Dh2yQz75zTnAjAB7sKE7bOP5LXSDsY0AWqSuFzA5LSKf+BT6P Gps1a1dp3EeNeuB1QiGw2QeYLUBdbOkoDhbqVaj7G5+vthFohIcfx6j4CZKnibpPwMVr fZPw== 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=sAMCBrWOlvhWHRQfoPG7nat7D/DsWHPnezgCzgjj800=; b=pxWAZP5R1R+no+3xVMcaWRVIpB1x4oFEbGFbUiK4LD47WbWMFEFiGTi8Zw8lJK2Z8Z 4TtXfQtlD7/0sRepkDNMkj2hjzOTVeEHYnysCSD9HYf2JvB5anjD9ouTaTv5DZLSI3o9 J/GZ113JATYwaRQk4mlLRoKhIxbHtXqO4pjPTYg80+q3Yfo1enbF7PzhaFS9ZhwpAjKx bltAOwBnPS2q7aHoXGDEJ/yr8N9frOMoKh4K5NPuYRYdXIbMeeJSM744Gc/PDgw1U5Ix AZQ1T7Z/k0WapCTkyFnYbvzLDf6Egdp9XNmduW68wSjgCnbX3Z7X3Cc0FLcvHlj0Bxpf /Pzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=pgFeFCV2; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 190si2694260ybf.2.2020.08.05.11.21.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 Aug 2020 11:21: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=pgFeFCV2; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:60250 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k3O2z-0002Kk-9Y for patch@linaro.org; Wed, 05 Aug 2020 14:21:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49886) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k3Nyj-0004KP-Fn for qemu-devel@nongnu.org; Wed, 05 Aug 2020 14:17:29 -0400 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]:33108) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k3Nyh-0006Tj-JI for qemu-devel@nongnu.org; Wed, 05 Aug 2020 14:17:29 -0400 Received: by mail-pl1-x642.google.com with SMTP id g19so13194188plq.0 for ; Wed, 05 Aug 2020 11:17:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=sAMCBrWOlvhWHRQfoPG7nat7D/DsWHPnezgCzgjj800=; b=pgFeFCV28gv4EmomjDuouj08WrzlGGVyl4HrPVq1A3OBVWQzCKx+H0SQ2lKMKrK4qB iYDKiZEQZyN+dAjIVCioY7q3XGkOccA7zxrTa6Ja65AOxlrmsc5OL/tjdRMEp9v3GVT0 WuSLnKaAEzF08yAqcEH4H9lnkDmoEOznYUMkkpbvBphq/d+/Rs1s55MVY8dea7f7GgoB Fmr9G3RH4BoP9n2JxESNitGRDzFpmBz1kktdOYn+r/Q6X1ycGAnwoMrKmXJdPvGhx+FD /SqQeV2GwaYLI6bDeG6luXUT56l7fT4xHIv0eTPhUr8WPaW4+iY2brd7k0A1RGXQ+6ee ViGA== 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=sAMCBrWOlvhWHRQfoPG7nat7D/DsWHPnezgCzgjj800=; b=mQBpVQu6GB491I14rxRgY7M0kYi3IlbnNGy8s7/Fom/lHfB7Et9+Rl48/sQLvrgMIj YSYEF5yt1xSxG2bgt3B+DsmUyqkmuVwShuu0XIBLHiBDSLItV3z36dxOboUoh9xydBQl ZMq8/IsXcO+UtSsu6CQ7cZpRIiqerEqRVBZHjojv+BnzxKcYM2+qv1hr+ZUm74sM/Ho0 JtkTgENo/EvzZBMkHFGHEveUJL4l/30red/hnkYrbO+PcUcGCU62hctrfdmaCIHOsUVr YTXJj8paEC+vDHiYgnImUcnkgRVdOaHB4GiWdC29ZnQIxLwv8FhaIbbTDql1uyX9jzu3 JRvg== X-Gm-Message-State: AOAM532wOidjrJM3tV1erUAHb6dovTY9kyRLn3QYiqoSB9ZIP/24caol QTtZwVarLpy//viGcBESynvdUoj00s8= X-Received: by 2002:a17:902:7d84:: with SMTP id a4mr4286651plm.44.1596651445773; Wed, 05 Aug 2020 11:17:25 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:38ab:50b1:ff8a:26ef]) by smtp.gmail.com with ESMTPSA id a15sm3670196pfo.185.2020.08.05.11.17.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Aug 2020 11:17:25 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v1 09/21] target/m68k: add BQL to do_interrupt and cpu_exec_interrupt Date: Wed, 5 Aug 2020 14:12:51 -0400 Message-Id: <20200805181303.7822-10-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200805181303.7822-1-robert.foley@linaro.org> References: <20200805181303.7822-1-robert.foley@linaro.org> 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, Laurent Vivier , cota@braap.org, peter.puhov@linaro.org, pbonzini@redhat.com, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This is part of a series of changes to remove the implied BQL from the common code of cpu_handle_interrupt and cpu_handle_exception. As part of removing the implied BQL from the common code, we are pushing the BQL holding down into the per-arch implementation functions of do_interrupt and cpu_exec_interrupt. The purpose of this set of changes is to set the groundwork so that an arch could move towards removing the BQL from the cpu_handle_interrupt/exception paths. This approach was suggested by Paolo Bonzini. For reference, here are two key posts in the discussion, explaining the reasoning/benefits of this approach. https://lists.gnu.org/archive/html/qemu-devel/2020-07/msg08731.html https://lists.gnu.org/archive/html/qemu-devel/2020-08/msg00044.html Signed-off-by: Robert Foley --- target/m68k/op_helper.c | 5 +++++ 1 file changed, 5 insertions(+) -- 2.17.1 diff --git a/target/m68k/op_helper.c b/target/m68k/op_helper.c index 4a032a150e..0c3333476a 100644 --- a/target/m68k/op_helper.c +++ b/target/m68k/op_helper.c @@ -448,7 +448,9 @@ void m68k_cpu_do_interrupt(CPUState *cs) M68kCPU *cpu = M68K_CPU(cs); CPUM68KState *env = &cpu->env; + qemu_mutex_lock_iothread(); do_interrupt_all(env, 0); + qemu_mutex_unlock_iothread(); } static inline void do_interrupt_m68k_hardirq(CPUM68KState *env) @@ -508,6 +510,7 @@ bool m68k_cpu_exec_interrupt(CPUState *cs, int interrupt_request) { M68kCPU *cpu = M68K_CPU(cs); CPUM68KState *env = &cpu->env; + qemu_mutex_lock_iothread(); if (interrupt_request & CPU_INTERRUPT_HARD && ((env->sr & SR_I) >> SR_I_SHIFT) < env->pending_level) { @@ -519,8 +522,10 @@ bool m68k_cpu_exec_interrupt(CPUState *cs, int interrupt_request) */ cs->exception_index = env->pending_vector; do_interrupt_m68k_hardirq(env); + qemu_mutex_unlock_iothread(); return true; } + qemu_mutex_unlock_iothread(); return false; }