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=-10.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable 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 DBF28C433ED for ; Wed, 21 Apr 2021 07:10:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 981FF6142A for ; Wed, 21 Apr 2021 07:10:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234691AbhDUHKx (ORCPT ); Wed, 21 Apr 2021 03:10:53 -0400 Received: from 3.mo51.mail-out.ovh.net ([188.165.32.156]:56618 "EHLO 3.mo51.mail-out.ovh.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234052AbhDUHKv (ORCPT ); Wed, 21 Apr 2021 03:10:51 -0400 X-Greylist: delayed 2322 seconds by postgrey-1.27 at vger.kernel.org; Wed, 21 Apr 2021 03:10:50 EDT Received: from mxplan5.mail.ovh.net (unknown [10.108.1.125]) by mo51.mail-out.ovh.net (Postfix) with ESMTPS id 5AF05280626; Wed, 21 Apr 2021 08:31:33 +0200 (CEST) Received: from kaod.org (37.59.142.97) by DAG4EX1.mxp5.local (172.16.2.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Wed, 21 Apr 2021 08:31:32 +0200 Authentication-Results: garm.ovh; auth=pass (GARM-97G002e998e6ca-db5a-48ff-8671-b7c8d58cae9d, 3FD145AD23CDC28BEDADD0458B38E3079EC5C648) smtp.auth=clg@kaod.org X-OVh-ClientIp: 90.89.73.13 Subject: Re: [PATCH v5 3/3] ppc: Enable 2nd DAWR support on p10 To: Ravi Bangoria , David Gibson CC: , , , , , , , , , References: <20210412114433.129702-1-ravi.bangoria@linux.ibm.com> <20210412114433.129702-4-ravi.bangoria@linux.ibm.com> From: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= Message-ID: <8020c404-d8ce-2758-d936-fc5e851017f0@kaod.org> Date: Wed, 21 Apr 2021 08:31:31 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252" Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [37.59.142.97] X-ClientProxiedBy: DAG9EX2.mxp5.local (172.16.2.82) To DAG4EX1.mxp5.local (172.16.2.31) X-Ovh-Tracer-GUID: 621233e5-729b-4b55-94fb-826174eaf06d X-Ovh-Tracer-Id: 14322854192763145208 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduledrvddtjedguddtjecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefuvfhfhffkffgfgggjtgfgihesthekredttdefheenucfhrhhomhepveorughrihgtpgfnvggpifhorghtvghruceotghlgheskhgrohgurdhorhhgqeenucggtffrrghtthgvrhhnpeeglefgjeevheeifeffudeuhedvveeftdeliedukeejgeeviefgieefhfdtffeftdenucfkpheptddrtddrtddrtddpfeejrdehledrudegvddrleejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmohguvgepshhmthhpqdhouhhtpdhhvghlohepmhigphhlrghnhedrmhgrihhlrdhovhhhrdhnvghtpdhinhgvtheptddrtddrtddrtddpmhgrihhlfhhrohhmpegtlhhgsehkrghougdrohhrghdprhgtphhtthhopehgrhhouhhgsehkrghougdrohhrgh Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On 4/21/21 8:20 AM, Ravi Bangoria wrote: > Hi David, > > On 4/19/21 10:23 AM, David Gibson wrote: >> On Mon, Apr 12, 2021 at 05:14:33PM +0530, Ravi Bangoria wrote: >>> As per the PAPR, bit 0 of byte 64 in pa-features property indicates >>> availability of 2nd DAWR registers. i.e. If this bit is set, 2nd >>> DAWR is present, otherwise not. Use KVM_CAP_PPC_DAWR1 capability to >>> find whether kvm supports 2nd DAWR or not. If it's supported, allow >>> user to set the pa-feature bit in guest DT using cap-dawr1 machine >>> capability. Though, watchpoint on powerpc TCG guest is not supported >>> and thus 2nd DAWR is not enabled for TCG mode. >>> >>> Signed-off-by: Ravi Bangoria >>> Reviewed-by: Greg Kurz >> >> So, I'm actually not sure if using an spapr capability is what we want >> to do here.  The problem is that presumably the idea is to at some >> point make the DAWR1 capability default to on (on POWER10, at least). >> But at that point you'll no longer to be able to start TCG guests >> without explicitly disabling it.  That's technically correct, since we >> don't implement DAWR1 in TCG, but then we also don't implement DAWR0 >> and we let that slide... which I think is probably going to cause less >> irritation on balance. > > Ok. Probably something like this is what you want? > > Power10 behavior: >   - KVM does not support DAWR1: Boot the guest without DAWR1 >     support (No warnings). Error out only if user tries with >     cap-dawr1=on. >   - KVM supports DAWR1: Boot the guest with DAWR1 support, unless >     user specifies cap-dawr1=off. >   - TCG guest: Ignore cap-dawr1 i.e. boot as if there is only >     DAWR0 (Should be fixed in future while adding PowerPC watch- >     point support in TCG mode) > > Power10 predecessor behavior: >   - KVM guest: Boot the guest without DAWR1 support. Error out >     if user tries with cap-dawr1=on. >   - TCG guest: Ignore cap-dawr1 i.e. boot as if there is only >     DAWR0 (Should be fixed in future while adding PowerPC watch- >     point support in TCG mode) > >> I'm wondering if we're actually just better off setting the pa feature >> just based on the guest CPU model.  TCG will be broken if you try to >> use it, but then, it already is.  AFAIK there's no inherent reason we >> couldn't implement DAWR support in TCG, it's just never been worth the >> trouble. > > Correct. Probably there is no practical usecase for DAWR in TCG mode. What's the expected behavior ? Is it to generate a DSI if we have a DAWR match ? C. 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=-10.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 205EDC433B4 for ; Wed, 21 Apr 2021 06:33:58 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (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 92598613B0 for ; Wed, 21 Apr 2021 06:33:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 92598613B0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kaod.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:45282 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lZ6Qp-00015H-HO for qemu-devel@archiver.kernel.org; Wed, 21 Apr 2021 02:33:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33746) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZ6Oj-0000CW-8k; Wed, 21 Apr 2021 02:31:41 -0400 Received: from 8.mo51.mail-out.ovh.net ([46.105.45.231]:42354) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZ6Oh-0003WP-4D; Wed, 21 Apr 2021 02:31:40 -0400 Received: from mxplan5.mail.ovh.net (unknown [10.108.1.125]) by mo51.mail-out.ovh.net (Postfix) with ESMTPS id 5AF05280626; Wed, 21 Apr 2021 08:31:33 +0200 (CEST) Received: from kaod.org (37.59.142.97) by DAG4EX1.mxp5.local (172.16.2.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Wed, 21 Apr 2021 08:31:32 +0200 Authentication-Results: garm.ovh; auth=pass (GARM-97G002e998e6ca-db5a-48ff-8671-b7c8d58cae9d, 3FD145AD23CDC28BEDADD0458B38E3079EC5C648) smtp.auth=clg@kaod.org X-OVh-ClientIp: 90.89.73.13 Subject: Re: [PATCH v5 3/3] ppc: Enable 2nd DAWR support on p10 To: Ravi Bangoria , David Gibson References: <20210412114433.129702-1-ravi.bangoria@linux.ibm.com> <20210412114433.129702-4-ravi.bangoria@linux.ibm.com> From: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= Message-ID: <8020c404-d8ce-2758-d936-fc5e851017f0@kaod.org> Date: Wed, 21 Apr 2021 08:31:31 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252" Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [37.59.142.97] X-ClientProxiedBy: DAG9EX2.mxp5.local (172.16.2.82) To DAG4EX1.mxp5.local (172.16.2.31) X-Ovh-Tracer-GUID: 621233e5-729b-4b55-94fb-826174eaf06d X-Ovh-Tracer-Id: 14322854192763145208 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduledrvddtjedguddtjecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefuvfhfhffkffgfgggjtgfgihesthekredttdefheenucfhrhhomhepveorughrihgtpgfnvggpifhorghtvghruceotghlgheskhgrohgurdhorhhgqeenucggtffrrghtthgvrhhnpeeglefgjeevheeifeffudeuhedvveeftdeliedukeejgeeviefgieefhfdtffeftdenucfkpheptddrtddrtddrtddpfeejrdehledrudegvddrleejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmohguvgepshhmthhpqdhouhhtpdhhvghlohepmhigphhlrghnhedrmhgrihhlrdhovhhhrdhnvghtpdhinhgvtheptddrtddrtddrtddpmhgrihhlfhhrohhmpegtlhhgsehkrghougdrohhrghdprhgtphhtthhopehgrhhouhhgsehkrghougdrohhrgh Received-SPF: pass client-ip=46.105.45.231; envelope-from=clg@kaod.org; helo=8.mo51.mail-out.ovh.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mikey@neuling.org, kvm@vger.kernel.org, mst@redhat.com, mpe@ellerman.id.au, cohuck@redhat.com, qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, pbonzini@redhat.com, paulus@samba.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 4/21/21 8:20 AM, Ravi Bangoria wrote: > Hi David, > > On 4/19/21 10:23 AM, David Gibson wrote: >> On Mon, Apr 12, 2021 at 05:14:33PM +0530, Ravi Bangoria wrote: >>> As per the PAPR, bit 0 of byte 64 in pa-features property indicates >>> availability of 2nd DAWR registers. i.e. If this bit is set, 2nd >>> DAWR is present, otherwise not. Use KVM_CAP_PPC_DAWR1 capability to >>> find whether kvm supports 2nd DAWR or not. If it's supported, allow >>> user to set the pa-feature bit in guest DT using cap-dawr1 machine >>> capability. Though, watchpoint on powerpc TCG guest is not supported >>> and thus 2nd DAWR is not enabled for TCG mode. >>> >>> Signed-off-by: Ravi Bangoria >>> Reviewed-by: Greg Kurz >> >> So, I'm actually not sure if using an spapr capability is what we want >> to do here.  The problem is that presumably the idea is to at some >> point make the DAWR1 capability default to on (on POWER10, at least). >> But at that point you'll no longer to be able to start TCG guests >> without explicitly disabling it.  That's technically correct, since we >> don't implement DAWR1 in TCG, but then we also don't implement DAWR0 >> and we let that slide... which I think is probably going to cause less >> irritation on balance. > > Ok. Probably something like this is what you want? > > Power10 behavior: >   - KVM does not support DAWR1: Boot the guest without DAWR1 >     support (No warnings). Error out only if user tries with >     cap-dawr1=on. >   - KVM supports DAWR1: Boot the guest with DAWR1 support, unless >     user specifies cap-dawr1=off. >   - TCG guest: Ignore cap-dawr1 i.e. boot as if there is only >     DAWR0 (Should be fixed in future while adding PowerPC watch- >     point support in TCG mode) > > Power10 predecessor behavior: >   - KVM guest: Boot the guest without DAWR1 support. Error out >     if user tries with cap-dawr1=on. >   - TCG guest: Ignore cap-dawr1 i.e. boot as if there is only >     DAWR0 (Should be fixed in future while adding PowerPC watch- >     point support in TCG mode) > >> I'm wondering if we're actually just better off setting the pa feature >> just based on the guest CPU model.  TCG will be broken if you try to >> use it, but then, it already is.  AFAIK there's no inherent reason we >> couldn't implement DAWR support in TCG, it's just never been worth the >> trouble. > > Correct. Probably there is no practical usecase for DAWR in TCG mode. What's the expected behavior ? Is it to generate a DSI if we have a DAWR match ? C.