All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Wei Liu <wei.liu2@citrix.com>
Cc: ian.jackson@eu.citrix.com, xen-devel@lists.xen.org
Subject: Re: [PATCH qemu-traditional] ioreq: Support 32-bit default_ioport_* accesses
Date: Mon, 23 May 2016 09:02:58 -0400	[thread overview]
Message-ID: <5742FF82.1070606@oracle.com> (raw)
In-Reply-To: <20160523120255.GP31272@citrix.com>

On 05/23/2016 08:02 AM, Wei Liu wrote:
> On Fri, May 20, 2016 at 09:52:40AM -0400, Boris Ostrovsky wrote:
>> Recent changes in ACPICA (specifically, Linux commit 66b1ed5aa8dd ("ACPICA:
>> ACPI 2.0, Hardware: Add access_width/bit_offset support for
>> acpi_hw_write()") result in guests issuing 32-bit accesses to IO space.
>>
>> QEMU needs to be able to handle them.
>>
>> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
>> ---
>>  vl.c | 15 ++++++++-------
>>  1 file changed, 8 insertions(+), 7 deletions(-)
>>
>> diff --git a/vl.c b/vl.c
>> index c864e7d..79d3ab5 100644
>> --- a/vl.c
>> +++ b/vl.c
>> @@ -350,17 +350,18 @@ static void default_ioport_writew(void *opaque, uint32_t address, uint32_t data)
>>  
>>  static uint32_t default_ioport_readl(void *opaque, uint32_t address)
>>  {
>> -#ifdef DEBUG_UNUSED_IOPORT
>> -    fprintf(stderr, "unused inl: port=0x%04x\n", address);
>> -#endif
>> -    return 0xffffffff;
>> +    uint32_t data;
>> +    data = default_ioport_readw(opaque, address) & 0xffff;
>> +    address = (address + 2) & (MAX_IOPORTS - 1);
> I'm not very familiar with how hardware behaves, but shouldn't we return
> some sort of invalid result (~0) and log when the port wraps?

Intel SDM says that trying to access ports beyond 0xffff is
implementation-specific. So wrapping them I guess is valid (it's how
qemu implements it for default_ioport_readw/writew, which is what I am
following here).

-boris



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  reply	other threads:[~2016-05-23 13:02 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-20 13:52 [PATCH qemu-traditional] ioreq: Support 32-bit default_ioport_* accesses Boris Ostrovsky
2016-05-23 12:02 ` Wei Liu
2016-05-23 13:02   ` Boris Ostrovsky [this message]
2016-05-23 13:05     ` Wei Liu
2016-05-23 13:42 ` Wei Liu
2016-05-25 14:26 ` Ian Jackson
2016-05-25 14:35   ` Ian Jackson
2016-05-25 15:08     ` Boris Ostrovsky
2016-05-25 15:22       ` Ian Jackson
2016-05-25 15:36         ` Boris Ostrovsky
2016-05-25 16:03           ` Jan Beulich
2016-05-25 16:09             ` Ian Jackson
2016-05-25 16:51               ` Boris Ostrovsky
2016-05-25 16:57                 ` Boris Ostrovsky
2016-05-26 14:00                 ` Ian Jackson
2016-05-25 16:02       ` Jan Beulich

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=5742FF82.1070606@oracle.com \
    --to=boris.ostrovsky@oracle.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=wei.liu2@citrix.com \
    --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.