. How/where can I access the GPFNs in the host? Is "gfn_t gfn = gpa
>> PAGE_SHIFT" and "gpa_t cr2_or_gpa" in the KVM page fault handler,
x86 is the same as GPFN. (that is can I use pfn_to_page in guest VM to
access the struct page in Guest)
Thank You.
Best Regards,
Shivank Garg
M.Tech Student,
IIT Kanpur
use outside the core kernel. In the future, guest_memfd might be
moved to core-mm, at which point the symbols no longer would have to be
exported. When/if that happens is still unclear.
Signed-off-by: Shivank Garg
---
security/security.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/security
the
default allocation behavior.
Signed-off-by: Shivansh Dhiman
Signed-off-by: Shivank Garg
---
include/linux/pagemap.h | 41 +
mm/filemap.c| 27 +++
2 files changed, 64 insertions(+), 4 deletions(-)
diff --git a/include
before and after memory allocation
These tests help ensure NUMA support for guest_memfd works correctly.
Signed-off-by: Shivank Garg
---
.../testing/selftests/kvm/guest_memfd_test.c | 86 ++-
1 file changed, 82 insertions(+), 4 deletions(-)
diff --git a/tools/testing/selftests
mem inodes instead of
anonymous inodes
Shivank Garg (6):
mm/mempolicy: Export memory policy symbols
security: Export security_inode_init_security_anon for KVM guest_memfd
KVM: Add kvm_gmem_exit() cleanup function
KVM: guest_memfd: Add slab-allocated inode cache
KVM: guest_memfd: Enforc
ith a struct kvm, and
metadata about backing memory is not unique to a specific binding and
struct kvm.
Signed-off-by: Ackerley Tng
Signed-off-by: Fuad Tabba
Signed-off-by: Shivank Garg
---
include/uapi/linux/magic.h | 1 +
virt/kvm/guest_memfd.c | 133 +++
ested-by: David Hildenbrand
Signed-off-by: Shivank Garg
---
virt/kvm/guest_memfd.c | 75 --
1 file changed, 73 insertions(+), 2 deletions(-)
diff --git a/virt/kvm/guest_memfd.c b/virt/kvm/guest_memfd.c
index 0ccbb152483a..233d3fd5781c 100644
--- a/virt/kvm/gues
Add dedicated inode structure (kvm_gmem_inode_info) and slab-allocated
inode cache for guest memory backing, similar to how shmem handles inodes.
This adds the necessary allocation/destruction functions and prepares
for upcoming guest_memfd NUMA policy support changes.
Signed-off-by: Shivank
symbols no longer would have to be exported. When/if that happens is
still unclear.
Acked-by: David Hildenbrand
Acked-by: Vlastimil Babka
Signed-off-by: Shivank Garg
---
mm/mempolicy.c | 6 ++
1 file changed, 6 insertions(+)
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index b28a1e6ae096
On 4/10/2025 7:10 PM, Ackerley Tng wrote:
> Shivank Garg writes:
>
>> Previously, guest-memfd allocations followed local NUMA node id in absence
>> of process mempolicy, resulting in arbitrary memory allocation.
>> Moreover, mbind() couldn't be used since memo
On 4/10/2025 2:11 PM, Christoph Hellwig wrote:
> On Tue, Apr 08, 2025 at 11:23:57AM +0000, Shivank Garg wrote:
>> KVM guest_memfd is implementing its own inodes to store metadata for
>> backing memory using a custom filesystem. This requires the ability to
>> initialize
Hi Paul,
On 4/10/2025 1:49 AM, Paul Moore wrote:
> On Tue, Apr 8, 2025 at 7:25 AM Shivank Garg wrote:
>>
>> KVM guest_memfd is implementing its own inodes to store metadata for
>> backing memory using a custom filesystem. This requires the ability to
>> initi
Add empty kvm_gmem_exit() function for proper cleanup of guest memory
resources. Call it from both kvm_init() error path and kvm_exit().
This is preparatory change for upcoming work that involves KVM guest_memfd
using inodes to store metadata for backing memory.
Signed-off-by: Shivank Garg
On 4/22/2025 10:55 PM, David Hildenbrand wrote:
> On 10.04.25 10:41, Christoph Hellwig wrote:
>> On Tue, Apr 08, 2025 at 11:23:57AM +, Shivank Garg wrote:
>>> KVM guest_memfd is implementing its own inodes to store metadata for
>>> backing memory using a custom fi
On 6/19/2025 9:33 PM, Matthew Wilcox wrote:
> On Wed, Jun 18, 2025 at 11:29:31AM +0000, Shivank Garg wrote:
>> From: Shivansh Dhiman
>>
>> Add NUMA mempolicy support to the filemap allocation path by introducing
>> new APIs that take a mempolicy argument:
&
the
default allocation behavior.
Signed-off-by: Shivansh Dhiman
Co-developed-by: Shivank Garg
Signed-off-by: Shivank Garg
---
include/linux/pagemap.h | 41 +
mm/filemap.c| 27 +++
2 files changed, 64 insertions(+), 4
it is unmovable.
Suggested-by: David Hildenbrand
Signed-off-by: Shivank Garg
---
virt/kvm/guest_memfd.c | 69 --
1 file changed, 67 insertions(+), 2 deletions(-)
diff --git a/virt/kvm/guest_memfd.c b/virt/kvm/guest_memfd.c
index 5a1ce6f5e287..2bd5ff3abd
symbols no longer would have to be exported. When/if that happens is
still unclear.
Acked-by: David Hildenbrand
Acked-by: Vlastimil Babka
Signed-off-by: Shivank Garg
---
mm/mempolicy.c | 6 ++
1 file changed, 6 insertions(+)
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 3b1dfd08338b
Add dedicated inode structure (kvm_gmem_inode_info) and slab-allocated
inode cache for guest memory backing, similar to how shmem handles inodes.
This adds the necessary allocation/destruction functions and prepares
for upcoming guest_memfd NUMA policy support changes.
Signed-off-by: Shivank
allocation
These tests help ensure NUMA support for guest_memfd works correctly.
Signed-off-by: Shivank Garg
---
tools/testing/selftests/kvm/Makefile.kvm | 1 +
.../testing/selftests/kvm/guest_memfd_test.c | 123 +-
2 files changed, 122 insertions(+), 2 deletions(-)
diff
e.kernel.org/all/6fbef654-36e2-4be5-906e-2a648a845...@redhat.com
[7] https://lore.kernel.org/all/2b77e055-98ac-43a1-a7ad-9f9065d7f...@amd.com
[8] https://lore.kernel.org/all/diqzbjumm167@ackerleytng-ctop.c.googlers.com
Ackerley Tng (1):
KVM: guest_memfd: Use guest mem inodes instead of anon
f-by: Fuad Tabba
Signed-off-by: Shivank Garg
---
include/uapi/linux/magic.h | 1 +
virt/kvm/guest_memfd.c | 134 +++--
virt/kvm/kvm_main.c| 7 +-
virt/kvm/kvm_mm.h | 10 ++-
4 files changed, 127 insertions(+), 25 deletions(-)
diff --git a/in
this
symbol for use outside the core kernel. In the future, guest_memfd might be
moved to core-mm, at which point the symbols no longer would have to be
exported. When/if that happens is still unclear.
Signed-off-by: Shivank Garg
---
The handling of the S_PRIVATE flag for these inodes was
On 6/18/2025 8:42 PM, Gregory Price wrote:
> On Wed, Jun 18, 2025 at 11:29:32AM +0000, Shivank Garg wrote:
>> KVM guest_memfd wants to implement support for NUMA policies just like
>> shmem already does using the shared policy infrastructure. As
>> guest_memfd currently
On 6/20/2025 8:04 PM, Matthew Wilcox wrote:
> On Fri, Jun 20, 2025 at 11:29:20AM +0530, Shivank Garg wrote:
>> filemap_grab_folio_mpol() is used in [Patch 6/7] in kvm_gmem_prepare_folio().
>>
>> filemap_alloc_folio_mpol() and __filemap_get_folio_mpol()) are internally
>
On 6/23/2025 3:46 AM, Andrew Morton wrote:
> On Mon, 23 Jun 2025 00:32:05 +0530 Shivank Garg wrote:
>
>>> -EXPORT_SYMBOL(__filemap_get_folio);
>>> +EXPORT_SYMBOL(__filemap_get_folio_mpol);
>>>
>>> static inline struct folio *find_get_en
On 6/23/2025 3:46 AM, Andrew Morton wrote:
> On Mon, 23 Jun 2025 00:32:05 +0530 Shivank Garg wrote:
>
>>> -EXPORT_SYMBOL(__filemap_get_folio);
>>> +EXPORT_SYMBOL(__filemap_get_folio_mpol);
>>>
>>> static inline struct folio *find_get_en
On 6/23/2025 12:46 PM, Vlastimil Babka wrote:
> On 6/22/25 21:02, Shivank Garg wrote:
>>
>> Hi Andrew,
>>
>> Thank you for addressing this.
>>
>> If you don’t mind me asking,
>> I was curious why we used EXPORT_SYMBOL instead of EXPORT_SYMBOL_GP
On 6/10/2025 4:37 AM, Andrew Morton wrote:
> On Mon, 9 Jun 2025 12:06:07 +0000 Shivank Garg wrote:
>
>> The mm selftests are timing out with the current 180-second limit.
>> Testing shows that run_vmtests.sh takes approximately 11 minutes
>> (664 seconds) to comp
: Shivank Garg
---
tools/testing/selftests/mm/settings | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/mm/settings
b/tools/testing/selftests/mm/settings
index a953c96aa16e..e2206265f67c 100644
--- a/tools/testing/selftests/mm/settings
+++ b/tools/testing
On 6/23/2025 12:13 AM, Andrew Morton wrote:
> On Fri, 20 Jun 2025 17:53:15 +0100 Matthew Wilcox wrote:
>
>> On Fri, Jun 20, 2025 at 03:34:47PM +0100, Matthew Wilcox (Oracle) wrote:
>>> +struct folio *__filemap_get_folio_mpol(struct address_space *mapping,
>>> + pgoff_t index, fgf_t f
On 6/24/2025 9:46 AM, Huang, Ying wrote:
> Shivank Garg writes:
>
>> +static void kvm_gmem_init_inodecache(void)
>> +{
>> +kvm_gmem_inode_cachep = kmem_cache_create("kvm_gmem_inode_cache",
>> +
y support to filemap_alloc_folio()
mm/filemap: Extend __filemap_get_folio() to support NUMA memory
policies
Shivank Garg (4):
mm/mempolicy: Export memory policy symbols
KVM: guest_memfd: Add slab-allocated inode cache
KVM: guest_memfd: Enforce NUMA mempolicy using shared policy
KVM: guest_memfd: se
by: Ackerley Tng
Signed-off-by: Shivank Garg
---
include/uapi/linux/magic.h | 1 +
virt/kvm/guest_memfd.c | 134 +++--
virt/kvm/kvm_main.c| 7 +-
virt/kvm/kvm_mm.h | 10 ++-
4 files changed, 127 insertions(+), 25 deletions(-)
diff --
symbols no longer would have to be exported. When/if that happens is
still unclear.
Acked-by: David Hildenbrand
Acked-by: Vlastimil Babka
Signed-off-by: Shivank Garg
---
mm/mempolicy.c | 6 ++
1 file changed, 6 insertions(+)
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 3b1dfd08338b
ting users pass NULL maintaining current behavior.
Reviewed-by: Pankaj Gupta
Reviewed-by: Vlastimil Babka
Signed-off-by: Matthew Wilcox (Oracle)
Signed-off-by: Shivank Garg
---
fs/bcachefs/fs-io-buffered.c | 2 +-
fs/btrfs/compression.c | 4 ++--
fs/btrfs/verity.c| 2 +-
icy.
This infrastructure will enable future support for NUMA-aware page cache
allocations in guest_memfd memory backend KVM guests.
Reviewed-by: Pankaj Gupta
Reviewed-by: Vlastimil Babka
Signed-off-by: Matthew Wilcox (Oracle)
Signed-off-by: Shivank Garg
---
include/linux/pagemap.h | 10 --
mm
allocation
These tests help ensure NUMA support for guest_memfd works correctly.
Signed-off-by: Shivank Garg
---
tools/testing/selftests/kvm/Makefile.kvm | 1 +
.../testing/selftests/kvm/guest_memfd_test.c | 122 +-
2 files changed, 122 insertions(+), 1 deletion(-)
diff
it is unmovable.
Suggested-by: David Hildenbrand
Signed-off-by: Shivank Garg
---
virt/kvm/guest_memfd.c | 67 --
1 file changed, 65 insertions(+), 2 deletions(-)
diff --git a/virt/kvm/guest_memfd.c b/virt/kvm/guest_memfd.c
index 989e2b26b344..5c9a5eb5c1
Add dedicated inode structure (kvm_gmem_inode_info) and slab-allocated
inode cache for guest memory backing, similar to how shmem handles inodes.
This adds the necessary allocation/destruction functions and prepares
for upcoming guest_memfd NUMA policy support changes.
Signed-off-by: Shivank
On 7/21/2025 5:14 PM, Vlastimil Babka wrote:
>> +kvm_gmem_inode_cachep = kmem_cache_create("kvm_gmem_inode_cache",
>> + sizeof(struct
>> kvm_gmem_inode_info),
>> + 0, SLAB_ACCOUNT,
>> +
On 7/22/2025 8:10 PM, David Hildenbrand wrote:
> On 13.07.25 19:43, Shivank Garg wrote:
>> This series introduces NUMA-aware memory placement support for KVM guests
>> with guest_memfd memory backends. It builds upon Fuad Tabba's work that
>> enabled host-mapping
42 matches
Mail list logo