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

Re: [PATCH 2/3] x86/PV: replace assertions in '0' debug key stack dumping


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 18 Oct 2021 16:37:27 +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=aYnM3Cx+t/POs6nJpfu4JnU+GlMJPoe3IG/zUlueIVM=; b=B6jNuNXsIIF7mr3002b0iXEQoCYBi40knjhCxxKsdmUhCKxcEFhZ0Tt5emYKUGmWBWgLosrriF9+izzUKg8WoBCbxv8sRd1YOEuEoowof3J//GStgN/f7FBQQcH/3ftT7wsfLNcojnb8WohFK4aiqfCyUiaTx3t2S5I6ThdUsu1Ezrw+1QumBd9HIzaA/YaElmTl2DDrNDkxhhRzEqAhnlmuQYJYu00AaFY2wGIfcvFmXP/I2LRHy/kGJN3jeIPpXVT3/JfPKta38GJCoCLPPuogfoHbTifziNW+IQJCtk6p71hs99x25vawsrnG1HxJ2y/kOkqcrvh+TXO5fvVAvA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F7af2cOsPFseG2NXSm572PpIHHgnSKqCO8cH4JcdHteiFt0tV2OLrP4sfymTr38wmRxQA0EMd98Q5x81IKV5LC63lkOxpIra66xzZOmbeJAMX7gDm3Gja4ZtpbrzXiwJQQupV2EEDFmwY6Urb4y0zkAiuYMFHg1XxoT3RrbXZL6k0LnczkUPO6q4j4ReMQ86TomBoQK5WuEl0rh7yOE/MIzs/Ghi091bBt8ui9xw3ti8lpE9wF/gdgpoBnUr0I1NNDmGEBeJUZJxBDD1cmP7FNPeDmZ8pYRHcgY0049js/5x/zYv0yswR0MdaWD3ZI9MhncgdM+AIU8A330uYf8Byw==
  • Authentication-results: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=suse.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Mon, 18 Oct 2021 14:37:35 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 18.10.2021 16:26, Roger Pau Monné wrote:
> On Wed, Sep 29, 2021 at 11:42:54AM +0200, Jan Beulich wrote:
>> While it was me to add them, I'm afraid I don't see justification for
>> the assertions: A vCPU may very well have got preempted while in user
>> mode. Limit compat guest user mode stack dumps to the containing page
>> (like is done when using do_page_walk()), and suppress their dumping
>> altogether for 64-bit Dom0.
> 
> I'm slightly lost by this last sentence...
> 
>> @@ -328,7 +329,12 @@ static void show_guest_stack(struct vcpu
>>      {
>>          struct vcpu *vcpu;
>>  
>> -        ASSERT(guest_kernel_mode(v, regs));
>> +        if ( !guest_kernel_mode(v, regs) )
>> +        {
>> +            printk("User mode stack\n");
>> +            return;
>> +        }
> 
> ...as you seem to unconditionally prevent the dump regardless of
> whether it's dom0 or domU as long as it's not a kernel stack?

Well, Dom0 comes into play by way of me talking about debug key '0'.
I've replaced "Dom0" by "domains" in the sentence.

> I assume when running in PV 64bit mode user-space could be executing a
> 32bit program and hence Xen could then misprint the stack as a 64bit
> one?

That's not a primary concern, I would think. The real problem is
do_page_walk() doing

    unsigned long mfn = pagetable_get_pfn(v->arch.guest_table);

first thing: No consideration of guest user mode here at all. And
I didn't want to teach it without real need.

Jan




 


Rackspace

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