Received: by 2002:a19:ad09:0:0:0:0:0 with SMTP id t9csp4032264lfc; Mon, 31 Aug 2020 15:02:29 -0700 (PDT) X-Received: by 2002:a62:6dc1:: with SMTP id i184mr2881937pfc.57.1598911348911; Mon, 31 Aug 2020 15:02:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598911348; cv=none; d=google.com; s=arc-20160816; b=Hl8J2kPDrI59FQFpTBg45VdAceOM/RuQHJelpM2TueJTDPGIRvKeuWS11dVYGFl1Em hLAtiXWlA1cRInK6V1mP4jG1jBC3joMAV1s4RQ5ItETorkNGdyxRxO/z7895stlZaULY /r0roBg7c4G8c8bRL5XEKV7aURm0aW+QnyRJ8fcSRrP7d8OM1JYvjP4Xz1kLYGbcTGBb 0/d4MmQERRNEf1nwoNqhyfQlyMHs5ox85g0fiOoJYqnnZPoG4loI2jvZBw4mExO0lnGD eA/1BrGNYPG+R5Cd0deA3I47bjTgW5ixNdpPhW+bh+1zwIT6PR2liltQJFcKTFPfKI0o rtKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:references:cc:to:from:subject :dkim-signature; bh=X0cFCtxK4xl55T5MuZgphvDqnW4fkCQ//cpbpdaWuII=; b=Dzr9ftltFGm6wgeIn7uCb/V7BgyDC4+h67b+dr0xcZFsAIhazaLcaFuY1mG9waVo5w RzYtK820nHAIuHaHTsuxUk4lsFs1gXQuhJJB4aySpS2F4V/Ii4rtfXm9hdfwpQogINMa 6vwznQ27ooT2T78iO8WoQZw0a9X9xA/Tp0EjqfPJ4KZgE3rhk1n7SIaStjCap7vSq8p/ DVSfGFjyYyPsDZEewijK0sAT2r/bHG/okylNLk4NVhZUTsewTOm139HYCIBdGko29AKL CZZtUvTGPMtZqk37UQjWTnzJ1zlfQhxDGCicwRNs24k41QtjuR/PGfUYYNqIZocjZoiT ERGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Q+rOkWxj; spf=pass (google.com: domain of richard.henderson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=richard.henderson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id w75sor1847929pfc.88.2020.08.31.15.02.28 for (Google Transport Security); Mon, 31 Aug 2020 15:02:28 -0700 (PDT) Received-SPF: pass (google.com: domain of richard.henderson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Q+rOkWxj; spf=pass (google.com: domain of richard.henderson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=richard.henderson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=X0cFCtxK4xl55T5MuZgphvDqnW4fkCQ//cpbpdaWuII=; b=Q+rOkWxjgJi2ChGk3eRGNT7q1L2VezWMZouczsGSnq/pGfBV7SH5gcXWq9CO8IsN4/ DboCRiPyTikwG1bGDNRI/XKFN+dPdTNE5TPcDEgfcAArzWtJJkhcQSFUIfzUZvFfgdWT 0krwWTVKkhsF4IcNcAJI883hZUiN6asUoLxHE7SwUghI918R+8Wdrvk5sAE59Fw/2lrz TW1S+OeG3fWwyMfeshrf18PanPDDw+FwU5lx3gXeTZfZazn/3+f17hqerOQdrDYuf2Eh pGtc7lxDHLALV5Ai4T0vrwWU4wPo0WZ/wCCT+GZX7XZNCUBQYgOiwaw3k3tBocHGrZCT 9kpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=X0cFCtxK4xl55T5MuZgphvDqnW4fkCQ//cpbpdaWuII=; b=FmTxfoV5zcaLNmaSRexJ55nVtdbwvbyD5bO4hvwT8OtMWaZhrvEuyqSowIcjqlH08M kV17Dp8o9avvTGaR2UGBd9vja/0z/ptHnbTy5R4xjVO7Vpk7S/Fn7eDEbsYYdkJpb9IF ln81S801kaesnSceod3hQVUbUd8mZuqDc9QvdgIDgmzqfEmeM7N2ZvjC1UcUuo7SBULm 6PXDbSRbYZ8j6xgt0NETf36mFCVB8RLs5cNgdmyeHqqTUsPOsv/wUHUCV6P58SYXU82F RnUHJ4WXShgILbImtV04Gpcl59Vj8in15HdKY04/gd3QQoXsGVSDslB/jRpKDY8bLcUN Mw9Q== X-Gm-Message-State: AOAM532oPdt6wYWVN91nafHhCrOMSrwAomvsLXEwfg4MLuoT7t89ws0q CWGjeuEAhn3jmPOucYJN77s1xYTACVObxDo7 X-Google-Smtp-Source: ABdhPJzu3nRvymJP3v2mQhcPt4yPiSsA88UUSsh0vzQCCZFZfpeeIkARyNeuHPoSJi+Ery/QJ9Jeig== X-Received: by 2002:a62:760e:: with SMTP id r14mr2857257pfc.309.1598911347876; Mon, 31 Aug 2020 15:02:27 -0700 (PDT) Return-Path: Received: from [192.168.1.11] ([71.212.141.89]) by smtp.gmail.com with ESMTPSA id w66sm9581237pfb.126.2020.08.31.15.02.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 31 Aug 2020 15:02:27 -0700 (PDT) Subject: Re: [PATCH v2 2/7] target/arm: add ARMCPUClass->do_interrupt_locked From: Richard Henderson To: Robert Foley , qemu-devel@nongnu.org Cc: Peter Maydell , "open list:ARM TCG CPUs" , peter.puhov@linaro.org, pbonzini@redhat.com, alex.bennee@linaro.org References: <20200819182856.4893-1-robert.foley@linaro.org> <20200819182856.4893-3-robert.foley@linaro.org> <439e8b14-adc1-b7ea-edaa-d11069863007@linaro.org> Message-ID: Date: Mon, 31 Aug 2020 15:02:25 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <439e8b14-adc1-b7ea-edaa-d11069863007@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: j7eBoweGvTYI On 8/31/20 2:18 PM, Richard Henderson wrote: > On 8/19/20 11:28 AM, Robert Foley wrote: >> Adding ->do_interrupt_locked to ARMCPUClass is preparation for >> pushing the BQL down into the per-arch implementation of ->do_interrupt. >> >> This is needed since ARM's *_cpu_exec_interrupt calls to *_do_interrupt. >> With the push down of the BQL into *_cpu_exec_interrupt and >> *_do_interrupt, *_cpu_exec_interrupt will call to ->do_interrupt >> with lock held. Since ->do_interrupt also has the lock, we need a way >> to allow cpu_exec_interrupt to call do_interrupt with lock held. >> This patch solves this issue of *_cpu_exec_interrupt needing >> to call do_interrupt with lock held. >> >> This patch is part of a series of transitions to move the >> BQL down into the do_interrupt per arch functions. This set of >> transitions is needed to maintain bisectability. >> >> 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-08/msg00784.html >> https://lists.gnu.org/archive/html/qemu-devel/2020-08/msg01517.html >> 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/arm/cpu-qom.h | 3 +++ >> target/arm/cpu.c | 5 +++-- >> target/arm/cpu_tcg.c | 5 +++-- >> 3 files changed, 9 insertions(+), 4 deletions(-) > > Reviewed-by: Richard Henderson I take it back. These two cc->do_interrupt calls can be replaced with direct calls. > #ifndef CONFIG_USER_ONLY > cc->do_interrupt = arm_v7m_cpu_do_interrupt; > #endif > > cc->cpu_exec_interrupt = arm_v7m_cpu_exec_interrupt; If we are in arm_v7m_cpu_exec_interrupt we will always call arm_v7m_cpu_do_interrupt. I think the mismatch of #ifdef, which implies a different destination is possible, is a bug -- cc->do_interrupt is not otherwise assigned and in fact would be NULL. I suspect that some of these slots themselves should be ifdefed, so that we cannot assign to them when they are unused. That would help keep the ifdefs in the cpu init functions in sync. This same condition is *not* true for cris -- there is no crisv10_cpu_exec_interrupt -- so you do need the new do_interrupt_locked field there. r~