All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Huang\, Ying" <ying.huang@intel.com>
To: Dave Hansen <dave.hansen@intel.com>
Cc: Lu Baolu <baolu.lu@linux.intel.com>, Bob Liu <liubo95@huawei.com>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H . Peter Anvin" <hpa@zytor.com>,
	Alex Williamson <alex.williamson@redhat.com>,
	"Joerg Roedel" <joro@8bytes.org>,
	David Woodhouse <dwmw2@infradead.org>,
	Rik van Riel <riel@redhat.com>, Michal Hocko <mhocko@suse.com>,
	Dave Jiang <dave.jiang@intel.com>, <x86@kernel.org>,
	<linux-kernel@vger.kernel.org>, <linux-mm@kvack.org>,
	<iommu@lists.linux-foundation.org>,
	Vegard Nossum <vegard.nossum@oracle.com>,
	Andy Lutomirski <luto@kernel.org>,
	Matthew Wilcox <willy@linux.intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	"Paul E . McKenney" <paulmck@linux.vnet.ibm.com>,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	Kees Cook <keescook@chromium.org>,
	"xieyisheng \(A\)" <xieyisheng1@huawei.com>
Subject: Re: [PATCH 1/2] mm: Add kernel MMU notifier to manage IOTLB/DEVTLB
Date: Thu, 14 Dec 2017 14:43:27 +0800	[thread overview]
Message-ID: <87efnxn71s.fsf@yhuang-dev.intel.com> (raw)
In-Reply-To: <4466eac3-c4f5-47e4-e568-912a560240c1@intel.com> (Dave Hansen's message of "Wed, 13 Dec 2017 22:28:37 -0800")

Hi, Dave,

Dave Hansen <dave.hansen@intel.com> writes:

> On 12/13/2017 07:38 PM, Lu Baolu wrote:
>> 2. When vmalloc/vfree interfaces are called, the page mappings
>>     for kernel memory might get changed. And current code calls
>>     flush_tlb_kernel_range() to flush CPU TLBs only. The IOTLB or
>>     DevTLB will be stale compared to that on the cpu for kernel
>>     mappings.
>
> What's the plan to deal with all of the ways other than vmalloc() that
> the kernel changes the page tables?

The kernel MMU notifier is called in flush_tlb_kernel_range().  So IOMMU
will be notified for TLB flushing caused by all ways that the kernel
changes the page tables including vmalloc, kmap, etc.

Best Regards,
Huang, Ying

WARNING: multiple messages have this Message-ID (diff)
From: "Huang\, Ying" <ying.huang@intel.com>
To: Dave Hansen <dave.hansen@intel.com>
Cc: Lu Baolu <baolu.lu@linux.intel.com>, Bob Liu <liubo95@huawei.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H . Peter Anvin" <hpa@zytor.com>,
	Alex Williamson <alex.williamson@redhat.com>,
	Joerg Roedel <joro@8bytes.org>,
	David Woodhouse <dwmw2@infradead.org>,
	Rik van Riel <riel@redhat.com>, Michal Hocko <mhocko@suse.com>,
	Dave Jiang <dave.jiang@intel.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	iommu@lists.linux-foundation.org,
	Vegard Nossum <vegard.nossum@oracle.com>,
	Andy Lutomirski <luto@kernel.org>,
	Matthew Wilcox <willy@linux.intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	"Paul E . McKenney" <paulmck@linux.vnet.ibm.com>,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	Kees Cook <keescook@chromium.org>,
	"xieyisheng (A)" <xieyisheng1@huawei.com>
Subject: Re: [PATCH 1/2] mm: Add kernel MMU notifier to manage IOTLB/DEVTLB
Date: Thu, 14 Dec 2017 14:43:27 +0800	[thread overview]
Message-ID: <87efnxn71s.fsf@yhuang-dev.intel.com> (raw)
In-Reply-To: <4466eac3-c4f5-47e4-e568-912a560240c1@intel.com> (Dave Hansen's message of "Wed, 13 Dec 2017 22:28:37 -0800")

Hi, Dave,

Dave Hansen <dave.hansen@intel.com> writes:

> On 12/13/2017 07:38 PM, Lu Baolu wrote:
>> 2. When vmalloc/vfree interfaces are called, the page mappings
>>     for kernel memory might get changed. And current code calls
>>     flush_tlb_kernel_range() to flush CPU TLBs only. The IOTLB or
>>     DevTLB will be stale compared to that on the cpu for kernel
>>     mappings.
>
> What's the plan to deal with all of the ways other than vmalloc() that
> the kernel changes the page tables?

The kernel MMU notifier is called in flush_tlb_kernel_range().  So IOMMU
will be notified for TLB flushing caused by all ways that the kernel
changes the page tables including vmalloc, kmap, etc.

Best Regards,
Huang, Ying

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

WARNING: multiple messages have this Message-ID (diff)
From: "Huang\, Ying" <ying.huang@intel.com>
To: Dave Hansen <dave.hansen@intel.com>
Cc: Lu Baolu <baolu.lu@linux.intel.com>, Bob Liu <liubo95@huawei.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H . Peter Anvin" <hpa@zytor.com>,
	Alex Williamson <alex.williamson@redhat.com>,
	Joerg Roedel <joro@8bytes.org>,
	David Woodhouse <dwmw2@infradead.org>,
	Rik van Riel <riel@redhat.com>, Michal Hocko <mhocko@suse.com>,
	Dave Jiang <dave.jiang@intel.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	iommu@lists.linux-foundation.org,
	Vegard Nossum <vegard.nossum@oracle.com>,
	Andy Lutomirski <luto@kernel.org>,
	Matthew Wilcox <willy@linux.intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	"Paul E . McKenney" <paulmck@linux.vnet.ibm.com>,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	Kees Coo k <keescook@chromium.org>,
	"xieyisheng (A)" <xieyisheng1@huawei.com>
Subject: Re: [PATCH 1/2] mm: Add kernel MMU notifier to manage IOTLB/DEVTLB
Date: Thu, 14 Dec 2017 14:43:27 +0800	[thread overview]
Message-ID: <87efnxn71s.fsf@yhuang-dev.intel.com> (raw)
In-Reply-To: <4466eac3-c4f5-47e4-e568-912a560240c1@intel.com> (Dave Hansen's message of "Wed, 13 Dec 2017 22:28:37 -0800")

Hi, Dave,

Dave Hansen <dave.hansen@intel.com> writes:

> On 12/13/2017 07:38 PM, Lu Baolu wrote:
>> 2. When vmalloc/vfree interfaces are called, the page mappings
>>     for kernel memory might get changed. And current code calls
>>     flush_tlb_kernel_range() to flush CPU TLBs only. The IOTLB or
>>     DevTLB will be stale compared to that on the cpu for kernel
>>     mappings.
>
> What's the plan to deal with all of the ways other than vmalloc() that
> the kernel changes the page tables?

The kernel MMU notifier is called in flush_tlb_kernel_range().  So IOMMU
will be notified for TLB flushing caused by all ways that the kernel
changes the page tables including vmalloc, kmap, etc.

Best Regards,
Huang, Ying

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2017-12-14  6:43 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-14  1:02 [PATCH 0/2] Kernel MMU notifier for IOTLB/DEVTLB management Lu Baolu
2017-12-14  1:02 ` Lu Baolu
2017-12-14  1:02 ` [PATCH 1/2] mm: Add kernel MMU notifier to manage IOTLB/DEVTLB Lu Baolu
2017-12-14  1:02   ` Lu Baolu
2017-12-14  1:02   ` Lu Baolu
2017-12-14  3:10   ` Bob Liu
2017-12-14  3:10     ` Bob Liu
2017-12-14  3:10     ` Bob Liu
2017-12-14  3:38     ` Lu Baolu
2017-12-14  3:38       ` Lu Baolu
2017-12-14  6:07       ` Bob Liu
2017-12-14  6:07         ` Bob Liu
2017-12-14  6:07         ` Bob Liu
2017-12-15  3:08         ` Raj, Ashok
2017-12-15  3:08           ` Raj, Ashok
2017-12-15  3:08           ` Raj, Ashok
2017-12-14  6:28       ` Dave Hansen
2017-12-14  6:28         ` Dave Hansen
2017-12-14  6:43         ` Huang, Ying [this message]
2017-12-14  6:43           ` Huang, Ying
2017-12-14  6:43           ` Huang, Ying
2017-12-14  1:02 ` [PATCH 2/2] iommu/vt-d: Register " Lu Baolu
2017-12-14  1:02   ` Lu Baolu
2017-12-14  1:02   ` Lu Baolu

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=87efnxn71s.fsf@yhuang-dev.intel.com \
    --to=ying.huang@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=alex.williamson@redhat.com \
    --cc=baolu.lu@linux.intel.com \
    --cc=dave.hansen@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=dwmw2@infradead.org \
    --cc=hpa@zytor.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joro@8bytes.org \
    --cc=keescook@chromium.org \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=liubo95@huawei.com \
    --cc=luto@kernel.org \
    --cc=mhocko@suse.com \
    --cc=mingo@redhat.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=riel@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=vegard.nossum@oracle.com \
    --cc=willy@linux.intel.com \
    --cc=x86@kernel.org \
    --cc=xieyisheng1@huawei.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
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.