kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Auger <eric.auger@linaro.org>
To: Andre Przywara <andre.przywara@arm.com>,
	"eric.auger@st.com" <eric.auger@st.com>
Cc: "christoffer.dall@linaro.org" <christoffer.dall@linaro.org>,
	Marc Zyngier <Marc.Zyngier@arm.com>,
	"p.fedin@samsung.com" <p.fedin@samsung.com>,
	"kvmarm@lists.cs.columbia.edu" <kvmarm@lists.cs.columbia.edu>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: [RFC 1/6] KVM: api: add kvm_irq_routing_extended_msi
Date: Tue, 23 Jun 2015 09:36:47 +0200	[thread overview]
Message-ID: <55890C8F.7060502@linaro.org> (raw)
In-Reply-To: <558838BB.9090908@arm.com>

Hi André,
On 06/22/2015 06:32 PM, Andre Przywara wrote:
> Hi Eric,
> 
> On 18/06/15 18:40, Eric Auger wrote:
>> On ARM, the MSI msg (address and data) comes along with
>> out-of-band device ID information. The device ID encodes the device
>> that composes the MSI msg. Let's create a new routing entry structure
>> that enables to encode that information on top of standard MSI
>> message
>>
>> Signed-off-by: Eric Auger <eric.auger@linaro.org>
>> ---
>>  Documentation/virtual/kvm/api.txt | 9 +++++++++
>>  include/uapi/linux/kvm.h          | 9 +++++++++
>>  2 files changed, 18 insertions(+)
>>
>> diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt
>> index d20fd94..bcec91e 100644
>> --- a/Documentation/virtual/kvm/api.txt
>> +++ b/Documentation/virtual/kvm/api.txt
>> @@ -1419,6 +1419,7 @@ struct kvm_irq_routing_entry {
>>  		struct kvm_irq_routing_irqchip irqchip;
>>  		struct kvm_irq_routing_msi msi;
>>  		struct kvm_irq_routing_s390_adapter adapter;
>> +		struct kvm_irq_routing_extended_msi ext_msi;
>>  		__u32 pad[8];
>>  	} u;
>>  };
>> @@ -1427,6 +1428,7 @@ struct kvm_irq_routing_entry {
>>  #define KVM_IRQ_ROUTING_IRQCHIP 1
>>  #define KVM_IRQ_ROUTING_MSI 2
>>  #define KVM_IRQ_ROUTING_S390_ADAPTER 3
>> +#define KVM_IRQ_ROUTING_EXTENDED_MSI 4
>>  
>>  No flags are specified so far, the corresponding field must be set to zero.
>>  
>> @@ -1442,6 +1444,13 @@ struct kvm_irq_routing_msi {
>>  	__u32 pad;
>>  };
>>  
>> +struct kvm_irq_routing_extended_msi {
>> +	__u32 address_lo;
>> +	__u32 address_hi;
>> +	__u32 data;
>> +	__u32 devid;
>> +};
>> +
> 
> I wonder if we could re-use the existing struct kvm_irq_routing_msi,
> which has an u32 pad field already. Since we use a different type
> number, this should not break. Admittedly not the nicest thing, but
> reduces interface bloat:
> 
> struct kvm_irq_routing_msi {
> 	__u32 address_lo;
> 	__u32 address_hi;
> 	__u32 data;
> 	union {
> 		__u32 pad;
> 		__u32 devid;
> 	};
> };
> 
> to maintain backward compatibility on the userland source level.
I also envisioned that solution. I eventually chose adding a new struct,
for sake of homogeneity since the fellow kvm struct does not have such a
padding field: struct kvm_kernel_irq_routing_entry (kvm_host.h).

But I don't have a strong preference so if it is a general preference I
will follow, of course.

Thanks

Eric


> 
> Cheers,
> Andre.
> 
>>  struct kvm_irq_routing_s390_adapter {
>>  	__u64 ind_addr;
>>  	__u64 summary_addr;
>> diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
>> index 2a23705..e3f65a0 100644
>> --- a/include/uapi/linux/kvm.h
>> +++ b/include/uapi/linux/kvm.h
>> @@ -829,6 +829,13 @@ struct kvm_irq_routing_msi {
>>  	__u32 pad;
>>  };
>>  
>> +struct kvm_irq_routing_extended_msi {
>> +	__u32 address_lo;
>> +	__u32 address_hi;
>> +	__u32 data;
>> +	__u32 devid;
>> +};
>> +
>>  struct kvm_irq_routing_s390_adapter {
>>  	__u64 ind_addr;
>>  	__u64 summary_addr;
>> @@ -841,6 +848,7 @@ struct kvm_irq_routing_s390_adapter {
>>  #define KVM_IRQ_ROUTING_IRQCHIP 1
>>  #define KVM_IRQ_ROUTING_MSI 2
>>  #define KVM_IRQ_ROUTING_S390_ADAPTER 3
>> +#define KVM_IRQ_ROUTING_EXTENDED_MSI 4
>>  
>>  struct kvm_irq_routing_entry {
>>  	__u32 gsi;
>> @@ -851,6 +859,7 @@ struct kvm_irq_routing_entry {
>>  		struct kvm_irq_routing_irqchip irqchip;
>>  		struct kvm_irq_routing_msi msi;
>>  		struct kvm_irq_routing_s390_adapter adapter;
>> +		struct kvm_irq_routing_extended_msi ext_msi;
>>  		__u32 pad[8];
>>  	} u;
>>  };
>>

--
To unsubscribe from this list: send the line "unsubscribe kvm" in

  reply	other threads:[~2015-06-23  7:37 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-18 17:40 [RFC 0/6] KVM: arm/arm64: gsi routing support Eric Auger
2015-06-18 17:40 ` [RFC 1/6] KVM: api: add kvm_irq_routing_extended_msi Eric Auger
2015-06-22 16:32   ` Andre Przywara
2015-06-23  7:36     ` Eric Auger [this message]
2015-06-18 17:40 ` [RFC 2/6] KVM: kvm_host: add kvm_extended_msi Eric Auger
2015-06-18 17:40 ` [RFC 3/6] KVM: irqchip: convey devid to kvm_set_msi Eric Auger
2015-06-18 17:40 ` [RFC 4/6] KVM: arm/arm64: enable irqchip routing Eric Auger
2015-06-18 17:53   ` Marc Zyngier
2015-06-18 18:00     ` Eric Auger
2015-06-18 18:07       ` Marc Zyngier
2015-06-18 17:40 ` [RFC 5/6] KVM: arm/arm64: enable MSI routing Eric Auger
2015-06-18 17:40 ` [RFC 6/6] KVM: arm: implement kvm_set_msi by gsi direct mapping Eric Auger
2015-06-19  6:37 ` [RFC 0/6] KVM: arm/arm64: gsi routing support Pavel Fedin
2015-06-22  8:31   ` Eric Auger
2015-06-22  8:40 ` Andre Przywara
2015-06-22  9:21   ` Eric Auger
2015-06-23  7:38     ` Pavel Fedin
2015-06-23  7:50       ` Eric Auger
2015-06-23  8:50         ` Pavel Fedin
2015-06-23  9:44           ` Eric Auger
2015-06-23  9:03     ` Andre Przywara
2015-06-23  9:33       ` Eric Auger
2015-06-23 12:53       ` Eric Auger
2015-06-24 12:20         ` Pavel Fedin
2015-06-24 13:03           ` Eric Auger
2015-06-25  8:46             ` Pavel Fedin
2015-06-26 16:17               ` Eric Auger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55890C8F.7060502@linaro.org \
    --to=eric.auger@linaro.org \
    --cc=Marc.Zyngier@arm.com \
    --cc=andre.przywara@arm.com \
    --cc=christoffer.dall@linaro.org \
    --cc=eric.auger@st.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=p.fedin@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).