All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: xen-devel <xen-devel@lists.xensource.com>,
	Wei Liu <wei.liu2@citrix.com>, "liuw@liuw.name" <liuw@liuw.name>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	QEMU-devel <qemu-devel@nongnu.org>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH 2/2] Xen: Add xen-apic support and hook it up.
Date: Wed, 11 Apr 2012 17:23:05 +0100	[thread overview]
Message-ID: <CAFEAcA9Lpo_ejTuDo+snKGOSzSEAWD6D4b_37ur2RTRSZ_euhQ@mail.gmail.com> (raw)
In-Reply-To: <4F85AD8F.7000004@siemens.com>

On 11 April 2012 17:13, Jan Kiszka <jan.kiszka@siemens.com> wrote:
> On 2012-04-11 18:07, Peter Maydell wrote:
>>> +#include "hw/apic_internal.h"
>>> +#include "hw/msi.h"
>>> +#include "xen.h"
>>> +
>>> +static uint64_t xen_apic_mem_read(void *opaque, target_phys_addr_t addr,
>>> +                                  unsigned size)
>>> +{
>>> +    return -1U;
>>> +}
>>
>> This seems a rather confusing way to write 'return 0xffffffff;'
>
> You mean 0xffffffffffffffff? :)

No, that's why it's confusing :-)

1U is the integer constant 1 with a type of 'unsigned int'
(cf C99 section 6.4.4.1). It then has the unary negation
operator applied to it, giving (for the usual 32 bit integer
case) 0xffffffff. This is then cast from 'unsigned int'
to 'uint64_t' giving 0xffffffff as a 64 bit unsigned value.

(I had to write a test program to (a) confirm what it was
going to return and (b) that it would be the same thing on
both 32 and 64 bit systems...)

I have no opinion on what the return value actually ought
to be.

-- PMM

  reply	other threads:[~2012-04-11 16:23 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-05  9:32 [Qemu-devel] [PATCH 0/0] MSI/MSIX injection for Xen HVM guests Wei Liu
2012-04-05  9:32 ` Wei Liu
2012-04-05  9:34 ` [Qemu-devel] [PATCH 1/2] Xen: basic HVM MSI injection support Wei Liu
2012-04-05  9:34   ` Wei Liu
2012-04-05  9:35 ` [Qemu-devel] [PATCH 2/2] Xen: Add xen-apic support and hook it up Wei Liu
2012-04-05  9:35   ` Wei Liu
2012-04-11 16:02   ` Stefano Stabellini
2012-04-11 16:01     ` Jan Kiszka
2012-04-11 16:07   ` Peter Maydell
2012-04-11 16:13     ` Jan Kiszka
2012-04-11 16:23       ` Peter Maydell [this message]
2012-04-11 16:17     ` Stefano Stabellini
2012-04-11 16:19       ` Stefano Stabellini
2012-04-11 17:02       ` Eric Blake
2012-04-12  3:23         ` [Qemu-devel] " Wei Liu
2012-04-11 21:37       ` Paolo Bonzini
2012-04-05 10:14 ` [Qemu-devel] [PATCH 0/0] MSI/MSIX injection for Xen HVM guests Paolo Bonzini
2012-04-05 10:14   ` Paolo Bonzini
2012-04-05 10:43   ` [Qemu-devel] " Stefano Stabellini
2012-04-05 10:43     ` Stefano Stabellini
2012-04-05 10:50     ` [Qemu-devel] " Paolo Bonzini
2012-04-05 10:50       ` Paolo Bonzini

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=CAFEAcA9Lpo_ejTuDo+snKGOSzSEAWD6D4b_37ur2RTRSZ_euhQ@mail.gmail.com \
    --to=peter.maydell@linaro.org \
    --cc=Stefano.Stabellini@eu.citrix.com \
    --cc=jan.kiszka@siemens.com \
    --cc=liuw@liuw.name \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xensource.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.