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=-9.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 C17A0C43219 for ; Fri, 3 May 2019 06:51:31 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (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 79C4A2075E for ; Fri, 3 May 2019 06:51:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 79C4A2075E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 44wN8K14VpzDqV6 for ; Fri, 3 May 2019 16:51:29 +1000 (AEST) Received: from ozlabs.org (bilbo.ozlabs.org [203.11.71.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 44wN6g18JCzDqP1 for ; Fri, 3 May 2019 16:50:03 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Received: by ozlabs.org (Postfix, from userid 1034) id 44wN6f6dqYz9sB8; Fri, 3 May 2019 16:50:02 +1000 (AEST) X-powerpc-patch-notification: thanks X-powerpc-patch-commit: c1fe190c06723322f2dfac31d3b982c581e434ef X-Patchwork-Hint: ignore In-Reply-To: <20190401060312.22670-1-mikey@neuling.org> To: Michael Neuling From: Michael Ellerman Subject: Re: [PATCH v2] powerpc: Add force enable of DAWR on P9 option Message-Id: <44wN6f6dqYz9sB8@ozlabs.org> Date: Fri, 3 May 2019 16:50:02 +1000 (AEST) X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mikey@neuling.org, linuxppc-dev@lists.ozlabs.org, Cameron Kaiser Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Mon, 2019-04-01 at 06:03:12 UTC, Michael Neuling wrote: > This adds a flag so that the DAWR can be enabled on P9 via: > echo Y > /sys/kernel/debug/powerpc/dawr_enable_dangerous > > The DAWR was previously force disabled on POWER9 in: > 9654153158 powerpc: Disable DAWR in the base POWER9 CPU features > Also see Documentation/powerpc/DAWR-POWER9.txt > > This is a dangerous setting, USE AT YOUR OWN RISK. > > Some users may not care about a bad user crashing their box > (ie. single user/desktop systems) and really want the DAWR. This > allows them to force enable DAWR. > > This flag can also be used to disable DAWR access. Once this is > cleared, all DAWR access should be cleared immediately and your > machine once again safe from crashing. > > Userspace may get confused by toggling this. If DAWR is force > enabled/disabled between getting the number of breakpoints (via > PTRACE_GETHWDBGINFO) and setting the breakpoint, userspace will get an > inconsistent view of what's available. Similarly for guests. > > For the DAWR to be enabled in a KVM guest, the DAWR needs to be force > enabled in the host AND the guest. For this reason, this won't work on > POWERVM as it doesn't allow the HCALL to work. Writes of 'Y' to the > dawr_enable_dangerous file will fail if the hypervisor doesn't support > writing the DAWR. > > To double check the DAWR is working, run this kernel selftest: > tools/testing/selftests/powerpc/ptrace/ptrace-hwbreak.c > Any errors/failures/skips mean something is wrong. > > Signed-off-by: Michael Neuling Applied to powerpc topic/ppc-kvm, thanks. https://git.kernel.org/powerpc/c/c1fe190c06723322f2dfac31d3b982c5 cheers