linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lu Baolu <baolu.lu@linux.intel.com>
To: "Liu, Yi L" <yi.l.liu@intel.com>, Joerg Roedel <joro@8bytes.org>
Cc: baolu.lu@linux.intel.com, David Woodhouse <dwmw2@infradead.org>,
	"Raj, Ashok" <ashok.raj@intel.com>,
	"Kumar, Sanjay K" <sanjay.k.kumar@intel.com>,
	"Pan, Jacob jun" <jacob.jun.pan@intel.com>,
	"Tian, Kevin" <kevin.tian@intel.com>,
	"Sun, Yi Y" <yi.y.sun@intel.com>,
	"peterx@redhat.com" <peterx@redhat.com>,
	Jean-Philippe Brucker <jean-philippe.brucker@arm.com>,
	"iommu@lists.linux-foundation.org"
	<iommu@lists.linux-foundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Jacob Pan <jacob.jun.pan@linux.intel.com>
Subject: Re: [PATCH v5 04/12] iommu/vt-d: Add 256-bit invalidation descriptor support
Date: Tue, 4 Dec 2018 14:13:31 +0800	[thread overview]
Message-ID: <3b0eadd2-b99f-98d6-594f-0419f0542789@linux.intel.com> (raw)
In-Reply-To: <A2975661238FB949B60364EF0F2C257439D838AB@SHSMSX104.ccr.corp.intel.com>

Hi,

On 12/4/18 1:23 AM, Liu, Yi L wrote:
> Hi Joerg,
> 
>> From: Joerg Roedel [mailto:joro@8bytes.org]
>> Sent: Monday, December 3, 2018 5:49 AM
>> To: Lu Baolu <baolu.lu@linux.intel.com>
>> Subject: Re: [PATCH v5 04/12] iommu/vt-d: Add 256-bit invalidation descriptor
>> support
>>
>> On Wed, Nov 28, 2018 at 11:54:41AM +0800, Lu Baolu wrote:
>>> -
>>> -	desc_page = alloc_pages_node(iommu->node, GFP_ATOMIC | __GFP_ZERO,
>> 0);
>>> +	/*
>>> +	 * Need two pages to accommodate 256 descriptors of 256 bits each
>>> +	 * if the remapping hardware supports scalable mode translation.
>>> +	 */
>>> +	desc_page = alloc_pages_node(iommu->node, GFP_ATOMIC | __GFP_ZERO,
>>> +				     !!ecap_smts(iommu->ecap));
>>
>>
>> Same here, does the allocation really need GFP_ATOMIC?
> 
> still leave to Baolu.

The existing code uses GFP_ATOMIC, this patch only changes the size of
the allocated desc_page.

I don't think we really need GFP_ATOMIC here (and also for some other
places). I will clean up them in a separated patch.

> 
>>
>>>   struct q_inval {
>>>   	raw_spinlock_t  q_lock;
>>> -	struct qi_desc  *desc;          /* invalidation queue */
>>> +	void		*desc;          /* invalidation queue */
>>>   	int             *desc_status;   /* desc status */
>>>   	int             free_head;      /* first free entry */
>>>   	int             free_tail;      /* last free entry */
>>
>> Why do you switch the pointer to void* ?
> 
> In this patch, there is some code like the code below. It calculates
> destination address of memcpy with qi->desc. If it's still struct qi_desc
> pointer, the calculation result would be wrong.
> 
> +			memcpy(desc, qi->desc + (wait_index << shift),
> +			       1 << shift);
> 
> The change of the calculation method is to support 128 bits invalidation
> descriptors and 256 invalidation descriptors in this unified code logic.
> 
> Also, the conversation between Baolu and me may help.
> 
> https://lore.kernel.org/patchwork/patch/1006756/

Yes. We need to support different descriptor size.

Best regards,
Lu Baolu

  reply	other threads:[~2018-12-04  6:16 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-28  3:54 [PATCH v5 00/12] iommu/vt-d: Add scalable mode support Lu Baolu
2018-11-28  3:54 ` [PATCH v5 01/12] iommu/vt-d: Enumerate the scalable mode capability Lu Baolu
2018-11-28  3:54 ` [PATCH v5 02/12] iommu/vt-d: Manage scalalble mode PASID tables Lu Baolu
2018-12-03 13:44   ` Joerg Roedel
2018-12-03 17:23     ` Liu, Yi L
2018-12-04  5:58       ` Lu Baolu
2018-12-05 15:50         ` Joerg Roedel
2018-12-06  1:13           ` Lu Baolu
2018-12-05 15:47       ` Joerg Roedel
2018-11-28  3:54 ` [PATCH v5 03/12] iommu/vt-d: Move page table helpers into header Lu Baolu
2018-11-28  3:54 ` [PATCH v5 04/12] iommu/vt-d: Add 256-bit invalidation descriptor support Lu Baolu
2018-12-03 13:48   ` Joerg Roedel
2018-12-03 17:23     ` Liu, Yi L
2018-12-04  6:13       ` Lu Baolu [this message]
2018-12-05 15:56         ` Joerg Roedel
2018-12-06  1:19           ` Lu Baolu
2018-11-28  3:54 ` [PATCH v5 05/12] iommu/vt-d: Reserve a domain id for FL and PT modes Lu Baolu
2018-11-28  3:54 ` [PATCH v5 06/12] iommu/vt-d: Add second level page table interface Lu Baolu
2018-11-28  3:54 ` [PATCH v5 07/12] iommu/vt-d: Setup pasid entry for RID2PASID support Lu Baolu
2018-11-28  3:54 ` [PATCH v5 08/12] iommu/vt-d: Pass pasid table to context mapping Lu Baolu
2018-11-28  3:54 ` [PATCH v5 09/12] iommu/vt-d: Setup context and enable RID2PASID support Lu Baolu
2018-11-28  3:54 ` [PATCH v5 10/12] iommu/vt-d: Add first level page table interface Lu Baolu
2018-11-28  3:54 ` [PATCH v5 11/12] iommu/vt-d: Shared virtual address in scalable mode Lu Baolu
2018-11-28  3:54 ` [PATCH v5 12/12] iommu/vt-d: Remove deferred invalidation 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=3b0eadd2-b99f-98d6-594f-0419f0542789@linux.intel.com \
    --to=baolu.lu@linux.intel.com \
    --cc=ashok.raj@intel.com \
    --cc=dwmw2@infradead.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=jacob.jun.pan@intel.com \
    --cc=jacob.jun.pan@linux.intel.com \
    --cc=jean-philippe.brucker@arm.com \
    --cc=joro@8bytes.org \
    --cc=kevin.tian@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterx@redhat.com \
    --cc=sanjay.k.kumar@intel.com \
    --cc=yi.l.liu@intel.com \
    --cc=yi.y.sun@intel.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;
as well as URLs for NNTP newsgroup(s).