From patchwork Wed Jan 22 08:53:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Woodhouse X-Patchwork-Id: 11345345 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 53FC61820 for ; Wed, 22 Jan 2020 08:55:02 +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 3040224672 for ; Wed, 22 Jan 2020 08:55:02 +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="rowZcxFz" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3040224672 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 1iuBlx-0000kb-KH; Wed, 22 Jan 2020 08:54:01 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iuBlv-0000kI-TH for xen-devel@lists.xenproject.org; Wed, 22 Jan 2020 08:53:59 +0000 X-Inumbo-ID: baa6679c-3cf4-11ea-aecd-bc764e2007e4 Received: from bombadil.infradead.org (unknown [2607:7c80:54:e::133]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id baa6679c-3cf4-11ea-aecd-bc764e2007e4; Wed, 22 Jan 2020 08:53:59 +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=p233OatuRQuoWS6LOUmWPlwIXjbBEnNCI12DOuMnnC8=; b=rowZcxFz/1a7uBUKZ17pXnmB2I /W39PPTxOf1xBW2Ii5tK8aLOW4VNsaaxj7rIjUtfSTpBs/FwX17XnIuSKCGNrK91AS3n6MP/F3k1A pfbtB3RYSlB3lpFIBj9ZgRva3ppPTlYc08LZk6+tpkRxdG8mhhEOFeiHuBi6U/6dGy6d4kevzby2h 3Wbza7rp+B/zXXvVLp01GLmWMTC6Izi3r+LnGhT7/FKtfswzB7ifmnd5z+8mCfB5bIGe1rjsQvnu3 i1Y/pJpFjg2sR6FHcYklDcdAnXkK/FY5ToMi4taaA9FhxvRXkuwk2MtErNdbTSn+b6ZtZLO4RLVOn oa498Vzg==; 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 1iuBlu-0001yE-Gf; Wed, 22 Jan 2020 08:53:58 +0000 Received: from dwoodhou by i7.infradead.org with local (Exim 4.92 #3 (Red Hat Linux)) id 1iuBlt-008mRY-9l; Wed, 22 Jan 2020 08:53:57 +0000 From: David Woodhouse To: Xen-devel Date: Wed, 22 Jan 2020 08:53:49 +0000 Message-Id: <20200122085357.2092778-6-dwmw2@infradead.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200122085357.2092778-1-dwmw2@infradead.org> References: <6cbe16ae42ab806df513d359220212d4f01ce43d.camel@infradead.org> <20200122085357.2092778-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 v2 06/14] Add IND_WRITE64 primitive to kexec kimage 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 a single page-aligned physical address to be written to the current destination, intended to pass the location of the live update data stream from one Xen to the next. Signed-off-by: David Woodhouse --- xen/arch/x86/x86_64/kexec_reloc.S | 9 ++++++++- xen/include/xen/kimage.h | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/x86_64/kexec_reloc.S b/xen/arch/x86/x86_64/kexec_reloc.S index d488d127cf..a75f989926 100644 --- a/xen/arch/x86/x86_64/kexec_reloc.S +++ b/xen/arch/x86/x86_64/kexec_reloc.S @@ -131,11 +131,18 @@ is_source: jmp next_entry is_zero: testb $IND_ZERO, %cl - jz next_entry + jz is_write64 movl $(PAGE_SIZE / 8), %ecx /* Zero the destination page. */ xorl %eax, %eax rep stosq jmp next_entry +is_write64: + testb $IND_WRITE64, %cl + jz next_entry + andq $PAGE_MASK, %rcx + movq %rcx, %rax + stosq + jmp next_entry done: popq %rbx ret diff --git a/xen/include/xen/kimage.h b/xen/include/xen/kimage.h index cbfb9e9054..e94839d7c3 100644 --- a/xen/include/xen/kimage.h +++ b/xen/include/xen/kimage.h @@ -6,6 +6,7 @@ #define IND_DONE 0x4 #define IND_SOURCE 0x8 #define IND_ZERO 0x10 +#define IND_WRITE64 0x20 #ifndef __ASSEMBLY__