From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andre Przywara Subject: Reason for extra struct kvm_run parameter in MMIO handling? Date: Fri, 06 Feb 2015 17:30:45 +0000 Message-ID: <54D4FA45.1000103@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: "kvmarm@lists.cs.columbia.edu" To: "kvm@vger.kernel.org" , Paolo Bonzini , Gleb Natapov Return-path: Received: from cam-admin0.cambridge.arm.com ([217.140.96.50]:64529 "EHLO cam-admin0.cambridge.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753735AbbBFRa5 (ORCPT ); Fri, 6 Feb 2015 12:30:57 -0500 Sender: kvm-owner@vger.kernel.org List-ID: Hi, while reworking the ARM vGIC emulation layer to use the kvm_io_bus framework, I wonder why the whole KVM MMIO handling always passes the pointer to struct kvm_run along with the struct kvm_vcpu pointer. As kvm_run is a member of kvm_vcpu, the vcpu alone should be sufficient, right? Also I see the very top of the call chain is effectively: kvm_arch_vcpu_ioctl_run(vcpu, vcpu->run); So is that just legacy code still lingering around from the dawn of time and nobody dared to rework this or is there a particular reason for doing so? I am asking because I lack the kvm_run pointer in the MMIO handler, so I just use vcpu->run and I wonder if there are potential issues in doing so. Cheers, Andre.