Re: [RFC PATCH v11 08/29] KVM: Introduce per-page memory attributes

From
Sean Christopherson <seanjc@google.com>
Date
2023-08-14 21:55:51
Also in
kvm, kvm-riscv, kvmarm, linux-arm-kernel, linux-fsdevel, linux-mips, linux-mm, linux-riscv, linuxppc-dev, lkml
Reply to
Binbin Wu, 2023-08-14
On Mon, Aug 14, 2023, Binbin Wu wrote:
On 7/19/2023 7:44 AM, Sean Christopherson wrote:
quoted
+	struct kvm_mmu_notifier_range post_set_range = {
+		.start = start,
+		.end = end,
+		.arg.attributes = attributes,
+		.handler = kvm_arch_post_set_memory_attributes,
+		.on_lock = (void *)kvm_null_fn,
+		.on_unlock = kvm_mmu_invalidate_end,
+		.may_block = true,
+	};
+	unsigned long i;
+	void *entry;
+	int r;
+
+	entry = attributes ? xa_mk_value(attributes) : NULL;
Why attributes of value 0 is considered not a value? Is it because 0 is not
a valid value when RWX is considered in the future?
0 values don't require an entry in the xarray, i.e. don't need to be stored and
so don't consume memory.  The potential conflict with a RWX=0 entry has already
been noted, but we'll cross that bridge when we get to it, e.g. KVM can easily
support RWX=0 by using an internal "valid" flag.
Both the changelog and the document added mention that the address and size
of attrs will be updated to
"reflect the actual pages of the memory range have been successfully set to
the attributes", but it doesn't.
Yeah, on the todo list, all of the changelogs are horribly stale.
Thread (108 messages) 108 messages, 20 authors, last reply 2023-09-06
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help