lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120226000630.GC22460@alea.gnuu.de>
Date:	Sun, 26 Feb 2012 01:06:30 +0100
From:	Jörg Sommer <joerg@...a.gnuu.de>
To:	Alexander Graf <agraf@...e.de>
Cc:	Avi Kivity <avi@...hat.com>, Marcelo Tosatti <mtosatti@...hat.com>,
	kvm list <kvm@...r.kernel.org>, kvm-ppc@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: Current kernel fails to compile with KVM on PowerPC

Jörg Sommer hat am Sat 25. Feb, 15:51 (+0100) geschrieben:
> Jörg Sommer hat am Tue 21. Feb, 09:32 (+0100) geschrieben:
> > Alexander Graf hat am Mon 20. Feb, 22:27 (+0100) geschrieben:
> > > On 20.02.2012, at 18:38, Jörg Sommer wrote:
> > > > Alexander Graf hat am Tue 22. Nov, 22:29 (+0100) geschrieben:
> > > >> On 22.11.2011, at 21:04, Jörg Sommer wrote:
> > > >>> [1] »kernel BUG at include/linux/kvm_host.h:603!«
> > > >>> http://www.mail-archive.com/kvm@vger.kernel.org/msg61433.html
> > > >> 
> > > >> This is unfortunately still there. It's because of preemption being
> > > >> enabled. Please just use CONFIG_PREEMPT_NONE for the time being
> > > > 
> > > > This doesn't help. I've build with CONFIG_PREEMPT_NONE, but I'm getting
> > > > this Oops, when I start qemu.
> > > 
> > > Could you please try git://git.kernel.org/pub/scm/virt/kvm/kvm.git? I
> > > fixed a bunch of things with preemption since then and it definitely
> > > worked for me. If it still fails in that tree, I can try again to
> > > reproduce it :).
> > 
> > This kernel (e9badff4b38a3f8b2c20aa8a30db210caf85a497) fails to build:
> > 
> >   CC [M]  arch/powerpc/kvm/book3s_pr.o
> > arch/powerpc/kvm/book3s_pr.c: In function ‘kvm_vcpu_ioctl_get_one_reg’:
> > arch/powerpc/kvm/book3s_pr.c:883:45: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
> > arch/powerpc/kvm/book3s_pr.c:883:80: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
> > arch/powerpc/kvm/book3s_pr.c:883:284: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
> > arch/powerpc/kvm/book3s_pr.c:883:327: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
> > arch/powerpc/kvm/book3s_pr.c:883:459: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
> > arch/powerpc/kvm/book3s_pr.c:883:748: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
> > arch/powerpc/kvm/book3s_pr.c:883:1112: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
> > arch/powerpc/kvm/book3s_pr.c:883:1476: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
> > arch/powerpc/kvm/book3s_pr.c:883:1867: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]

> @@ -652,6 +653,11 @@ static int kvm_vcpu_ioctl_get_one_reg(struct kvm_vcpu *vcpu,
>         int r = -EINVAL;
>  
>         switch (reg->id) {
> +#ifdef CONFIG_PPC_BOOK3S
> +       case KVM_REG_PPC_HIOR:
> +               r = put_user(to_book3s(vcpu)->hior, (u64 __user *)reg->addr);
> +               break;
> +#endif
>         default:
>                 break;
>         }

Is this the right fix for this code?

diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c
index ee222ec..a5d061c 100644
--- a/arch/powerpc/kvm/book3s_pr.c
+++ b/arch/powerpc/kvm/book3s_pr.c
@@ -880,7 +880,7 @@ int kvm_vcpu_ioctl_get_one_reg(struct kvm_vcpu *vcpu, struct kvm_one_reg *reg)
 
        switch (reg->id) {
        case KVM_REG_PPC_HIOR:
-               r = put_user(to_book3s(vcpu)->hior, (u64 __user *)reg->addr);
+               r = put_user(to_book3s(vcpu)->hior, (u64 __user *)&reg->addr);
                break;
        default:
                break;
@@ -895,7 +895,7 @@ int kvm_vcpu_ioctl_set_one_reg(struct kvm_vcpu *vcpu, struct kvm_one_reg *reg)
 
        switch (reg->id) {
        case KVM_REG_PPC_HIOR:
-               r = get_user(to_book3s(vcpu)->hior, (u64 __user *)reg->addr);
+               r = get_user(to_book3s(vcpu)->hior, (u64 __user *)&reg->addr);
                if (!r)
                        to_book3s(vcpu)->hior_explicit = true;
                break;

Bye, Jörg.
-- 
If Java had true garbage collection, most programs would delete
themselves upon execution

Download attachment "signature.asc" of type "application/pgp-signature" (199 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ