diff mbox series

[v2,13/15] KVM: s390: remove useless page->index usage

Message ID 20250116113355.32184-14-imbrenda@linux.ibm.com (mailing list archive)
State New
Headers show
Series KVM: s390: Stop using page->index and other things | expand

Commit Message

Claudio Imbrenda Jan. 16, 2025, 11:33 a.m. UTC
The page->index field for VSIE dat tables is only used for segment
tables.

Stop setting the field for all region tables.

Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
---
 arch/s390/mm/gmap.c | 9 ---------
 1 file changed, 9 deletions(-)

Comments

Janosch Frank Jan. 20, 2025, 12:25 p.m. UTC | #1
On 1/16/25 12:33 PM, Claudio Imbrenda wrote:
> The page->index field for VSIE dat tables is only used for segment
> tables.
> 
> Stop setting the field for all region tables.
> 
> Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>

Haha, I never noticed, good catch.

Reviewed-by: Janosch Frank <frankja@linux.ibm.com>


> ---
>   arch/s390/mm/gmap.c | 9 ---------
>   1 file changed, 9 deletions(-)
> 
> diff --git a/arch/s390/mm/gmap.c b/arch/s390/mm/gmap.c
> index 9d4a62628e51..80674bbf0f7b 100644
> --- a/arch/s390/mm/gmap.c
> +++ b/arch/s390/mm/gmap.c
> @@ -1507,9 +1507,6 @@ int gmap_shadow_r2t(struct gmap *sg, unsigned long saddr, unsigned long r2t,
>   	page = gmap_alloc_crst();
>   	if (!page)
>   		return -ENOMEM;
> -	page->index = r2t & _REGION_ENTRY_ORIGIN;
> -	if (fake)
> -		page->index |= GMAP_SHADOW_FAKE_TABLE;
>   	s_r2t = page_to_phys(page);
>   	/* Install shadow region second table */
>   	spin_lock(&sg->guest_table_lock);
> @@ -1590,9 +1587,6 @@ int gmap_shadow_r3t(struct gmap *sg, unsigned long saddr, unsigned long r3t,
>   	page = gmap_alloc_crst();
>   	if (!page)
>   		return -ENOMEM;
> -	page->index = r3t & _REGION_ENTRY_ORIGIN;
> -	if (fake)
> -		page->index |= GMAP_SHADOW_FAKE_TABLE;
>   	s_r3t = page_to_phys(page);
>   	/* Install shadow region second table */
>   	spin_lock(&sg->guest_table_lock);
> @@ -1673,9 +1667,6 @@ int gmap_shadow_sgt(struct gmap *sg, unsigned long saddr, unsigned long sgt,
>   	page = gmap_alloc_crst();
>   	if (!page)
>   		return -ENOMEM;
> -	page->index = sgt & _REGION_ENTRY_ORIGIN;
> -	if (fake)
> -		page->index |= GMAP_SHADOW_FAKE_TABLE;
>   	s_sgt = page_to_phys(page);
>   	/* Install shadow region second table */
>   	spin_lock(&sg->guest_table_lock);
diff mbox series

Patch

diff --git a/arch/s390/mm/gmap.c b/arch/s390/mm/gmap.c
index 9d4a62628e51..80674bbf0f7b 100644
--- a/arch/s390/mm/gmap.c
+++ b/arch/s390/mm/gmap.c
@@ -1507,9 +1507,6 @@  int gmap_shadow_r2t(struct gmap *sg, unsigned long saddr, unsigned long r2t,
 	page = gmap_alloc_crst();
 	if (!page)
 		return -ENOMEM;
-	page->index = r2t & _REGION_ENTRY_ORIGIN;
-	if (fake)
-		page->index |= GMAP_SHADOW_FAKE_TABLE;
 	s_r2t = page_to_phys(page);
 	/* Install shadow region second table */
 	spin_lock(&sg->guest_table_lock);
@@ -1590,9 +1587,6 @@  int gmap_shadow_r3t(struct gmap *sg, unsigned long saddr, unsigned long r3t,
 	page = gmap_alloc_crst();
 	if (!page)
 		return -ENOMEM;
-	page->index = r3t & _REGION_ENTRY_ORIGIN;
-	if (fake)
-		page->index |= GMAP_SHADOW_FAKE_TABLE;
 	s_r3t = page_to_phys(page);
 	/* Install shadow region second table */
 	spin_lock(&sg->guest_table_lock);
@@ -1673,9 +1667,6 @@  int gmap_shadow_sgt(struct gmap *sg, unsigned long saddr, unsigned long sgt,
 	page = gmap_alloc_crst();
 	if (!page)
 		return -ENOMEM;
-	page->index = sgt & _REGION_ENTRY_ORIGIN;
-	if (fake)
-		page->index |= GMAP_SHADOW_FAKE_TABLE;
 	s_sgt = page_to_phys(page);
 	/* Install shadow region second table */
 	spin_lock(&sg->guest_table_lock);