From patchwork Tue Mar 27 04:37:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Neuling X-Patchwork-Id: 891344 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=kvm-ppc-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=neuling.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 409JCR49yrz9s2L for ; Tue, 27 Mar 2018 15:37:39 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751056AbeC0Ehh (ORCPT ); Tue, 27 Mar 2018 00:37:37 -0400 Received: from ozlabs.org ([103.22.144.67]:47859 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751058AbeC0Ehe (ORCPT ); Tue, 27 Mar 2018 00:37:34 -0400 Received: from localhost.localdomain (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 409JCH2Yjxz9s1R; Tue, 27 Mar 2018 15:37:31 +1100 (AEDT) Received: by localhost.localdomain (Postfix, from userid 1000) id 485B7EE78BC; Tue, 27 Mar 2018 15:37:31 +1100 (AEDT) From: Michael Neuling To: mpe@ellerman.id.au Cc: linuxppc-dev@lists.ozlabs.org, paulus@ozlabs.org, david@gibson.dropbear.id.au, npiggin@gmail.com, pedromfc@linux.vnet.ibm.com, kvm-ppc@vger.kernel.org, Ananth N Mavinakayanahalli Subject: [PATCH v3 0/8] powerpc: Disable DAWR on POWER9 Date: Tue, 27 Mar 2018 15:37:16 +1100 Message-Id: <20180327043724.13862-1-mikey@neuling.org> X-Mailer: git-send-email 2.14.1 Sender: kvm-ppc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm-ppc@vger.kernel.org Using the DAWR on POWER9 can cause xstops, hence we need to disable it. The current CPU_FTR for DAWR is a bit messy. Despite having CPU_FTR_DAWR, currently we assume DAWR exists in the KVM code based on CPU_FTR_ARCH_207. In other places we assume DAWR exists if CPU_FTR_DAWR is set. This attempts to clear up the situation by always using CPU_FTR_DAWR before setting the DAWR (to a non-zero value). DAWR has 5 different ways of being set from userspace. ptrace, h_set_mode, h_set_mode(DAWR), h_set_dabr(), kvmppc_set_one_reg() and xmon. For ptrace, we now advertise zero breakpoints on POWER9 via the PPC_PTRACE_GETHWDBGINFO call. This results in GDB falling back to software emulation of the watchpoint (which is slow). h_set_mode() and h_set_dabr() will now return an error to the guest when on a POWER9 host. Current Linux guests ignore this error, so they will silently not get the DAWR (sigh). The same error codes are being used by POWERVM in this case. kvmppc_set_one_reg() will store the value in the vcpu but won't actually set it on POWER9 hardware. This is done so we don't break migration from P8 to P9, at the cost of silently losing the DAWR on the migration. This is not ideal but hopefully the best overall solution. This approach has been acked by paulus. For xmon, the 'bd' command will return an error on P9. Thanks to Pedro Franco de Carvalho for the initial version of this. v3: Split patches Fix usage of H_UNSUPPORTED v2: Move to CPU feature quirk from Nick's dbginfo.num_data_bps = 0 if !breakpoint_available() from Pedro --- To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html