From mboxrd@z Thu Jan 1 00:00:00 1970 From: Borislav Petkov Subject: Re: [Part2 PATCH v6 32/38] KVM: SVM: Add support for SEV DEBUG_DECRYPT command Date: Mon, 30 Oct 2017 16:12:30 +0100 Message-ID: <20171030151223.vdxb6oc3cttw74zm@pd.tnic> References: <20171020023413.122280-1-brijesh.singh@amd.com> <20171020023413.122280-33-brijesh.singh@amd.com> <20171027202518.GS12039@nazgul.tnic> <5e041a3f-823f-08ce-a653-a02b71e2cb6b@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: kvm@vger.kernel.org, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Paolo Bonzini , Radim =?utf-8?B?S3LEjW3DocWZ?= , Joerg Roedel , Tom Lendacky , x86@kernel.org, linux-kernel@vger.kernel.org To: Brijesh Singh Return-path: Content-Disposition: inline In-Reply-To: <5e041a3f-823f-08ce-a653-a02b71e2cb6b@amd.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On Mon, Oct 30, 2017 at 08:56:13AM -0500, Brijesh Singh wrote: > I am not able to reproduce the build warning in my setup, what config > option or compiler you are using to  trigger this issue ? gcc7 has gotten smarter. > I am on Fedora with gcc 6.4.x. Logically, the code looks okay. I can > try to rearrange code to fix the warning. I have not touched this > function since couple of rev, have u seen similar warning in previous > versions (v5, v4 etc). thanks Lemme see: sev_dbg_crypt() does ret = __sev_dbg_decrypt(kvm, __sme_page_pa(src_p[0]) + s_off, dst_vaddr, 0, __sme_page_pa(dst_p[0]) + d_off, len, &argp->error); and that 4th argument is 0. IINM, that's dst_kaddr and you're doing memcpy((void *)dst_kaddr, page_address(tpage) + offset, size); ^^^^^^^^^^^^^^^^ BOOM! -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.