From: "Jan Beulich" Subject: Re: [PATCH v7 11/19] x86/VPMU: Interface for setting PMU mode and flags Date: Tue, 17 Jun 2014 16:14:33 +0100 Message-ID: <53A07779020000780001B279@mail.emea.novell.com> References: <1402076415-26475-1-git-send-email-boris.ostrovsky@oracle.com> <1402076415-26475-12-git-send-email-boris.ostrovsky@oracle.com> <5398480A0200007800019D62@mail.emea.novell.com> <53A05835.1000000@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <53A05835.1000000@oracle.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Boris Ostrovsky Cc: kevin.tian@intel.com, keir@xen.org, suravee.suthikulpanit@amd.com, tim@xen.org, dietmar.hahn@ts.fujitsu.com, xen-devel@lists.xen.org, jun.nakajima@intel.com List-Id: xen-devel@lists.xenproject.org >>> On 17.06.14 at 17:01, wrote: > I have a question though. I want to add a compat check for > > struct xen_pmu_arch { > union { > struct cpu_user_regs regs; > uint8_t pad[256]; > } r; > union { > uint32_t lapic_lvtpc; > uint64_t pad; > } l; > union { > struct xen_pmu_amd_ctxt amd; > struct xen_pmu_intel_ctxt intel; > uint8_t pad[128]; > } c; > }; > > which is a shared structure (i.e. it's not used across a hypercall). The > problem I am having is that cpu_user_regs needs to be translated. Does > the xlat framework allow checking a structure that needs one of its > fields translated? I went through the scripts and it appears that it > doesn't. Indeed this is an all-or-nothing thing. Naming (and perhaps splitting out) the latter two sub-unions may allow checking them individually though. Jan