From nobody Fri Nov 29 16:31:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=suse.com); dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=2; a=rsa-sha256; t=1633005318; cv=pass; d=zohomail.com; s=zohoarc; b=oJ5z+BWbVPD5PlLwBEKthgKDNotQR0OEz6tzQdZbFnfWlr9C9uB9Y2rbXWiBM0m/28EAObJABJoLADPdimE8knOiP9PnLLYIJXpsRETS+8gaQfi4zLThSRFEPLniM8Lkm7Dfc6XNv0AGD7qSDomiSeIpDMCmmoo+garn4cbD8+k= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633005318; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=PbKi1v7uP9b6x4lBqFwjoXN28PwSTCvFjDe33pv1YU8=; b=QDVm38VruRDHqcF+ohNsSgeLbLZki6vgJnm9+jxHOnQl50yGD1CbYAKGefVz+hB+a1TPTXBBt20fRl+MS5iurQ7YOVkwQUMbnyLLvT5+vae2zsAquR7iVzZfKiyvMF04+zeaqw0+WftkQY/aznIQQH4TF+GAp4ZcLqz3tsRix5g= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=suse.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1633005318342524.114914128021; Thu, 30 Sep 2021 05:35:18 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.199860.354165 (Exim 4.92) (envelope-from ) id 1mVvHE-0002Bd-KI; Thu, 30 Sep 2021 12:35:04 +0000 Received: by outflank-mailman (output) from mailman id 199860.354165; Thu, 30 Sep 2021 12:35:04 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mVvHE-0002BW-FV; Thu, 30 Sep 2021 12:35:04 +0000 Received: by outflank-mailman (input) for mailman id 199860; Thu, 30 Sep 2021 12:35:03 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mVvHD-0002BO-IT for xen-devel@lists.xenproject.org; Thu, 30 Sep 2021 12:35:03 +0000 Received: from de-smtp-delivery-102.mimecast.com (unknown [194.104.109.102]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 2449351a-2bed-44de-bdc3-aea2482869e4; Thu, 30 Sep 2021 12:35:02 +0000 (UTC) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05lp2106.outbound.protection.outlook.com [104.47.17.106]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-23-BQHqtiwQPkGOwPYhZzIz8Q-1; Thu, 30 Sep 2021 14:35:00 +0200 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) by VE1PR04MB6383.eurprd04.prod.outlook.com (2603:10a6:803:11b::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.13; Thu, 30 Sep 2021 12:34:59 +0000 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::4d37:ec64:4e90:b16b]) by VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::4d37:ec64:4e90:b16b%7]) with mapi id 15.20.4566.014; Thu, 30 Sep 2021 12:34:59 +0000 Received: from [10.156.60.236] (37.24.206.209) by AS9PR06CA0226.eurprd06.prod.outlook.com (2603:10a6:20b:45e::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.14 via Frontend Transport; Thu, 30 Sep 2021 12:34:58 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 2449351a-2bed-44de-bdc3-aea2482869e4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1633005301; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PbKi1v7uP9b6x4lBqFwjoXN28PwSTCvFjDe33pv1YU8=; b=cWg/DoKMo8jMX2NCzV96eNxXPTBYNuYyo75/jRK5qa0a3nlGrin6ohDQixzyZ4pkRCSXzg aPyBE1qjVxWnocWu0DAUkZHpQla64MxFBp6tJFNFy2w6vXq8i9+X7CuoIRSAQ9DLPVKU0z kL91O/lFYjv80aW7nVPiB6/5PHLBgQY= X-MC-Unique: BQHqtiwQPkGOwPYhZzIz8Q-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V34JzRotiHrrRxaj62lpYZ6LyQ3MVAns8brGxGNFisP46zu+4Bm2gQlHGLyEaNO/mYdsKcps2/uKh53FHs1miNRKwNrotDJi0GKE25MeMCdi6EdDq+7bEXzwWmfCC8Vb1kNB12Y/ENAhsgdOo9/kBGb8A3SQi6CyQmtFGR2Cj7HDwFFsBBeBXkYWlRb1DWj8KV4OEqb/WmB7cJ0Kbr7cLj9rN+GXK8hzgdFgAKWWZTooUZXfHKjsfuxcaQeeSPGwcuMI2ymxJ6ThJi+/Gzo6yBGAPiXZbvdo1QyV3qp4O/MdGt2kicoZhgFD0IKSxP0aioVPgijZXbGVHGJjKq6hDQ== 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; bh=PbKi1v7uP9b6x4lBqFwjoXN28PwSTCvFjDe33pv1YU8=; b=LQaWmTodXJtHB8gox1R4O2husN39gb5WzDaABpRF4C7J/bmNGmaUtNjN3+3uYIZlrm0TEcfDGg5efuFYPH0DjLu30OXUp0HuoaKrvvEqJHui0ziurBKC5SFDY60KnXVXaBnCrRqLsSANtshNj84G6U2C1yb3EKEqQScH+xdTgNXFKrhbKHmFPVYHpJyM6BxRNuqtatM1BaxVEjPKKBCCzgnCI9D44vVMtbiSIMZzOKAdX1fhrg4Dmb2Caf7A7m/sVMaLxIofNos202jjOEFm4Vipd2BP67XaiIixaqoCxh77L9jN3GVCsU8COWchafe185LNCAzRBGzWMi2JgsCKtg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Authentication-Results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com; Subject: [PATCH 1/6] xen/x86: streamline set_pte_mfn() From: Jan Beulich To: Juergen Gross , Boris Ostrovsky Cc: Stefano Stabellini , lkml , "xen-devel@lists.xenproject.org" References: <022b1a5e-4121-6bae-f07c-4ad5eac12481@suse.com> Message-ID: Date: Thu, 30 Sep 2021 14:34:56 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 In-Reply-To: <022b1a5e-4121-6bae-f07c-4ad5eac12481@suse.com> Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: AS9PR06CA0226.eurprd06.prod.outlook.com (2603:10a6:20b:45e::25) To VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6ceb9de9-bca4-4c85-34ae-08d9840eb73c X-MS-TrafficTypeDiagnostic: VE1PR04MB6383: X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TC1mRBq40fgQodWv/jlWln35z0/4GeyyPOSAzy0hKfoTPda6IsbItMlXTXqjk/zB/Feoal2zVIeqmTdFCH/Jyff8olq8/F49T61Lj67kzXz8lTrJCffUHgnAIf0Zq8Vyy/kM8HBIFgGGySYmxbxVw+Q0IxOvGFs1GlMwkoqbeUVMIgqcXQkIwUSWWTmXkmrdBb28JuYF0nSZVt1zVbseyf753N/gdjc0kjj1dcoAe1vwTZS1Vagiyv52uN+9p/yUbuX5+AiznQ6ow7yxu52Y0uP6abHkiLK5SID5DEoYcFb2+R9X7icu86PQ6KhSRPIiG6FwNW4uGj1W61FyL5ptn/hcYCW/hC92OwxhaX0FBMyEfhvlO0c1avZA6HjTqr9BGjzaVY8ICZCB6+nWokNhH50wVIi2bY9nn8NkIDCFZR3easZXxAiDg4rWNaZG0LcHKvam5b55uuW9C8idAYt8hC7dW8mn0qCWfSiwuAt39d7XyTXZuxWAJrv//idBCe2b0mEMp4elJPtsXfWRM+6ZThKaG+EwpaZcgbYuJHBwl8rwpxeMh2E0qRtoC0vksGK4mL0msprkka+OgNt2cC6l9Ozp8XW8lJcQdtJghpA9vxrteUXg6YWbzOTgVAum6yuPQsTN/zd+PiNpH8wvUUQ247WmeGdhEiLTmNqJzLcKm+hdDH03qSG6BkR8uOUWbHS1pyE7ntpSjw3DAS6TMAvTEloO7pvc/llKV5r+nE7BO2M= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5600.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(4326008)(2616005)(186003)(956004)(508600001)(31686004)(66946007)(83380400001)(8936002)(86362001)(2906002)(31696002)(16576012)(316002)(38100700002)(110136005)(8676002)(36756003)(6486002)(66556008)(66476007)(54906003)(26005)(5660300002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?UFgzaXhGQkkrZHhQa2FhN1pXc0p6Yk8yRVBhNU1MaDRyVUJUUEsyWnZIdmxF?= =?utf-8?B?UkxYVnNwKythcGpMRld5b205U2hjd1JHc3JPZ25rdHhMZlJyT1dEOVl6ZzBr?= =?utf-8?B?MGVaNFprbDMxdFhBZmFkdzdrTjg1OXVjNHBaRjhUVklCTWRaejRDUll0UUlY?= =?utf-8?B?a3pqa2xraDE2TFBoUnhWRUpSdnVXcUNta1dKTzRkRllqN0t5TnZGanQ3Mlk5?= =?utf-8?B?Z1liTmp3NDhaRnRqNGlqZ0JEOElXRHVyelhISi9VLzBqY2VPUG9KRFJPK2ta?= =?utf-8?B?YU9KNnF1RFVKSXFGYlpSOTh3cVd5c3V2VWFoTFRGSHM0WUdiNWN5Ykw1Y21r?= =?utf-8?B?b3VKTTZtQUFMUzV4MmxuYlhZYjMxL3BqUDFpQ1ZmczB5M21wQ3Z4S1FyUzRR?= =?utf-8?B?K1BFV3hjL2Q3TVV5WUg5S1luQW9DQ2RDa3pOZnd6eWtzeEpaOXU4OWxXKzM4?= =?utf-8?B?U09peHgzM3FIZTV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=?utf-8?B?UzZ3eEhwelQ3Q3RzOUdMeno0Z00vV2c4YzN5KzlDOXlBVnFrSkVtd2hPUi9a?= =?utf-8?B?QlZlczBodkVocVN6NldXWE01MkhwdUZFTC81SUY0RjkrOURKUzlMNWRKTUVB?= =?utf-8?B?ZVRsQ0txRHgrSzkwMjBoRHlvVnVDQis5NlpSTEtodW5YTXRPeGNRMWM4Nk14?= =?utf-8?B?QWM3UEpYWWZ3OVFoZXRUZWxyZmVXNDE5ZGlDQTJiY1dEVm91WFFYb0V1UVFu?= =?utf-8?B?N29nUm44eFYyZE1PSXNYRkt2QldrWlBac2ZNSllkemwzTTdhN3Y4NW45NUZp?= =?utf-8?B?QXZ4N2NUNDVlVERFcy9QTWd6TkFJWmxiKzF6TmhuZmRxcVZhY1U1emFMcUhy?= =?utf-8?Q?KYJhkcLgwFGmV7C9CzW/n+9xxUGCX9gQ6alpI6m?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6ceb9de9-bca4-4c85-34ae-08d9840eb73c X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5600.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2021 12:34:58.9369 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: MTCCM6GdL4RD5oKcxgFMrJJWni9iY3k6Cc66Fcm16BqN2uOyT8Q+giH0k25AdM9GSW7VfEOWDYcRVjjYFIxMLw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6383 X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1633005319695100001 Content-Type: text/plain; charset="utf-8" In preparation for restoring xen_set_pte_init()'s original behavior of avoiding hypercalls, make set_pte_mfn() no longer use the standard set_pte() code path. That one is more complicated than the alternative of simply using an available hypercall directly. This way we can avoid introducing a fair number (2k on my test system) of cases where the hypervisor would trap-and-emulate page table updates. Signed-off-by: Jan Beulich Reviewed-by: Boris Ostrovsky --- a/arch/x86/xen/mmu_pv.c +++ b/arch/x86/xen/mmu_pv.c @@ -241,9 +241,11 @@ static void xen_set_pmd(pmd_t *ptr, pmd_ * Associate a virtual page frame with a given physical page frame * and protection flags for that frame. */ -void set_pte_mfn(unsigned long vaddr, unsigned long mfn, pgprot_t flags) +void __init set_pte_mfn(unsigned long vaddr, unsigned long mfn, pgprot_t f= lags) { - set_pte_vaddr(vaddr, mfn_pte(mfn, flags)); + if (HYPERVISOR_update_va_mapping(vaddr, mfn_pte(mfn, flags), + UVMF_INVLPG)) + BUG(); } =20 static bool xen_batched_set_pte(pte_t *ptep, pte_t pteval) From nobody Fri Nov 29 16:31:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=suse.com); dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=2; a=rsa-sha256; t=1633005344; cv=pass; d=zohomail.com; s=zohoarc; b=f0dp7Ej8UEugPV5ugRSWhuSTSKWwRclI9+86jBIJchblnbG3MaHnnXiNyt9uPQw/QWpMGRCJNVYfK6wMc1lQT5Z/5r2dauD83p4SNLN1ifohUsQlBQJuJGhuDJKq8zrN8TQinokWY6TNLVSiZls+b6uJcmLFHFBtfj6qCfgNOog= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633005344; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=eWRvbp7ta3owYpcdKj7PO7T0r2HXZ7zs9WVfAD35Uvw=; b=i92ZbMJmzeve8GWTf6/UDhXTiOjdL0TZTPoGs0Spa+xopwYbmllMP0EadueZbrykferQfa2OiXiYAVD1667trRy9OiD+BdYZSuGrN6QIQG4EcOatc/tM79GDvm8xwbvkJj23W2SDpfEeMkElVtZSW1FOBrSmx93JQA6mk+6nykk= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=suse.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1633005344101758.2761559086726; Thu, 30 Sep 2021 05:35:44 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.199867.354176 (Exim 4.92) (envelope-from ) id 1mVvHe-0002mq-0A; Thu, 30 Sep 2021 12:35:30 +0000 Received: by outflank-mailman (output) from mailman id 199867.354176; Thu, 30 Sep 2021 12:35:29 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mVvHd-0002mj-TK; Thu, 30 Sep 2021 12:35:29 +0000 Received: by outflank-mailman (input) for mailman id 199867; Thu, 30 Sep 2021 12:35:29 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mVvHc-0002kX-VO for xen-devel@lists.xenproject.org; Thu, 30 Sep 2021 12:35:28 +0000 Received: from de-smtp-delivery-102.mimecast.com (unknown [194.104.111.102]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 7087557a-fe7b-48c5-8378-b1e43e0c7094; Thu, 30 Sep 2021 12:35:27 +0000 (UTC) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05lp2113.outbound.protection.outlook.com [104.47.17.113]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-20-aoc0CG_oOqS0JfWrqru6WQ-1; Thu, 30 Sep 2021 14:35:25 +0200 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) by VE1PR04MB6383.eurprd04.prod.outlook.com (2603:10a6:803:11b::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.13; Thu, 30 Sep 2021 12:35:24 +0000 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::4d37:ec64:4e90:b16b]) by VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::4d37:ec64:4e90:b16b%7]) with mapi id 15.20.4566.014; Thu, 30 Sep 2021 12:35:24 +0000 Received: from [10.156.60.236] (37.24.206.209) by AS9PR06CA0219.eurprd06.prod.outlook.com (2603:10a6:20b:45e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.15 via Frontend Transport; Thu, 30 Sep 2021 12:35:24 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 7087557a-fe7b-48c5-8378-b1e43e0c7094 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1633005327; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eWRvbp7ta3owYpcdKj7PO7T0r2HXZ7zs9WVfAD35Uvw=; b=UXXlauToOjHhrRu8X3wJHT8P7ehbax9MC1OeZ3RsHo86vGKJB0it7YUxco6xoxXbkgaw3S ztAjrHLkaA1JeyHZxaaQ5wHEoNMwZX1QGNvQN1IEDv9/H0rHnt0ku5QsTmpa9foc2KLImI MA1BJaalnudb+f5VWlA01VsvQSia5Sg= X-MC-Unique: aoc0CG_oOqS0JfWrqru6WQ-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gHkFibb5LYshIVpl0Jp9XnQZEGUsmW7OWVWVt0BujZRFHmCG+Bc50cgQqtzeRjcbiYLLLyPp0v7NQqVfrtBiNOqdMjnNKS6XkdwG0hx0DPY9PKuUk97H+nWKvlabCeMYG0nO6Cv3dX40QvfHKH3weYlGrh0gofHGLkrCYCtRRdQpVpZyWSlxBSEjB/JHVZyboqadYFIGEYsDJIR/N9YdBetu/2osTnEew84x+VfLMq3lcMVRoDoEK+7uwwI/2+I3z7XD5GHGfSHJTOznViGOtsnJKSWNmsn7GF/fhTZiPrN19YwZsuiqmddGoZr/i4zUXs4sWaQ8xhoRPc6WEvFh8w== 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; bh=eWRvbp7ta3owYpcdKj7PO7T0r2HXZ7zs9WVfAD35Uvw=; b=YsImSKohjx7Tx5XUvZCvBF0KUB/FrYqV17rGkQVV+9k75XwtAkVl8oe8qcsDUAD0lvstAt1+cYkDhiTXIoYMHE0DnpWyPbXLceIXXlEi0QICl3TcgypmmsBapKE59xmxL/anh/vyg+M0BjWzHKOrgvll6/aMGFQLIyEYnl7dw5tt0y/rd8xPZQI/GwpYH6WK2E7BLRFMCOnsMvRps7GY0/EMEmflRe7xvtpwfqbUb0Vc9MeFe+lAtlwTkSwR/4uxHmbgoZvgRIZjhb3tYtq9STA4tIjUjf9s+SJCOsrclV63PQ48ZXwH/Myqx2KVt1iZhJ0XmcF0nv6BARaYO4wCbA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Authentication-Results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com; Subject: [PATCH 2/6] xen/x86: restore (fix) xen_set_pte_init() behavior From: Jan Beulich To: Juergen Gross , Boris Ostrovsky Cc: Stefano Stabellini , lkml , "xen-devel@lists.xenproject.org" References: <022b1a5e-4121-6bae-f07c-4ad5eac12481@suse.com> Message-ID: <57ce1289-0297-e96e-79e1-cedafb5d9bf6@suse.com> Date: Thu, 30 Sep 2021 14:35:22 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 In-Reply-To: <022b1a5e-4121-6bae-f07c-4ad5eac12481@suse.com> Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: AS9PR06CA0219.eurprd06.prod.outlook.com (2603:10a6:20b:45e::10) To VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 74700795-3594-4d3b-fd63-08d9840ec687 X-MS-TrafficTypeDiagnostic: VE1PR04MB6383: X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3173; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: w3I5bU96eYptQzelHHw9QkIo2SbqWLNurMYmpBlW2DK5UVBHPgPgtxQg9tSYuQ1lObrEXgzpRgOfhMx4S2WELbT6wKE1zE0/fE66OBbI4c2JDgnoAcsWUMN3f6Qlo4hAJ382EcUf2prMHo5u6YCXoNDZyv9NBzCZyZewBA1AdH29qlEZaez7fVEfR7Hu+p9HEs1+C9AWlDjsfCIJz9KVgIII8PNMR6pLwAcL7Ie5bUqxWgYza07SitTUTdY/P1Ca2ATtd/A6dyk7aCQ1LHPGL9SS56Iv4bL0ZiY2K+5TW59ElCM4kaHi+9Rf+JALzQebeV5WYeid90F9gDrQVdjMihv239FLVaMqfYu6/2G4S8oDfpoIZZVDLCiD24m7SR6/in71fd22+YeL7VfC30TPdEiuQGCkeUZNMmHHcirbqkqsWSI12lfu7wI1ycT0RpeXdwnRiMLpNmspBYyfzAkLOsMTdBLYjVqHKV8Uq6NdiuTeqHzTAcLP8OC0Fxy5JU1uz58MH6FBWGQfqln/WjRoidjfFoFigOVwXBjbzqPFKrgXm0zChU4PaZZ7qP3BwbKSoIj6/9UJAhAwj0p30VywGdGiiUNUzd8tn1+EO3lehmpuFrKu3PpmH+shMcfWeE8a1yz+7N7F/iF8YXYmIEqtS+wgayvOWBFLZbFq+LZJW2OSEZECzQ2FjhlKRORfS4JHGLxI/x95rUKr2pK36L+m69sRDzxNdXDqPgBH7L+dstoBoQzCJZEYIQLtmU+xnYIh X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5600.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(4326008)(2616005)(186003)(956004)(508600001)(31686004)(66946007)(83380400001)(8936002)(86362001)(2906002)(31696002)(16576012)(316002)(38100700002)(110136005)(8676002)(36756003)(6486002)(66556008)(66476007)(54906003)(26005)(5660300002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?eFRnVmthazE2TnZIdTNjRWltRXNxVFRDbDdINzFXWlMvUFV6QzFIRFBEN2sr?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b-fd63-08d9840ec687 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5600.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2021 12:35:24.5804 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Z+QpJ6hdD1dvtUjfh20b2SeBFtCK/5mrepLbPm7M8obAJPEYT8rkLVValbSZp1jWDTxr/UUqZCjnonlfRIpSDA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6383 X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1633005345941100001 Content-Type: text/plain; charset="utf-8" Commit f7c90c2aa400 ("x86/xen: don't write ptes directly in 32-bit PV guests") needlessly (and heavily) penalized 64-bit guests here: The majority of the early page table updates is to writable pages (which get converted to r/o only after all the writes are done), in particular those involved in building the direct map (which consists of all 4k mappings in PV). On my test system this accounts for almost 16 million hypercalls when each could simply have been a plain memory write. Switch back to using native_set_pte(), except for updates of early ioremap tables (where a suitable accessor exists to recognize them). With 32-bit PV support gone, this doesn't need to be further conditionalized (albeit backports thereof may need adjustment). To avoid a fair number (almost 256k on my test system) of trap-and- emulate cases appearing as a result, switch the hook in xen_pagetable_init(). Finally commit d6b186c1e2d8 ("x86/xen: avoid m2p lookup when setting early page table entries") inserted a function ahead of xen_set_pte_init(), separating it from its comment (which may have been part of the reason why the performance regression wasn't anticipated / recognized while codeing / reviewing the change mentioned further up). Move the function up and adjust that comment to describe the new behavior. Signed-off-by: Jan Beulich Reviewed-by: Boris Ostrovsky --- a/arch/x86/xen/mmu_pv.c +++ b/arch/x86/xen/mmu_pv.c @@ -1194,6 +1194,13 @@ static void __init xen_pagetable_p2m_set =20 static void __init xen_pagetable_init(void) { + /* + * The majority of further PTE writes is to pagetables already + * announced as such to Xen. Hence it is more efficient to use + * hypercalls for these updates. + */ + pv_ops.mmu.set_pte =3D __xen_set_pte; + paging_init(); xen_post_allocator_init(); =20 @@ -1422,10 +1429,18 @@ static void xen_pgd_free(struct mm_struc * * Many of these PTE updates are done on unpinned and writable pages * and doing a hypercall for these is unnecessary and expensive. At - * this point it is not possible to tell if a page is pinned or not, - * so always write the PTE directly and rely on Xen trapping and + * this point it is rarely possible to tell if a page is pinned, so + * mostly write the PTE directly and rely on Xen trapping and * emulating any updates as necessary. */ +static void __init xen_set_pte_init(pte_t *ptep, pte_t pte) +{ + if (unlikely(is_early_ioremap_ptep(ptep))) + __xen_set_pte(ptep, pte); + else + native_set_pte(ptep, pte); +} + __visible pte_t xen_make_pte_init(pteval_t pte) { unsigned long pfn; @@ -1447,11 +1462,6 @@ __visible pte_t xen_make_pte_init(pteval } PV_CALLEE_SAVE_REGS_THUNK(xen_make_pte_init); =20 -static void __init xen_set_pte_init(pte_t *ptep, pte_t pte) -{ - __xen_set_pte(ptep, pte); -} - /* Early in boot, while setting up the initial pagetable, assume everything is pinned. */ static void __init xen_alloc_pte_init(struct mm_struct *mm, unsigned long = pfn) From nobody Fri Nov 29 16:31:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=suse.com); dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=2; a=rsa-sha256; t=1633005374; cv=pass; d=zohomail.com; s=zohoarc; b=MEz9FSZvt2J6TPpIqej5mZp8QVCC/gCCfD3VBSkqfdX2ot4B6tT6D6RBAjJ5/JM9zDBM3bzaxnXb+lFyOoSKV3K6WWGG7oSJL9wLudc1uL1sQn5ZXThrFWI41QlSPx6lneW5viDtoE0592swjwqhqOC8d7Zw0Vjm6RSBmAf08AA= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633005374; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=csvwBDBtFGc48jg4jEJIdJUsqEpEZpnnkIuWC7zw3YQ=; b=MgkCH012A4DVWn7dHMXL31C6QsiB4QwG0Zp4Q8LwNpj+hLRaKO7DTwvaM8lSO8Roh9qFvuE2WK2J40D2alHgiPt3ObFkYBbKJFt5JZHB7jfzUyEaGRJfTufZW4VCiotpmLTVCJujiokjYWzhLIT+VJ79/ptllh2YR6eBOdr9xy0= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=suse.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1633005374133467.46519549820664; Thu, 30 Sep 2021 05:36:14 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.199876.354186 (Exim 4.92) (envelope-from ) id 1mVvI8-0003OB-8w; Thu, 30 Sep 2021 12:36:00 +0000 Received: by outflank-mailman (output) from mailman id 199876.354186; Thu, 30 Sep 2021 12:36:00 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mVvI8-0003O4-5w; Thu, 30 Sep 2021 12:36:00 +0000 Received: by outflank-mailman (input) for mailman id 199876; Thu, 30 Sep 2021 12:35:59 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mVvI7-0003Nq-3v for xen-devel@lists.xenproject.org; Thu, 30 Sep 2021 12:35:59 +0000 Received: from de-smtp-delivery-102.mimecast.com (unknown [194.104.109.102]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 89c7f0a5-7e08-470c-8c32-c4657eb79df8; Thu, 30 Sep 2021 12:35:58 +0000 (UTC) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-ve1eur02lp2055.outbound.protection.outlook.com [104.47.6.55]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-23-4iLhtgzoOE-IdxjPXrGF9g-2; Thu, 30 Sep 2021 14:35:56 +0200 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) by VE1PR04MB6383.eurprd04.prod.outlook.com (2603:10a6:803:11b::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.13; Thu, 30 Sep 2021 12:35:54 +0000 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::4d37:ec64:4e90:b16b]) by VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::4d37:ec64:4e90:b16b%7]) with mapi id 15.20.4566.014; Thu, 30 Sep 2021 12:35:54 +0000 Received: from [10.156.60.236] (37.24.206.209) by AM6PR01CA0058.eurprd01.prod.exchangelabs.com (2603:10a6:20b:e0::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.16 via Frontend Transport; Thu, 30 Sep 2021 12:35:54 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 89c7f0a5-7e08-470c-8c32-c4657eb79df8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1633005357; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=csvwBDBtFGc48jg4jEJIdJUsqEpEZpnnkIuWC7zw3YQ=; b=bqvNY1Rp3+97atd0vJfMyGRPQbRJVrhbbEJspkM+hBJK/l9rNiqm327UbdbUsu26poYojI 6eE0EeYH/9K1ilvbI0v2ZnLSS/iTudsMNpVMv8Rp8yXGfLtepBukGQW8+mgYRu5tMNTOC/ /bvsBvfjtfgdlUfeEjMMtSLDdQSdIJo= X-MC-Unique: 4iLhtgzoOE-IdxjPXrGF9g-2 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FEdWrKHzXgjyp7ZEHrbXCFH6f7gIoRdJxTJRaM5qejyIyVP5t8YLM941Ss03r005KvIpTh+w66LzNQo8+4TcfIxapaGDiFInA7duYaZxTud6TPt7AqSsaq8Lx/oBw2SY7/MSWiL3oqcEZHxY+MfIr1S3u8ziwIK4FxZwW7f/YhW4TicFf3V8h4RTZc8NnV89jE2+hKmcBsAC8d+pMXBi1ftcmD8889QrL77QN2WuW2iuo5fpZeT47XZ49P/XJKNjk24ptdlvh1LHsLyQ+FIcqls0cj0zvGazmq6HzY+gfv/ZyF7HQxcOMBB6yG3Zhwm9HrxotvovuDubrOz2VW0MXw== 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; bh=csvwBDBtFGc48jg4jEJIdJUsqEpEZpnnkIuWC7zw3YQ=; b=ZcvCV2pd5y9a99dHbgErSusWKYtrYYe1JVKdU+Fl6+9kfK/90vRoQVjEmE6q1n2811b5sAPf69SBxeBlVuYse7isclAJs956GlPonBVpu54oWs6/qOrGvzTspb3RTCrjLZUv29l2h3nNwrbGNmTQOsSRfxJtJ0kqmjKITl89pXZYdUhlG7TOB+wYPP4H9Xls4J8neNjCMOXvFPoxMmaxejYfnGmcadQxbUVmLXk9bWpYZ9CQig7KuNXy1POLCoqXJCWVuqZRm3XfZ9FAaKaki0fxxfrXcLzvJd40xyQPblcoonPQsQaNbg/468i4jNb7P3RrLy/nRP7E/sXv6GAdmw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Authentication-Results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com; Subject: [PATCH 3/6] xen/x86: adjust xen_set_fixmap() From: Jan Beulich To: Juergen Gross , Boris Ostrovsky Cc: Stefano Stabellini , lkml , "xen-devel@lists.xenproject.org" References: <022b1a5e-4121-6bae-f07c-4ad5eac12481@suse.com> Message-ID: <11fcaea2-ec17-3edd-ecdf-4cdd2d472bd0@suse.com> Date: Thu, 30 Sep 2021 14:35:52 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 In-Reply-To: <022b1a5e-4121-6bae-f07c-4ad5eac12481@suse.com> Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: AM6PR01CA0058.eurprd01.prod.exchangelabs.com (2603:10a6:20b:e0::35) To VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 733cb1a5-c54a-41c4-369a-08d9840ed853 X-MS-TrafficTypeDiagnostic: VE1PR04MB6383: X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: myEIyzqFlWR0QrxdEpAZVC+kMgoa8VyQRPVsJvIIB/9mrT6ZOoOJ53sMJyck12R5nMTjIuRneA7fU3mZOtVPxF/IpUAJzxRcF4QrYKkWHyaCjM+GdrxkpwYjGkemq5LTUIFLuO9mq0vXkqk0Z1NgbPukI7GjnCaGoo4EZ7lTYPidPJzS4brADk8XIix+EYobpcg4xqbWE8DjJumuPHc2CNSUjThGyr95nBBwU1BwA7GkIOLycVw3De2qFb4AKl71yLsdAm+XFe89/K7vwFR/0zM1jKmWgOdbfxToPxb2a3Zk1zkqD9so+/Jp/cXyQYiIUXeSCywNWVfjWiznDpjAZNVQ7lHxNy4VBRQCwTnfnxUC9CZHtoqHf286Tb3SG7ZQEXQ8wVETXsrjNlOEkXeD0XN4RVGDyDhUzNijQinc09b1tkut+wv7i1yJcPysW9PX4K+rCy23Tjh+HJL8lizfMDAhtndXUi+Y0deQ5niOT87aK6fGOdnZKl3YR/L/t+NVdl7VrzJFlJt1+kHRD2EVW6XfxDB7F36dw0spF24JV/wHhGkJrlNJGtd9/CyoR5piWigIndnre1js/4hdlvGRBW4fKjSOpElHtaoEdOr71/3MgOaHy9LA7sqh4N/XCVOuqigSYFG4wGHK4yOzO5Csb6De8VJGJqf0Slog9wcfHLPertff7YBdUA02Sv+udubbmCI+UVR8TVPre9slX5rNfg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5600.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(4326008)(2616005)(186003)(956004)(508600001)(31686004)(66946007)(83380400001)(8936002)(86362001)(2906002)(31696002)(16576012)(316002)(38100700002)(110136005)(8676002)(36756003)(6486002)(66556008)(66476007)(54906003)(26005)(5660300002)(43740500002);DIR:O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BYRUcvTXFPS0paaUQ1QW5OZzBxWWlscExm?= =?utf-8?Q?rX8YE4XHd/jpxBwtdja4KUYuj5kV+O7aAPytAvi?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 733cb1a5-c54a-41c4-369a-08d9840ed853 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5600.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2021 12:35:54.4645 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: SgL0mzeJ4pJiRZIPT79Ewr88HsQdIU/G/WhWCllKZd+ErP5iAy3MdUnMGElgEPiueK0J3e7on0LHxLRtAnkq2w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6383 X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1633005375927100001 Content-Type: text/plain; charset="utf-8" Using __native_set_fixmap() here means guaranteed trap-and-emulate instances the hypervisor has to deal with. Since the virtual address covered by the to be adjusted page table entry is easy to determine (and actually already gets obtained in a special case), simply use an available, easy to invoke hypercall instead. Signed-off-by: Jan Beulich Reviewed-by: Boris Ostrovsky --- a/arch/x86/xen/mmu_pv.c +++ b/arch/x86/xen/mmu_pv.c @@ -2010,6 +2010,7 @@ static unsigned char dummy_mapping[PAGE_ static void xen_set_fixmap(unsigned idx, phys_addr_t phys, pgprot_t prot) { pte_t pte; + unsigned long vaddr; =20 phys >>=3D PAGE_SHIFT; =20 @@ -2050,15 +2051,15 @@ static void xen_set_fixmap(unsigned idx, break; } =20 - __native_set_fixmap(idx, pte); + vaddr =3D __fix_to_virt(idx); + if (HYPERVISOR_update_va_mapping(vaddr, pte, UVMF_INVLPG)) + BUG(); =20 #ifdef CONFIG_X86_VSYSCALL_EMULATION /* Replicate changes to map the vsyscall page into the user pagetable vsyscall mapping. */ - if (idx =3D=3D VSYSCALL_PAGE) { - unsigned long vaddr =3D __fix_to_virt(idx); + if (idx =3D=3D VSYSCALL_PAGE) set_pte_vaddr_pud(level3_user_vsyscall, vaddr, pte); - } #endif } =20 From nobody Fri Nov 29 16:31:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=suse.com); dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=2; a=rsa-sha256; t=1633005400; cv=pass; d=zohomail.com; s=zohoarc; b=PQ+ukGO4qXa8AdgQV6znqYiZIx4tGHJd9p5S0sB46dzY4vu7xkyiI9JnAFnLGB21cvzeU8CwCAm1EO1qCqAOgMGjxbkhbCEp4hmleqDKV3AyGq1Mm/W1yUNnD3ENLmyYE1mrAkd0dpIvsax3lBeXwE6luQPEXdBwuhKd0yomtUY= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633005400; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=o8zK1TzXB8klvX7+Pkf65I5+DzQn9KW4HMfyUQ+KytU=; b=mPZ8+8fmmqA+36M3FHYTbRt5ZEzIFhWj8JlaKXjJ52I3NTLsi9rml3Ps6/Xnypl+oiKhjzhw1IqXOdzLLRC3Ot213cLA6eZIwQjQiw6UZTywCcd3TbKjzmrqzKtPsctuqBlNkAVnBMHeld0SWBRtXfLY/eVjvtkT5WKNjA61L18= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=suse.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 163300540086059.79581308997797; Thu, 30 Sep 2021 05:36:40 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.199881.354198 (Exim 4.92) (envelope-from ) id 1mVvIY-0003xK-J1; Thu, 30 Sep 2021 12:36:26 +0000 Received: by outflank-mailman (output) from mailman id 199881.354198; Thu, 30 Sep 2021 12:36:26 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mVvIY-0003xD-F9; Thu, 30 Sep 2021 12:36:26 +0000 Received: by outflank-mailman (input) for mailman id 199881; Thu, 30 Sep 2021 12:36:24 +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.92) (envelope-from ) id 1mVvIW-0003qN-Gm for xen-devel@lists.xenproject.org; Thu, 30 Sep 2021 12:36:24 +0000 Received: from de-smtp-delivery-102.mimecast.com (unknown [194.104.111.102]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 04402960-21eb-11ec-bd4c-12813bfff9fa; Thu, 30 Sep 2021 12:36:22 +0000 (UTC) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-ve1eur02lp2053.outbound.protection.outlook.com [104.47.6.53]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-24-6eL9DEv_Pv2FjHTNjZfUMA-1; Thu, 30 Sep 2021 14:36:19 +0200 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) by VE1PR04MB6383.eurprd04.prod.outlook.com (2603:10a6:803:11b::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.13; Thu, 30 Sep 2021 12:36:19 +0000 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::4d37:ec64:4e90:b16b]) by VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::4d37:ec64:4e90:b16b%7]) with mapi id 15.20.4566.014; Thu, 30 Sep 2021 12:36:18 +0000 Received: from [10.156.60.236] (37.24.206.209) by AS8P250CA0002.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:330::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.14 via Frontend Transport; Thu, 30 Sep 2021 12:36:18 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 04402960-21eb-11ec-bd4c-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1633005381; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=o8zK1TzXB8klvX7+Pkf65I5+DzQn9KW4HMfyUQ+KytU=; b=VKRTLO8jAajIVo5wGOmhq2mOiqO36DXcIbBucVZF1lFsuk16nm/EKLu9dy28xKnFdfhEpA goRqEtecj/e4FeXVorWtHtjX7XDcKKuwu7n1GKIFQjiRvcy9DrF+nzEwjp08VtCqeRm2ir lNS3fC7eJMcsmofeghsixzjiN8eAh64= X-MC-Unique: 6eL9DEv_Pv2FjHTNjZfUMA-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kMBiKcdZwFUlZCDUnusQJqhHEl01m6RqnYCQoiilh8RcBq/yikADO0kZd0xNg4SRVIKUfYrq3iKxYe2uIDcPYkXsF6DZ94GX96k3TiSRJF5DAWdBqeNHteF61SANsoROfAvZMzJ3kae/FwIlJArqXovkYearrU7oM6ninbUbuDN0vwNNtgQzrZAB/HOYaWGVypJMktV+Gs6kySnj9ggFTaLWU0orM1ppMs7qUG9k9H+BaQvRbOkVxB7qm9mkmeCylmCA6TdYsm4Z1NberxqPJztMOdgJ9CmbEGHzVg4Bvw+XdAIatVVtnW32e+eBo4d62Xf+16J+TIlrvn3c45fUqA== 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; bh=o8zK1TzXB8klvX7+Pkf65I5+DzQn9KW4HMfyUQ+KytU=; b=Z3p//lghpU4IxqbBK0J98DcyYeBPPdwrJ+g9NIcykIvo1f4Xl8DNMQ0WxUm7bPn9w+vSSJ67JFv9GYVNpnBRL85w1XESnDYbTgTDEaMgTuVLbXYmvLUt+jll4pO9gU537gQ9powSL35qzc+jEZ7Aa4gCM65fm6Bka/YeGTzc9IgzYm95vVidqI9pXsKe7wQzZHm22EoA1Q2UlB2dijg7eFaVw9FhcddpiRrQSRrhUk/L08HNoFOm7hh9B+AGFIeGjeVosuX0AO+WPcaRP3uYlvCQty5JhWZeBh4pqxTYt5Tym6mVr45aa6BJO5YjD5egEeno1ll6xSxkARnUTKQ3Ow== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Authentication-Results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com; Subject: [PATCH 4/6] xen/x86: adjust handling of the L3 user vsyscall special page table From: Jan Beulich To: Juergen Gross , Boris Ostrovsky Cc: Stefano Stabellini , lkml , "xen-devel@lists.xenproject.org" References: <022b1a5e-4121-6bae-f07c-4ad5eac12481@suse.com> Message-ID: <1048f5b8-b726-dcc1-1216-9d5ac328ce82@suse.com> Date: Thu, 30 Sep 2021 14:36:16 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 In-Reply-To: <022b1a5e-4121-6bae-f07c-4ad5eac12481@suse.com> Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: AS8P250CA0002.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:330::7) To VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2b717692-eea2-41fb-d7d2-08d9840ee6e7 X-MS-TrafficTypeDiagnostic: VE1PR04MB6383: X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gdR4A6Abb/a+iWFzTqvPecxY4Eub29t75bTxiVjq2QZn305HQ4ddz4Bc1OOb+VFCCGL1cNjCrrFtwyUFu8RPc/a2VvspELkOFrkoFe5UHbH7s742kuTdaJkq2rIO21WFXEFMVFH6mXtLcqA6wUPm+BJTpZNqlJuJUGHnLB0r3wqOZBelOEe1ptaH461vAnjkoU7g6fj56UYk5uwye9lRJTh1MfD3DfRyrlRAyM2G37N7zKuVs1r99N3LWmqaDKc+nmyfSs0lPo/6C5WEE1eH+aHNBMIIXTZHwgT9UYpm+IPndP03GvQ77PnOgoGZ/0d26dFf2JUbTiIqzkvsgK0IUfo0sITIiOXLSautuuecisOIm3hJisPM2MjUKokGbbWSzqG6+1+Fdq2mnIr4Nzb9MH8Mf7hy1VyWqMfQ8vHzZxK1hfSseDVkTOdsehd50rLlEmHtE0BcjXdE3q5IsTqw/4LW65Aobf/dkBhcHd9HdLyQXU6WZhARRxPx64w+FPirP9NBPJ8DKwFLDaJZn8GiLTayTQemhdblCBWVFjm4zGo9LAwxpl6wMbTVkB3TNkieRUJcxECQWYmyu0uZPd1COwAurTTcqRwwjPes3uvSbJRQBmhCXN/OG5HhcEgBZ63uc1T5H90dlEE/0LLJV1dSlGgqJ7YBBlOuWm0ZWDqsxbdJKR+DeZR1cKm6wSQxZlE6TX+Na4ILH5aoalSx2sScWmmeDrf3gSpg8H4ubVDFgQHEAGUQQyo71vYynd9FrUAZ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5600.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(4326008)(2616005)(186003)(956004)(508600001)(31686004)(66946007)(83380400001)(8936002)(86362001)(2906002)(31696002)(16576012)(316002)(38100700002)(110136005)(8676002)(36756003)(6486002)(66556008)(66476007)(54906003)(26005)(5660300002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?bTAwNm9TS1RoekNsWmJkVWdpeW9PRkNqb2cxVmRFTnl5ZjZwUjJDWDJtNC9Y?= =?utf-8?B?bDkxdU1tczhwNHpmVXdCSDltUWg0S2xzaC9uUUcycG9yMjd5S2V5b20wWlRV?= =?utf-8?B?Vk9FZG5sUlc0dmRFUHZ5Q083NVgzTHlSMWxwOGNzZ0pwWVJvM3k5MWdmWlFt?= =?utf-8?B?SGQ0TjdVNHh5eUJyRXpGZFJ6eDVmbW5OcFpCSWc2ajlsK2p1SThaZDYwSWdo?= =?utf-8?B?NmdWNkcrTFV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8?B?TDRDVk9tWTluSzNQK0Y1eGFjcDc4NUxZVjl0alFMZlNiM0QyamZ3SC81NWl0?= =?utf-8?B?Q3FtbmtSRktlRDJtOWVlOGNFeVhUOGcxOExNWVZ4ZVlkV282Tnh3cEljKzVG?= =?utf-8?B?WTNSMzRtS0FEeDJZMmw1V2MyWWtDQmU3alNjTGtvTTNPMHE3TmUwVjloOWFo?= =?utf-8?B?M3VISXVDOUJqSWQ2bEpCek4wSks4OWl6MWZPTXQvWDB4V1hET1BCTFJwY2Uw?= =?utf-8?B?QkJjUENPVm84eFV5amhlblFjMEJXREg3RlhwczU5cG15cHVtTHo5TWdLbmk3?= =?utf-8?B?QUlSMXdaY2RwTVpMM2tXMEhZdWJlb2tYZmVHRnBXSHpSTE9PMGhaZy9mYlNJ?= =?utf-8?B?VS9aWktHd2xpUW54L3BodDhoeDFZRGhEOW00OEpXcUNyS3MzV2htTk9BaDJr?= =?utf-8?B?SHdmeGVrai8xcnk3NTJlSGgyVXZxQjk3anNBN25hY2docnZRVVZHYnA3VllW?= =?utf-8?B?MGpsUlhsbERiYkZZb0NrYWpxME9yVlE4QklMQkFIODBOOFQyMlIwemlqYnpJ?= =?utf-8?B?VDlYUWoyQ0JtTzZsZGQyaXRUTysxYWxxRTcvczlJMDZiamV3Zmx2eHVQajVO?= =?utf-8?Q?c9peOGsyC02fuM45TWZ2tI0IDfAblxG1zFUz95G?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2b717692-eea2-41fb-d7d2-08d9840ee6e7 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5600.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2021 12:36:18.9427 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: p/UVvcBHTex3EDann2EoFsoQf08BAYRzVOqe4nNdq8gQITWVXi39PUQVG29gmdW3u5gyJ6YEe5ipqfbkTqb8sg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6383 X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1633005402699100001 Content-Type: text/plain; charset="utf-8" Marking the page tableas pinned without ever actually pinning is was probably an oversight in the first place. The main reason for the change is more subtle, though: The write of the one present entry each here and in the subsequently allocated L2 table engage a code path in the hypervisor which exists only for thought-to-be-broken guests: An mmu- update operation to a page which is neither a page table nor marked writable. The hypervisor merely assumes (or should I say "hopes") that the fact that a writable reference to the page can be obtained means it is okay to actually write to that page in response to such a hypercall. While there make all involved code and data dependent upon X86_VSYSCALL_EMULATION (some code was already). Signed-off-by: Jan Beulich Reviewed-by: Boris Ostrovsky --- a/arch/x86/xen/mmu_pv.c +++ b/arch/x86/xen/mmu_pv.c @@ -86,8 +86,10 @@ #include "mmu.h" #include "debugfs.h" =20 +#ifdef CONFIG_X86_VSYSCALL_EMULATION /* l3 pud for userspace vsyscall mapping */ static pud_t level3_user_vsyscall[PTRS_PER_PUD] __page_aligned_bss; +#endif =20 /* * Protects atomic reservation decrease/increase against concurrent increa= ses. @@ -791,7 +793,9 @@ static void __init xen_mark_pinned(struc static void __init xen_after_bootmem(void) { static_branch_enable(&xen_struct_pages_ready); +#ifdef CONFIG_X86_VSYSCALL_EMULATION SetPagePinned(virt_to_page(level3_user_vsyscall)); +#endif xen_pgd_walk(&init_mm, xen_mark_pinned, FIXADDR_TOP); } =20 @@ -1761,7 +1765,6 @@ void __init xen_setup_kernel_pagetable(p set_page_prot(init_top_pgt, PAGE_KERNEL_RO); set_page_prot(level3_ident_pgt, PAGE_KERNEL_RO); set_page_prot(level3_kernel_pgt, PAGE_KERNEL_RO); - set_page_prot(level3_user_vsyscall, PAGE_KERNEL_RO); set_page_prot(level2_ident_pgt, PAGE_KERNEL_RO); set_page_prot(level2_kernel_pgt, PAGE_KERNEL_RO); set_page_prot(level2_fixmap_pgt, PAGE_KERNEL_RO); @@ -1778,6 +1781,13 @@ void __init xen_setup_kernel_pagetable(p /* Unpin Xen-provided one */ pin_pagetable_pfn(MMUEXT_UNPIN_TABLE, PFN_DOWN(__pa(pgd))); =20 +#ifdef CONFIG_X86_VSYSCALL_EMULATION + /* Pin user vsyscall L3 */ + set_page_prot(level3_user_vsyscall, PAGE_KERNEL_RO); + pin_pagetable_pfn(MMUEXT_PIN_L3_TABLE, + PFN_DOWN(__pa_symbol(level3_user_vsyscall))); +#endif + /* * At this stage there can be no user pgd, and no page structure to * attach it to, so make sure we just set kernel pgd. From nobody Fri Nov 29 16:31:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=suse.com); dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=2; a=rsa-sha256; t=1633005437; cv=pass; d=zohomail.com; s=zohoarc; b=coIuSu0fYGY72GSTTLOntMCIwYlO8TyMFGOZTLMMoxNOH5vCm565czuJxlv+WTi58oso32VzJlEjKv+vZRS39oDWsVQPs2Kl2JYKOprsndRgLleWUNnFCgVBwG/WSif6ZAaCuK5JKf6ozkFQ6asQlqZ6LV+6D8lSpJOrIzmKOME= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633005437; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=kQLmBvAO/NkPEGuiu0F/4ldlzMcypIF4EQud5MBiHsY=; b=ZXY0KnoJD9TG6JuAcJMcDebSBIuliL8Zl6kOYt4hzKOe3oJyXknH0+q7Xx9WpIuu2f6cODxsT/NdNKzpr/CAG1CF7xzI2bPhpBY1iC4nsveDqfjQTXXVgrO+mBrIGVMO7xuzEuJ95SY8jd4fWnEK3OhA9hSu3aDqgmzpgtzllp8= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=suse.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1633005437794756.6451052192731; Thu, 30 Sep 2021 05:37:17 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.199891.354209 (Exim 4.92) (envelope-from ) id 1mVvJ9-0004j0-Ve; Thu, 30 Sep 2021 12:37:03 +0000 Received: by outflank-mailman (output) from mailman id 199891.354209; Thu, 30 Sep 2021 12:37:03 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mVvJ9-0004it-Sh; Thu, 30 Sep 2021 12:37:03 +0000 Received: by outflank-mailman (input) for mailman id 199891; Thu, 30 Sep 2021 12:37:02 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mVvJ8-0004hO-J1 for xen-devel@lists.xenproject.org; Thu, 30 Sep 2021 12:37:02 +0000 Received: from de-smtp-delivery-102.mimecast.com (unknown [194.104.109.102]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 14e64bfa-0714-4185-8266-1e86bbc43d80; Thu, 30 Sep 2021 12:37:01 +0000 (UTC) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05lp2111.outbound.protection.outlook.com [104.47.17.111]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-27-DpP6b-ieMKKti2mFjHTOAQ-1; Thu, 30 Sep 2021 14:36:59 +0200 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) by VE1PR04MB6383.eurprd04.prod.outlook.com (2603:10a6:803:11b::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.13; Thu, 30 Sep 2021 12:36:58 +0000 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::4d37:ec64:4e90:b16b]) by VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::4d37:ec64:4e90:b16b%7]) with mapi id 15.20.4566.014; Thu, 30 Sep 2021 12:36:58 +0000 Received: from [10.156.60.236] (37.24.206.209) by AS8PR04CA0006.eurprd04.prod.outlook.com (2603:10a6:20b:310::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.14 via Frontend Transport; Thu, 30 Sep 2021 12:36:57 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 14e64bfa-0714-4185-8266-1e86bbc43d80 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1633005420; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kQLmBvAO/NkPEGuiu0F/4ldlzMcypIF4EQud5MBiHsY=; b=KPMhD+ubwGcbeJ0Z2FbrprXjSue7JAAg7cG2m0GyPJ+FF4jtAEloLuVzW74wOw1nzDRigx DrwceYg5vXeKkTYgP8kP9NtGOUyOqdn/xJ6gDJ+hp1RAwwdlQJxRzuWk/1pLLb69h/OX7d Ie6o1qBwoizJS8rH2L8wai7I7wK0/FA= X-MC-Unique: DpP6b-ieMKKti2mFjHTOAQ-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NLgF1NznO7aBcsrf6Z1TOlaQBeHNNiUvPb2gb58YMwWGMdmcyr53JQqCdpcreZ7Mjb/r45nbJqKRFxjSMVd2QOxHKosrUQFuTwT+EVoUjNVyMS0PnkPMXSesUtCjVATBVJxx7gfyithJ2fp/wuINmACD9+GToLPPAIuYsWgu+3sPgOBFlVp4bumGgND9EYYPXXHC3Omys6Gff0HXtaCoCX+SKwbru80+fbcMq3mUvkBoQn9Nej8YmFuUW14Z/B0hnY52aQZHLj6eH/boVdwg1uuUFBMr0cpLDBtUQwMyzvER+c6XOE9unB1CzuUQ/3nz4fhX/TZCmjUB2N/1dAscrQ== 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; bh=kQLmBvAO/NkPEGuiu0F/4ldlzMcypIF4EQud5MBiHsY=; b=WjwgnqVCBjNuQzXULQV5ichQfsGruTlopM3javsrTOXEu+Z9uY6ZPwGMPhlLJM5n2tqvRorzSHXGxZXHrF7Nmn25LCE5saLTdE2VldA3Ms6G2pzc8g5xc1HAQu4GnHedfbjHbzblLVVXm3e4zUrPBCsNTEoLjQhYwUTjqyGSIOnDInLJkqiUFfjSnBb1dxe8WxDbOw0iW2y77A4c/R7u8UMeAaKUG5jb66LenCx9nC0isclvQMvtEO7DU2bf0C3LkjqAQ8vaDIIBqAWjUgVLmtgu4B5JCtWGlwGSFt28vfOqvyc3vF7JkDMw8BKeyXO67qz7j/8a+sIDxs/mUnfVng== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Authentication-Results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com; Subject: [PATCH 5/6] xen/x86: there's no highmem anymore in PV mode From: Jan Beulich To: Juergen Gross , Boris Ostrovsky Cc: Stefano Stabellini , lkml , "xen-devel@lists.xenproject.org" References: <022b1a5e-4121-6bae-f07c-4ad5eac12481@suse.com> Message-ID: Date: Thu, 30 Sep 2021 14:36:56 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 In-Reply-To: <022b1a5e-4121-6bae-f07c-4ad5eac12481@suse.com> Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: AS8PR04CA0006.eurprd04.prod.outlook.com (2603:10a6:20b:310::11) To VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0612504c-decf-405b-a082-08d9840efe61 X-MS-TrafficTypeDiagnostic: VE1PR04MB6383: X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2449; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: R4UcBi46QwQHaVjkTAZQCfIupTQMqrpyBx9n7ju4hxbxhJQkdJVISVHTlCeCjp0PFqqT18cQXi5Br8YkyrctwK6p4eIjkHXb2VeOBBLWk+DVHVtVmUNLSC5t9giu8zkNZkkWUG6JQabWTd804QPntlKBrEba+0qEI9boaajzUrwVXWM+nvk1dYGj/60hq+hhxGN8XnUgbFGEicwvyedCnP+AjMnIiHywhqSBPSfK8HcH77XBaNQrMG/scSsBW7BbTLhr54CLGpqVDPB1khY1bkLtO28R/m8iVrRanDHjeTfGHh13sanFzW/cwvE2XCh+aQM+PqyqefjUBftXJmwQM3ri9hVlwqu4KOPDmQhtspyVl1iK+VB8QuyhsIEE9o91TU43LWh39uVYFaUdFTMg008Q/obFHIqvGpgCaOsJNhZWgCr+hhJAKzx7XlnRm1L/WXQANRPXGfR0s16utEEr95IPWhGB5sxlUOTPgGZ2xBybR3gjKsJ+B1QVciSRCpBZ8Opw+mgBZCltRvCAO3DPEWNjOAhQavCdMXkCdj3mepDdjeLFmwtZB19g5H9gfzKGG9AzEu0pGUOQ2i3nKkC0l19YiQmNDhTQ1BDQtHd4nD7gUBCM5mvmVbWQMFhz6fA/UKzA0KI25SJ76/kk9CxorPwfuHBng3FI5ix6dipLk1iW/OXP8D/gABOvQOINqK48t0OY1fqCKeYPEOo1S9fyQy1/FYGrM6iI7U2aAubCwoI2hx7HxILDmXIiRqZ6dIgy X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5600.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(4326008)(2616005)(186003)(956004)(508600001)(31686004)(66946007)(83380400001)(4744005)(8936002)(86362001)(2906002)(31696002)(16576012)(316002)(38100700002)(110136005)(8676002)(36756003)(6486002)(66556008)(66476007)(54906003)(26005)(5660300002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?aVNIQVdJUFNvZEhPTE4zZ2Y2U2lwdnh4ampJcHA4ajB3UWtnR2JMR2hOa1FB?= =?utf-8?B?NXVJWDcwQ3pkTXliMU5jdDMyeWtmam8yV2QydHp1bURsWGhvT1cxUW96c2M2?= =?utf-8?B?dUpsKzRJb0lIRzNrSVAyVjYrcnRQSWpabnQ2WU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EM3M213dGlGaHJqR056VkVua1BaWHhRT1ZQ?= =?utf-8?B?eHVHWld5VXY0dW9GMFVvS05DWkhldnJXck9tU0JwNkxLTVQrRUk5Zk9FQlNa?= =?utf-8?B?SzR3aC9MeDVwUHZEbWFwK1k0a2orcGxhVCtrbXBxTk1ObjZLd2VHc2VTYTRk?= =?utf-8?B?bFJPaDBxZm5nWjhjV1FQeUczNDIxbTlrSW8yOVlxMlpOM3BkTTdQcmFJQmQ1?= =?utf-8?B?b0E0MnVLbkVDRSsvV09oTUJVOWQwbFgxRXVUTzhwM1lHQ2xxcTMvQlhaOUdh?= =?utf-8?B?VkIyMkc5V0pjRUkzTkpxd05NUitnTTErTVlyUjVHeDBVZXg4UWZCWGpYRjR1?= =?utf-8?B?bC9oRXQwazZoWXZIOWpJZFRtNTJVK1F0T1djMjg0a2pKZVlzb2QwWDBSMDNJ?= =?utf-8?B?NEFUVmtucVBWTEhPRnJ6eDhhMlJJbDliOXFsZGk3NEh3VVpHcm54eC8vUWhQ?= =?utf-8?B?blNQZWxBWGhHdzZGWlNHb3dyeklhSjkvc1h3MXN2QnFvSEpPdkFrdVFZaFp2?= =?utf-8?B?WElKZzlNN2poT2NSYjUrTW5NdFErSzcvbEZDNjlrTDNqWjlwdkZqZkVkWnZ0?= =?utf-8?B?cWExVlpGS1dxQ2VJWjB1YXVhUUxzTWxxQXc3dEdEUld1cVU3Q01lRHZpZDJi?= =?utf-8?B?TThyV2JoZjlmOU90enhZTEROcTRkTVBTdFczUmsxNVduZ1M5eVNuTG8zN3Ux?= =?utf-8?Q?Jg+1OiP19zLbircV4luKpuR4I3O06jn9mVVG5eH?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0612504c-decf-405b-a082-08d9840efe61 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5600.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2021 12:36:58.2824 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: lorDMFZEw33I+PbNj/8V+X2Uh+khFHY8f/LF/MBUkcYTQgNai/Ztpy/5HDhjm0hmyow0lZj1JBun0R3ePZGdVw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6383 X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1633005439056100001 Content-Type: text/plain; charset="utf-8" Considerations for it are a leftover from when 32-bit was still supported. Signed-off-by: Jan Beulich Reviewed-by: Boris Ostrovsky --- a/arch/x86/xen/setup.c +++ b/arch/x86/xen/setup.c @@ -306,10 +306,6 @@ static void __init xen_update_mem_tables BUG(); } =20 - /* Update kernel mapping, but not for highmem. */ - if (pfn >=3D PFN_UP(__pa(high_memory - 1))) - return; - if (HYPERVISOR_update_va_mapping((unsigned long)__va(pfn << PAGE_SHIFT), mfn_pte(mfn, PAGE_KERNEL), 0)) { WARN(1, "Failed to update kernel mapping for mfn=3D%ld pfn=3D%ld\n", From nobody Fri Nov 29 16:31:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=suse.com); dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=2; a=rsa-sha256; t=1633005466; cv=pass; d=zohomail.com; s=zohoarc; b=MpdRshYIusqxdKnhD25KOaF3JbHZFUTVWUL46I7XXViGJ7d7PQxkhrwWFBQ68o+QpBa5t4VSeeXhEtymIhk/3+dEb4I4PNxxyZEwYJ8PekaYEwiPchzDWNXF28zPn5sTcAW/iI8MMA3jY4szT+vu4eYwe1/ddZeqvli94mUwwbo= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633005466; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=kPPXxxwugPBH+beN9q4uizgqAq1OKQYB05wUlCmlLlM=; b=faTSNPv3cCWM92KpIiozsvjoKk63wuCEdzp7l/fPY73XnGhpbsngqtMHJgwrDWCs9K5rQe04EApOF2ZJa03503DbRwoawmNW55QztP8FfIsbhIoI7p4YfcrL3PyFozQuvnUMitwZEZvLJG71ocOy/+2PLYXQVgz+H1P33P11TL8= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=suse.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1633005466230472.24039321411647; Thu, 30 Sep 2021 05:37:46 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.199896.354220 (Exim 4.92) (envelope-from ) id 1mVvJa-0005Q4-8B; Thu, 30 Sep 2021 12:37:30 +0000 Received: by outflank-mailman (output) from mailman id 199896.354220; Thu, 30 Sep 2021 12:37:30 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mVvJa-0005Px-5A; Thu, 30 Sep 2021 12:37:30 +0000 Received: by outflank-mailman (input) for mailman id 199896; Thu, 30 Sep 2021 12:37:28 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mVvJY-0005OJ-JQ for xen-devel@lists.xenproject.org; Thu, 30 Sep 2021 12:37:28 +0000 Received: from de-smtp-delivery-102.mimecast.com (unknown [194.104.111.102]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 1aa5581e-a0bd-4b30-9dfa-2e87ad04a3e8; Thu, 30 Sep 2021 12:37:27 +0000 (UTC) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05lp2107.outbound.protection.outlook.com [104.47.17.107]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-18-xfIf_bZcPQyeHCkSQiq7nA-2; Thu, 30 Sep 2021 14:37:25 +0200 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) by VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.13; Thu, 30 Sep 2021 12:37:22 +0000 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::4d37:ec64:4e90:b16b]) by VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::4d37:ec64:4e90:b16b%7]) with mapi id 15.20.4566.014; Thu, 30 Sep 2021 12:37:21 +0000 Received: from [10.156.60.236] (37.24.206.209) by AS8PR04CA0044.eurprd04.prod.outlook.com (2603:10a6:20b:312::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.16 via Frontend Transport; Thu, 30 Sep 2021 12:37:21 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 1aa5581e-a0bd-4b30-9dfa-2e87ad04a3e8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1633005446; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kPPXxxwugPBH+beN9q4uizgqAq1OKQYB05wUlCmlLlM=; b=KE1jczkPjRiGYi1Af8INeMw6vNy/tRNOAmuF7RjGtwuJStzm7pFbWblctRGKbNnzGbFmHm 6+5D/2lvjvsACUAoH5cR/ca3Ns670cFhFGo4MwCdyQg3lwSzraeqD7E4FtoIF6KQfG9DVK Lr9SWQhCsvs89C7bOEGCZex+b84Hbpo= X-MC-Unique: xfIf_bZcPQyeHCkSQiq7nA-2 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XilTaAxqeBZWIJGbAE5s+aGyJxwBTKSk8JJIcQrGqZ56NngxDJh9hPmPvxM+fRJQTOOB8UH7l9TvHBP2yjvJNk2u7t5ZIXVOBZZ2pgHd2OUxBbsavaHT65oINnSGheq2AgnETqceJNhs8rRDrLvf2Mwn2fwG+z8yPgwpQ0X5wvFKQ6800h8iOyqyeGAtYYPQKIKTfP8YRaq8U+JObZf6Zc87ncHz9vA/3KQPwS8BTst102uFq1izpVMFUAglboi19KA1Le00aggzRFcl4Kz2GhsUCqQ3RoeahTcOaD0p8VzszyCWvwdBYEYwT25OcSHBfoi6/AJnFOskedlbBRqHgQ== 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; bh=kPPXxxwugPBH+beN9q4uizgqAq1OKQYB05wUlCmlLlM=; b=L81yw8xq8kuaHu8deo1awIB9H4n/kFDii481Ozwug91sYMLO9KNforOxYqXeAE6KaYblcI6PkfRJkyuE0vNEbiKRemO9hHxneo51pjXTovhT0QgvlLRa3LoeEqVFyMTvLE8U0LwTwlzxbPVDsGpGfmycn48kUh1rwFCe/NG8SAZlhUocJtmcsqlJTfcuS8WQspEXM4XC2lZUIo8u27f6nEkyXYGPJwmU+p6/kqDEjKwZ0r8Z3BoblFLH0U9wXHh3Z7VCfMDJLFVg/+82qREaMopTNDrv7a8rQ3galWv6Dx1Fo5LuWX3RDraRs+KnxISelYZ3+zZEFD06EkxqCJ6VYQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Authentication-Results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com; Subject: [PATCH 6/6] xen/x86: restrict PV Dom0 identity mapping From: Jan Beulich To: Juergen Gross , Boris Ostrovsky Cc: Stefano Stabellini , lkml , "xen-devel@lists.xenproject.org" References: <022b1a5e-4121-6bae-f07c-4ad5eac12481@suse.com> Message-ID: <038b8c02-3621-d66a-63ae-982ccf67ae88@suse.com> Date: Thu, 30 Sep 2021 14:37:19 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 In-Reply-To: <022b1a5e-4121-6bae-f07c-4ad5eac12481@suse.com> Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: AS8PR04CA0044.eurprd04.prod.outlook.com (2603:10a6:20b:312::19) To VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2cfb7984-2657-4317-0ae4-08d9840f0c60 X-MS-TrafficTypeDiagnostic: VI1PR04MB5600: X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XvmdscEd9rEdQFfFcHzHE1yUzmCA78KefJFiaS7tFz7cTJRHRuJb5OVAubYJ/hJnDKcaueTs421LujF3q2Gq74K6EKMuda/8MmLMK15SeKvZ3iB+HEliVw3Vpkat8CpnlVaIWdyk8tBxSJs7E94elR/+7cS7aRfU3aJYV+fLwULbQSA471/n+h7e1H/Fq0AWl0TE/sVeGnAznw1QpzpaNU52beKmxKjL8DyTUSFpGt3U6ZaZ++2osWQekH0GlOyQ3VoPJXLiVnEPM+5E1k9uet3VlQdAY6j8zFRIM6B3FfkD+ojsMqME2UNz7+tFnjAQwfc/2BQafiOv6ElT7GUygYdOry4RH4o61ClJMhKGmCSsJI3mpsT+VMaYgxNOZvx1OwvTfH3K1CjFez0uYtKGWZQPegnhcRIB+co5wZB8Oac16+v19khbEap0d/Qi3CFgMLDotqVe5PRInBTTm2a0LxGvsgD84nD/a9igeJ9A7hjSiIPJ4+SUo4Uo1NMb/OLRohHufORSrIfFmfoPsCvx/DcEo8LAS9YbCSZX/nlBrkKnCONLsaGbmdnOWRGko1e7bfaBV/9UnPr+wsNs0Q/EPvzTFdbOtXAKIdfm4yH99c9aNpR7+25fXkiX2/JpwT2h2Pxjd5u92hxxQdMwtWRagqyiWt/0jC/YuBrtHUF89CQ5h+6NWmJ69+0oQYKrKgdDib07cB7P5+rAvc2CtRDwAyNDVfI2ThBQT8SVCYhhjaXbMBDOlMJ912X64JEspchd X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5600.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(508600001)(2906002)(316002)(5660300002)(83380400001)(38100700002)(66556008)(66476007)(66946007)(16576012)(110136005)(54906003)(8676002)(31696002)(8936002)(31686004)(4744005)(186003)(6486002)(956004)(4326008)(2616005)(36756003)(86362001)(26005)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?M2p2R1N1S3czTkRsYXdxQ2MwZjdXdlAzVlYrVkRFWmNXVzhveTlQWlo4cWpE?= =?utf-8?B?dE1tNmNZUEcrU244WGl0c2Q5eWhhMXQ2WHQ5ck9qVDlEb1VCZnNaS0RCT0Vt?= =?utf-8?B?K2dXWWtLMm1DYWF4cjd4NDA1MEEvWXlnaU9jY0NkME9iTzFVbk01c2o0b2lW?= =?utf-8?B?MlJrK3R5d2Z0Y0kvTW1yck1PWHhEM3lIeUVmdVFscjZnZXFPMHJUcVFDV3kw?= =?utf-8?B?cjM4K0V5dEQrajhZT2dWMzhPdWNUWVZsUU9OSTlQTzNNL2tENlhMcld3NWRF?= =?utf-8?B?VWRaVCtKdnBrdmo3NkE3SWRQeUhURy9tV0YwcjlLYmdxZkVGTm9hTGdCdkFn?= =?utf-8?B?WUwwQmFpZDE3RUlDck8rdW53QWRERzJuRm51YVI3QTk0WlNGTWZWMFE3VXJY?= =?utf-8?B?aWRTdnBwWE9oZFhvLy9aMitGRUxUZENJcVhSRnhscC9pZUM5aVRZdlRyaWZU?= =?utf-8?B?cnYyUFVCS2NIcmxnNm05L2diNUVhaTN4NnFUeng4OWlpSGpjem9hcjI0MXhL?= =?utf-8?B?ZHp3MWRMQXc2QmhwK21XUVBHTHAxS2dwZ2Znc1pEbWY5eHdkYm9icmJFa09I?= =?utf-8?B?aU01ZGF0Qm13K3VsQnJYUHlQRSt5bENUeDRHcGFyNDg3WEZvd0M2V05oTk1W?= =?utf-8?B?STd3T1c1ZkcvSjdrSmJxRjFkNVBqZm5vdjVvWTFWRlRpNXpaakJ4NnlJTFdJ?= =?utf-8?B?dTlsMjV1N1JTQ01NWllUZW0wbUJZZ3NucnBzYno4a2dpT2JneVRFTURaQnZm?= =?utf-8?B?Ym9pbXdwUURvL0V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?B?WFBEYXlEZFVqRmFHclJQRndWNzBpUEU0NFM4bEpRM0xaVWVCQ3ZzMGgySXgx?= =?utf-8?Q?93ZKV8oWsM+vckc/XhkCzli11oCJHU6m/B8ieBu?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2cfb7984-2657-4317-0ae4-08d9840f0c60 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5600.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2021 12:37:21.8021 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: N+68ucEy+pC2zMfLvWa3YBirMpv4MDFLr5fQVKEKl3arg/Yr/kg/vljVeeZ6LHuxaQ1Uv2OjsEoU6X25wHf1UQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5600 X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1633005468140100001 Content-Type: text/plain; charset="utf-8" When moving away RAM pages, there having been a mapping of those is not a proper indication that instead MMIO should be mapped there. At the point in time this effectively covers the low megabyte only. Mapping of that is, however, the job of init_mem_mapping(). Comparing the two one can also spot that we've been wrongly (or at least inconsistently) using PAGE_KERNEL_IO here. Simply zap any such mappings instead. Signed-off-by: Jan Beulich Reviewed-by: Boris Ostrovsky --- a/arch/x86/xen/setup.c +++ b/arch/x86/xen/setup.c @@ -425,13 +425,13 @@ static unsigned long __init xen_set_iden } =20 /* - * If the PFNs are currently mapped, the VA mapping also needs - * to be updated to be 1:1. + * If the PFNs are currently mapped, their VA mappings need to be + * zapped. */ for (pfn =3D start_pfn; pfn <=3D max_pfn_mapped && pfn < end_pfn; pfn++) (void)HYPERVISOR_update_va_mapping( (unsigned long)__va(pfn << PAGE_SHIFT), - mfn_pte(pfn, PAGE_KERNEL_IO), 0); + native_make_pte(0), 0); =20 return remap_pfn; }