KVM Archive on lore.kernel.org
 help / color / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Cc: "Cédric Le Goater" <clg@kaod.org>,
	paulus@samba.org, mpe@ellerman.id.au, mikey@neuling.org,
	pbonzini@redhat.com, mst@redhat.com, qemu-ppc@nongnu.org,
	qemu-devel@nongnu.org, kvm@vger.kernel.org, cohuck@redhat.com,
	groug@kaod.org
Subject: Re: [PATCH v5 3/3] ppc: Enable 2nd DAWR support on p10
Date: Thu, 22 Apr 2021 11:56:54 +1000
Message-ID: <YIDX5nRJ2NWdGvlj@yekko.fritz.box> (raw)
In-Reply-To: <0b6e1a4a-eed2-1a45-50bf-2ccab398f4ed@linux.ibm.com>


[-- Attachment #1: Type: text/plain, Size: 3978 bytes --]

On Wed, Apr 21, 2021 at 12:24:22PM +0530, Ravi Bangoria wrote:
> Hi Cedric,
> 
> On 4/21/21 12:01 PM, Cédric Le Goater wrote:
> > 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 <ravi.bangoria@linux.ibm.com>
> > > > > Reviewed-by: Greg Kurz <groug@kaod.org>
> > > > 
> > > > 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 ?
> 
> Yes. DSI is the main thing. But many auxiliary stuff, off the top of my
> head:
>  - DAR needs to be set. Now, DAR value is set differently on p8 vs p10
>    (not sure about p9 because there was hw bug and thus we needed to
>    fully disable DAWR on p9).
>  - DAWR matching criteria for quadword instruction are different for
>    p8/p9 vs p10.
>  - P10 supports 512 byte unaligned watchpoints but p8/p9 does not.
> 
> Kernel is aware of these differences and thus handles these scenarios,
> sometimes as special case. i.e. Qemu will need to mimic the exact hw
> behavior for the specific revision of processor.

I don't actually know if qemu has TCG watchpoint support on any
hardware.  Presumably it would mean instrumenting all the tcg loads
and stores.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply index

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-12 11:44 [PATCH v5 0/3] ppc: Enable 2nd DAWR support on Power10 Ravi Bangoria
2021-04-12 11:44 ` [PATCH v5 1/3] Linux headers: update from 5.12-rc3 Ravi Bangoria
2021-04-12 11:44 ` [PATCH v5 2/3] ppc: Rename current DAWR macros and variables Ravi Bangoria
2021-04-19  4:47   ` David Gibson
2021-04-12 11:44 ` [PATCH v5 3/3] ppc: Enable 2nd DAWR support on p10 Ravi Bangoria
2021-04-12 13:10   ` Cédric Le Goater
2021-04-19  4:53   ` David Gibson
2021-04-21  6:20     ` Ravi Bangoria
2021-04-21  6:31       ` Cédric Le Goater
2021-04-21  6:54         ` Ravi Bangoria
2021-04-22  1:56           ` David Gibson [this message]
2021-04-22  4:45             ` Richard Henderson
2021-05-05  5:50       ` David Gibson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YIDX5nRJ2NWdGvlj@yekko.fritz.box \
    --to=david@gibson.dropbear.id.au \
    --cc=clg@kaod.org \
    --cc=cohuck@redhat.com \
    --cc=groug@kaod.org \
    --cc=kvm@vger.kernel.org \
    --cc=mikey@neuling.org \
    --cc=mpe@ellerman.id.au \
    --cc=mst@redhat.com \
    --cc=paulus@samba.org \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=ravi.bangoria@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

KVM Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/kvm/0 kvm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kvm kvm/ https://lore.kernel.org/kvm \
		kvm@vger.kernel.org
	public-inbox-index kvm

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.kvm


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git