Generate a long parseable list for all domains.
primary# ldm list -l -p
Look for the entry in the list's VCPU sections that has a pid field equal to the physical CPU number.
If you find such an entry, the CPU is in the domain the entry is listed under, and the virtual CPU number within the domain is given by the entry's vid field.
If you do not find such an entry, the CPU is not in any domain.