From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 25F1DC433E2 for ; Tue, 1 Sep 2020 14:08:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EA59C206EF for ; Tue, 1 Sep 2020 14:08:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728316AbgIAOIk (ORCPT ); Tue, 1 Sep 2020 10:08:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728296AbgIANzt (ORCPT ); Tue, 1 Sep 2020 09:55:49 -0400 Received: from theia.8bytes.org (8bytes.org [IPv6:2a01:238:4383:600:38bc:a715:4b6d:a889]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 619BAC061244; Tue, 1 Sep 2020 06:55:48 -0700 (PDT) Received: by theia.8bytes.org (Postfix, from userid 1000) id 9D02D391; Tue, 1 Sep 2020 15:55:46 +0200 (CEST) Date: Tue, 1 Sep 2020 15:55:45 +0200 From: Joerg Roedel To: Borislav Petkov Cc: x86@kernel.org, Joerg Roedel , Tom Lendacky , hpa@zytor.com, Andy Lutomirski , Dave Hansen , Peter Zijlstra , Jiri Slaby , Dan Williams , Juergen Gross , Kees Cook , David Rientjes , Cfir Cohen , Erdem Aktas , Masami Hiramatsu , Mike Stunes , Sean Christopherson , Martin Radev , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org Subject: Re: [PATCH v6 69/76] x86/realmode: Setup AP jump table Message-ID: <20200901135545.GE22385@8bytes.org> References: <20200824085511.7553-1-joro@8bytes.org> <20200824085511.7553-70-joro@8bytes.org> <20200831170937.GK27517@zn.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200831170937.GK27517@zn.tnic> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Mon, Aug 31, 2020 at 07:09:37PM +0200, Borislav Petkov wrote: > On Mon, Aug 24, 2020 at 10:55:04AM +0200, Joerg Roedel wrote: > > + /* Check if AP Jump Table is non-zero and page-aligned */ > > + if (!jump_table_addr || jump_table_addr & ~PAGE_MASK) > > + return 0; > > I think you need to return !0 here so that the panic() below fires with > a modified message: > > panic("Failed to get/update SEV-ES AP Jump Table"); > > or are we gonna boot an UP guest still? Right, this needs a !0 return value. This code runs once on the boot CPU before the kernel starts the secondary CPUs, so a panic() is the right thing to do if this fails. Regards, Joerg