From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F41A6C433E0 for ; Wed, 6 Jan 2021 12:25:54 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BEEF2205F4 for ; Wed, 6 Jan 2021 12:25:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BEEF2205F4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=NpGXW+jRW7tfLjYWBPx2vdPk2ro5QeVO4ET2JCQQjSQ=; b=vYXV+J1CrnANiXyDwnRarOPNA DCgR3PJLf4mHIFejPsKMic6KRtgv+Rk1TPo9tpymJK9uEAMAmqUQZtU3KM+TKjSxViIa5TleEsu8I VSJq9Ir/0WPuBQsyhowuP+bKfM3rVVwiyXLYwuY0BOlUyISznG/g6AppcIx+Jo3fUk45I2a0d1kYY JOfQjBCk/0MFg9l0PgUe6QltIBg1XkDTO3kKQ1LgAGkCMP+aJ5kxv9cq5/PFMzQhoGgg9vkjSQAr5 AX0qbBqfkA+sxBBdPigHs9e6+IWenwedpTOl9WaeYx2e7Az6LlFATSbB5FeRvdFhHI2267az8gKkC A3cqOHQMQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kx7rD-0006ep-HY; Wed, 06 Jan 2021 12:24:07 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kx7rA-0006e2-TH for linux-arm-kernel@lists.infradead.org; Wed, 06 Jan 2021 12:24:05 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 08ED3D6E; Wed, 6 Jan 2021 04:24:01 -0800 (PST) Received: from C02TD0UTHF1T.local (unknown [10.57.36.216]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D4A593F70D; Wed, 6 Jan 2021 04:23:59 -0800 (PST) Date: Wed, 6 Jan 2021 12:23:56 +0000 From: Mark Rutland To: tingwei@codeaurora.org Subject: Re: Set DBGCLAIM when self-host debug is enabled Message-ID: <20210106122356.GC26994@C02TD0UTHF1T.local> References: <512a30e6cc6877687c10c0f9ccc3c4c5@codeaurora.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <512a30e6cc6877687c10c0f9ccc3c4c5@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210106_072405_007789_BA841314 X-CRM114-Status: GOOD ( 16.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Will Deacon , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jan 06, 2021 at 06:29:53PM +0800, tingwei@codeaurora.org wrote: > Hi Will and Mark, Hi Tingwei, > In recent implementation of save/restore ARM debug registers in > EL2/EL3, we found it's necessary to know whether self-host debug is > enabled so EL2/EL3 can avoid saving/restoring debug registers but no > one is using debug. In what situation are you considering? I assume you mean idle sequences using CPU_SUSPEND? Generally our expectation for CPU_SUSPEND is: * Where StateType==0, the debug state is preserved with all other PE state. * Where StateType==1 and the PE returns "warm" without having entered a powerdown state, the debug state is preserved along with all other PE state. * Where StateType==1, and the PE returns "cold" after having entered a powerdown state (i.e. we return via the entry point address), the debug state is not preserved. ... and I'm missing where you could avoid saving the state. What situation(s) did you have in mind? > In ARM PSCI, it has one option to set DBGCLAIM[1] to 1 to indicate > that debug is in use by a self-host debugger. Do you think it's > resonable to add this to Kernel? > > For example, can we set DBGCLAIM[1] to 1 in enable_debug_monitors() > and clear it in disable_debug_monitors(). I was under the impression that this was solely for the benefit of an external debugger, and should have no functional impact on the PSCI implementation from the kernel's PoV, so as above I think we need a better description of the case you're trying to address. Thanks, Mark. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel