Re: [Qemu-devel] [PATCH v5] target-ppc: ppc64 target's virtio can be either endian

2014-04-22 Thread Dave Anderson
- Original Message - On Mon, Apr 21, 2014 at 4:48 PM, Greg Kurz gk...@linux.vnet.ibm.com wrote: On Mon, 21 Apr 2014 09:56:48 +0200 Alexander Graf ag...@suse.de wrote: Am 21.04.2014 um 06:16 schrieb Bharata B Rao bharata@gmail.com: On Mon, Apr 14, 2014 at

Re: [Qemu-devel] [PATCH v5] target-ppc: ppc64 target's virtio can be either endian

2014-04-22 Thread Greg Kurz
On Tue, 22 Apr 2014 09:19:48 -0400 (EDT) Dave Anderson ander...@redhat.com wrote: - Original Message - On Mon, Apr 21, 2014 at 4:48 PM, Greg Kurz gk...@linux.vnet.ibm.com wrote: On Mon, 21 Apr 2014 09:56:48 +0200 Alexander Graf ag...@suse.de wrote: Am

Re: [Qemu-devel] [PATCH v5] target-ppc: ppc64 target's virtio can be either endian

2014-04-22 Thread Dave Anderson
- Original Message - On Tue, 22 Apr 2014 09:19:48 -0400 (EDT) Dave Anderson ander...@redhat.com wrote: - Original Message - On Mon, Apr 21, 2014 at 4:48 PM, Greg Kurz gk...@linux.vnet.ibm.com wrote: On Mon, 21 Apr 2014 09:56:48 +0200 Alexander Graf

Re: [Qemu-devel] [PATCH v5] target-ppc: ppc64 target's virtio can be either endian

2014-04-21 Thread Alexander Graf
Am 21.04.2014 um 06:16 schrieb Bharata B Rao bharata@gmail.com: On Mon, Apr 14, 2014 at 5:42 PM, Greg Kurz gk...@linux.vnet.ibm.com wrote: + +#if !defined(CONFIG_USER_ONLY) +bool virtio_is_big_endian(void) +{ +PowerPCCPU *cp = POWERPC_CPU(first_cpu); +CPUPPCState *env =

Re: [Qemu-devel] [PATCH v5] target-ppc: ppc64 target's virtio can be either endian

2014-04-21 Thread Bharata B Rao
On Mon, Apr 21, 2014 at 1:26 PM, Alexander Graf ag...@suse.de wrote: Am 21.04.2014 um 06:16 schrieb Bharata B Rao bharata@gmail.com: On Mon, Apr 14, 2014 at 5:42 PM, Greg Kurz gk...@linux.vnet.ibm.comwrote: + +#if !defined(CONFIG_USER_ONLY) +bool virtio_is_big_endian(void) +{ +

Re: [Qemu-devel] [PATCH v5] target-ppc: ppc64 target's virtio can be either endian

2014-04-21 Thread Greg Kurz
On Mon, 21 Apr 2014 09:46:59 +0530 Bharata B Rao bharata@gmail.com wrote: On Mon, Apr 14, 2014 at 5:42 PM, Greg Kurz gk...@linux.vnet.ibm.com wrote: + +#if !defined(CONFIG_USER_ONLY) +bool virtio_is_big_endian(void) +{ +PowerPCCPU *cp = POWERPC_CPU(first_cpu); +

Re: [Qemu-devel] [PATCH v5] target-ppc: ppc64 target's virtio can be either endian

2014-04-21 Thread Alexander Graf
Am 21.04.2014 um 10:55 schrieb Bharata B Rao bharata@gmail.com: On Mon, Apr 21, 2014 at 1:26 PM, Alexander Graf ag...@suse.de wrote: Am 21.04.2014 um 06:16 schrieb Bharata B Rao bharata@gmail.com: On Mon, Apr 14, 2014 at 5:42 PM, Greg Kurz gk...@linux.vnet.ibm.com wrote:

Re: [Qemu-devel] [PATCH v5] target-ppc: ppc64 target's virtio can be either endian

2014-04-21 Thread Greg Kurz
On Mon, 21 Apr 2014 09:56:48 +0200 Alexander Graf ag...@suse.de wrote: Am 21.04.2014 um 06:16 schrieb Bharata B Rao bharata@gmail.com: On Mon, Apr 14, 2014 at 5:42 PM, Greg Kurz gk...@linux.vnet.ibm.com wrote: + +#if !defined(CONFIG_USER_ONLY) +bool

Re: [Qemu-devel] [PATCH v5] target-ppc: ppc64 target's virtio can be either endian

2014-04-21 Thread Bharata B Rao
On Mon, Apr 21, 2014 at 4:48 PM, Greg Kurz gk...@linux.vnet.ibm.com wrote: On Mon, 21 Apr 2014 09:56:48 +0200 Alexander Graf ag...@suse.de wrote: Am 21.04.2014 um 06:16 schrieb Bharata B Rao bharata@gmail.com: On Mon, Apr 14, 2014 at 5:42 PM, Greg Kurz gk...@linux.vnet.ibm.com

Re: [Qemu-devel] [PATCH v5] target-ppc: ppc64 target's virtio can be either endian

2014-04-20 Thread Bharata B Rao
On Mon, Apr 14, 2014 at 5:42 PM, Greg Kurz gk...@linux.vnet.ibm.com wrote: + +#if !defined(CONFIG_USER_ONLY) +bool virtio_is_big_endian(void) +{ +PowerPCCPU *cp = POWERPC_CPU(first_cpu); +CPUPPCState *env = cp-env; + +/* NOTE: booke uses the same number for another unrelated

[Qemu-devel] [PATCH v5] target-ppc: ppc64 target's virtio can be either endian

2014-04-14 Thread Greg Kurz
We turn the virtio_is_big_endian() helper into a target dependant hook to compute endianness for legacy virtio devices. We base it on the OS endian, as reflected by the endianness of the interrupt vectors (handled through the ILE bit in the LPCR register). Using first_cpu to fetch the registers

Re: [Qemu-devel] [PATCH v5] target-ppc: ppc64 target's virtio can be either endian

2014-04-14 Thread Alexander Graf
On 14.04.14 14:12, Greg Kurz wrote: We turn the virtio_is_big_endian() helper into a target dependant hook to compute endianness for legacy virtio devices. We base it on the OS endian, as reflected by the endianness of the interrupt vectors (handled through the ILE bit in the LPCR register).