From: Peter Gonda <pgonda@google.com>
To: kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Peter Gonda <pgonda@google.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Sean Christopherson <seanjc@google.com>,
Vishal Annapurve <vannapurve@google.com>,
Ackerly Tng <ackerleytng@google.com>,
Andrew Jones <andrew.jones@linux.dev>
Subject: [PATCH V6 6/7] KVM: selftests: Update ucall pool to allocate from shared memory
Date: Tue, 10 Jan 2023 09:50:56 -0800 [thread overview]
Message-ID: <20230110175057.715453-7-pgonda@google.com> (raw)
In-Reply-To: <20230110175057.715453-1-pgonda@google.com>
Update the per VM ucall_header allocation from vm_vaddr_alloc() to
vm_vaddr_alloc_shared(). This allows encrypted guests to use ucall pools
by placing their shared ucall structures in unencrypted (shared) memory.
No behavior change for non encrypted guests.
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Sean Christopherson <seanjc@google.com>
Cc: Vishal Annapurve <vannapurve@google.com>
Cc: Ackerly Tng <ackerleytng@google.com>
cc: Andrew Jones <andrew.jones@linux.dev>
Signed-off-by: Peter Gonda <pgonda@google.com>
---
tools/testing/selftests/kvm/lib/ucall_common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/kvm/lib/ucall_common.c b/tools/testing/selftests/kvm/lib/ucall_common.c
index 2f0e2ea941cc..99ef4866a001 100644
--- a/tools/testing/selftests/kvm/lib/ucall_common.c
+++ b/tools/testing/selftests/kvm/lib/ucall_common.c
@@ -24,7 +24,7 @@ void ucall_init(struct kvm_vm *vm, vm_paddr_t mmio_gpa)
vm_vaddr_t vaddr;
int i;
- vaddr = __vm_vaddr_alloc(vm, sizeof(*hdr), KVM_UTIL_MIN_VADDR, MEM_REGION_DATA);
+ vaddr = vm_vaddr_alloc_shared(vm, sizeof(*hdr), KVM_UTIL_MIN_VADDR);
hdr = (struct ucall_header *)addr_gva2hva(vm, vaddr);
memset(hdr, 0, sizeof(*hdr));
--
2.39.0.314.g84b9a713c41-goog
next prev parent reply other threads:[~2023-01-10 17:51 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-10 17:50 [PATCH V6 0/7] KVM: selftests: Add simple SEV test Peter Gonda
2023-01-10 17:50 ` [PATCH V6 1/7] KVM: selftests: sparsebit: add const where appropriate Peter Gonda
2023-03-24 17:09 ` Sean Christopherson
2023-01-10 17:50 ` [PATCH V6 2/7] KVM: selftests: add hooks for managing protected guest memory Peter Gonda
2023-03-24 17:10 ` Sean Christopherson
2023-01-10 17:50 ` [PATCH V6 3/7] KVM: selftests: handle protected bits in page tables Peter Gonda
2023-03-24 17:24 ` Sean Christopherson
2023-01-10 17:50 ` [PATCH V6 4/7] KVM: selftests: add support for protected vm_vaddr_* allocations Peter Gonda
2023-03-24 17:30 ` Sean Christopherson
2023-01-10 17:50 ` [PATCH V6 5/7] KVM: selftests: add library for creating/interacting with SEV guests Peter Gonda
2023-03-24 18:08 ` Sean Christopherson
2023-01-10 17:50 ` Peter Gonda [this message]
2023-01-10 17:50 ` [PATCH V6 7/7] KVM: selftests: Add simple sev vm testing Peter Gonda
2023-03-24 18:23 ` Sean Christopherson
2023-01-18 20:50 ` [PATCH V6 0/7] KVM: selftests: Add simple SEV test Sean Christopherson
2023-01-20 16:43 ` Peter Gonda
2023-03-24 19:05 ` Sean Christopherson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230110175057.715453-7-pgonda@google.com \
--to=pgonda@google.com \
--cc=ackerleytng@google.com \
--cc=andrew.jones@linux.dev \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.com \
--cc=vannapurve@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox