From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [RFC v1 05/15] vmx: Initialize VT-d Posted-Interrupts Descriptor Date: Mon, 04 May 2015 09:36:04 +0100 Message-ID: <55472F74.2010506@citrix.com> References: <1427286717-4093-1-git-send-email-feng.wu@intel.com> <1427286717-4093-6-git-send-email-feng.wu@intel.com> <20150326192914.GB25340@x230.dumpdata.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: "Wu, Feng" , Konrad Rzeszutek Wilk Cc: "Zhang, Yang Z" , "Tian, Kevin" , "keir@xen.org" , "JBeulich@suse.com" , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On 04/05/2015 06:32, Wu, Feng wrote: > >>> + v->arch.hvm_vmx.pi_desc.ndm = 0; >>> + dest = cpu_physical_id(v->processor); >>> + >>> + if ( x2apic_enabled ) >>> + v->arch.hvm_vmx.pi_desc.ndst = dest; >>> + else >>> + v->arch.hvm_vmx.pi_desc.ndst = (dest << 8) & 0xFF00; >> Surely there are some macros for that? > I find some macros defined in xen/include/asm-x86/apicdef.h, but since > it is not a common format here, I cannot find one which can be used for it. > > In the above case (the 'else' branch), 'dest' will occupy bit 8:15 of 'ndst' field. > > Either we add a macro in the file (it is a little strange, since the format is not common), > or we remain the current solution. Any ideas? MASK_INSR() is what you are looking for, but you will need to provide a sensible name for 0xFF00. ~Andrew