[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] x86/pv: Inject #GP for implicit grant unmaps


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 26 Jul 2022 08:29:46 +0200
  • 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
  • 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=st+k8Ys+XWdrzUrpeNQQuwR2aWpv5futUnkxzwVhjNo=; b=cm3c+MU3Lpzai/gJjeIyJCTsF85Xx5FNkuLTMWuZIMBoWp//+9Rz3Yho2p20sRSyLFj/Vg/WjQpcnqTjW7eHbhZXB4Zlbi2efHPfd4N8Mfb8s8EUrr3w5twBdyUNbhG7WA7hjdXDS4G5Ii0HiFDyakbEggu8vB9JrAc7sEGF+QVklH+5Yp3YapRR2DQSV5Zi+5D+2ahzubyifMHusbOs3iGu5Qg3R3d9URUe6kNT2Tu9+NKj8F4t4UT3OBAKgA+eGA8h8HMk7gW90p2E9zICU5wGz2moikHguism2tUBUOq2fbmCu2GgpBBdSCP+Qs5JL5e1VuKqLhj7g9ssKZ/lWA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XLtSwTEaJMIGiN9gvNH+ExBgV67FD4+msqFm1xvFKTAoPoGavekLKu1NtTdcWHODm1HLrWNOtUL44DKgqe+mVMApjHgIYpsxQD0GcSlnXSllR/Z/TAV78t5FWeECwY6kNjFIXrFcmN2vw2d43YV6l7K1MoAPsXGFk1j27OviDxn+JXOYUOYZSJUK0dP6uUHc3EFoW94EyBqhngPrrbqzxgfs2vZK+SGEqYWrF9Puj1lgL3PszC75ZkhgTVkq5jhFjpcM9V1smSiCx325U45M6+r1S4gikN7WO5oAglpBOyaap0C+vSzggMrzIP+qtQyJRCfwm34NBapu+CvIH5kVSw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 26 Jul 2022 06:29:57 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 25.07.2022 19:50, Andrew Cooper wrote:
> This is a debug behaviour to identify buggy kernels.  Crashing the domain is
> the most unhelpful thing to do, because it discards the relevant context.
> 
> Instead, inject #GP[0] like other permission errors in x86.  In particular,
> this lets the kernel provide a backtrace that's actually helpful to a
> developer trying to figure out what's going wrong.
> 
> As a bugfix, this always injects #GP[0] to current, not l1e_owner.  It is not
> l1e_owner's fault if dom0 using superpowers triggers an implicit unmap.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

Acked-by: Jan Beulich <jbeulich@xxxxxxxx>

Albeit preferably with ...

> --- a/xen/arch/x86/mm.c
> +++ b/xen/arch/x86/mm.c
> @@ -1232,7 +1232,7 @@ void put_page_from_l1e(l1_pgentry_t l1e, struct domain 
> *l1e_owner)
>          gdprintk(XENLOG_WARNING,
>                   "Attempt to implicitly unmap a granted PTE %" PRIpte "\n",
>                   l1e_get_intpte(l1e));
> -        domain_crash(l1e_owner);
> +        pv_inject_hw_exception(TRAP_gp_fault, 0);
>      }
>  #endif

... the gdprintk() adjusted to also log l1e_owner.

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.