Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp608001lqh; Fri, 31 May 2024 10:35:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUGWtL9aeAEAFeUQ5/h/DUiEcES2mya8G7FZdlinK2SzfCMnYhhVvSgr4ogiPjR32vPfgQ2LwKyr7HBMFq7JrO/O5QFsFuZ7p9es+JOrQ== X-Google-Smtp-Source: AGHT+IH+GzMU3ML6Hc2+npLaSEIWzeC05UEjWA7YCoqXsFxGNKnFs1HOfdYBZ13mtaCOifYKx/I8 X-Received: by 2002:a05:6214:5b0c:b0:6ad:786a:5e35 with SMTP id 6a1803df08f44-6aecd6f99d2mr27530566d6.62.1717176906841; Fri, 31 May 2024 10:35:06 -0700 (PDT) Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 6a1803df08f44-6ae4b42c5a6si24978086d6.530.2024.05.31.10.35.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 10:35:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-197253-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=PsL9h2ho; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-197253-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197253-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 543291C2122C for ; Fri, 31 May 2024 17:35:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C479717C233; Fri, 31 May 2024 17:34:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="PsL9h2ho" Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2051.outbound.protection.outlook.com [40.107.223.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D41152E3F2; Fri, 31 May 2024 17:34:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.51 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717176897; cv=fail; b=nvvc+qO3NyT3IBHnhq4Vh7xon6MFSYHIvbyaOcofiLenNMRRhj4Qlotw6oWNyVF0QONAO4F8v0EkZkeaUWlXfwtbnJ5mNcsEXiTHn1Lna7IsyfKmw8Xpoqror7LtNArZHJBHg/iKap36gYakuWpDyq/1Xv37is/WUao8q/nfFl0= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717176897; c=relaxed/simple; bh=HGbbPn0j7cSGbgxUWMBBu1dBJhQERpAie1cW8BITsbM=; h=Message-ID:Date:Subject:To:Cc:References:From:In-Reply-To: Content-Type:MIME-Version; b=n1f4EJ4gLH50MTf3hnihz/00SNgxz8VCy4Uwj4E4tw4tFGt6lYQq3b7mJPorOjETE6hkPnBjhxCR/4Z/XZtzIukuFO0l9V8q2qVnKOyFqhsgM9beZcef8N86PqbAAKOdjkSh6JNQhw14u5dFwLZaqzrSG7T2c/F0V4DvCTHTU9U= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=PsL9h2ho; arc=fail smtp.client-ip=40.107.223.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GJhbAgIpyuoPRsYceDKT4/CEC4zFyR6+1rDCuuM37JLKHizlbb0+hInhYaW9BxJfN3AqI3qfw4S6P1RLlRbxYOqghpjrQyqdIpgXMu1Im4hu+cxxzJa4Hi4jOxoBpHrnaa470ML8O0zsVA4ZCoisaOn2cl85Mer4f5wvuvN0L+opyzW+vQ1z/QpeF98uVe9tIMB80TQrl6lrqTEsLgkdRTgBX5H9A958Nkn/3J3FayRsKdq/bebN9Yboul/8cVwcn23272GC4Aorv0mNOU7q5nZShyyrRkNP/8lrYyd1ct2lKSvXOz9E6qr0aiJTlTHZszUJhK2lmIDb8HBSp7Z2vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=QoaySfdFh0dO4uC3xsOiM+R0hlt1UwwokZlhF1tZNqs=; b=kDRwA6hrWkT1LaPvSHQuNJWm2IOnUkHWgE4oP7sO8L4/2qKXwTKzRwGMkBPg7/W5WHNh69nRD5Xnc4X93JxLKn+zHkRVEEBltlJ1SB9zyFJ98tt40WNvRNq/m5P4CsN/vApWMToMddTYhSQXWg83YMR2u4l6OZofvVJhc4xhARLGXwRrn7+xOKn5jclfm+2giGE9wzOsxC6D0znWCSM+2KXF0LbMMxi++ySnPDp3UxzKSVJBL/nVh8b3VALRaxMQ0mPvFaTKIIkEQ3S7OJ21GjKKnk/qEw6iUrzQW72+xfq09AhCkvxLvf5nkT3UhdS1wnhFA2/vhrSoV1/Y3UrGyw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QoaySfdFh0dO4uC3xsOiM+R0hlt1UwwokZlhF1tZNqs=; b=PsL9h2hoYa8YDeAJaHrKB34M7Rfdro0R1dJNTRnj0Vj+h50EFBaB1M+ROpItUmPQ9LH8/bDIFjWYU4XlbkJKhOwOFHqkqJNZA+hbxOZjZF/G/dS+JeMcMLHIx7NapdhfBDG+HyHyEdBPLwy2XEWBQoHBmOxI1wZrfpMLGI3J+8A= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from SN6PR12MB2767.namprd12.prod.outlook.com (2603:10b6:805:75::23) by PH8PR12MB6793.namprd12.prod.outlook.com (2603:10b6:510:1c4::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.25; Fri, 31 May 2024 17:34:52 +0000 Received: from SN6PR12MB2767.namprd12.prod.outlook.com ([fe80::e441:89a7:4dd:dce7]) by SN6PR12MB2767.namprd12.prod.outlook.com ([fe80::e441:89a7:4dd:dce7%4]) with mapi id 15.20.7633.018; Fri, 31 May 2024 17:34:52 +0000 Message-ID: <75cb309b-b05c-42a0-a3ca-de08fa1cae59@amd.com> Date: Fri, 31 May 2024 12:34:49 -0500 User-Agent: Mozilla Thunderbird Subject: Re: [PATCHv11 11/19] x86/tdx: Convert shared memory back to private on kexec Content-Language: en-US To: Borislav Petkov , "Kirill A. Shutemov" Cc: Thomas Gleixner , Ingo Molnar , Dave Hansen , x86@kernel.org, "Rafael J. Wysocki" , Peter Zijlstra , Adrian Hunter , Kuppuswamy Sathyanarayanan , Elena Reshetova , Jun Nakajima , Rick Edgecombe , Tom Lendacky , Sean Christopherson , "Huang, Kai" , Ard Biesheuvel , Baoquan He , "H. Peter Anvin" , "K. Y. Srinivasan" , Haiyang Zhang , kexec@lists.infradead.org, linux-hyperv@vger.kernel.org, linux-acpi@vger.kernel.org, linux-coco@lists.linux.dev, linux-kernel@vger.kernel.org, Tao Liu References: <20240528095522.509667-1-kirill.shutemov@linux.intel.com> <20240528095522.509667-12-kirill.shutemov@linux.intel.com> <20240531151442.GMZlnpYkDCRlg1_YS0@fat_crate.local> From: "Kalra, Ashish" In-Reply-To: <20240531151442.GMZlnpYkDCRlg1_YS0@fat_crate.local> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SN7PR04CA0085.namprd04.prod.outlook.com (2603:10b6:806:121::30) To SN6PR12MB2767.namprd12.prod.outlook.com (2603:10b6:805:75::23) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR12MB2767:EE_|PH8PR12MB6793:EE_ X-MS-Office365-Filtering-Correlation-Id: df64b88d-5847-41d3-8d6b-08dc8197faa5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|376005|1800799015|7416005; X-Microsoft-Antispam-Message-Info: =?utf-8?B?R0Z1OWJ2aS9ib2Z6YW1xV3JrZjBObzBpUUg0bmI2ZWRWSlVDMEFSZWdsMGRL?= =?utf-8?B?Vjc5OGQxU1R0bzRqQ1Y3eG9YcmFpUUVsRW40VzROUDg1TXRzdUR1bDJ5K0gz?= =?utf-8?B?dE5XL21nT01kc2ZuNUxIRXp4eW9ZYk5adVo1aDl6SzhSU1lnLy9GVEJleUs3?= =?utf-8?B?aGpvV3pYeFJocUR3Wm03WEtuQk81Tm9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K2VyeUk5eFdWc0xJWFhlankvb2NDNVZFTFNTWkwzK21i?= =?utf-8?B?eHRjYnEyWnJjRHJMWDRXNFJJc3RwMGFkRm5qTjhCckFSeHk1RjhIamJ6UkY1?= =?utf-8?B?TkpUNmIvelB4VEkyd1NUd0Z0NURhQi9jOGpPaTFBbHlxbFhuaVhpQ01iVHFo?= =?utf-8?B?L20rUzRjY2VVNXYzaERaR0lpcmtWUXF3MjQ0Ny83djBTOVR5MERkaVBIVXZX?= =?utf-8?B?UGhqSXR0bUlRcWdwaHVjN3FTVkIzNjZ3YytJSWNXaC9yby9wQWtCcFBLZ1Q3?= =?utf-8?B?MEZQY05DTWsrVFlqNkFxcmZDUnVPYUEvdWxTRXJlMmx2M0dYUFF3MnBvRGlB?= =?utf-8?B?emk5SzJvNnRaS1RRL05sTENhSFZQbERZZk52aXcxcEFxbGwwU2VDVUJpdU1m?= =?utf-8?B?UGY2TUp6U3BBMWJYUkJncFlYS0JLY2ZJRVdTdHp6TnlqMjRsdU5EVWZtMGtC?= =?utf-8?B?RXBsMllDakREYVNHd1o4QWNZcysxQnRCUy9sQW9BOHpFeEdQNURlQ2pKY1p0?= =?utf-8?B?alpRTERwaTZQNzVEOERJelpwQUJVWW8zWnNOc3hkQ1VJYStKdDBDV0dJTitE?= =?utf-8?B?R0JBUy91SXptNmNFMTJXTFVlR2pVZTNwd0F3THU5Ky9xanFSV2FsdG9RPT0=?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR12MB2767.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(376005)(1800799015)(7416005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?VXZYUDdnVUZEY3BRM0VKUHFFNmVJUWJUT2RwMlVITWpvTnhFL3FNbG9JdjFr?= =?utf-8?B?OUQwYnhq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Ew0enJBZkdETmpKd21xSS9LVnJjaStnYmJ0dXBr?= =?utf-8?B?ZzI1bUROcHJ2c2RZWi9TUjR3K3hRN1JtZm1mVEVHeFU3bmJVcWJoUG16U1lM?= =?utf-8?B?S2hjUDcwaTVkVHZmMHR1TS85NkJUSmNMQzk3N3hNNkZPUmdvQ1A3ajV0Uk1T?= =?utf-8?B?elB2THhocWlndGJJc1RUcXNONUg0eEhIR3B3ZUdzSElpZzMwbjgxMjdRZnVq?= =?utf-8?B?MFo3MXI2c2lac0JSRHZJZ1E2SHhiOHVsdUt0WXl3UjZzMlR5R0FJTHVjcnZ3?= =?utf-8?Q?BBgkNZhiTwGfW9UBkd1RBYmOX?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: df64b88d-5847-41d3-8d6b-08dc8197faa5 X-MS-Exchange-CrossTenant-AuthSource: SN6PR12MB2767.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2024 17:34:52.6184 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: RluoCCIPvHPGUK1eLXUJ6QtR8F7LnSAZPticLq9SNyRw5eCyRC5Dq6EbdzORfMtAvUp/yxtg1R08csf+daBqzA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB6793 Hello Boris, On 5/31/2024 10:14 AM, Borislav Petkov wrote: >> static int __set_memory_enc_dec(unsigned long addr, int numpages, bool enc) >> { >> - if (cc_platform_has(CC_ATTR_MEM_ENCRYPT)) >> - return __set_memory_enc_pgtable(addr, numpages, enc); >> + int ret = 0; >> >> - return 0; >> + if (cc_platform_has(CC_ATTR_MEM_ENCRYPT)) { >> + if (!down_read_trylock(&mem_enc_lock)) >> + return -EBUSY; >> + >> + ret = __set_memory_enc_pgtable(addr, numpages, enc); >> + >> + up_read(&mem_enc_lock); >> + } > So CC_ATTR_MEM_ENCRYPT is set for SEV* guests too. You need to change > that code here to take the lock only on TDX, where you want it, not on > the others. SNP guest kexec patches are based on top of this patch-series and SNP guests also need this exclusive mem_enc_lock protection, so CC_ATTR_MEM_ENCRYPT makes sense to be used here. Thanks, Ashish