From patchwork Tue Apr 6 05:38:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ravi Bangoria X-Patchwork-Id: 12184177 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=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT 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 8CF03C433ED for ; Tue, 6 Apr 2021 05:39:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 484A9611CC for ; Tue, 6 Apr 2021 05:39:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232967AbhDFFjt (ORCPT ); Tue, 6 Apr 2021 01:39:49 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:3646 "EHLO mx0b-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231752AbhDFFjr (ORCPT ); Tue, 6 Apr 2021 01:39:47 -0400 Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 1365X7nq109971; Tue, 6 Apr 2021 01:39:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : content-transfer-encoding : mime-version; s=pp1; bh=mLB47dibA3OSwGBj27SutkMchCWc8CvO8NZtioNOQnE=; b=No7jtEsfkiaD3kOpBYQVaRY9bsgpCo/UkTALth7izH0EtHs39yzBnL4TzF4Js9v0kJys 9z/qVVevlUPeIY0TYfUoRCj8PXlQ4+bb3edx6+gvqEftImNhIrJpSBafon7AAmhmByxU Gnt139m8ICEZtwKxhJObCjFwxgj3wy/1o6IaYNxmL/oFLQI34knsSIFsyqSK9yQd5rCm ISCrF2z1Spr3SG1mkzNWjqU7rtAerK7e5vvQ2AgY82Kz4Wg2WBJ3KpuGYOsNGp07PbuL fQFtC1B49e4XZ78bwZURtAfMhCxNe7/9rE7086cu1Kt7sZHwQAJ4VeZcaAiDNQq69Q2/ Ew== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 37q5kxfs9x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 06 Apr 2021 01:39:13 -0400 Received: from m0127361.ppops.net (m0127361.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 1365XcdS110950; Tue, 6 Apr 2021 01:39:12 -0400 Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 37q5kxfs94-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 06 Apr 2021 01:39:12 -0400 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.0.43/8.16.0.43) with SMTP id 1365amMl028874; Tue, 6 Apr 2021 05:39:10 GMT Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by ppma03ams.nl.ibm.com with ESMTP id 37q2y9hu2x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 06 Apr 2021 05:39:10 +0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 1365d8OS30671212 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 6 Apr 2021 05:39:08 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4F18052052; Tue, 6 Apr 2021 05:39:08 +0000 (GMT) Received: from bangoria.ibmuc.com (unknown [9.199.40.1]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id C9E5E5204E; Tue, 6 Apr 2021 05:39:04 +0000 (GMT) From: Ravi Bangoria To: paulus@samba.org, david@gibson.dropbear.id.au Cc: ravi.bangoria@linux.ibm.com, mpe@ellerman.id.au, mikey@neuling.org, pbonzini@redhat.com, mst@redhat.com, clg@kaod.org, qemu-ppc@nongnu.org, qemu-devel@nongnu.org, kvm@vger.kernel.org, cohuck@redhat.com, groug@kaod.org Subject: [PATCH v4 0/3] ppc: Enable 2nd DAWR support on Power10 Date: Tue, 6 Apr 2021 11:08:30 +0530 Message-Id: <20210406053833.282907-1-ravi.bangoria@linux.ibm.com> X-Mailer: git-send-email 2.30.2 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: MCYFSoaxnKv4EDLXyT9u0_WvNJiHeose X-Proofpoint-GUID: dKqAIj6i_Wb8ivCLaz-8NPPIr987M65k X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.369,18.0.761 definitions=2021-04-06_01:2021-04-01,2021-04-06 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 mlxlogscore=999 suspectscore=0 phishscore=0 lowpriorityscore=0 malwarescore=0 mlxscore=0 priorityscore=1501 spamscore=0 clxscore=1015 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104030000 definitions=main-2104060037 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org This series enables 2nd DAWR support on p10 qemu guest. 2nd DAWR is new watchpoint added in Power10 processor. Kernel/kvm patches are already in[1]. Watchpoint on powerpc TCG guest is not supported and thus 2nd DAWR is not enabled for TCG mode. Patches apply fine on qemu/master branch (11577d85b1a6). v3: https://lore.kernel.org/r/20210330095350.36309-1-ravi.bangoria@linux.ibm.com v3->v4: - spapr_dt_pa_features(): POWER10 processor is compatible with 3.0 (PCR_COMPAT_3_00). No need to ppc_check_compat(3_10) for now as ppc_check_compati(3_00) will also be true. ppc_check_compat(3_10) can be added while introducing pa_features_310 in future. - Use error_append_hint() for hints. Also add ERRP_GUARD(). - Add kvmppc_set_cap_dawr1() stub function for CONFIG_KVM=n. v2: https://lore.kernel.org/r/20210329041906.213991-1-ravi.bangoria@linux.ibm.com v2->v3: - Don't introduce pa_features_310[], instead, reuse pa_features_300[] for 3.1 guests, as there is no difference between initial values of them atm. - Call gen_spr_book3s_310_dbg() from init_proc_POWER10() instead of init_proc_POWER8(). Also, Don't call gen_spr_book3s_207_dbg() from gen_spr_book3s_310_dbg() as init_proc_POWER10() already calls it. v1: https://lore.kernel.org/r/20200723104220.314671-1-ravi.bangoria@linux.ibm.com [Apologies for long gap] v1->v2: - Introduce machine capability cap-dawr1 to enable/disable the feature. By default, 2nd DAWR is OFF for guests even when host kvm supports it. User has to manually enable it with -machine cap-dawr1=on if he wishes to use it. - Split the header file changes into separate patch. (Sync headers from v5.12-rc3) [1] https://git.kernel.org/torvalds/c/bd1de1a0e6eff Ravi Bangoria (3): Linux headers: update from 5.12-rc3 ppc: Rename current DAWR macros and variables ppc: Enable 2nd DAWR support on p10 hw/ppc/spapr.c | 7 +- hw/ppc/spapr_caps.c | 32 +++++++ include/hw/ppc/spapr.h | 8 +- include/standard-headers/drm/drm_fourcc.h | 23 ++++- include/standard-headers/linux/input.h | 2 +- .../standard-headers/rdma/vmw_pvrdma-abi.h | 7 ++ linux-headers/asm-generic/unistd.h | 4 +- linux-headers/asm-mips/unistd_n32.h | 1 + linux-headers/asm-mips/unistd_n64.h | 1 + linux-headers/asm-mips/unistd_o32.h | 1 + linux-headers/asm-powerpc/kvm.h | 2 + linux-headers/asm-powerpc/unistd_32.h | 1 + linux-headers/asm-powerpc/unistd_64.h | 1 + linux-headers/asm-s390/unistd_32.h | 1 + linux-headers/asm-s390/unistd_64.h | 1 + linux-headers/asm-x86/kvm.h | 1 + linux-headers/asm-x86/unistd_32.h | 1 + linux-headers/asm-x86/unistd_64.h | 1 + linux-headers/asm-x86/unistd_x32.h | 1 + linux-headers/linux/kvm.h | 89 +++++++++++++++++++ linux-headers/linux/vfio.h | 27 ++++++ target/ppc/cpu.h | 6 +- target/ppc/kvm.c | 12 +++ target/ppc/kvm_ppc.h | 12 +++ target/ppc/translate_init.c.inc | 19 +++- 25 files changed, 250 insertions(+), 11 deletions(-)