From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2D579C43457 for ; Wed, 14 Oct 2020 15:43:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C23242222E for ; Wed, 14 Oct 2020 15:43:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="y9rh7Ihk"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="C0XFs60M" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731499AbgJNPnZ (ORCPT ); Wed, 14 Oct 2020 11:43:25 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:59464 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726954AbgJNPnY (ORCPT ); Wed, 14 Oct 2020 11:43:24 -0400 Date: Wed, 14 Oct 2020 15:43:20 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1602690201; h=from:from:sender:sender:reply-to: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=0mpOy9K1flk/vxzl9xD64ffVDuS3YqxEYQAqDaJFd0w=; b=y9rh7IhkMPM3D0pTsaGI3NxMYJrcuKyk26QrEMkQgkc6N9mBTDvcpofPynp4tAP44NN2y1 wjibpw/+nCMv+0gPGqav49MTNqrwmqR4M9vlEeQbyr8CBwn6zmnA/VaMaz5ozU5Q6WNHNU ZrEy8FhAe2rDmyO8lH2M2o3JKpEckGw3megwtbzM2zSgk2OKO8/NQkTRcb8W2hSaCoSXLY gbQf5tjl+kGgSLjRrzOSuH7wFKPQtYT75ROEL7UcRutk6Lyc3Gvftt5pRTM9rX2imMaNcw Re8k4+KSnmprkwlTw8h8YQu8zF+a1Q3CkdawaZhXxpjCS7fvcroYvDgQ0yq83w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1602690201; h=from:from:sender:sender:reply-to: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=0mpOy9K1flk/vxzl9xD64ffVDuS3YqxEYQAqDaJFd0w=; b=C0XFs60Mo7tpRBeiP4xPaDDd0p76Fo4lCciHhzq704h7ktyMKgPPeFF5M8LCZfsQDzYtRT F8jMk5ZBQZ16HYCw== From: "tip-bot2 for Kairui Song" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/urgent] hyperv_fb: Update screen_info after removing old framebuffer Cc: Kairui Song , Ingo Molnar , Dexuan Cui , Jake Oshins , Wei Hu , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , x86 , LKML In-Reply-To: <20201014092429.1415040-3-kasong@redhat.com> References: <20201014092429.1415040-3-kasong@redhat.com> MIME-Version: 1.0 Message-ID: <160269020010.7002.11896111566490290262.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the x86/urgent branch of tip: Commit-ID: 3cb73bc3fa2a3cb80b88aa63b48409939e0d996b Gitweb: https://git.kernel.org/tip/3cb73bc3fa2a3cb80b88aa63b48409939e0d996b Author: Kairui Song AuthorDate: Wed, 14 Oct 2020 17:24:29 +08:00 Committer: Ingo Molnar CommitterDate: Wed, 14 Oct 2020 17:05:26 +02:00 hyperv_fb: Update screen_info after removing old framebuffer On gen2 HyperV VM, hyperv_fb will remove the old framebuffer, and the new allocated framebuffer address could be at a differnt location, and it might be no longer a VGA framebuffer. Update screen_info so that after kexec the kernel won't try to reuse the old invalid/stale framebuffer address as VGA, corrupting memory. [ mingo: Tidied up the changelog. ] Signed-off-by: Kairui Song Signed-off-by: Ingo Molnar Cc: Dexuan Cui Cc: Jake Oshins Cc: Wei Hu Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Stephen Hemminger Link: https://lore.kernel.org/r/20201014092429.1415040-3-kasong@redhat.com --- drivers/video/fbdev/hyperv_fb.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/video/fbdev/hyperv_fb.c b/drivers/video/fbdev/hyperv_fb.c index 02411d8..e36fb1a 100644 --- a/drivers/video/fbdev/hyperv_fb.c +++ b/drivers/video/fbdev/hyperv_fb.c @@ -1114,8 +1114,15 @@ static int hvfb_getmem(struct hv_device *hdev, struct fb_info *info) getmem_done: remove_conflicting_framebuffers(info->apertures, KBUILD_MODNAME, false); - if (!gen2vm) + + if (gen2vm) { + /* framebuffer is reallocated, clear screen_info to avoid misuse from kexec */ + screen_info.lfb_size = 0; + screen_info.lfb_base = 0; + screen_info.orig_video_isVGA = 0; + } else { pci_dev_put(pdev); + } kfree(info->apertures); return 0;