From: James Houghton <jthoughton@google.com>
To: Will Deacon <will@kernel.org>
Cc: Steve Capper <steve.capper@arm.com>,
Andrew Morton <akpm@linux-foundation.org>,
Mike Kravetz <mike.kravetz@oracle.com>,
Muchun Song <songmuchun@bytedance.com>,
Anshuman Khandual <anshuman.khandual@arm.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Ryan Roberts <ryan.roberts@arm.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] arm64: mm: Always make sw-dirty PTEs hw-dirty in pte_modify
Date: Mon, 11 Dec 2023 11:01:38 -0800 [thread overview]
Message-ID: <CADrL8HXqKfG9S0xLot6gA7_Vhw7rod6WqqgcKAVWNZ4FJOquQw@mail.gmail.com> (raw)
In-Reply-To: <20231211184236.GB26462@willie-the-truck>
On Mon, Dec 11, 2023 at 10:42 AM Will Deacon <will@kernel.org> wrote:
>
> On Mon, Dec 04, 2023 at 05:26:46PM +0000, James Houghton wrote:
> > Make it impossible to create a sw-dirty, hw-clean PTE with pte_modify.
> > Such a PTE should be impossible to create, and there may be places that
> > assume that pte_dirty() implies pte_hw_dirty().
> >
> > Signed-off-by: James Houghton <jthoughton@google.com>
>
> I'm not sure how, but you seem to be missing the '---' separator and the
> diffstat here, so I suspect this might confuse tools such as b4 which try
> to apply the patch directly.
Thanks for pointing that out. Looks like it came from using
`--summary` in git format-patch. :/
>
> > diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h
> > index b19a8aee684c..79ce70fbb751 100644
> > --- a/arch/arm64/include/asm/pgtable.h
> > +++ b/arch/arm64/include/asm/pgtable.h
> > @@ -834,6 +834,12 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
> > pte = set_pte_bit(pte, __pgprot(PTE_DIRTY));
> >
> > pte_val(pte) = (pte_val(pte) & ~mask) | (pgprot_val(newprot) & mask);
> > + /*
> > + * If we end up clearing hw dirtiness for a sw-dirty PTE, set hardware
> > + * dirtiness again.
> > + */
> > + if (pte_sw_dirty(pte))
> > + pte = pte_mkdirty(pte);
> > return pte;
>
> Looks like this is a fix for Catalin to pick up (patch #1 isn't necessary
> afaict).
If only this patch is taken, make sure to add cc:stable and the fixes
tag from patch #1. Thank you!
next prev parent reply other threads:[~2023-12-11 19:02 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-04 17:26 [PATCH 0/2] arm64: hugetlb: Fix page fault loop for sw-dirty/hw-clean contiguous PTEs James Houghton
2023-12-04 17:26 ` [PATCH 1/2] arm64: hugetlb: Distinguish between hw and sw dirtiness in __cont_access_flags_changed James Houghton
2023-12-04 17:26 ` [PATCH 2/2] arm64: mm: Always make sw-dirty PTEs hw-dirty in pte_modify James Houghton
2023-12-06 10:26 ` Ryan Roberts
2023-12-11 18:42 ` Will Deacon
2023-12-11 19:01 ` James Houghton [this message]
2023-12-05 14:43 ` [PATCH 0/2] arm64: hugetlb: Fix page fault loop for sw-dirty/hw-clean contiguous PTEs Ryan Roberts
2023-12-05 17:54 ` James Houghton
2023-12-06 10:24 ` Ryan Roberts
2023-12-06 21:01 ` James Houghton
2023-12-12 17:22 ` (subset) " Catalin Marinas
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=CADrL8HXqKfG9S0xLot6gA7_Vhw7rod6WqqgcKAVWNZ4FJOquQw@mail.gmail.com \
--to=jthoughton@google.com \
--cc=akpm@linux-foundation.org \
--cc=anshuman.khandual@arm.com \
--cc=catalin.marinas@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mike.kravetz@oracle.com \
--cc=ryan.roberts@arm.com \
--cc=songmuchun@bytedance.com \
--cc=steve.capper@arm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox