All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Martin <dave.martin@linaro.org>
To: "Jon Medhurst (Tixy)" <tixy@linaro.org>
Cc: Christoffer Dall <c.dall@virtualopensystems.com>,
	Will Deacon <will.deacon@arm.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"kvmarm@lists.cs.columbia.edu" <kvmarm@lists.cs.columbia.edu>
Subject: Re: [PATCH 14/15] KVM: ARM: Handle I/O aborts
Date: Mon, 1 Oct 2012 17:07:25 +0100	[thread overview]
Message-ID: <20121001160725.GC2100@linaro.org> (raw)
In-Reply-To: <1349104329.2160.71.camel@linaro1.home>

On Mon, Oct 01, 2012 at 04:12:09PM +0100, Jon Medhurst (Tixy) wrote:
> On Mon, 2012-10-01 at 13:53 +0100, Dave Martin wrote:
> > On Sun, Sep 30, 2012 at 05:49:21PM -0400, Christoffer Dall wrote:
> > > On Thu, Sep 27, 2012 at 11:11 AM, Will Deacon <will.deacon@arm.com> wrote:
> > > > On Sat, Sep 15, 2012 at 04:35:59PM +0100, Christoffer Dall wrote:
> > > > I'm afraid you're not going to thank me much for this, but it's high time we
> > > > unified the various instruction decoding functions we have under arch/arm/
> > > > and this seems like a good opportunity for that. For example, look at the
> > > > following snippets (there is much more in the files I list) in addition to
> > > > what you have:
> > > >
> > > 
> > > I think it would be great if we had a set of unified decoding functions!
> > > 
> > > However, I think it's a shame if we can't merge KVM because we want to
> > > clean up this code. There would be nothing in the way of breaking API
> > > or anything like that preventing us from cleaning this up after the
> > > code has been merged.
> > > 
> > > Please consider reviewing the code for correctness and consider if the
> > > code could be merged as is.
> > > 
> > > On the other hand, if you or Dave or anyone else wants to create a set
> > > of patches that cleans this up in a timely manner, I will be happy to
> > > merge them for my code as well ;)
> > 
> > The time I would have available to put into this is rather limited, but
> > I have some initial ideas, as outlined below.
> > 
> > Tixy (who did the kprobes implementation, which is probably the most
> > sophisticated opcode handling we have in the kernel right now) may have
> > ideas too.  I would hope that any common framework could reuse a fair
> > chunk of his implementation and test coverage.
> 
> To my thinking, the kprobes code is very tailored to the job it needs to
> do and that turning it into something generic is just going to make
> everything bigger and more complex - because a generic framework would
> be bigger (as it's trying to be generic) and then things like kprobes
> will probably end up having an additional framework layered over the top
> to bend it to it's purposes. Perhaps I'm being too pessimistic.

Perhaps kprobes is a bit of a double-edged example.  It's an example of
an implementation with some good features, but because it is larger
the amount of adaptation required to convert to a common framework
would necessarily be larger also.

Yet, kprobes isn't trying to solve radically different problems from
other subsystems in the kernel.  It doesn't just want to descode and
manipulate the properties of instructions, it is actually interested in
many of the same properties (for example, whether an instruction is
a load or store, whether it modifies the PC etc.) as some other
subsystems.

I worry that by default every implementation of this ends up rather
deeply tailored to its correcponding subsystem -- so we gradually
accumulate more incompatible partially-overlapping duplicates of this
functionality over time.  This doesn't feel like a good thing.

> It would also requiring an inordinate amount of time to thrash out
> requirements, design, prototype, and to implement. (I don't think I'm
> being overly pessimistic about that ;-)
> 
> So, unless some-one has serious quantities of spare time lying around...

Well, I don't suggest that we should expect to get there in one go:
such an effort won't ever the off the ground for sure.

If we can consolidate a few simpler subsystems' opcode handling then
that would still be a step in the right direction, even if integrating
kprobes could not happen until much later.

If we do nothing, the situation will just gradually get worse.

Cheers
---Dave

WARNING: multiple messages have this Message-ID (diff)
From: dave.martin@linaro.org (Dave Martin)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 14/15] KVM: ARM: Handle I/O aborts
Date: Mon, 1 Oct 2012 17:07:25 +0100	[thread overview]
Message-ID: <20121001160725.GC2100@linaro.org> (raw)
In-Reply-To: <1349104329.2160.71.camel@linaro1.home>

On Mon, Oct 01, 2012 at 04:12:09PM +0100, Jon Medhurst (Tixy) wrote:
> On Mon, 2012-10-01 at 13:53 +0100, Dave Martin wrote:
> > On Sun, Sep 30, 2012 at 05:49:21PM -0400, Christoffer Dall wrote:
> > > On Thu, Sep 27, 2012 at 11:11 AM, Will Deacon <will.deacon@arm.com> wrote:
> > > > On Sat, Sep 15, 2012 at 04:35:59PM +0100, Christoffer Dall wrote:
> > > > I'm afraid you're not going to thank me much for this, but it's high time we
> > > > unified the various instruction decoding functions we have under arch/arm/
> > > > and this seems like a good opportunity for that. For example, look at the
> > > > following snippets (there is much more in the files I list) in addition to
> > > > what you have:
> > > >
> > > 
> > > I think it would be great if we had a set of unified decoding functions!
> > > 
> > > However, I think it's a shame if we can't merge KVM because we want to
> > > clean up this code. There would be nothing in the way of breaking API
> > > or anything like that preventing us from cleaning this up after the
> > > code has been merged.
> > > 
> > > Please consider reviewing the code for correctness and consider if the
> > > code could be merged as is.
> > > 
> > > On the other hand, if you or Dave or anyone else wants to create a set
> > > of patches that cleans this up in a timely manner, I will be happy to
> > > merge them for my code as well ;)
> > 
> > The time I would have available to put into this is rather limited, but
> > I have some initial ideas, as outlined below.
> > 
> > Tixy (who did the kprobes implementation, which is probably the most
> > sophisticated opcode handling we have in the kernel right now) may have
> > ideas too.  I would hope that any common framework could reuse a fair
> > chunk of his implementation and test coverage.
> 
> To my thinking, the kprobes code is very tailored to the job it needs to
> do and that turning it into something generic is just going to make
> everything bigger and more complex - because a generic framework would
> be bigger (as it's trying to be generic) and then things like kprobes
> will probably end up having an additional framework layered over the top
> to bend it to it's purposes. Perhaps I'm being too pessimistic.

Perhaps kprobes is a bit of a double-edged example.  It's an example of
an implementation with some good features, but because it is larger
the amount of adaptation required to convert to a common framework
would necessarily be larger also.

Yet, kprobes isn't trying to solve radically different problems from
other subsystems in the kernel.  It doesn't just want to descode and
manipulate the properties of instructions, it is actually interested in
many of the same properties (for example, whether an instruction is
a load or store, whether it modifies the PC etc.) as some other
subsystems.

I worry that by default every implementation of this ends up rather
deeply tailored to its correcponding subsystem -- so we gradually
accumulate more incompatible partially-overlapping duplicates of this
functionality over time.  This doesn't feel like a good thing.

> It would also requiring an inordinate amount of time to thrash out
> requirements, design, prototype, and to implement. (I don't think I'm
> being overly pessimistic about that ;-)
> 
> So, unless some-one has serious quantities of spare time lying around...

Well, I don't suggest that we should expect to get there in one go:
such an effort won't ever the off the ground for sure.

If we can consolidate a few simpler subsystems' opcode handling then
that would still be a step in the right direction, even if integrating
kprobes could not happen until much later.

If we do nothing, the situation will just gradually get worse.

Cheers
---Dave

  reply	other threads:[~2012-10-01 16:07 UTC|newest]

Thread overview: 164+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-15 15:34 [PATCH 00/15] KVM/ARM Implementation Christoffer Dall
2012-09-15 15:34 ` Christoffer Dall
2012-09-15 15:34 ` [PATCH 01/15] ARM: add mem_type prot_pte accessor Christoffer Dall
2012-09-15 15:34   ` Christoffer Dall
2012-09-18 12:23   ` Will Deacon
2012-09-18 12:23     ` Will Deacon
2012-09-18 19:18     ` Christoffer Dall
2012-09-18 19:18       ` Christoffer Dall
2012-09-18 21:04   ` Russell King - ARM Linux
2012-09-18 21:04     ` Russell King - ARM Linux
2012-09-18 21:53     ` Christoffer Dall
2012-09-18 21:53       ` Christoffer Dall
2012-09-20 10:01       ` Marc Zyngier
2012-09-20 10:01         ` Marc Zyngier
2012-09-20 13:21         ` Christoffer Dall
2012-09-20 13:21           ` Christoffer Dall
2012-09-15 15:34 ` [PATCH 02/15] ARM: Add page table and page defines needed by KVM Christoffer Dall
2012-09-15 15:34   ` Christoffer Dall
2012-09-18 12:47   ` Will Deacon
2012-09-18 12:47     ` Will Deacon
2012-09-18 14:06     ` Catalin Marinas
2012-09-18 14:06       ` Catalin Marinas
2012-09-18 15:05       ` Christoffer Dall
2012-09-18 15:05         ` Christoffer Dall
2012-09-18 15:07         ` Catalin Marinas
2012-09-18 15:07           ` Catalin Marinas
2012-09-18 15:10           ` Christoffer Dall
2012-09-18 15:10             ` Christoffer Dall
2012-09-18 22:01     ` Christoffer Dall
2012-09-18 22:01       ` Christoffer Dall
2012-09-19  9:21       ` Will Deacon
2012-09-19  9:21         ` Will Deacon
2012-09-20  0:10         ` Christoffer Dall
2012-09-20  0:10           ` Christoffer Dall
2012-09-15 15:34 ` [PATCH 03/15] ARM: Section based HYP idmap Christoffer Dall
2012-09-15 15:34   ` Christoffer Dall
2012-09-18 13:00   ` Will Deacon
2012-09-18 13:00     ` Will Deacon
2012-10-01  2:19     ` Christoffer Dall
2012-10-01  2:19       ` Christoffer Dall
2012-09-15 15:34 ` [PATCH 04/15] ARM: idmap: only initialize HYP idmap when HYP mode is available Christoffer Dall
2012-09-15 15:34   ` Christoffer Dall
2012-09-18 13:03   ` Will Deacon
2012-09-18 13:03     ` Will Deacon
2012-09-20  0:11     ` Christoffer Dall
2012-09-20  0:11       ` Christoffer Dall
2012-09-15 15:35 ` [PATCH 05/15] ARM: Expose PMNC bitfields for KVM use Christoffer Dall
2012-09-15 15:35   ` Christoffer Dall
2012-09-18 13:08   ` Will Deacon
2012-09-18 13:08     ` Will Deacon
2012-09-18 22:13     ` Christoffer Dall
2012-09-18 22:13       ` Christoffer Dall
2012-09-19  4:09     ` [kvmarm] " Rusty Russell
2012-09-19  4:09       ` Rusty Russell
2012-09-19  9:30       ` Will Deacon
2012-09-19  9:30         ` Will Deacon
2012-09-15 15:35 ` [PATCH 06/15] KVM: ARM: Initial skeleton to compile KVM support Christoffer Dall
2012-09-15 15:35   ` Christoffer Dall
2012-09-25 15:20   ` Will Deacon
2012-09-25 15:20     ` Will Deacon
2012-09-26  1:43     ` Christoffer Dall
2012-09-26  1:43       ` Christoffer Dall
2012-09-27 14:13       ` Will Deacon
2012-09-27 14:13         ` Will Deacon
2012-09-27 14:39         ` Marc Zyngier
2012-09-27 14:39           ` Marc Zyngier
2012-09-27 14:45         ` [kvmarm] " Peter Maydell
2012-09-27 14:45           ` Peter Maydell
2012-09-27 15:20           ` Will Deacon
2012-09-27 15:20             ` Will Deacon
2012-09-30 19:21         ` Christoffer Dall
2012-09-30 19:21           ` Christoffer Dall
2012-10-01 13:03           ` [kvmarm] " Marc Zyngier
2012-10-01 13:03             ` Marc Zyngier
2012-10-04 13:02           ` Min-gyu Kim
2012-10-04 13:02             ` Min-gyu Kim
2012-10-04 13:35             ` Christoffer Dall
2012-10-04 13:35               ` Christoffer Dall
2012-10-05  6:28             ` Rusty Russell
2012-10-05  6:28               ` Rusty Russell
2012-10-04 13:44     ` [kvmarm] " Avi Kivity
2012-10-04 13:44       ` Avi Kivity
2012-09-15 15:35 ` [PATCH 07/15] KVM: ARM: Hypervisor inititalization Christoffer Dall
2012-09-15 15:35   ` Christoffer Dall
2012-09-15 15:35 ` [PATCH 08/15] KVM: ARM: Memory virtualization setup Christoffer Dall
2012-09-15 15:35   ` Christoffer Dall
2012-09-15 15:35 ` [PATCH 09/15] KVM: ARM: Inject IRQs and FIQs from userspace Christoffer Dall
2012-09-15 15:35   ` Christoffer Dall
2012-09-25 15:55   ` Will Deacon
2012-09-25 15:55     ` Will Deacon
2012-09-29 15:50     ` Christoffer Dall
2012-09-29 15:50       ` Christoffer Dall
2012-09-30 12:48       ` Will Deacon
2012-09-30 12:48         ` Will Deacon
2012-09-30 14:34         ` Christoffer Dall
2012-09-30 14:34           ` Christoffer Dall
2012-09-15 15:35 ` [PATCH 10/15] KVM: ARM: World-switch implementation Christoffer Dall
2012-09-15 15:35   ` Christoffer Dall
2012-09-25 17:00   ` Will Deacon
2012-09-25 17:00     ` Will Deacon
2012-09-25 17:15     ` [kvmarm] " Peter Maydell
2012-09-25 17:15       ` Peter Maydell
2012-09-25 17:42       ` Marc Zyngier
2012-09-25 17:42         ` Marc Zyngier
2012-09-30  0:33         ` Christoffer Dall
2012-09-30  0:33           ` Christoffer Dall
2012-09-30  9:48           ` Peter Maydell
2012-09-30  9:48             ` Peter Maydell
2012-09-30 14:31             ` Christoffer Dall
2012-09-30 14:31               ` Christoffer Dall
2012-09-30 17:47     ` Christoffer Dall
2012-09-30 17:47       ` Christoffer Dall
2012-09-15 15:35 ` [PATCH 11/15] KVM: ARM: Emulation framework and CP15 emulation Christoffer Dall
2012-09-15 15:35   ` Christoffer Dall
2012-09-15 15:35 ` [PATCH 12/15] KVM: ARM: User space API for getting/setting co-proc registers Christoffer Dall
2012-09-15 15:35   ` Christoffer Dall
2012-09-15 15:35 ` [PATCH 13/15] KVM: ARM: Handle guest faults in KVM Christoffer Dall
2012-09-15 15:35   ` Christoffer Dall
2012-09-25 11:11   ` Min-gyu Kim
2012-09-25 11:11     ` Min-gyu Kim
2012-09-25 12:38     ` Christoffer Dall
2012-09-25 12:38       ` Christoffer Dall
2012-09-27  3:11       ` Min-gyu Kim
2012-09-27  3:11         ` Min-gyu Kim
2012-09-27  5:35         ` Christoffer Dall
2012-09-27  5:35           ` Christoffer Dall
2012-09-27 15:26         ` [kvmarm] " Marc Zyngier
2012-09-27 15:26           ` Marc Zyngier
2012-09-27 12:39       ` Catalin Marinas
2012-09-27 12:39         ` Catalin Marinas
2012-09-27 17:15         ` Christoffer Dall
2012-09-27 17:15           ` Christoffer Dall
2012-09-27 17:21           ` Catalin Marinas
2012-09-27 17:21             ` Catalin Marinas
2012-09-15 15:35 ` [PATCH 14/15] KVM: ARM: Handle I/O aborts Christoffer Dall
2012-09-15 15:35   ` Christoffer Dall
2012-09-27 15:11   ` Will Deacon
2012-09-27 15:11     ` Will Deacon
2012-09-30 21:49     ` Christoffer Dall
2012-09-30 21:49       ` Christoffer Dall
2012-10-01 12:53       ` Dave Martin
2012-10-01 12:53         ` Dave Martin
2012-10-01 15:12         ` Jon Medhurst (Tixy)
2012-10-01 15:12           ` Jon Medhurst (Tixy)
2012-10-01 16:07           ` Dave Martin [this message]
2012-10-01 16:07             ` Dave Martin
2012-10-05  9:00         ` Russell King - ARM Linux
2012-10-05  9:00           ` Russell King - ARM Linux
2012-10-08 10:04           ` Dave Martin
2012-10-08 10:04             ` Dave Martin
2012-10-08 21:52             ` Christoffer Dall
2012-10-08 21:52               ` Christoffer Dall
2012-09-15 15:36 ` [PATCH 15/15] KVM: ARM: Guest wait-for-interrupts (WFI) support Christoffer Dall
2012-09-15 15:36   ` Christoffer Dall
2012-09-25 17:04   ` Will Deacon
2012-09-25 17:04     ` Will Deacon
2012-09-29 23:00     ` Christoffer Dall
2012-09-29 23:00       ` Christoffer Dall
2012-09-18 12:21 ` [PATCH 00/15] KVM/ARM Implementation Will Deacon
2012-09-18 12:21   ` Will Deacon
2012-09-18 12:32   ` Christoffer Dall
2012-09-18 12:32     ` Christoffer Dall
2012-09-19 12:44 ` Avi Kivity
2012-09-19 12:44   ` Avi Kivity

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=20121001160725.GC2100@linaro.org \
    --to=dave.martin@linaro.org \
    --cc=c.dall@virtualopensystems.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=tixy@linaro.org \
    --cc=will.deacon@arm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.