On 2/5/19 6:32 AM, David Gibson wrote: > On Mon, Feb 04, 2019 at 05:07:28PM +0100, Cédric Le Goater wrote: >> On 2/4/19 6:21 AM, David Gibson wrote: >>> On Mon, Jan 07, 2019 at 07:43:27PM +0100, Cédric Le Goater wrote: >>>> Theses are use to capure the XIVE EAS table of the KVM device, the >>>> configuration of the source targets. >>>> >>>> Signed-off-by: Cédric Le Goater <clg@xxxxxxxx> >>>> --- >>>> arch/powerpc/include/uapi/asm/kvm.h | 11 ++++ >>>> arch/powerpc/kvm/book3s_xive_native.c | 87 +++++++++++++++++++++++++++ >>>> 2 files changed, 98 insertions(+) >>>> >>>> diff --git a/arch/powerpc/include/uapi/asm/kvm.h b/arch/powerpc/include/uapi/asm/kvm.h >>>> index 1a8740629acf..faf024f39858 100644 >>>> --- a/arch/powerpc/include/uapi/asm/kvm.h >>>> +++ b/arch/powerpc/include/uapi/asm/kvm.h >>>> @@ -683,9 +683,20 @@ struct kvm_ppc_cpu_char { >>>> #define KVM_DEV_XIVE_SAVE_EQ_PAGES 4 >>>> #define KVM_DEV_XIVE_GRP_SOURCES 2 /* 64-bit source attributes */ >>>> #define KVM_DEV_XIVE_GRP_SYNC 3 /* 64-bit source attributes */ >>>> +#define KVM_DEV_XIVE_GRP_EAS 4 /* 64-bit eas attributes */ >>>> >>>> /* Layout of 64-bit XIVE source attribute values */ >>>> #define KVM_XIVE_LEVEL_SENSITIVE (1ULL << 0) >>>> #define KVM_XIVE_LEVEL_ASSERTED (1ULL << 1) >>>> >>>> +/* Layout of 64-bit eas attribute values */ >>>> +#define KVM_XIVE_EAS_PRIORITY_SHIFT 0 >>>> +#define KVM_XIVE_EAS_PRIORITY_MASK 0x7 >>>> +#define KVM_XIVE_EAS_SERVER_SHIFT 3 >>>> +#define KVM_XIVE_EAS_SERVER_MASK 0xfffffff8ULL >>>> +#define KVM_XIVE_EAS_MASK_SHIFT 32 >>>> +#define KVM_XIVE_EAS_MASK_MASK 0x100000000ULL >>>> +#define KVM_XIVE_EAS_EISN_SHIFT 33 >>>> +#define KVM_XIVE_EAS_EISN_MASK 0xfffffffe00000000ULL >>>> + >>>> #endif /* __LINUX_KVM_POWERPC_H */ >>>> diff --git a/arch/powerpc/kvm/book3s_xive_native.c b/arch/powerpc/kvm/book3s_xive_native.c >>>> index f2de1bcf3b35..0468b605baa7 100644 >>>> --- a/arch/powerpc/kvm/book3s_xive_native.c >>>> +++ b/arch/powerpc/kvm/book3s_xive_native.c >>>> @@ -525,6 +525,88 @@ static int kvmppc_xive_native_sync(struct kvmppc_xive *xive, long irq, u64 addr) >>>> return 0; >>>> } >>>> >>>> +static int kvmppc_xive_native_set_eas(struct kvmppc_xive *xive, long irq, >>>> + u64 addr) >>> >>> I'd prefer to avoid the name "EAS" here. IIUC these aren't "raw" EAS >>> values, but rather essentially the "source config" in the terminology >>> of the PAPR hcalls. Which, yes, is basically implemented by setting >>> the EAS, but since it's the PAPR architected state that we need to >>> preserve across migration, I'd prefer to stick as close as we can to >>> the PAPR terminology. >> >> But we don't have an equivalent name in the PAPR specs for the tuple >> (prio, server). We could use the generic 'target' name may be ? even >> if this is usually referring to a CPU number. > > Um.. what? That's about terminology for one of the fields in this > thing, not about the name for the thing itself. > >> Or, IVE (Interrupt Vector Entry) ? which makes some sense. >> This is was the former name in HW. I think we recycle it for KVM. > > That's a terrible idea, which will make a confusing situation even > more confusing. Let's use SOURCE_CONFIG and QUEUE_CONFIG. The KVM ioctls are very similar to the hcalls anyhow. C.