From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752652AbdJ3PMg (ORCPT ); Mon, 30 Oct 2017 11:12:36 -0400 Received: from mail.skyhub.de ([5.9.137.197]:42564 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751654AbdJ3PMe (ORCPT ); Mon, 30 Oct 2017 11:12:34 -0400 Date: Mon, 30 Oct 2017 16:12:30 +0100 From: Borislav Petkov To: Brijesh Singh 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 Subject: Re: [Part2 PATCH v6 32/38] KVM: SVM: Add support for SEV DEBUG_DECRYPT command 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-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5e041a3f-823f-08ce-a653-a02b71e2cb6b@amd.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@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.