All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Vasant Hegde <vasant.hegde@amd.com>
Cc: Alejandro Jimenez <alejandro.j.jimenez@oracle.com>,
	iommu@lists.linux.dev, linux-kernel@vger.kernel.org,
	joro@8bytes.org, suravee.suthikulpanit@amd.com, will@kernel.org,
	joao.m.martins@oracle.com, boris.ostrovsky@oracle.com
Subject: Re: [PATCH 1/1] iommu/amd: Preserve default DTE fields when updating Host Page Table Root
Date: Tue, 7 Jan 2025 14:01:46 -0400	[thread overview]
Message-ID: <20250107180146.GO5556@nvidia.com> (raw)
In-Reply-To: <f87e897e-028f-43a7-9557-e65778267fc8@amd.com>

On Tue, Jan 07, 2025 at 05:45:38PM +0530, Vasant Hegde wrote:
> > @@ -2052,12 +2052,12 @@ static void set_dte_entry(struct amd_iommu *iommu,
> >  	make_clear_dte(dev_data, dte, &new);
> 
> This fix is fine. But with all changes we have done in this code does, do we
> really need make_clear_dte()?

> How about removing `make_clear_dte()` and moving DTE_FLAG_V to
> write_dte_lower128() ?

The V flag should just be set by the functions building the DTE,
write_dte_lower() should accept a fully formed dte as a matter of
layering.

I'm hopefull Suravee will come with something like this:

https://lore.kernel.org/linux-iommu/20241016142237.GP3559746@nvidia.com/

And then I'd expect to drop make_clear_dte() and sprinkle the V into
the individual settings that already have bitflags for entry 0.

The one place outside that call chain using make_clear_dte() is
clear_dte_entry() which should call a set_dte_blocked() with the above
break up.

Then the set_dte() functions are called by the attach functions and
you can get hitless replace.

Jason

  parent reply	other threads:[~2025-01-07 18:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-06 19:14 [PATCH 1/1] iommu/amd: Preserve default DTE fields when updating Host Page Table Root Alejandro Jimenez
2025-01-07  8:50 ` Srivastava, Dheeraj Kumar
2025-01-07 12:15 ` Vasant Hegde
2025-01-07 13:36   ` Arun Kodilkar, Sairaj
2025-01-07 18:01   ` Jason Gunthorpe [this message]
2025-02-26 16:19     ` Alejandro Jimenez
2025-02-26 16:35       ` Jason Gunthorpe
2025-02-28  9:54       ` Vasant Hegde
2025-02-28 11:18 ` Joerg Roedel

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=20250107180146.GO5556@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=alejandro.j.jimenez@oracle.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=iommu@lists.linux.dev \
    --cc=joao.m.martins@oracle.com \
    --cc=joro@8bytes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=vasant.hegde@amd.com \
    --cc=will@kernel.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.