linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] KVM: guest_memfd: Remove redundant kvm_gmem_getattr implementation
@ 2025-06-02 17:23 Shivank Garg
  2025-06-02 19:57 ` Ackerley Tng
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Shivank Garg @ 2025-06-02 17:23 UTC (permalink / raw)
  To: pbonzini, kvm, linux-kernel; +Cc: shivankg, bharata, tabba, ackerleytng

Remove the redundant kvm_gmem_getattr() implementation that simply calls
generic_fillattr() without any special handling. The VFS layer
(vfs_getattr_nosec()) will call generic_fillattr() by default when no
custom getattr operation is provided in the inode_operations structure.

This is a cleanup with no functional change.

Signed-off-by: Shivank Garg <shivankg@amd.com>
---
 virt/kvm/guest_memfd.c | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/virt/kvm/guest_memfd.c b/virt/kvm/guest_memfd.c
index b2aa6bf24d3a..7d85cc33c0bb 100644
--- a/virt/kvm/guest_memfd.c
+++ b/virt/kvm/guest_memfd.c
@@ -382,23 +382,12 @@ static const struct address_space_operations kvm_gmem_aops = {
 #endif
 };
 
-static int kvm_gmem_getattr(struct mnt_idmap *idmap, const struct path *path,
-			    struct kstat *stat, u32 request_mask,
-			    unsigned int query_flags)
-{
-	struct inode *inode = path->dentry->d_inode;
-
-	generic_fillattr(idmap, request_mask, inode, stat);
-	return 0;
-}
-
 static int kvm_gmem_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
 			    struct iattr *attr)
 {
 	return -EINVAL;
 }
 static const struct inode_operations kvm_gmem_iops = {
-	.getattr	= kvm_gmem_getattr,
 	.setattr	= kvm_gmem_setattr,
 };
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] KVM: guest_memfd: Remove redundant kvm_gmem_getattr implementation
  2025-06-02 17:23 [PATCH] KVM: guest_memfd: Remove redundant kvm_gmem_getattr implementation Shivank Garg
@ 2025-06-02 19:57 ` Ackerley Tng
  2025-06-24 19:57   ` Sean Christopherson
  2025-06-25 12:26 ` Gupta, Pankaj
  2025-06-25 22:25 ` Sean Christopherson
  2 siblings, 1 reply; 6+ messages in thread
From: Ackerley Tng @ 2025-06-02 19:57 UTC (permalink / raw)
  To: Shivank Garg; +Cc: pbonzini, kvm, linux-kernel, shivankg, bharata, tabba


Reviewed-By: Ackerley Tng <ackerleytng@google.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] KVM: guest_memfd: Remove redundant kvm_gmem_getattr implementation
  2025-06-02 19:57 ` Ackerley Tng
@ 2025-06-24 19:57   ` Sean Christopherson
  2025-06-25  5:25     ` Shivank Garg
  0 siblings, 1 reply; 6+ messages in thread
From: Sean Christopherson @ 2025-06-24 19:57 UTC (permalink / raw)
  To: Ackerley Tng; +Cc: Shivank Garg, pbonzini, kvm, linux-kernel, bharata, tabba

On Mon, Jun 02, 2025, Ackerley Tng wrote:
> 
> Reviewed-By: Ackerley Tng <ackerleytng@google.com>

Ackerley,

FYI, your mail doesn't appear to have made it to the lists, e.g. isn't available
on lore.  I don't see anything obviously wrong (though that means almost nothing).
Hopefully it's just a one-off glitch?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] KVM: guest_memfd: Remove redundant kvm_gmem_getattr implementation
  2025-06-24 19:57   ` Sean Christopherson
@ 2025-06-25  5:25     ` Shivank Garg
  0 siblings, 0 replies; 6+ messages in thread
From: Shivank Garg @ 2025-06-25  5:25 UTC (permalink / raw)
  To: Sean Christopherson, Ackerley Tng
  Cc: pbonzini, kvm, linux-kernel, bharata, tabba



On 6/25/2025 1:27 AM, Sean Christopherson wrote:
> On Mon, Jun 02, 2025, Ackerley Tng wrote:
>>
>> Reviewed-By: Ackerley Tng <ackerleytng@google.com>
> 
> Ackerley,
> 
> FYI, your mail doesn't appear to have made it to the lists, e.g. isn't available
> on lore.  I don't see anything obviously wrong (though that means almost nothing).
> Hopefully it's just a one-off glitch?

Hi Sean,

I can find it on lore:
https://lore.kernel.org/all/diqzv7pdq5lc.fsf@ackerleytng-ctop.c.googlers.com

Thanks,
Shivank

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] KVM: guest_memfd: Remove redundant kvm_gmem_getattr implementation
  2025-06-02 17:23 [PATCH] KVM: guest_memfd: Remove redundant kvm_gmem_getattr implementation Shivank Garg
  2025-06-02 19:57 ` Ackerley Tng
@ 2025-06-25 12:26 ` Gupta, Pankaj
  2025-06-25 22:25 ` Sean Christopherson
  2 siblings, 0 replies; 6+ messages in thread
From: Gupta, Pankaj @ 2025-06-25 12:26 UTC (permalink / raw)
  To: Shivank Garg, pbonzini, kvm, linux-kernel; +Cc: bharata, tabba, ackerleytng

On 6/2/2025 7:23 PM, Shivank Garg wrote:
> Remove the redundant kvm_gmem_getattr() implementation that simply calls
> generic_fillattr() without any special handling. The VFS layer
> (vfs_getattr_nosec()) will call generic_fillattr() by default when no
> custom getattr operation is provided in the inode_operations structure.
> 
> This is a cleanup with no functional change.
> 
> Signed-off-by: Shivank Garg <shivankg@amd.com>

Reviewed-by: Pankaj Gupta <pankaj.gupta@amd.com>

> ---
>   virt/kvm/guest_memfd.c | 11 -----------
>   1 file changed, 11 deletions(-)
> 
> diff --git a/virt/kvm/guest_memfd.c b/virt/kvm/guest_memfd.c
> index b2aa6bf24d3a..7d85cc33c0bb 100644
> --- a/virt/kvm/guest_memfd.c
> +++ b/virt/kvm/guest_memfd.c
> @@ -382,23 +382,12 @@ static const struct address_space_operations kvm_gmem_aops = {
>   #endif
>   };
>   
> -static int kvm_gmem_getattr(struct mnt_idmap *idmap, const struct path *path,
> -			    struct kstat *stat, u32 request_mask,
> -			    unsigned int query_flags)
> -{
> -	struct inode *inode = path->dentry->d_inode;
> -
> -	generic_fillattr(idmap, request_mask, inode, stat);
> -	return 0;
> -}
> -
>   static int kvm_gmem_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
>   			    struct iattr *attr)
>   {
>   	return -EINVAL;
>   }
>   static const struct inode_operations kvm_gmem_iops = {
> -	.getattr	= kvm_gmem_getattr,
>   	.setattr	= kvm_gmem_setattr,
>   };
>   


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] KVM: guest_memfd: Remove redundant kvm_gmem_getattr implementation
  2025-06-02 17:23 [PATCH] KVM: guest_memfd: Remove redundant kvm_gmem_getattr implementation Shivank Garg
  2025-06-02 19:57 ` Ackerley Tng
  2025-06-25 12:26 ` Gupta, Pankaj
@ 2025-06-25 22:25 ` Sean Christopherson
  2 siblings, 0 replies; 6+ messages in thread
From: Sean Christopherson @ 2025-06-25 22:25 UTC (permalink / raw)
  To: Sean Christopherson, pbonzini, kvm, linux-kernel, Shivank Garg
  Cc: bharata, tabba, ackerleytng

On Mon, 02 Jun 2025 17:23:18 +0000, Shivank Garg wrote:
> Remove the redundant kvm_gmem_getattr() implementation that simply calls
> generic_fillattr() without any special handling. The VFS layer
> (vfs_getattr_nosec()) will call generic_fillattr() by default when no
> custom getattr operation is provided in the inode_operations structure.
> 
> This is a cleanup with no functional change.
> 
> [...]

Applied to kvm-x86 generic, thanks!

[1/1] KVM: guest_memfd: Remove redundant kvm_gmem_getattr implementation
      https://github.com/kvm-x86/linux/commit/87d4fbf4a387

--
https://github.com/kvm-x86/kvm-unit-tests/tree/next

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-06-25 22:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-02 17:23 [PATCH] KVM: guest_memfd: Remove redundant kvm_gmem_getattr implementation Shivank Garg
2025-06-02 19:57 ` Ackerley Tng
2025-06-24 19:57   ` Sean Christopherson
2025-06-25  5:25     ` Shivank Garg
2025-06-25 12:26 ` Gupta, Pankaj
2025-06-25 22:25 ` Sean Christopherson

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).