LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Harsh Prateek Bora <harshpb@linux.ibm.com>
To: Gaurav Batra <gbatra@linux.ibm.com>, maddy@linux.ibm.com
Cc: linuxppc-dev@lists.ozlabs.org, ritesh.list@gmail.com,
	donettom@linux.ibm.com, vaibhav@linux.ibm.com,
	sbhat@linux.ibm.com
Subject: Re: [PATCH] powerpc/pseries/iommu: Add TCEs for 16GB pages when RAM is pre-mapped
Date: Wed, 6 May 2026 09:34:53 +0530	[thread overview]
Message-ID: <36506ccd-5448-4ed6-a1be-aa89d80c4d43@linux.ibm.com> (raw)
In-Reply-To: <d8448246-f296-44d1-ac95-a80984e78c7e@linux.ibm.com>



On 06/05/26 2:31 am, Gaurav Batra wrote:
> 
> On 5/5/26 1:49 PM, Harsh Prateek Bora wrote:
>>
>>
>> On 05/05/26 2:24 am, Gaurav Batra wrote:
>>> @@ -2431,7 +2437,7 @@ static int iommu_mem_notifier(struct 
>>> notifier_block *nb, unsigned long action,
>>>           spin_lock(&dma_win_list_lock);
>>>           list_for_each_entry(window, &dma_win_list, list) {
>>>               if (window->direct && (arg->start_pfn << PAGE_SHIFT) <
>>> -                ddw_memory_hotplug_max()) {
>>> +                pseries_ddw_max_ram) {
>>>                   ret |= tce_setrange_multi_pSeriesLP(arg->start_pfn,
>>>                           arg->nr_pages, window->prop);
>>
>> I think not only start_pfn, but end_pfn also needs to be within allowed
>> range, which may require clamping arg->nr_pages if crossing the limits.
> The reason to only check for start_pfn is because the range given will 
> either be in the RAM or pmemory. It can never cross the boundary

Usually as an API, we do not trust the caller, hence the check for
start_pfn. However, if at all we need to go ahead with that assumption,
may be document that as a code comment and/or in the commit log also?

>>
>>>               }
>>> @@ -2444,7 +2450,7 @@ static int iommu_mem_notifier(struct 
>>> notifier_block *nb, unsigned long action,
>>>           spin_lock(&dma_win_list_lock);
>>>           list_for_each_entry(window, &dma_win_list, list) {
>>>               if (window->direct && (arg->start_pfn << PAGE_SHIFT) <
>>> -                ddw_memory_hotplug_max()) {
>>> +                pseries_ddw_max_ram) {
>>>                   ret |= tce_clearrange_multi_pSeriesLP(arg->start_pfn,
>>>                           arg->nr_pages, window->prop);
>>>               }
>>



  reply	other threads:[~2026-05-06  4:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-04 20:54 [PATCH] powerpc/pseries/iommu: Add TCEs for 16GB pages when RAM is pre-mapped Gaurav Batra
2026-05-05 18:49 ` Harsh Prateek Bora
2026-05-05 21:01   ` Gaurav Batra
2026-05-06  4:04     ` Harsh Prateek Bora [this message]
2026-05-06 19:27       ` Gaurav Batra
2026-05-07  4:44         ` Harsh Prateek Bora

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=36506ccd-5448-4ed6-a1be-aa89d80c4d43@linux.ibm.com \
    --to=harshpb@linux.ibm.com \
    --cc=donettom@linux.ibm.com \
    --cc=gbatra@linux.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.ibm.com \
    --cc=ritesh.list@gmail.com \
    --cc=sbhat@linux.ibm.com \
    --cc=vaibhav@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
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