From patchwork Mon Jul 17 07:20:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jens Wiklander X-Patchwork-Id: 13315277 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 3DEA7EB64DC for ; Mon, 17 Jul 2023 07:21:54 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.564172.881444 (Exim 4.92) (envelope-from ) id 1qLIXt-0005AH-5g; Mon, 17 Jul 2023 07:21:25 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 564172.881444; Mon, 17 Jul 2023 07:21:25 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qLIXt-0005AA-26; Mon, 17 Jul 2023 07:21:25 +0000 Received: by outflank-mailman (input) for mailman id 564172; Mon, 17 Jul 2023 07:21:23 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qLIXr-0005A3-0Q for xen-devel@lists.xenproject.org; Mon, 17 Jul 2023 07:21:23 +0000 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [2a00:1450:4864:20::134]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 87e25e77-2472-11ee-b23a-6b7b168915f2; Mon, 17 Jul 2023 09:21:22 +0200 (CEST) Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-4fb863edcb6so6584613e87.0 for ; Mon, 17 Jul 2023 00:21:22 -0700 (PDT) Received: from rayden.urgonet (h-46-59-78-111.A175.priv.bahnhof.se. [46.59.78.111]) by smtp.gmail.com with ESMTPSA id l10-20020ac24a8a000000b004f846cd74bcsm2658938lfp.245.2023.07.17.00.21.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jul 2023 00:21:20 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 87e25e77-2472-11ee-b23a-6b7b168915f2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689578481; x=1692170481; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7RE6uG9NjzKwawEyJ2gsdMq0MHWGazWEuP8uHbPdmuU=; b=zWNOzeXta3SSh8fEY3svaVDiKh1QL/i98lXyuLzVAeqC98dgvekXp17KodV8L8Da+S q1SNlq2MlUZgD6uAav71n9zzRrJ285CmxpQ3LKfB9+ne6FnZWLLDIgugOPdkG7QaQKUw zxSKS0DNdXJWltjMxbnnnqmj9YrzUGsEXdGHEEC5B4V6X6tT3SxMckY+1EQzfKAqRhjV JTbatKQYo2nwq+ZSMcH8s5wdq1veUdownCcSH20KpQXT1DGhyL4bbIxT9pMsQK2jrsAQ 0cMBniQW9WyNQNzJjZkZTr0NvZo/6wMfAjKhFq1+G2AawUZbabbh8JFUAZZAbPy4tDL/ 4YmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689578481; x=1692170481; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7RE6uG9NjzKwawEyJ2gsdMq0MHWGazWEuP8uHbPdmuU=; b=GDhKO5VUP06Uo3luVJ5hIKj3YD+6b1RUEgGmv7iF0mZHH4m2Rc3unOXw8R84ZCBXU0 p1a/uYZKzGFKJ6BC8XFnJMZce55RvrM2+EGP9CKmsvlT44iduYeB9BJqhGZRJf2BBIC9 Mjq1SKGToCB9VBlrK1xi++AznV8Qs/Gh5JtX0bvbURK/C1xPCSMMkcIFKBQEHs3j0PQQ 8GzHXOD8zX8eU/44I3Q6SnqSaNCWKlRN/Ok8qxFAEJSJGJi8R7sHuoB4pcr+Ez7pXEm9 69paC+HMXvB0RaD74Ru5uWXWhetYVvJgNz9iBnNYJhTeWRKVReyKhr2r1zbS+6RGUIDv FCBw== X-Gm-Message-State: ABy/qLaANZnpkfAvT92tVh5apEihWXyDa+eb1ur9059PqHZlwiUY5T3p yMycVa+RS1QMsgxZUUUuCJ/YNxXETUNtygFvSas= X-Google-Smtp-Source: APBJJlGeN3T6Hgojf0g7hw68B554gvcSk/HnHMYLTAMBsluJJgWJmx0JTC5gYyMwfff0qCOyOvzovg== X-Received: by 2002:a05:6512:2392:b0:4f9:5718:70b3 with SMTP id c18-20020a056512239200b004f9571870b3mr8576528lfv.31.1689578481324; Mon, 17 Jul 2023 00:21:21 -0700 (PDT) From: Jens Wiklander To: xen-devel@lists.xenproject.org Cc: Stefano Stabellini , Julien Grall , Volodymyr Babchuk , Bertrand.Marquis@arm.com, Anthony PERARD , Juergen Gross , Wei Liu , Marc Bonnici , Achin Gupta , Andrew Cooper , George Dunlap , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Jens Wiklander , Jan Beulich , Bertrand Marquis , Jan Beulich Subject: [XEN PATCH v10 01/24] xen: Introduce arch_domain_teardown() Date: Mon, 17 Jul 2023 09:20:44 +0200 Message-Id: <20230717072107.753304-2-jens.wiklander@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230717072107.753304-1-jens.wiklander@linaro.org> References: <20230717072107.753304-1-jens.wiklander@linaro.org> MIME-Version: 1.0 From: Andrew Cooper Plumb it into domain_teardown(). Provide arch_val in the teardown continuation information for use by arch_domain_teardown(). No practical change. Signed-off-by: Andrew Cooper Signed-off-by: Jens Wiklander Reviewed-by: Jan Beulich Reviewed-by: Bertrand Marquis --- CC: Jan Beulich CC: Roger Pau Monné CC: Wei Liu CC: Stefano Stabellini CC: Julien Grall CC: Volodymyr Babchuk CC: Bertrand Marquis CC: Jens Wiklander v9 -> v10 - Added Jan's and Bertand's tags --- xen/arch/arm/domain.c | 5 +++++ xen/arch/x86/domain.c | 5 +++++ xen/common/domain.c | 6 ++++++ xen/include/xen/domain.h | 1 + xen/include/xen/sched.h | 1 + 5 files changed, 18 insertions(+) diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c index 8c18e9207907..15d9709a97d2 100644 --- a/xen/arch/arm/domain.c +++ b/xen/arch/arm/domain.c @@ -793,6 +793,11 @@ fail: return rc; } +int arch_domain_teardown(struct domain *d) +{ + return 0; +} + void arch_domain_destroy(struct domain *d) { /* IOMMU page table is shared with P2M, always call diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 39c215316546..5f66c2ae33d7 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -888,6 +888,11 @@ int arch_domain_create(struct domain *d, return rc; } +int arch_domain_teardown(struct domain *d) +{ + return 0; +} + void arch_domain_destroy(struct domain *d) { if ( is_hvm_domain(d) ) diff --git a/xen/common/domain.c b/xen/common/domain.c index caaa40263792..304aa04fa6cb 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -439,6 +439,7 @@ static int domain_teardown(struct domain *d) PROG_none, PROG_gnttab_mappings, PROG_vcpu_teardown, + PROG_arch_teardown, PROG_done, }; @@ -459,6 +460,11 @@ static int domain_teardown(struct domain *d) return rc; } + PROGRESS(arch_teardown): + rc = arch_domain_teardown(d); + if ( rc ) + return rc; + PROGRESS(done): break; diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h index 1df8f933d076..d35af348410c 100644 --- a/xen/include/xen/domain.h +++ b/xen/include/xen/domain.h @@ -81,6 +81,7 @@ int arch_domain_create(struct domain *d, struct xen_domctl_createdomain *config, unsigned int flags); +int arch_domain_teardown(struct domain *d); void arch_domain_destroy(struct domain *d); void arch_domain_shutdown(struct domain *d); diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h index 85242a73d374..854f3e32c00e 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -589,6 +589,7 @@ struct domain */ struct { unsigned int val; + unsigned int arch_val; struct vcpu *vcpu; } teardown;