All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Durrant <Paul.Durrant@citrix.com>
To: Don Slutz <dslutz@verizon.com>, Jan Beulich <JBeulich@suse.com>
Cc: "Tim (Xen.org)" <tim@xen.org>, Kevin Tian <kevin.tian@intel.com>,
	"Keir (Xen.org)" <keir@xen.org>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Jun Nakajima <jun.nakajima@intel.com>,
	Andrew Cooper <Andrew.Cooper3@citrix.com>,
	Eddie Dong <eddie.dong@intel.com>,
	George Dunlap <George.Dunlap@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Stefano Stabellini <Stefano.Stabellini@citrix.com>,
	Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com>,
	Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
	Ian Jackson <Ian.Jackson@citrix.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>
Subject: Re: [PATCH v9 08/13] Add IOREQ_TYPE_VMWARE_PORT
Date: Thu, 26 Feb 2015 15:00:54 +0000	[thread overview]
Message-ID: <9AAE0902D5BC7E449B7C8E4E778ABCD02581C937@AMSPEX01CL01.citrite.net> (raw)
In-Reply-To: <54EF33CC.4000708@terremark.com>

> -----Original Message-----
> From: Don Slutz [mailto:dslutz@verizon.com]
> Sent: 26 February 2015 14:55
> To: Paul Durrant; Jan Beulich; Don Slutz
> Cc: Aravind Gopalakrishnan; Suravee Suthikulpanit; Andrew Cooper; Ian
> Campbell; George Dunlap; Ian Jackson; Stefano Stabellini; Eddie Dong; Jun
> Nakajima; Kevin Tian; xen-devel@lists.xen.org; Boris Ostrovsky; Konrad
> Rzeszutek Wilk; Keir (Xen.org); Tim (Xen.org)
> Subject: Re: [PATCH v9 08/13] Add IOREQ_TYPE_VMWARE_PORT
> 
> On 02/26/15 06:49, Paul Durrant wrote:
> >> -----Original Message-----
> >> From: Jan Beulich [mailto:JBeulich@suse.com]
> >> Sent: 26 February 2015 08:08
> >> To: Don Slutz
> >> Cc: Aravind Gopalakrishnan; Suravee Suthikulpanit; Andrew Cooper; Ian
> >> Campbell; Paul Durrant; George Dunlap; Ian Jackson; Stefano Stabellini;
> Eddie
> >> Dong; Jun Nakajima; Kevin Tian; xen-devel@lists.xen.org; Boris Ostrovsky;
> >> Konrad Rzeszutek Wilk; Keir (Xen.org); Tim (Xen.org)
> >> Subject: Re: [PATCH v9 08/13] Add IOREQ_TYPE_VMWARE_PORT
> >>
> >>>>> On 25.02.15 at 21:20, <dslutz@verizon.com> wrote:
> >>> On 02/24/15 10:34, Jan Beulich wrote:
> >>>>>>> On 17.02.15 at 00:05, <dslutz@verizon.com> wrote:
> >>>>> @@ -501,22 +542,50 @@ static void hvm_free_ioreq_gmfn(struct
> >> domain *d, unsigned long gmfn)
> >>>>>      clear_bit(i, &d->arch.hvm_domain.ioreq_gmfn.mask);
> >>>>>  }
> >>>>>
> >>>>> -static void hvm_unmap_ioreq_page(struct hvm_ioreq_server *s,
> >> bool_t buf)
> >>>>> +static void hvm_unmap_ioreq_page(struct hvm_ioreq_server *s, int
> >> buf)
> >>>>>  {
> >>>>> -    struct hvm_ioreq_page *iorp = buf ? &s->bufioreq : &s->ioreq;
> >>>>> +    struct hvm_ioreq_page *iorp = NULL;
> >>>>> +
> >>>>> +    switch ( buf )
> >>>>> +    {
> >>>>> +    case 0:
> >>>>> +        iorp = &s->ioreq;
> >>>>> +        break;
> >>>>> +    case 1:
> >>>>> +        iorp = &s->bufioreq;
> >>>>> +        break;
> >>>>> +    case 2:
> >>>>> +        iorp = &s->vmport_ioreq;
> >>>>> +        break;
> >>>>> +    }
> >>>>
> >>>> These literals should become an enum.
> >>>>
> >>>
> >>> Paul Durrant asked for #defined values.  So it is not clear which way to
> >>> go. Will wait for response.
> >>
> >> Obviously either would be fine. An enum has the potential advantage
> >> of the compiler being able to check switch statements for completeness
> >> (albeit there are cases where this ends up being a disadvantage).
> >>
> >
> > I'm fine with an enum... just not with (repeated) magic numbers in the
> code.
> >
> 
> Ok, will use enum.
> 
> 
> > [snip]
> >>> Some background.  When Julien Grall added 2, this was said:
> >>>
> >>> Keir Fraser
> >>> [...]
> >>> They were almost certainly used for representing R-M-W ALU
> operations
> >> back
> >>> in the days of the old IO emulator, very long ago. Still, there''s no
> >>> harm in
> >>> leaving them unused.
> >>> [...]
> >>> I did find the old defn:
> >>>
> >>> dcs-xen-54:~/xen>git show 4ff8936 | grep IOREQ_TYPE_
> >>> #define IOREQ_TYPE_PIO          0 /* pio */
> >>> #define IOREQ_TYPE_COPY         1 /* mmio ops */
> >>> #define IOREQ_TYPE_AND          2
> >>> #define IOREQ_TYPE_OR           3
> >>> #define IOREQ_TYPE_XOR          4
> >>> #define IOREQ_TYPE_XCHG         5
> >>> #define IOREQ_TYPE_ADD          6
> >>> [...]
> >>> Which matches what Keir Fraser said.
> >>>
> >>> I did not find why Paul Durrant did not use 9.  I can only find it as 2
> >>> in all Paul's patch sets.  Which is closely connected to:
> >>>
> >>>          BUILD_BUG_ON(IOREQ_TYPE_PIO != HVMOP_IO_RANGE_PORT);
> >>>          BUILD_BUG_ON(IOREQ_TYPE_COPY !=
> >> HVMOP_IO_RANGE_MEMORY);
> >>>          BUILD_BUG_ON(IOREQ_TYPE_PCI_CONFIG !=
> >> HVMOP_IO_RANGE_PCI);
> >>>
> >>> (a new hyper call arg).  This also did not add a hole in "range" so
> >>> Paul Durrant did not have to check for a "range" hole.
> >>>
> >>> So I did just like Paul Durrant did.  He also approved the patch with
> >>> this number in QEMU.  Since this is now in upstream QEMU, changing it
> at
> >>> this time is a slower process.  Since the only time QEMU uses its
> >>> version is when Xen header files are missing, I do not see how a QEMU
> >>> built with its version would be usable as a QEMU for Xen.  So I am
> >>> happy to change to a new number like 9.
> >>
> >> Yes please. I'm not saying we absolutely have to correct the one
> >> Paul added (unless we learn it causes problems), but I think we
> >> should avoid making the same (even if only potential) mistake twice.
> >> Of course it would help to get insight from Paul (now Cc-ed) here.
> >>
> >
> > I used the hole because I really did not think anyone would
> > ever expect to use an ancient emulator against a recent
> > Xen. Given there has been no fallout I don't see why we can't
> > use the hole.
> 
> 
> Well, this is a little confusing (I read this as Paul is fine with 3).
> Since both Jan Beulich and Keir Fraser want to skip the hole, I will
> switch to 9.

I read Keir's comment as meaning he didn't care either way. If Jan wants to use 9 then I have no objection.

  Paul

> 
>    -Don Slutz
> 
> >   Paul
> >

  reply	other threads:[~2015-02-26 15:00 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-16 23:05 [PATCH v9 00/13] Xen VMware tools support Don Slutz
2015-02-16 23:05 ` [PATCH v9 01/13] hvm: Move MAX_INST_LEN into x86_emulate.h Don Slutz
2015-02-17  9:52   ` Andrew Cooper
2015-02-17 21:31     ` Don Slutz
2015-03-03 14:02   ` George Dunlap
2015-03-03 14:08     ` Andrew Cooper
2015-03-03 14:09       ` George Dunlap
2015-02-16 23:05 ` [PATCH v9 02/13] xen: Add support for VMware cpuid leaves Don Slutz
2015-02-17 10:02   ` Andrew Cooper
2015-02-17 15:57     ` Jan Beulich
2015-02-17 15:59       ` Andrew Cooper
2015-02-16 23:05 ` [PATCH v9 03/13] tools: Add vmware_hwver support Don Slutz
2015-03-03 14:14   ` Ian Campbell
2015-02-16 23:05 ` [PATCH v9 04/13] vmware: Add VMware provided include file Don Slutz
2015-02-17 10:03   ` Andrew Cooper
2015-02-16 23:05 ` [PATCH v9 05/13] xen: Add vmware_port support Don Slutz
2015-02-17 10:30   ` Andrew Cooper
2015-02-18  2:18     ` Don Slutz
2015-02-23 15:05   ` Jan Beulich
2015-02-23 16:03     ` Don Slutz
2015-02-23 16:28       ` Jan Beulich
2015-02-16 23:05 ` [PATCH v9 06/13] xen: Add ring 3 " Don Slutz
2015-02-17 14:38   ` Andrew Cooper
2015-02-18 17:03     ` Don Slutz
2015-02-18 18:19       ` Andrew Cooper
2015-02-21 13:36         ` Don Slutz
2015-02-21 15:40           ` Andrew Cooper
2015-02-21 16:06             ` Don Slutz
2015-02-23 15:12   ` Jan Beulich
2015-02-23 17:11     ` Don Slutz
2015-02-24  8:34       ` Jan Beulich
2015-02-24 17:14         ` Don Slutz
2015-02-25  8:39           ` Jan Beulich
2015-02-16 23:05 ` [PATCH v9 07/13] tools: Add " Don Slutz
2015-03-03 14:23   ` Ian Campbell
2015-05-14 23:10     ` Don Slutz
2015-02-16 23:05 ` [PATCH v9 08/13] Add IOREQ_TYPE_VMWARE_PORT Don Slutz
2015-02-17 10:08   ` Paul Durrant
2015-02-18  2:44     ` Don Slutz
2015-02-24 15:34   ` Jan Beulich
2015-02-25 20:20     ` Don Slutz
2015-02-26  8:07       ` Jan Beulich
2015-02-26 11:49         ` Paul Durrant
2015-02-26 14:55           ` Don Slutz
2015-02-26 15:00             ` Paul Durrant [this message]
2015-02-26 15:10             ` Jan Beulich
2015-02-26 19:52         ` Don Slutz
2015-02-27  7:48           ` Jan Beulich
2015-03-03 14:25   ` Ian Campbell
2015-02-16 23:05 ` [PATCH v9 09/13] Add xentrace to vmware_port Don Slutz
2015-02-17 13:45   ` Andrew Cooper
2015-02-17 18:22     ` Don Slutz
2015-02-23 16:57   ` Jan Beulich
2015-02-23 19:13     ` Don Slutz
2015-02-24  7:19       ` Jan Beulich
2015-03-03 14:27   ` Ian Campbell
2015-02-16 23:05 ` [PATCH v9 10/13] test_x86_emulator.c: Add typedef for boot_t Don Slutz
2015-02-17 14:44   ` Andrew Cooper
2015-02-17 22:46     ` Don Slutz
2015-02-16 23:05 ` [PATCH v9 11/13] test_x86_emulator.c: Add emacs block Don Slutz
2015-02-17 14:52   ` Andrew Cooper
2015-03-03 14:28     ` Ian Campbell
2015-03-03 14:31       ` Andrew Cooper
2015-02-16 23:05 ` [PATCH v9 12/13] test_x86_emulator.c: Add tests for #GP usage Don Slutz
2015-02-24 15:38   ` Jan Beulich
2015-02-24 18:29     ` Don Slutz
2015-02-25  8:30       ` Jan Beulich
2015-02-25 13:27         ` Don Slutz
2015-02-16 23:05 ` [OPTIONAL][PATCH v9 13/13] Add xen-hvm-param Don Slutz
2015-02-17 14:11   ` Andrew Cooper
2015-02-18  2:51     ` Don Slutz

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=9AAE0902D5BC7E449B7C8E4E778ABCD02581C937@AMSPEX01CL01.citrite.net \
    --to=paul.durrant@citrix.com \
    --cc=Andrew.Cooper3@citrix.com \
    --cc=Aravind.Gopalakrishnan@amd.com \
    --cc=George.Dunlap@citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Ian.Jackson@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=Stefano.Stabellini@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=dslutz@verizon.com \
    --cc=eddie.dong@intel.com \
    --cc=jun.nakajima@intel.com \
    --cc=keir@xen.org \
    --cc=kevin.tian@intel.com \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xen.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.