All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: stefano.stabellini@eu.citrix.com, andrew.cooper3@citrix.com,
	konrad@kernel.org, linux@eikelenboom.it, david.vrabel@citrix.com,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH QEMU-XEN] xen/pt: Start with emulated PCI_COMMAND set to zero.
Date: Thu, 25 Jun 2015 13:23:14 -0400	[thread overview]
Message-ID: <20150625172313.GA2470@x230.dumpdata.com> (raw)
In-Reply-To: <558BCB350200007800089529@mail.emea.novell.com>

On Thu, Jun 25, 2015 at 08:34:45AM +0100, Jan Beulich wrote:
> >>> On 24.06.15 at 17:59, <konrad.wilk@oracle.com> wrote:
> > While digging in this I realized that some shortcuts and assumptions
> > had been taken (I think I am restating what you two have already
> > realized).
> > 
> > 1) The dev.config is (by Xen code) used as the cache of the
> >    host configuration devices (which is OK at init right now).
> > 
> >    However to sync up the ->data with dev.config (and apply emu_mask)
> >    means that it cannot be used as such (the semantics of that have 
> > changed). 
> > 
> > 2). The dev.config is (by the generic code) used as a view of what
> >    the guest should see (cache of guest values).
> > 
> > 
> > To make this work, the plan would be:
> > 
> >  1). Remove all the dev.config accesses to check host values:
> > 	@@ -728,7 +729,7 @@ static int xen_pt_initfn(PCIDevice *d)
> > 	     }
> > 	 
> > 	     /* Bind interrupt */
> > 	-    if (!s->dev.config[PCI_INTERRUPT_PIN]) {
> > 	+    if (xen_host_pci_get_byte(PCI_INTERRUPT_PIN)) {
> > 		 XEN_PT_LOG(d, "no pin interrupt\n");
> > 		 goto out;
> > 	     }
> >      And replace them with calls to get the actual host value.
> > 
> >  2). Replace all the pci_get_[byte,word,long] (which are wrappers
> >      around dev.config) in the init routines (see get_capability_version and
> >      xen_pt_linkctrl_reg_init) with calls to xen_host_pci_[byte,word,long].
> > 
> >      In short - replace the calls to get the actual host values.
> > 
> > That would untangle a lot of this and make it a bit saner (I hope).
> 
> Except that I don't think changing the init-time uses would really be
> necessary.

Ah, but how would we go forward when dev.config is all we have - without
any 'data'? We have to stash the init guest values somewhere.

> 
> > And after that I can:
> > 
> >  3). Rip out ->data and use pci_set_[byte,word,long] or 
> > pci_get_[byte,word,long]
> >      to get one unified view of what the guest is suppose to have.
> > 
> >  4). Tackle bugs that will creep up because of this. I am not sure what
> >      they are, but surely will hit some. I expect that some of these
> >      patches will add debug/more logging to help me tackle this.
> > 
> >  5). Reinstate an host cache (if needed) for configuration access to lessen
> >      the amount of reads we do. 'host_cache_config' perhaps?
> 
> Not sure it's a good idea to cache registers that can change behind
> our back.
> 
> Jan
> 

  parent reply	other threads:[~2015-06-25 17:23 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-13  9:39 Dom0 linux 4.0 + devel/for-linus-4.1 branch: p2m.c:884:d0v0 gfn_to_mfn failed! gfn=ffffffff001ed type:4 Sander Eikelenboom
2015-04-13  9:50 ` David Vrabel
2015-04-13 11:21   ` Sander Eikelenboom
2015-04-13 12:07     ` David Vrabel
2015-04-13 12:14       ` Sander Eikelenboom
2015-04-13 12:21         ` David Vrabel
2015-04-13 12:27           ` Sander Eikelenboom
2015-04-13 15:11           ` Sander Eikelenboom
2015-04-14  9:44             ` David Vrabel
2015-04-14 20:42             ` Konrad Rzeszutek Wilk
2015-04-15 15:08               ` Sander Eikelenboom
2015-04-15 20:58                 ` Konrad Rzeszutek Wilk
2015-04-15 21:14                   ` Sander Eikelenboom
2015-06-10  1:02                     ` Is: qemu-xen mishandling upper 64-bit BAR compared to qemu-tradWas:Re: " Konrad Rzeszutek Wilk
2015-06-10  8:44                       ` Jan Beulich
2015-06-10 11:13                         ` Stefano Stabellini
2015-06-10 12:02                           ` Jan Beulich
2015-06-10 14:33                             ` Konrad Rzeszutek Wilk
2015-06-10 20:53                             ` [PATCH QEMU-XEN] xen/pt: Start with emulated PCI_COMMAND set to zero konrad
2015-06-11  7:47                               ` Jan Beulich
2015-06-11 11:19                                 ` Sander Eikelenboom
2015-06-12 13:37                                   ` Konrad Rzeszutek Wilk
2015-06-15 16:19                                 ` Stefano Stabellini
2015-06-15 18:46                                   ` Konrad Rzeszutek Wilk
2015-06-16  7:33                                   ` Jan Beulich
2015-06-24 15:59                                     ` Konrad Rzeszutek Wilk
2015-06-25  7:34                                       ` Jan Beulich
2015-06-25 12:08                                         ` Stefano Stabellini
2015-06-25 17:23                                         ` Konrad Rzeszutek Wilk [this message]
2015-06-26  6:10                                           ` Jan Beulich
2015-06-15 16:15                             ` Is: qemu-xen mishandling upper 64-bit BAR compared to qemu-tradWas:Re: Dom0 linux 4.0 + devel/for-linus-4.1 branch: p2m.c:884:d0v0 gfn_to_mfn failed! gfn=ffffffff001ed type:4 Stefano Stabellini

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=20150625172313.GA2470@x230.dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=david.vrabel@citrix.com \
    --cc=konrad@kernel.org \
    --cc=linux@eikelenboom.it \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /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.