Message ID | 1373968806-14032-1-git-send-email-aik@ozlabs.ru |
---|---|
State | New |
Headers | show |
Alexey Kardashevskiy <aik@ozlabs.ru> writes: > Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> > --- > target-ppc/kvm.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c > index 61f2737..606bdb9 100644 > --- a/target-ppc/kvm.c > +++ b/target-ppc/kvm.c > @@ -1628,7 +1628,7 @@ void *kvmppc_create_spapr_tce(uint32_t liobn, uint32_t window_size, int *pfd) > return NULL; > } > > - len = (window_size / SPAPR_TCE_PAGE_SIZE) * sizeof(sPAPRTCE); > + len = (window_size / SPAPR_TCE_PAGE_SIZE) * sizeof(uint64_t); > /* FIXME: round this up to page size */ > > table = mmap(NULL, len, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); > @@ -1651,7 +1651,7 @@ int kvmppc_remove_spapr_tce(void *table, int fd, uint32_t window_size) > return -1; > } > > - len = (window_size / SPAPR_TCE_PAGE_SIZE)*sizeof(sPAPRTCE); > + len = (window_size / SPAPR_TCE_PAGE_SIZE)*sizeof(uint64_t); > if ((munmap(table, len) < 0) || > (close(fd) < 0)) { > fprintf(stderr, "KVM: Unexpected error removing TCE table: > %s", Thanks, I'm running on x86 so this code didn't get built for me. Regards, Anthony Liguori > -- > 1.8.3.2
On 16.07.2013, at 12:00, Alexey Kardashevskiy wrote: > Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Why? sPAPRTCE is a typedef struct that's defined in include/hw/ppc/spapr.h which is included from target-ppc/kvm.c. So it should work just fine. Alex > --- > target-ppc/kvm.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c > index 61f2737..606bdb9 100644 > --- a/target-ppc/kvm.c > +++ b/target-ppc/kvm.c > @@ -1628,7 +1628,7 @@ void *kvmppc_create_spapr_tce(uint32_t liobn, uint32_t window_size, int *pfd) > return NULL; > } > > - len = (window_size / SPAPR_TCE_PAGE_SIZE) * sizeof(sPAPRTCE); > + len = (window_size / SPAPR_TCE_PAGE_SIZE) * sizeof(uint64_t); > /* FIXME: round this up to page size */ > > table = mmap(NULL, len, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); > @@ -1651,7 +1651,7 @@ int kvmppc_remove_spapr_tce(void *table, int fd, uint32_t window_size) > return -1; > } > > - len = (window_size / SPAPR_TCE_PAGE_SIZE)*sizeof(sPAPRTCE); > + len = (window_size / SPAPR_TCE_PAGE_SIZE)*sizeof(uint64_t); > if ((munmap(table, len) < 0) || > (close(fd) < 0)) { > fprintf(stderr, "KVM: Unexpected error removing TCE table: %s", > -- > 1.8.3.2 >
On 17.07.2013, at 01:12, Alexander Graf wrote: > > On 16.07.2013, at 12:00, Alexey Kardashevskiy wrote: > >> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> > > Why? sPAPRTCE is a typedef struct that's defined in include/hw/ppc/spapr.h which is included from target-ppc/kvm.c. So it should work just fine. Ah, my mailer screwed up threading. This is in reply to Anthony's cleanups? Alex
On 07/17/2013 09:13 AM, Alexander Graf wrote: > > On 17.07.2013, at 01:12, Alexander Graf wrote: > >> >> On 16.07.2013, at 12:00, Alexey Kardashevskiy wrote: >> >>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> >> >> Why? sPAPRTCE is a typedef struct that's defined in include/hw/ppc/spapr.h which is included from target-ppc/kvm.c. So it should work just fine. > > Ah, my mailer screwed up threading. This is in reply to Anthony's cleanups? Yes. He removed the struct.
diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c index 61f2737..606bdb9 100644 --- a/target-ppc/kvm.c +++ b/target-ppc/kvm.c @@ -1628,7 +1628,7 @@ void *kvmppc_create_spapr_tce(uint32_t liobn, uint32_t window_size, int *pfd) return NULL; } - len = (window_size / SPAPR_TCE_PAGE_SIZE) * sizeof(sPAPRTCE); + len = (window_size / SPAPR_TCE_PAGE_SIZE) * sizeof(uint64_t); /* FIXME: round this up to page size */ table = mmap(NULL, len, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); @@ -1651,7 +1651,7 @@ int kvmppc_remove_spapr_tce(void *table, int fd, uint32_t window_size) return -1; } - len = (window_size / SPAPR_TCE_PAGE_SIZE)*sizeof(sPAPRTCE); + len = (window_size / SPAPR_TCE_PAGE_SIZE)*sizeof(uint64_t); if ((munmap(table, len) < 0) || (close(fd) < 0)) { fprintf(stderr, "KVM: Unexpected error removing TCE table: %s",
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> --- target-ppc/kvm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)