x86: adjust PV I/O emulation functions' types
PATCH 1/1 x86: adjust PV I/O emulation functions' types
admin_io_okay(), guest_io_read(), and guest_io_write() all don't need their current "regs" parameter at all, and they don't use the vCPU passed to them for other than obtaining its domain. Drop the former and replace the latter by a struct domain pointer.
pci_cfg_okay() returns a boolean type, and its "write" parameter is of boolean kind too.
All of them get called for the current vCPU (and hence current domain) only, so name the domain parameters accordingly except in the admin_io_okay() case, which a subsequent patch will use for simplifying setup_io_bitmap().
Latch current->domain into a local variable in emulate_privileged_op().
xen/arch/x86/hvm/hvm.c +3 -4
@@ -599,13 +599,12 @@ static int hvm_access_cf8(static int handle_pvh_io (int dir,uint32_t port,uint32_t bytes,uint32_t *val) { -struct vcpu *curr = current; -struct cpu_user_regs *regs =guest_cpu_user_regs (); +struct domain *currd = current->domain;if ( dir ==IOREQ_WRITE ) -guest_io_write (port, bytes, *val, curr, regs); +guest_io_write (port, bytes, *val, currd);else - *val =guest_io_read (port, bytes, curr, regs); + *val =guest_io_read (port, bytes, currd);return X86EMUL_OKAY ; }
xen/arch/x86/traps.c +53 -59
326 lines not on this page · raw message
xen/include/asm-x86/traps.h +2 -2
@@ -48,8 +48,8 @@ extern int send_guest_trap(struct domain unsigned int trap_nr);uint32_t guest_io_read (unsigned int port,unsigned int bytes, -struct vcpu *,struct cpu_user_regs *); +struct domain *);void guest_io_write (unsigned int port,unsigned int bytes,uint32_t data, -struct vcpu *,struct cpu_user_regs *); +struct domain *);#endif /* ASM_TRAP_H */
x86: adjust PV I/O emulation functions' types
admin_io_okay(), guest_io_read(), and guest_io_write() all don't need their current "regs" parameter at all, and they don't use the vCPU passed to them for other than obtaining its domain. Drop the former and replace the latter by a struct domain pointer.
pci_cfg_okay() returns a boolean type, and its "write" parameter is of boolean kind too.
All of them get called for the current vCPU (and hence current domain) only, so name the domain parameters accordingly except in the admin_io_okay() case, which a subsequent patch will use for simplifying setup_io_bitmap().
Latch current->domain into a local variable in emulate_privileged_op().
xen/arch/x86/hvm/hvm.c +3 -4
@@ -599,13 +599,12 @@ static int hvm_access_cf8(static int handle_pvh_io (int dir,uint32_t port,uint32_t bytes,uint32_t *val) { -struct vcpu *curr = current; -struct cpu_user_regs *regs =guest_cpu_user_regs (); +struct domain *currd = current->domain;if ( dir ==IOREQ_WRITE ) -guest_io_write (port, bytes, *val, curr, regs); +guest_io_write (port, bytes, *val, currd);else - *val =guest_io_read (port, bytes, curr, regs); + *val =guest_io_read (port, bytes, currd);return X86EMUL_OKAY ; }
xen/arch/x86/traps.c +53 -59
326 lines not on this page · raw message
xen/include/asm-x86/traps.h +2 -2
@@ -48,8 +48,8 @@ extern int send_guest_trap(struct domain unsigned int trap_nr);uint32_t guest_io_read (unsigned int port,unsigned int bytes, -struct vcpu *,struct cpu_user_regs *); +struct domain *);void guest_io_write (unsigned int port,unsigned int bytes,uint32_t data, -struct vcpu *,struct cpu_user_regs *); +struct domain *);#endif /* ASM_TRAP_H */
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 8 lines · Jan Beulich
admin_io_okay(),guest_io_read(), andguest_io_write()all don't need their current "regs" parameter at all, and they don't use the vCPU passed to them for other than obtaining its domain. Drop the former and replace the latter by a struct domain pointer.
pci_cfg_okay()returns a boolean type, and its "write" parameter is of boolean kind too.
Quoted 8 lines
All of them get called for the current vCPU (and hence current domain) only, so name the domain parameters accordingly except in the
admin_io_okay()case, which a subsequent patch will use for simplifyingsetup_io_bitmap().Latch
current->domaininto a local variable inemulate_privileged_op().Signed-off-by Jan Beulich <[email protected]>