All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Don Slutz <dslutz@verizon.com>
To: Eric Blake <eblake@redhat.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Luiz Capitulino" <lcapitulino@redhat.com>,
	"Don Slutz" <don.slutz@gmail.com>,
	"Anthony Liguori" <aliguori@amazon.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Andreas Färber" <afaerber@suse.de>,
	"Richard Henderson" <rth@twiddle.net>
Subject: Re: [Qemu-devel] [BUGFIX][PATCH v7 1/9] vmport: The io memory region needs to be at least a size of 4
Date: Mon, 15 Jun 2015 09:53:23 -0400	[thread overview]
Message-ID: <557ED8D3.8010900@one.verizon.com> (raw)
In-Reply-To: <557B5F49.5050109@redhat.com>

On 06/12/15 18:38, Eric Blake wrote:
> On 06/12/2015 08:05 AM, Don Slutz wrote:
>> Before:
>>
>> commit c3c1bb99d1c11978d9ce94d1bdcf0705378c1459
>> Author: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
>> Date:   Mon Mar 16 22:35:54 2015 -0700
>>
>>     exec: Respect as_tranlsate_internal length clamp
>>
>> it did not matter.  Only accept I/O that starts on 1st
>> port.
>>
>> Signed-off-by: Don Slutz <dslutz@verizon.com>
>> CC: Don Slutz <don.slutz@gmail.com>
>> ---
>>  hw/misc/vmport.c | 6 +++++-
>>  1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/hw/misc/vmport.c b/hw/misc/vmport.c
>> index 7fcc00d..51b64bc 100644
>> --- a/hw/misc/vmport.c
>> +++ b/hw/misc/vmport.c
>> @@ -69,6 +69,10 @@ static uint64_t vmport_ioport_read(void *opaque, hwaddr addr,
>>      unsigned char command;
>>      uint32_t eax;
>>  
>> +    /* Only support 1 address */
>> +    if (addr) {
>> +        return ~0U;
>> +    }
> 
> Different answer on 32-bit platforms (there, ~0U is 0xffffffff, which
> then 0-extends to uint64_t rather than your desired result of
> 0xffffffffffffffffULL).
> 

This is not true:

Using:

build1:~/tmp>cat zr64.c
#include <stdio.h>

#include <stdint.h>

uint64_t vmport_ioport_read(void)
{
        return ~0U;
}

int
main(void)
{
        uint64_t res = vmport_ioport_read();

        printf("res=0x%llx\n", res);
}

On 32-bits:

build1:~/tmp>file zr64
zr64: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),
dynamically linked (uses shared libs), for GNU/Linux 2.6.18, not stripped
build1:~/tmp>./zr64
res=0xffffffff

on 64-bits:


build2:~/tmp>file zr64
zr64: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically
linked (uses shared libs), for GNU/Linux 2.6.18, not stripped
build2:~/tmp>./zr64
res=0xffffffff




> Why can't you just 'return -1;'?
> 

I/O instructions on x86 are limited to 32bits max.  Also when EAX is
changed via inl, the high 32bits are 0.  So the correct result is ~0U
not -1.

   -Don Slutz

  reply	other threads:[~2015-06-15 13:53 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-12 14:05 [Qemu-devel] [PATCH v7 0/9] Add limited support of VMware's hyper-call rpc Don Slutz
2015-06-12 14:05 ` [Qemu-devel] [BUGFIX][PATCH v7 1/9] vmport: The io memory region needs to be at least a size of 4 Don Slutz
2015-06-12 22:38   ` Eric Blake
2015-06-15 13:53     ` Don Slutz [this message]
2015-06-15 15:09       ` Eric Blake
2015-06-15 16:15         ` Don Slutz
2015-06-12 14:05 ` [Qemu-devel] [PATCH v7 2/9] vmport: Switch to trace Don Slutz
2015-06-12 14:05 ` [Qemu-devel] [BUGFIX][PATCH v7 3/9] vmport: Fix vmport_cmd_ram_size Don Slutz
2015-06-12 14:05 ` [Qemu-devel] [PATCH v7 4/9] vmport_rpc: Add the object vmport_rpc Don Slutz
2015-06-12 14:05 ` [Qemu-devel] [PATCH v7 5/9] vmport_rpc: Add limited support of VMware's hyper-call rpc Don Slutz
2015-06-12 14:05 ` [Qemu-devel] [PATCH v7 6/9] vmport_rpc: Add QMP access to vmport_rpc object Don Slutz
2015-06-15 15:53   ` Eric Blake
2015-06-17 16:42     ` Don Slutz
2015-06-12 14:05 ` [Qemu-devel] [PATCH v7 7/9] vmport_rpc: Add migration Don Slutz
2015-06-12 14:05 ` [Qemu-devel] [PATCH v7 8/9] vmport: Add VMware all ring hack Don Slutz
2015-06-12 14:05 ` [Qemu-devel] [PATCH v7 9/9] MAINTAINERS: add VMware port Don Slutz
2015-06-17 13:44 ` [Qemu-devel] [PATCH v7 0/9] Add limited support of VMware's hyper-call rpc Paolo Bonzini
2015-06-17 22:26   ` Don Slutz
2015-06-18  7:58     ` Michael S. Tsirkin
2015-06-18  8:33       ` Paolo Bonzini
2015-06-18  9:40         ` Michael S. Tsirkin
2015-06-18  8:33     ` Paolo Bonzini
2015-06-17 14:11 ` Michael S. Tsirkin
2015-06-17 14:13   ` Paolo Bonzini
2015-06-17 14:18     ` Michael S. Tsirkin
2015-06-17 14:27       ` Paolo Bonzini
2015-06-17 14:29         ` Michael S. Tsirkin
2015-06-17 16:17           ` Paolo Bonzini
2015-06-17 16:29             ` Michael S. Tsirkin
2015-06-17 16:48               ` Paolo Bonzini
2015-06-17 18:43                 ` Michael S. Tsirkin
2015-06-17 19:15                   ` Paolo Bonzini
2015-06-17 19:22                     ` Michael S. Tsirkin
2015-06-17 19:24                       ` Paolo Bonzini
2015-06-17 19:29                         ` Michael S. Tsirkin
2015-06-17 17:03               ` Don Slutz
2015-06-17 17:14                 ` Paolo Bonzini
2015-06-17 17:25                   ` Paolo Bonzini
2015-06-17 17:34                     ` Don Slutz
2015-06-17 18:58                       ` Michael S. Tsirkin
2015-06-18 18:40                         ` Don Slutz
2015-06-17 18:45                   ` Michael S. Tsirkin
2015-06-17 18:45                 ` Michael S. Tsirkin
2015-06-18  7:03             ` Gerd Hoffmann

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=557ED8D3.8010900@one.verizon.com \
    --to=dslutz@verizon.com \
    --cc=afaerber@suse.de \
    --cc=aliguori@amazon.com \
    --cc=armbru@redhat.com \
    --cc=don.slutz@gmail.com \
    --cc=eblake@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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.