Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp40855pxu; Tue, 24 Nov 2020 17:58:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJwPgGMicvvWp42zOpynvEDTizO9K5M1nvxhtHxq4f4uikLdpRh4flHbAUMwZygM5aa1C5wI X-Received: by 2002:a17:906:b292:: with SMTP id q18mr1187005ejz.93.1606269501300; Tue, 24 Nov 2020 17:58:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1606269501; cv=pass; d=google.com; s=arc-20160816; b=tUa/2j+sXFGzrwP/LSTOQkWFPKLGvIZ1md3dcp4pneudB0Ah/hRHXAUNeW8vlxV6CK 8rzsK0YFmVUsQyDIylZk3YIm0jFTpDkL3QwnLawKLZGlTCUNE9Ke4P9vB8N3PsTA9WPL pW4giC00t+bsreg6ijeUSTIxo7J2N2KEmRElU4dbJRwPSrMBsEijJM6exYqkLlqNf3SO 374WmJ5kkulY5Q/QAAYf2jTT2IRpGiseEU3uW/JulWJK+Y5Ykdff5IxXMRXaQ4ArvaDe 2M/B81i/NoUUUHJflLDsEdBwbulhyIOeuPpq0d7hNFO9xRiZMNk7fvMtz1oJjapUiOXZ vRZg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :msip_labels:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature; bh=EEShTQjqrhLIGxf+jX/srIl9s8yR7hrS3Y1sxYIXRYE=; b=B3yDpemv1BGE2zpVy2vlILVLaH+pawDDypZ6IIWez4jp1U4sMxEFyYIJnYl/SifRFT 0l/AepbBZ1L8erhQEiUjNe6tgKmsJl6d3HgTdPpo5Wt34antUW7ECEdMHcNtsrvxLUof /SOJwo6rMD18NZovFBEIyBRnyX7cYjSBoRkS52dbjZqyhijBsUSsaqSGsICLEcivDRid Lm3Ay8T7Gm6zIjz2Qa+wxdozX2/PodwF0ilrraWyQMEGksMEA87vHTQJZ1ohYaZLQo0c w68iIoJOUh53t1H5BBh8MloEa6xLvkD5fyikh2lvDACKdEDlDO58+rmr18n771IgrhSb C7RA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector2 header.b=e360GJzH; arc=pass (i=1 spf=pass spfdomain=microsoft.com dkim=pass dkdomain=microsoft.com dmarc=pass fromdomain=microsoft.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ec12si435417ejb.727.2020.11.24.17.57.58; Tue, 24 Nov 2020 17:58:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector2 header.b=e360GJzH; arc=pass (i=1 spf=pass spfdomain=microsoft.com dkim=pass dkdomain=microsoft.com dmarc=pass fromdomain=microsoft.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730522AbgKXIdg (ORCPT + 99 others); Tue, 24 Nov 2020 03:33:36 -0500 Received: from mail-dm6nam12on2107.outbound.protection.outlook.com ([40.107.243.107]:51169 "EHLO NAM12-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730474AbgKXIdf (ORCPT ); Tue, 24 Nov 2020 03:33:35 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a73K9jtwgZI0C/dUZfVPI2vSbUWNLL6KDBR4oxa/QRxfqIGuXsGs6L4ivRv5bL2qECQAt+L3K1YW0uoHwxCDTdFJE+vXP4kEH1MlAZF+vt0+Mgn2um8o+uQv0N+fEvu0O2nnnTkVmlxN3dmD+z2H6PaMKHHoWLMyhLYVUmnbRlkg0UuLPBnO02GNwqMS+w+mMBgAohGWIMPeyI6MoPyDGNqp0a4PnEfYNfaJEaSAFMfneF8wLZiC6VfP6zYvugFbHyfaYUn9k8wWClVBvFL3wdnSbSyhXsg4h/XQvqWaQnaFHhQVpdvc58NH82+BnqUlyNzEl3HaAQ9q03wSj/xSAA== 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-SenderADCheck; bh=EEShTQjqrhLIGxf+jX/srIl9s8yR7hrS3Y1sxYIXRYE=; b=H/A9HjdIW0sWyyxR+h9NWINRlCSCTH4UhnxtaG9E10qHygMeOWsJHyNbbBIUhREWg9F6bLjqX/w2UqY5D9egIBhXAuhfvQ1EXD88YrkWFTvuvM29PQkEt3EJqdhRU2qSIqvP99iUOhaP4YComn/4CQfn01v3jDuefeVGHgBRnJscEVbLqKxEgbvkUkUO0axk2tg0ZgPJnbyIKNqJ7GmS91BgJ6gDI5pP6ecEyeII/AEEnIBQSQ4fiio2RtpLLNLU0EN/TKyfj+BxUh9sN9WWKEUyOWq9horMi6XL0XjkiHERwk1b1FnuvwkVCgn2btcXwDIdJSDy6q6R7AKRp+eMYQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EEShTQjqrhLIGxf+jX/srIl9s8yR7hrS3Y1sxYIXRYE=; b=e360GJzH56uCTQZidEH85Vc7ZDQDlFvhX6YjNETFbCBjOtQnPMI6BhgmYP9r0g0gF4iChNW7r6rweVFHhUdKa9v694xxB8B0QHIf9+p2idMv06IhOoggXKkFyeygK0inTeQu65PRKMqxtutKsffLSwN+bbSW+1MJSvTV01tWR+A= Received: from MW2PR2101MB1801.namprd21.prod.outlook.com (2603:10b6:302:5::20) by MW4PR21MB1860.namprd21.prod.outlook.com (2603:10b6:303:7a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3611.4; Tue, 24 Nov 2020 08:33:33 +0000 Received: from MW2PR2101MB1801.namprd21.prod.outlook.com ([fe80::d0da:1926:ffb7:f06c]) by MW2PR2101MB1801.namprd21.prod.outlook.com ([fe80::d0da:1926:ffb7:f06c%8]) with mapi id 15.20.3611.017; Tue, 24 Nov 2020 08:33:33 +0000 From: Dexuan Cui To: Boqun Feng , "wei.liu@kernel.org" CC: KY Srinivasan , Haiyang Zhang , Stephen Hemminger , "b.zolnierkie@samsung.com" , "linux-hyperv@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , "linux-fbdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Michael Kelley , Wei Hu Subject: RE: [PATCH] video: hyperv_fb: Directly use the MMIO VRAM Thread-Topic: [PATCH] video: hyperv_fb: Directly use the MMIO VRAM Thread-Index: AQHWwBYrh+ep75sJdUq4vnjYcMIHRqnW9RcA Date: Tue, 24 Nov 2020 08:33:32 +0000 Message-ID: References: <20201121014547.54890-1-decui@microsoft.com> <20201121145411.GG3025@boqun-archlinux> In-Reply-To: <20201121145411.GG3025@boqun-archlinux> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=3963a294-6577-4647-97b6-267f7e8557ab;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=true;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=Internal;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2020-11-24T08:20:13Z;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; authentication-results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=microsoft.com; x-originating-ip: [2601:600:a280:7f70:c577:ba58:12ff:ac91] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 256fb33f-69db-4f9a-d4d0-08d89053a10f x-ms-traffictypediagnostic: MW4PR21MB1860: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: wRNnB9qEwzZYQMo4+445qOgb+8YZtZTY8EAntDRAG575DoaoTyHco+XQpKQUi2dx4xtO7O72fkjjdyhSm75D7ISsJLyG9gDMoVhHCAYUzIBRhP7Gm0bwfSBiozVTmzHMMTurVQGyYqeRM6d3roBd8nBEZLkFPZRkxsDKv83A+qXOm5c/hlY7iUyy7Ld3YZEa/hMtp4bZM4WK/Lc413KuwUuQHp79RhXWdmz5U1vE3BystZNLvZfGeZJ0P0z/LajbHFyc+P6UBoooEEygsuLZHn6bqB+ZWb9Tmhql29XeX6Uq0LyvRzNZd3/5ma9oQG4royvcfwNCez+UUoFxcO2Y+A== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW2PR2101MB1801.namprd21.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(376002)(346002)(366004)(39860400002)(136003)(396003)(9686003)(5660300002)(33656002)(82950400001)(8990500004)(107886003)(82960400001)(55016002)(52536014)(8936002)(8676002)(66446008)(64756008)(66556008)(66476007)(66946007)(10290500003)(6506007)(186003)(76116006)(71200400001)(83380400001)(2906002)(7696005)(54906003)(86362001)(4326008)(316002)(110136005)(478600001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?6dYcbf0pA7nuEXs1woMo2A624LFu+sXJu6btquTmON2awu2D6HDsX7ouQZQZ?= =?us-ascii?Q?4Bys6r8tYD3+QX4bFmjSAbr0daNL9EMPBgVBXckAcQi2fcmbFh5MDIWLzBWI?= =?us-ascii?Q?9OsOQ9TZ4bO+vD+ihXvaV/7qedyBNkrImRLP4fmNn5kv+jCTGy1ISY/L8IEV?= =?us-ascii?Q?hxzIF4AUtNpwTZPkAXg3otPF5CN6NdeLncL/jzRp4WLu51TqVXY0lx579lmW?= =?us-ascii?Q?15TlR0AtlGFZoBaZKken5y9wpvPgTIct6d0IiVOqcbcFYTpM5hDBCI8dHyBO?= =?us-ascii?Q?uTiQ60kkI6Oo1GogBs0HALs+hDu4pK0XVF4bpA9adkd/pX/bn/QJgFB3Jyde?= =?us-ascii?Q?dnuolEDaGfR3ZP7t5dnpNxJJmOeNCNNJuR+mMSgncy4eAbaeGDDwrjiQOPor?= =?us-ascii?Q?auaOLFldcLf8HMTmkl0s5/XDOuqqVGbhuJrF4YzbXzD3aH9NiFfYAkiHGyWU?= =?us-ascii?Q?EYI15hLO6yQik58VJS7mKum2IDSPB3HKxKuYwmjpKeXqFJssu5TKT6BVEepB?= =?us-ascii?Q?gB+3qQsba5hR50TlSTayGOD9j6zlmDs55KATCX3Qy3D0rePCNnFTs+2cq8QY?= =?us-ascii?Q?bpTuF2Ujvgn9SW9kV+P4Bu/p1tJcIZPPumN8RwLuilsovndQVHyLFu/VW0ay?= =?us-ascii?Q?8LzPn8LrDj4rvEk4F9e/WwHiBUp4gMFuDtYm1PcsiNkuEIC+rM5Mihe2HoNh?= =?us-ascii?Q?P4aK1PxNrHYZrZEed5e2dcEZ9BCLhbpZiIoJ7vlVY5I0xqhxAMRg53rwzEdB?= =?us-ascii?Q?E2/MlPd1UYDg4muyAG1UvZ6MQa4V5uqmoHs9U8xLJ53MrCPDFM2+FmdL3ljd?= =?us-ascii?Q?ZGCaQ2gijhX1VGE5+UzBo0xLNRIrbnk7ErPahqMEPt59jY9wGcJhNL2nS9ch?= =?us-ascii?Q?LCACwQ12ZU+1Uuv6Qkd16i56W9VWwJZYjUN9OgDaX9MRXs5AlLE0I/+g+x3i?= =?us-ascii?Q?PZl5jD6YPiYzo1l6cIWIv0EcfV3VGfPXJvvJAS+2ktoGuF1VO5MFw5trg7TH?= =?us-ascii?Q?+JPYsULYdcVnDjgMQX5clYxqHAZfodrNQxO5TIZJB5FH6IE=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW2PR2101MB1801.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 256fb33f-69db-4f9a-d4d0-08d89053a10f X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Nov 2020 08:33:33.0410 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: A19a7poQar6UyoSSd6cZnkM2kXKE3HKKdyoI3uAVCSxgMN1bh49+gqyZZCZNXqG3AiNsuSROqgivvX1BOphbEA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR21MB1860 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Wei Liu, Please do not pick up this patch, because actually MMIO VRAM can not work with fb_deferred_io. Previously I didn't test Xorg -- sorry. As soon as I tested it, I got the b= elow warning and the Xorg program ternimated immediately: [ 28.148432] WARNING: CPU: 19 PID: 1410 at mm/vmalloc.c:383 vmalloc_to_pa= ge+0x14b/0x150 ... [ 28.192959] CPU: 19 PID: 1410 Comm: Xorg Tainted: G E 5.1= 0.0-rc1+ #4 ... [ 28.208720] RIP: 0010:vmalloc_to_page+0x14b/0x150 ... [ 28.299231] Call Trace: [ 28.301428] fb_deferred_io_fault+0x3a/0xa0 [ 28.305276] __do_fault+0x36/0x120 [ 28.308276] handle_mm_fault+0x1144/0x1950 [ 28.311963] exc_page_fault+0x290/0x510 [ 28.315551] ? asm_exc_page_fault+0x8/0x30 [ 28.319186] asm_exc_page_fault+0x1e/0x30 [ 28.322969] RIP: 0033:0x7fbeda3ec2f5 The issue is that fb_deferred_io_page() requires that the PFN be backed by = a struct page, but it looks the MMIO address does not have the struct page ba= cked. So I have to drop this patch.=20 Thanks Wei Hu and Michael for pointing this out! FYI: drivers/video/fbdev/core/fb_defio.c: static struct page *fb_deferred_io_page(struct fb_info *info, unsigned long= offs) { void *screen_base =3D (void __force *) info->screen_base; struct page *page; if (is_vmalloc_addr(screen_base + offs)) page =3D vmalloc_to_page(screen_base + offs); else page =3D pfn_to_page((info->fix.smem_start + offs) >> PAGE_= SHIFT); return page; } /* this is to find and return the vmalloc-ed fb pages */ static vm_fault_t fb_deferred_io_fault(struct vm_fault *vmf) { unsigned long offset; struct page *page; struct fb_info *info =3D vmf->vma->vm_private_data; offset =3D vmf->pgoff << PAGE_SHIFT; if (offset >=3D info->fix.smem_len) return VM_FAULT_SIGBUS; page =3D fb_deferred_io_page(info, offset); if (!page) return VM_FAULT_SIGBUS; Thanks, -- Dexuan