Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp1581540pxy; Thu, 6 May 2021 10:44:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIE6Wh4XkfCxubzl3UWnwHxq6yjzszze5r1Hu9SOhh/bHQ2Gz7BPxAQKQYEzcvCV+s/nCy X-Received: by 2002:a17:902:e550:b029:ee:ba6b:a95e with SMTP id n16-20020a170902e550b02900eeba6ba95emr5539981plf.7.1620323099671; Thu, 06 May 2021 10:44:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620323099; cv=none; d=google.com; s=arc-20160816; b=N8izitsCIKB7iUoH6aGr3+kLDGGVSYHNsTZU3+dRBUsmR/PMXXz6j30azR2GSi7Ap6 gSGLgX5bk88pvWqP5qPrXdfIsIQwTyR6ktFfofTaxldgnF4hEobqa4ss6Ta6ZSEigBIu pzh/HTWEFb5oBnwrA72xjw1g8B9pKuSEginB5/3RDW4tp9rJWrKd05iBfDBtACM3yKCs ON2mXMKVIeqw+ahllCPBvKERXmVj61S7GPf2q9kFgYqfzmWTgdB3ZXCyxZYbXKUW1Dyd rS5PijTq89KqOrbUTWPPewXSgQPTQu+FE8qTDihaHXRy5XiofxJoJEhZzdQhHdpkpDhX LzZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:mime-version:user-agent:message-id :in-reply-to:date:references:cc:to:from; bh=zwKMThC5L3BeyEuhtRebHWBLLUxyNBhpL8Up+iWzlmQ=; b=NH+PA+ss29cGcDAtxWyB1uPjOL3KjtcfweyjqvbIgH21+0rqdSxNksZeeBPMAFQMmA qwL2FdS6tjyfA5LouqShb5dT9/fR8RbcbSlKEDPuLiAbmljlog8sklRWciJCj/80Yt8X VTelxloeulr+mSIkSpf+2Vadh9dZgEXCWj47JMB0ybvw9J5eTgwEYkij8hlGgBykd8rf QP7Y6cfYVVi1K4jBC3qWnGY2nF3JSIHcFn/YvkfjC2W1BiBatbw176dC7xz6L8BqvVvw E5Bv7Im2x3FY32lqJMnP6lk8utnuu14NyitHtxCNFUrSSHQnbl1U1Yuwr120vGPSmkm4 ngbQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xmission.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y18si3389735pgj.114.2021.05.06.10.44.45; Thu, 06 May 2021 10:44:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xmission.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236276AbhEFRnU (ORCPT + 99 others); Thu, 6 May 2021 13:43:20 -0400 Received: from out02.mta.xmission.com ([166.70.13.232]:47818 "EHLO out02.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236042AbhEFRnS (ORCPT ); Thu, 6 May 2021 13:43:18 -0400 Received: from in01.mta.xmission.com ([166.70.13.51]) by out02.mta.xmission.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1lei0n-005md5-4q; Thu, 06 May 2021 11:42:09 -0600 Received: from ip68-227-160-95.om.om.cox.net ([68.227.160.95] helo=fess.xmission.com) by in01.mta.xmission.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.87) (envelope-from ) id 1lei0m-0003nZ-2F; Thu, 06 May 2021 11:42:08 -0600 From: ebiederm@xmission.com (Eric W. Biederman) To: Joerg Roedel Cc: x86@kernel.org, kexec@lists.infradead.org, Joerg Roedel , stable@vger.kernel.org, hpa@zytor.com, Andy Lutomirski , Dave Hansen , Peter Zijlstra , Jiri Slaby , Dan Williams , Tom Lendacky , Juergen Gross , Kees Cook , David Rientjes , Cfir Cohen , Erdem Aktas , Masami Hiramatsu , Mike Stunes , Sean Christopherson , Martin Radev , Arvind Sankar , linux-coco@lists.linux.dev, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org References: <20210506093122.28607-1-joro@8bytes.org> <20210506093122.28607-3-joro@8bytes.org> Date: Thu, 06 May 2021 12:42:03 -0500 In-Reply-To: <20210506093122.28607-3-joro@8bytes.org> (Joerg Roedel's message of "Thu, 6 May 2021 11:31:22 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1lei0m-0003nZ-2F;;;mid=;;;hst=in01.mta.xmission.com;;;ip=68.227.160.95;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX18K6SvQ88nM/nPpaU9bp8QcNl7ZXSm1Ea8= X-SA-Exim-Connect-IP: 68.227.160.95 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on sa02.xmission.com X-Spam-Level: ** X-Spam-Status: No, score=2.0 required=8.0 tests=ALL_TRUSTED,BAYES_50, DCC_CHECK_NEGATIVE,T_TM2_M_HEADER_IN_MSG,T_TooManySym_01,XMNoVowels, XMSubLong autolearn=disabled version=3.4.2 X-Spam-Virus: No X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5000] * 1.5 XMNoVowels Alpha-numberic number with no vowels * 0.7 XMSubLong Long Subject * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa02 1397; Body=1 Fuz1=1 Fuz2=1] * 0.0 T_TooManySym_01 4+ unique symbols in subject X-Spam-DCC: XMission; sa02 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: **;Joerg Roedel X-Spam-Relay-Country: X-Spam-Timing: total 608 ms - load_scoreonly_sql: 0.04 (0.0%), signal_user_changed: 4.3 (0.7%), b_tie_ro: 2.8 (0.5%), parse: 1.46 (0.2%), extract_message_metadata: 11 (1.9%), get_uri_detail_list: 1.16 (0.2%), tests_pri_-1000: 6 (0.9%), tests_pri_-950: 1.07 (0.2%), tests_pri_-900: 0.84 (0.1%), tests_pri_-90: 182 (30.0%), check_bayes: 168 (27.7%), b_tokenize: 7 (1.2%), b_tok_get_all: 26 (4.3%), b_comp_prob: 2.5 (0.4%), b_tok_touch_all: 130 (21.3%), b_finish: 0.82 (0.1%), tests_pri_0: 246 (40.5%), check_dkim_signature: 0.37 (0.1%), check_dkim_adsp: 2.6 (0.4%), poll_dns_idle: 140 (23.0%), tests_pri_10: 2.5 (0.4%), tests_pri_500: 148 (24.4%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH 2/2] x86/kexec/64: Forbid kexec when running as an SEV-ES guest X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Joerg Roedel writes: > From: Joerg Roedel > > For now, kexec is not supported when running as an SEV-ES guest. Doing > so requires additional hypervisor support and special code to hand > over the CPUs to the new kernel in a safe way. > > Until this is implemented, do not support kexec in SEV-ES guests. I don't understand this. Fundamentally kexec is about doing things more or less inspite of what the firmware is doing. I don't have any idea what a SEV-ES is. But the normal x86 boot doesn't do anything special. Is cross cpu IPI emulation buggy? If this is a move in your face hypervisor like Xen is sometimes I can see perhaps needing a little bit of different work during bootup. Perhaps handing back a cpu on system shutdown and asking for more cpus on system boot up. What is the actual problem you are trying to avoid? And yes for a temporary hack the suggestion of putting code into machine_kexec_prepare seems much more reasonable so we don't have to carry special case infrastructure for the forseeable future. Eric > Cc: stable@vger.kernel.org # v5.10+ > Signed-off-by: Joerg Roedel > --- > arch/x86/kernel/machine_kexec_64.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c > index c078b0d3ab0e..f902cc9cc634 100644 > --- a/arch/x86/kernel/machine_kexec_64.c > +++ b/arch/x86/kernel/machine_kexec_64.c > @@ -620,3 +620,11 @@ void arch_kexec_pre_free_pages(void *vaddr, unsigned int pages) > */ > set_memory_encrypted((unsigned long)vaddr, pages); > } > + > +/* > + * Kexec is not supported in SEV-ES guests yet > + */ > +bool arch_kexec_supported(void) > +{ > + return !sev_es_active(); > +}