[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 05/10] xen/arm: smmuv3: Remove the page 1 fixup
- To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
- From: Rahul Singh <Rahul.Singh@xxxxxxx>
- Date: Mon, 5 Sep 2022 09:13:32 +0000
- Accept-language: en-US
- Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
- Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=pHCWcaXMERe3FXd6gIa8H2PVDggSzZSrakc57PwMIME=; b=kdLxXMbTmAY4EGI/Rj7UKEqvbELjTBAWOjuxscBIHKbiqBXbLNmyVhJrWGozwM+kVZdNdeS6xUv3RvahkSl7CZF5JtfR+g2hW5bCuXyDdYSmZjvwlg/22JwHGik+o8zyaCXEU9TLsI4HXpCiNLkV3hkxcwADjgwZjumxJTeDNxhaw8z4uN+9JuGS0cknCaIVmmChOV2U6BrM7YLprgaUKIlNu9DpzM6rrf6f26GJEnM1/FC0DqxOI3EtEZlGq4vMKsjYb6n7C97ZDMg3qYGzykW+7+/Lw4hoqJNjjQhzj6AP3A92rzVBoLnSFs5wNhinpUrY0TQgw8j2R3ahjpXK3Q==
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=pHCWcaXMERe3FXd6gIa8H2PVDggSzZSrakc57PwMIME=; b=aBEFzQwtctzEtKC44HZB99CXYMrwVjniE1w1rdPSfTUrKqbLuez07lwmV+OxlAJYtjBSE7B7RfvEMxP9eE+yReY+prx8GoFjS5WKy5ozmp8RS+VHdPg3gWc0L8+FzhI7SepHKdQMQmR4YVtDxH2mJKfKA5NnAZ3nYyXVeJ8EnFu5EISggON2OYD/hhIcomF/Z9C059b1ahbqFezACdMB3/kY2j5NSOSmyIZEuWIouMgz1JrcFic8KlknpaqSEJHceHFOj8FWa1WM+b/QLgZls3iJRcDCMOSlcqX1x+3F9vlWxgkepLIaWbVdR1Bqi56GmSHXb4fr2Api7spTfxVOXw==
- Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=RPZP91eSjyPJw8MGQV0ZkDhW//nL4DEsUnvyUnGc5mgVrYUix0r5ECz2i/wscsR6frbqm9TO9rO83ALOvfsBxBDZdTPRB0H/TULLNu2cS4Y8bR/vRbj2byjKfIz5Rvkep3CUdVX92Wx+MCiexv37YBgF6jqAAiGGkRX1+1F59NtNI7QdAQYAPw9/v3LSJb1LDzTM5hnb3hc2+ag13yBDUm0sJpenCHMw770VGKsVPQnGioifX7JnRyh8Q94prULqXYFooprBPDrnxUYSmDkrOO3twuCROwVuLvhRJLdA14NTk1CJDHX/E6C0TjH3wH7wPB4/ob75Ujfogxr+hNb+Zg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gKhFAFLjVm3llQURixmhBELy8C9mGTXWoEQ6AnUZ6H2U76o7Ag3iJaNlIlJe0ktXXI0XzEFRDPrrnb8eZGLffGmlVaFSPXaRufDyCj1fG8VK8yIhKzkCKWi2/Apesjv8UqtQNtJI91IITTbP7khgBMHPJ5csh9WCOjBqu0Iqgq03Y1KLMF6Z2XZig4n+e+0feO86ZpP36pOhOYXb2MN5vFybs3QkHeYKIvEWx4WlLPGF9a16o6y6/m0gZCAAhkLRpTJcJJ7cscrCR89kjd1bYHwDphFDwh/0hw0FOeHxRK0fkQchsADs0ozkfy9GQhs0UOy9XU6vnoB9ibImWxw+nQ==
- Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Robin Murphy <Robin.Murphy@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Will Deacon <will@xxxxxxxxxx>
- Delivery-date: Mon, 05 Sep 2022 09:13:53 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Nodisclaimer: true
- Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Thread-index: AQHYvtEkIpWQpxSsvEmAc2g+NtYY8q3MxpiAgAPLTwA=
- Thread-topic: [PATCH v2 05/10] xen/arm: smmuv3: Remove the page 1 fixup
Hi Stefano,
> On 3 Sep 2022, at 12:17 am, Stefano Stabellini <sstabellini@xxxxxxxxxx> wrote:
>
> On Fri, 2 Sep 2022, Rahul Singh wrote:
>> From: Robin Murphy <robin.murphy@xxxxxxx>
>>
>> Backport Linux commit 86d2d9214880. This is the clean backport without
>> any changes.
>>
>> Since we now keep track of page 1 via a separate pointer that
>> already encapsulates aliasing to page 0 as necessary, we can remove
>> the clunky fixup routine and simply use the relevant bases directly.
>> The current architecture spec (IHI0070D.a) defines
>> SMMU_{EVENTQ,PRIQ}_{PROD,CONS} as offsets relative to page 1, so the
>> cleanup represents a little bit of convergence as well as just
>> lines of code saved.
>>
>> Signed-off-by: Robin Murphy <robin.murphy@xxxxxxx>
>> Signed-off-by: Will Deacon <will@xxxxxxxxxx>
>> Origin: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>> 86d2d9214880
>> Signed-off-by: Rahul Singh <rahul.singh@xxxxxxx>
>> ---
>> Changes in v2:
>> - fix commit msg.
>> ---
>> xen/drivers/passthrough/arm/smmu-v3.c | 42 ++++++++++-----------------
>> xen/drivers/passthrough/arm/smmu-v3.h | 8 ++---
>> 2 files changed, 20 insertions(+), 30 deletions(-)
>>
>> diff --git a/xen/drivers/passthrough/arm/smmu-v3.c
>> b/xen/drivers/passthrough/arm/smmu-v3.c
>> index 85ad066266..f5485a8a1c 100644
>> --- a/xen/drivers/passthrough/arm/smmu-v3.c
>> +++ b/xen/drivers/passthrough/arm/smmu-v3.c
>> @@ -235,15 +235,6 @@ static struct arm_smmu_option_prop arm_smmu_options[] =
>> {
>> { 0, NULL},
>> };
>>
>> -static inline void __iomem *arm_smmu_page1_fixup(unsigned long offset,
>> - struct arm_smmu_device *smmu)
>> -{
>> - if (offset > SZ_64K)
>> - return smmu->page1 + offset - SZ_64K;
>> -
>> - return smmu->base + offset;
>> -}
>> -
>> static struct arm_smmu_domain *to_smmu_domain(struct iommu_domain *dom)
>> {
>> return container_of(dom, struct arm_smmu_domain, domain);
>> @@ -1578,6 +1569,7 @@ static int arm_smmu_dt_xlate(struct device *dev,
>> /* Probing and initialisation functions */
>> static int arm_smmu_init_one_queue(struct arm_smmu_device *smmu,
>> struct arm_smmu_queue *q,
>> + void __iomem *page,
>> unsigned long prod_off,
>> unsigned long cons_off,
>> size_t dwords, const char *name)
>> @@ -1606,8 +1598,8 @@ static int arm_smmu_init_one_queue(struct
>> arm_smmu_device *smmu,
>> 1 << q->llq.max_n_shift, name);
>> }
>>
>> - q->prod_reg = arm_smmu_page1_fixup(prod_off, smmu);
>> - q->cons_reg = arm_smmu_page1_fixup(cons_off, smmu);
>> + q->prod_reg = page + prod_off;
>> + q->cons_reg = page + prod_off;
>
> In the original patch it was:
>
> - q->prod_reg = arm_smmu_page1_fixup(prod_off, smmu);
> - q->cons_reg = arm_smmu_page1_fixup(cons_off, smmu);
> + q->prod_reg = page + prod_off;
> + q->cons_reg = page + cons_off;
>
> Specifically the second line seems to be wrong here?
Yes you are right I somehow miss that . I will fix that.
Regards.
Rahul
|