From patchwork Thu Jan 30 16:13:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Woodhouse X-Patchwork-Id: 11358283 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7D324112B for ; Thu, 30 Jan 2020 16:14:56 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 58C9520707 for ; Thu, 30 Jan 2020 16:14:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="ZFwA8Wod" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 58C9520707 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ixCSA-0004Fr-4x; Thu, 30 Jan 2020 16:14:02 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ixCS8-0004FI-NM for xen-devel@lists.xenproject.org; Thu, 30 Jan 2020 16:14:00 +0000 X-Inumbo-ID: 7576cf8a-437b-11ea-b211-bc764e2007e4 Received: from bombadil.infradead.org (unknown [2607:7c80:54:e::133]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 7576cf8a-437b-11ea-b211-bc764e2007e4; Thu, 30 Jan 2020 16:13:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=1y2PqV6WbRypv8RR0KrTco7MDDMIC2Om05DEmv5EIF0=; b=ZFwA8WodtpJ3kkyXCPUYsVDM+x Kh0FnAgUUUGurXeiBJz67Kahnvj9Y7//nIYEQnN1+bNF2dUZw3d0K6CEdR+otm5giZOiQfoTjAgPA /iSZPv1NFzIBh59TJkXMPeaUFVqB3gbjE4WPLeAjqOvdOyIM69TUaT8DWWPEMRaF+RV36YqoHI0Lu udXYm7zxlKtsh98nkNxdGbO6OzD4+KmAacWd/Rua0tDqz9Kp3dFqecb6tz9yzHEcdhighY8uNUL3l rB8JGpMRA7jYOD361W7Qq68f0ThkkncyyF0lAwP3LjCB9GMpQ664vpXxG53OyFy5E6RkBsJs4p+lK X5B6IOYw==; Received: from i7.infradead.org ([2001:8b0:10b:1:21e:67ff:fecb:7a92]) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1ixCRf-00059y-Gp; Thu, 30 Jan 2020 16:13:31 +0000 Received: from dwoodhou by i7.infradead.org with local (Exim 4.92 #3 (Red Hat Linux)) id 1ixCRe-009kd4-9n; Thu, 30 Jan 2020 16:13:30 +0000 From: David Woodhouse To: Xen-devel Date: Thu, 30 Jan 2020 16:13:12 +0000 Message-Id: <20200130161330.2324143-4-dwmw2@infradead.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200130161330.2324143-1-dwmw2@infradead.org> References: <20200130161330.2324143-1-dwmw2@infradead.org> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Subject: [Xen-devel] [RFC PATCH v3 04/22] Add KEXEC_RANGE_MA_LIVEUPDATE X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Julien Grall , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Varad Gautam , paul@xen.org, Ian Jackson , Hongyan Xia , Amit Shah , =?utf-8?q?Ro?= =?utf-8?q?ger_Pau_Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" From: David Woodhouse This allows kexec userspace to tell the next Xen where the range is, on its command line. Signed-off-by: David Woodhouse --- xen/arch/x86/machine_kexec.c | 13 ++++++++++--- xen/include/public/kexec.h | 1 + 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/xen/arch/x86/machine_kexec.c b/xen/arch/x86/machine_kexec.c index b70d5a6a86..273bc20664 100644 --- a/xen/arch/x86/machine_kexec.c +++ b/xen/arch/x86/machine_kexec.c @@ -186,9 +186,16 @@ void machine_kexec(struct kexec_image *image) int machine_kexec_get(xen_kexec_range_t *range) { - if (range->range != KEXEC_RANGE_MA_XEN) - return -EINVAL; - return machine_kexec_get_xen(range); + switch (range->range) { + case KEXEC_RANGE_MA_XEN: + return machine_kexec_get_xen(range); + case KEXEC_RANGE_MA_LIVEUPDATE: + range->start = lu_bootmem_start; + range->size = lu_bootmem_size; + return 0; + default: + return -EINVAL; + } } void arch_crash_save_vmcoreinfo(void) diff --git a/xen/include/public/kexec.h b/xen/include/public/kexec.h index 3f2a118381..298381af8d 100644 --- a/xen/include/public/kexec.h +++ b/xen/include/public/kexec.h @@ -150,6 +150,7 @@ typedef struct xen_kexec_load_v1 { #define KEXEC_RANGE_MA_EFI_MEMMAP 5 /* machine address and size of * of the EFI Memory Map */ #define KEXEC_RANGE_MA_VMCOREINFO 6 /* machine address and size of vmcoreinfo */ +#define KEXEC_RANGE_MA_LIVEUPDATE 7 /* Boot mem for live update */ /* * Find the address and size of certain memory areas