|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [xen master] x86/HVM: slightly improve CMPXCHG16B emulation
commit 2488ede7a994c8254b8d9304082d70924bbca141
Author: Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Wed Mar 5 15:41:14 2025 +0100
Commit: Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Mar 5 15:41:14 2025 +0100
x86/HVM: slightly improve CMPXCHG16B emulation
Using hvmemul_linear_mmio_write() directly (as fallback when mapping the
memory operand isn't possible) won't work properly when the access
crosses a RAM/MMIO boundary. Use linear_write() instead, which splits at
such boundaries as necessary.
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
xen/arch/x86/hvm/emulate.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index 3cd7f2e22f..de38142413 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -1718,10 +1718,8 @@ static int cf_check hvmemul_cmpxchg(
{
struct hvm_emulate_ctxt *hvmemul_ctxt =
container_of(ctxt, struct hvm_emulate_ctxt, ctxt);
- struct vcpu *curr = current;
unsigned long addr;
uint32_t pfec = PFEC_page_present | PFEC_write_access;
- struct hvm_vcpu_io *hvio = &curr->arch.hvm.hvm_io;
int rc;
void *mapping = NULL;
@@ -1745,10 +1743,7 @@ static int cf_check hvmemul_cmpxchg(
if ( !mapping )
{
/* Fix this in case the guest is really relying on r-m-w atomicity. */
- return hvmemul_linear_mmio_write(addr, bytes, p_new, pfec,
- hvmemul_ctxt, addr,
- hvio->mmio_access.write_access &&
- hvio->mmio_gla == (addr & PAGE_MASK));
+ return linear_write(addr, bytes, p_new, pfec, hvmemul_ctxt);
}
switch ( bytes )
--
generated by git-patchbot for /home/xen/git/xen.git#master
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |