From: "Jan Beulich" Subject: [PATCH] x86/HVM: rename mmio_gva field to mmio_gla Date: Tue, 14 Jun 2016 08:44:59 -0600 Message-ID: <5760348B02000078000F4DC9@prv-mh.provo.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part3C0A067B.1__=" Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bCpaU-0004MT-9y for xen-devel@lists.xenproject.org; Tue, 14 Jun 2016 14:45:06 +0000 List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: xen-devel Cc: Andrew Cooper , Paul Durrant List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part3C0A067B.1__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline ... to correctly reflect its purpose. To make things consistent also rename handle_mmio_with_translation()'s respective parameter (but don't touch sh_page_fault(), as renaming its parameter would require quite a few more changes there). Suggested-by: Andrew Cooper Signed-off-by: Jan Beulich --- a/xen/arch/x86/hvm/emulate.c +++ b/xen/arch/x86/hvm/emulate.c @@ -684,7 +684,7 @@ static void latch_linear_to_phys(struct if ( vio->mmio_access.gla_valid ) return; =20 - vio->mmio_gva =3D gla & PAGE_MASK; + vio->mmio_gla =3D gla & PAGE_MASK; vio->mmio_gpfn =3D PFN_DOWN(gpa); vio->mmio_access =3D (struct npfec){ .gla_valid =3D 1, .read_access =3D 1, @@ -782,7 +782,7 @@ static int __hvmemul_read( if ( ((access_type !=3D hvm_access_insn_fetch ? vio->mmio_access.read_access : vio->mmio_access.insn_fetch)) && - (vio->mmio_gva =3D=3D (addr & PAGE_MASK)) ) + (vio->mmio_gla =3D=3D (addr & PAGE_MASK)) ) return hvmemul_linear_mmio_read(addr, bytes, p_data, pfec, = hvmemul_ctxt, 1); =20 if ( (seg !=3D x86_seg_none) && @@ -889,7 +889,7 @@ static int hvmemul_write( return rc; =20 if ( vio->mmio_access.write_access && - (vio->mmio_gva =3D=3D (addr & PAGE_MASK)) ) + (vio->mmio_gla =3D=3D (addr & PAGE_MASK)) ) return hvmemul_linear_mmio_write(addr, bytes, p_data, pfec, = hvmemul_ctxt, 1); =20 if ( (seg !=3D x86_seg_none) && @@ -1181,7 +1181,7 @@ static int hvmemul_rep_movs( =20 bytes =3D PAGE_SIZE - (saddr & ~PAGE_MASK); if ( vio->mmio_access.read_access && - (vio->mmio_gva =3D=3D (saddr & PAGE_MASK)) && + (vio->mmio_gla =3D=3D (saddr & PAGE_MASK)) && bytes >=3D bytes_per_rep ) { sgpa =3D pfn_to_paddr(vio->mmio_gpfn) | (saddr & ~PAGE_MASK); @@ -1200,7 +1200,7 @@ static int hvmemul_rep_movs( =20 bytes =3D PAGE_SIZE - (daddr & ~PAGE_MASK); if ( vio->mmio_access.write_access && - (vio->mmio_gva =3D=3D (daddr & PAGE_MASK)) && + (vio->mmio_gla =3D=3D (daddr & PAGE_MASK)) && bytes >=3D bytes_per_rep ) { dgpa =3D pfn_to_paddr(vio->mmio_gpfn) | (daddr & ~PAGE_MASK); @@ -1320,7 +1320,7 @@ static int hvmemul_rep_stos( =20 bytes =3D PAGE_SIZE - (addr & ~PAGE_MASK); if ( vio->mmio_access.write_access && - (vio->mmio_gva =3D=3D (addr & PAGE_MASK)) && + (vio->mmio_gla =3D=3D (addr & PAGE_MASK)) && bytes >=3D bytes_per_rep ) { gpa =3D pfn_to_paddr(vio->mmio_gpfn) | (addr & ~PAGE_MASK); --- a/xen/arch/x86/hvm/io.c +++ b/xen/arch/x86/hvm/io.c @@ -114,7 +114,7 @@ int handle_mmio(void) return 1; } =20 -int handle_mmio_with_translation(unsigned long gva, unsigned long gpfn, +int handle_mmio_with_translation(unsigned long gla, unsigned long gpfn, struct npfec access) { struct hvm_vcpu_io *vio =3D ¤t->arch.hvm_vcpu.hvm_io; @@ -122,7 +122,7 @@ int handle_mmio_with_translation(unsigne vio->mmio_access =3D access.gla_valid && access.kind =3D=3D npfec_kind_with_gla ? access : (struct npfec){}; - vio->mmio_gva =3D gva & PAGE_MASK; + vio->mmio_gla =3D gla & PAGE_MASK; vio->mmio_gpfn =3D gpfn; return handle_mmio(); } --- a/xen/include/asm-x86/hvm/io.h +++ b/xen/include/asm-x86/hvm/io.h @@ -119,7 +119,7 @@ void relocate_portio_handler( void send_timeoffset_req(unsigned long timeoff); void send_invalidate_req(void); int handle_mmio(void); -int handle_mmio_with_translation(unsigned long gva, unsigned long gpfn, +int handle_mmio_with_translation(unsigned long gla, unsigned long gpfn, struct npfec); int handle_pio(uint16_t port, unsigned int size, int dir); void hvm_interrupt_post(struct vcpu *v, int vector, int type); --- a/xen/include/asm-x86/hvm/vcpu.h +++ b/xen/include/asm-x86/hvm/vcpu.h @@ -60,12 +60,12 @@ struct hvm_vcpu_io { =20 /* * HVM emulation: - * Virtual address @mmio_gva maps to MMIO physical frame @mmio_gpfn. + * Linear address @mmio_gla maps to MMIO physical frame @mmio_gpfn. * The latter is known to be an MMIO frame (not RAM). * This translation is only valid for accesses as per @mmio_access. */ struct npfec mmio_access; - unsigned long mmio_gva; + unsigned long mmio_gla; unsigned long mmio_gpfn; =20 /* --=__Part3C0A067B.1__= Content-Type: text/plain; name="x86-HVM-mmio_gla.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86-HVM-mmio_gla.patch" x86/HVM: rename mmio_gva field to mmio_gla=0A=0A... to correctly reflect = its purpose. To make things consistent also=0Arename handle_mmio_with_trans= lation()'s respective parameter (but don't=0Atouch sh_page_fault(), as = renaming its parameter would require quite a=0Afew more changes there).=0A= =0ASuggested-by: Andrew Cooper =0ASigned-off-by:= Jan Beulich =0A=0A--- a/xen/arch/x86/hvm/emulate.c=0A++= + b/xen/arch/x86/hvm/emulate.c=0A@@ -684,7 +684,7 @@ static void latch_line= ar_to_phys(struct=0A if ( vio->mmio_access.gla_valid )=0A = return;=0A =0A- vio->mmio_gva =3D gla & PAGE_MASK;=0A+ vio->mmio_gla = =3D gla & PAGE_MASK;=0A vio->mmio_gpfn =3D PFN_DOWN(gpa);=0A = vio->mmio_access =3D (struct npfec){ .gla_valid =3D 1,=0A = .read_access =3D 1,=0A@@ -782,7 +782,7 @@ static int = __hvmemul_read(=0A if ( ((access_type !=3D hvm_access_insn_fetch=0A = ? vio->mmio_access.read_access=0A : vio->mmio_access.ins= n_fetch)) &&=0A- (vio->mmio_gva =3D=3D (addr & PAGE_MASK)) )=0A+ = (vio->mmio_gla =3D=3D (addr & PAGE_MASK)) )=0A return = hvmemul_linear_mmio_read(addr, bytes, p_data, pfec, hvmemul_ctxt, 1);=0A = =0A if ( (seg !=3D x86_seg_none) &&=0A@@ -889,7 +889,7 @@ static int = hvmemul_write(=0A return rc;=0A =0A if ( vio->mmio_access.write= _access &&=0A- (vio->mmio_gva =3D=3D (addr & PAGE_MASK)) )=0A+ = (vio->mmio_gla =3D=3D (addr & PAGE_MASK)) )=0A return = hvmemul_linear_mmio_write(addr, bytes, p_data, pfec, hvmemul_ctxt, 1);=0A = =0A if ( (seg !=3D x86_seg_none) &&=0A@@ -1181,7 +1181,7 @@ static int = hvmemul_rep_movs(=0A =0A bytes =3D PAGE_SIZE - (saddr & ~PAGE_MASK);=0A= if ( vio->mmio_access.read_access &&=0A- (vio->mmio_gva = =3D=3D (saddr & PAGE_MASK)) &&=0A+ (vio->mmio_gla =3D=3D (saddr & = PAGE_MASK)) &&=0A bytes >=3D bytes_per_rep )=0A {=0A = sgpa =3D pfn_to_paddr(vio->mmio_gpfn) | (saddr & ~PAGE_MASK);=0A@@ -1200,7 = +1200,7 @@ static int hvmemul_rep_movs(=0A =0A bytes =3D PAGE_SIZE - = (daddr & ~PAGE_MASK);=0A if ( vio->mmio_access.write_access &&=0A- = (vio->mmio_gva =3D=3D (daddr & PAGE_MASK)) &&=0A+ (vio->mmio_gl= a =3D=3D (daddr & PAGE_MASK)) &&=0A bytes >=3D bytes_per_rep )=0A = {=0A dgpa =3D pfn_to_paddr(vio->mmio_gpfn) | (daddr & = ~PAGE_MASK);=0A@@ -1320,7 +1320,7 @@ static int hvmemul_rep_stos(=0A =0A = bytes =3D PAGE_SIZE - (addr & ~PAGE_MASK);=0A if ( vio->mmio_access.w= rite_access &&=0A- (vio->mmio_gva =3D=3D (addr & PAGE_MASK)) = &&=0A+ (vio->mmio_gla =3D=3D (addr & PAGE_MASK)) &&=0A = bytes >=3D bytes_per_rep )=0A {=0A gpa =3D pfn_to_paddr(vio->mm= io_gpfn) | (addr & ~PAGE_MASK);=0A--- a/xen/arch/x86/hvm/io.c=0A+++ = b/xen/arch/x86/hvm/io.c=0A@@ -114,7 +114,7 @@ int handle_mmio(void)=0A = return 1;=0A }=0A =0A-int handle_mmio_with_translation(unsigned long gva, = unsigned long gpfn,=0A+int handle_mmio_with_translation(unsigned long gla, = unsigned long gpfn,=0A struct npfec = access)=0A {=0A struct hvm_vcpu_io *vio =3D ¤t->arch.hvm_vcpu.hvm= _io;=0A@@ -122,7 +122,7 @@ int handle_mmio_with_translation(unsigne=0A = vio->mmio_access =3D access.gla_valid &&=0A = access.kind =3D=3D npfec_kind_with_gla=0A ? access = : (struct npfec){};=0A- vio->mmio_gva =3D gva & PAGE_MASK;=0A+ = vio->mmio_gla =3D gla & PAGE_MASK;=0A vio->mmio_gpfn =3D gpfn;=0A = return handle_mmio();=0A }=0A--- a/xen/include/asm-x86/hvm/io.h=0A+++ = b/xen/include/asm-x86/hvm/io.h=0A@@ -119,7 +119,7 @@ void relocate_portio_h= andler(=0A void send_timeoffset_req(unsigned long timeoff);=0A void = send_invalidate_req(void);=0A int handle_mmio(void);=0A-int handle_mmio_wit= h_translation(unsigned long gva, unsigned long gpfn,=0A+int handle_mmio_wit= h_translation(unsigned long gla, unsigned long gpfn,=0A = struct npfec);=0A int handle_pio(uint16_t port, unsigned int = size, int dir);=0A void hvm_interrupt_post(struct vcpu *v, int vector, int = type);=0A--- a/xen/include/asm-x86/hvm/vcpu.h=0A+++ b/xen/include/asm-x86/h= vm/vcpu.h=0A@@ -60,12 +60,12 @@ struct hvm_vcpu_io {=0A =0A /*=0A = * HVM emulation:=0A- * Virtual address @mmio_gva maps to MMIO = physical frame @mmio_gpfn.=0A+ * Linear address @mmio_gla maps to = MMIO physical frame @mmio_gpfn.=0A * The latter is known to be an = MMIO frame (not RAM).=0A * This translation is only valid for = accesses as per @mmio_access.=0A */=0A struct npfec = mmio_access;=0A- unsigned long mmio_gva;=0A+ unsigned long = mmio_gla;=0A unsigned long mmio_gpfn;=0A =0A /*=0A --=__Part3C0A067B.1__= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwOi8vbGlzdHMueGVuLm9y Zy94ZW4tZGV2ZWwK --=__Part3C0A067B.1__=--