linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Paul Mackerras <paulus@ozlabs.org>
To: Jose Ricardo Ziviani <joserz@linux.vnet.ibm.com>
Cc: linuxppc-dev@lists.ozlabs.org, kvm-ppc@vger.kernel.org,
	lvivier@redhat.com
Subject: Re: [PATCH v5 0/1] Implements MMIO emulation for lvx/stvx instructions
Date: Fri, 2 Feb 2018 11:30:18 +1100	[thread overview]
Message-ID: <20180202003018.GA27665@fergus.ozlabs.ibm.com> (raw)
In-Reply-To: <20180201181539.9650-1-joserz@linux.vnet.ibm.com>

On Thu, Feb 01, 2018 at 04:15:38PM -0200, Jose Ricardo Ziviani wrote:
> v5:
>  - Fixed the mask off of the effective address
> 
> v4:
>   - Changed KVM_MMIO_REG_VMX to 0xc0 because there are 64 VSX registers
> 
> v3:
>   - Added Reported-by in the commit message
> 
> v2:
>   - kvmppc_get_vsr_word_offset() moved back to its original place
>   - EA AND ~0xF, following ISA.
>   - fixed BE/LE cases
> 
> TESTS:
> 
> For testing purposes I wrote a small program that performs stvx/lvx using the
> program's virtual memory and using MMIO. Load/Store into virtual memory is the
> model I use to check if MMIO results are correct (because only MMIO is emulated
> by KVM).

I'd be interested to see your test program because in my testing it's
still not right, unfortunately.  Interestingly, it is right for the BE
guest on LE host case.  However, with a LE guest on a LE host the two
halves are swapped, both for lvx and stvx:

error in lvx at byte 0
was: -> 62 69 70 77 7e 85 8c 93 2a 31 38 3f 46 4d 54 5b
ref: -> 2a 31 38 3f 46 4d 54 5b 62 69 70 77 7e 85 8c 93
error in stvx at byte 0
was: -> 49 50 57 5e 65 6c 73 7a 11 18 1f 26 2d 34 3b 42
ref: -> 11 18 1f 26 2d 34 3b 42 49 50 57 5e 65 6c 73 7a

The byte order within each 8-byte half is correct but the two halves
are swapped.  ("was" is what was in memory and "ref" is the correct
value.  For lvx it does lvx from emulated MMIO and stvx to ordinary
memory, and for stvx it does lvx from ordinary memory and stvx to
emulated MMIO.  In both cases the checking is done with a byte by byte
comparison.)

Paul.

  parent reply	other threads:[~2018-02-02  0:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-01 18:15 [PATCH v5 0/1] Implements MMIO emulation for lvx/stvx instructions Jose Ricardo Ziviani
2018-02-01 18:15 ` [PATCH v5 1/1] KVM: PPC: Book3S: Add MMIO emulation for VMX instructions Jose Ricardo Ziviani
2018-02-02  2:55   ` Paul Mackerras
2018-02-02  0:30 ` Paul Mackerras [this message]
2018-02-03  0:02   ` [PATCH v5 0/1] Implements MMIO emulation for lvx/stvx instructions joserz

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=20180202003018.GA27665@fergus.ozlabs.ibm.com \
    --to=paulus@ozlabs.org \
    --cc=joserz@linux.vnet.ibm.com \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=lvivier@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).