From patchwork Fri Jan 24 15:30:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paul Durrant X-Patchwork-Id: 11350597 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 6282C924 for ; Fri, 24 Jan 2020 15:33:29 +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 3ED3820838 for ; Fri, 24 Jan 2020 15:33:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="GbiJTFTU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3ED3820838 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amazon.com 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 1iv0vi-0006px-Gs; Fri, 24 Jan 2020 15:31:30 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iv0vh-0006pe-LO for xen-devel@lists.xenproject.org; Fri, 24 Jan 2020 15:31:29 +0000 X-Inumbo-ID: 91edc874-3ebe-11ea-8032-12813bfff9fa Received: from smtp-fw-2101.amazon.com (unknown [72.21.196.25]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 91edc874-3ebe-11ea-8032-12813bfff9fa; Fri, 24 Jan 2020 15:31:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1579879882; x=1611415882; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=sxPnPVoRAvywpCa7LpMqm/5kHF3lOXD/ctRFVIMS828=; b=GbiJTFTU0tCrMGQflbSo9JZeH7f6d+Q8K5mEzvbtPVTj6IrqnplpfwgC bQ7uvpYAPjcZvcul3lUikSbndydB+xoAejIpx9k9XfURv02YTLfi2daFD JUvGzHV+doLg5ECDtdUEcEsX3qWWIz9LI8dtosii4wOV8aQwRKswky3XU U=; IronPort-SDR: DJMXuMG0lyhcTByMTyve91pr8Vjzo2AV9M5u+GSKATXi4BcsJSrPSceSunrtig7WO8NPhJKLDL y4Cl88A+211A== X-IronPort-AV: E=Sophos;i="5.70,358,1574121600"; d="scan'208";a="14030541" Received: from iad12-co-svc-p1-lb1-vlan2.amazon.com (HELO email-inbound-relay-2c-87a10be6.us-west-2.amazon.com) ([10.43.8.2]) by smtp-border-fw-out-2101.iad2.amazon.com with ESMTP; 24 Jan 2020 15:31:19 +0000 Received: from EX13MTAUEA002.ant.amazon.com (pdx4-ws-svc-p6-lb7-vlan2.pdx.amazon.com [10.170.41.162]) by email-inbound-relay-2c-87a10be6.us-west-2.amazon.com (Postfix) with ESMTPS id C09CBA07AC; Fri, 24 Jan 2020 15:31:17 +0000 (UTC) Received: from EX13D32EUB004.ant.amazon.com (10.43.166.212) by EX13MTAUEA002.ant.amazon.com (10.43.61.77) with Microsoft SMTP Server (TLS) id 15.0.1236.3; Fri, 24 Jan 2020 15:31:17 +0000 Received: from EX13MTAUWB001.ant.amazon.com (10.43.161.207) by EX13D32EUB004.ant.amazon.com (10.43.166.212) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Fri, 24 Jan 2020 15:31:16 +0000 Received: from u2f063a87eabd5f.cbg10.amazon.com (10.125.106.135) by mail-relay.amazon.com (10.43.161.249) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Fri, 24 Jan 2020 15:31:13 +0000 From: Paul Durrant To: Date: Fri, 24 Jan 2020 15:30:59 +0000 Message-ID: <20200124153103.18321-4-pdurrant@amazon.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200124153103.18321-1-pdurrant@amazon.com> References: <20200124153103.18321-1-pdurrant@amazon.com> MIME-Version: 1.0 Precedence: Bulk Subject: [Xen-devel] [PATCH v4 3/7] x86 / hvm: make domain_destroy() method optional X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Wei Liu , Andrew Cooper , Paul Durrant , George Dunlap , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" This method is currently empty for SVM so make it optional and, while in the neighbourhood, make it an alternative_vcall(). Signed-off-by: Paul Durrant Acked-by: Jan Beulich --- Cc: Jan Beulich Cc: Andrew Cooper Cc: Wei Liu Cc: "Roger Pau Monné" Cc: George Dunlap v4: - New in v4 (disaggregated from v3 patch #3) --- xen/arch/x86/hvm/hvm.c | 4 +++- xen/arch/x86/hvm/svm/svm.c | 5 ----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index 6333ae6aba..0b93609a82 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -747,7 +747,9 @@ void hvm_domain_destroy(struct domain *d) hvm_destroy_cacheattr_region_list(d); - hvm_funcs.domain_destroy(d); + if ( hvm_funcs.domain_destroy ) + alternative_vcall(hvm_funcs.domain_destroy, d); + rtc_deinit(d); stdvga_deinit(d); vioapic_deinit(d); diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c index b1c376d455..b7f67f9f03 100644 --- a/xen/arch/x86/hvm/svm/svm.c +++ b/xen/arch/x86/hvm/svm/svm.c @@ -1155,10 +1155,6 @@ static int svm_domain_initialise(struct domain *d) return 0; } -static void svm_domain_destroy(struct domain *d) -{ -} - static int svm_vcpu_initialise(struct vcpu *v) { int rc; @@ -2425,7 +2421,6 @@ static struct hvm_function_table __initdata svm_function_table = { .cpu_up = svm_cpu_up, .cpu_down = svm_cpu_down, .domain_initialise = svm_domain_initialise, - .domain_destroy = svm_domain_destroy, .vcpu_initialise = svm_vcpu_initialise, .vcpu_destroy = svm_vcpu_destroy, .save_cpu_ctxt = svm_save_vmcb_ctxt,