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

Re: [PATCH v5 04/12] xen/arm: add SVE exception class handling


  • To: Julien Grall <julien@xxxxxxx>
  • From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Date: Thu, 13 Apr 2023 13:27:50 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.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=cLiqadu5AG8GrrWoQG7VBbBfiLxOAYVHW7Po1uAAX34=; b=X8WSc6wRcLdqeIIhywXMuxV7ktvy59/k2FqOTrkiI2+qkxafiiiRgyFaxHKlupGKdkb8UEtRTa94DRugOGPp59kYAYljrgFAO6KmBvrbjAD73c/Wh9gaMi3AtqyJE1mrUzVD5/fY/yJEr/OITStk6MRYFLQ0Y/dqc/7FtCLIhq3bo3sLvuhlf/xg6lNhg2+CcTcYvVk69gvAYy19x2Q0y1saig5UCIg+jLlDz3vWq8QWBDFwRQ/oaiz+b3E9OmawpWuF726DubAtV0+GxeJrgNcbMuxCneHcEUSF+xPl/sojTQrM/P7XpYURPJjMLruN8GgkcmY1CJdvaCkBOvkrPg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=boEMpuluaGVaTAvrPJx5n8KdGDpNN183GSScEMsBr4LG9PB4lJCN27Yt8oWc79YapkitdqsPbsAQXz6AZ/DkKw4upwpiScqXknDyNPthDrIbRi54niytK75fLKFoNbGZSlg2kjcqWQ/brATSfyAqm9Bogt5078srCf+YVcVQs1rz4CRz2vXhEohZ7HWYKi+BGr/6niC1o9XX5Dk5ueu3VbCyu2uTISQ6CpMoOkg7Vj+eoZyHUsBiIRCB88IMf/igXq9IdgGyvdPxpEeusgoCmoRbNUKC45/MuW7Y+GC37YKWi96gcCMa/oZGU2ANQtME/R15F8p4/YuP/skKlu1L2A==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Wei Chen <Wei.Chen@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Thu, 13 Apr 2023 13:28:04 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHZbSQzMQ+GouBmA0y3P+pRTDiAq68pNiQAgAAHA4A=
  • Thread-topic: [PATCH v5 04/12] xen/arm: add SVE exception class handling

>> --- a/xen/arch/arm/traps.c
>> +++ b/xen/arch/arm/traps.c
>> @@ -2160,6 +2160,13 @@ void do_trap_guest_sync(struct cpu_user_regs *regs)
>>          perfc_incr(trap_sysreg);
>>          do_sysreg(regs, hsr);
>>          break;
>> +    case HSR_EC_SVE:
>> +        GUEST_BUG_ON(regs_mode_is_32bit(regs));
>> +        gprintk(XENLOG_WARNING,
>> +                "Domain id %d tried to use SVE while not allowed\n",
>> +                current->domain->domain_id);
> 
> gprintk() will already print the domain/vCPU for you. Also, if you want to 
> print a domain ID, then you should use ("%pd", d) rather than ("%d", 
> d->domain_id).

Ok I’ll change it to:

gprintk(XENLOG_WARNING, "Domain tried to use SVE while not allowed\n");

> 
>> +        inject_undef_exception(regs, hsr);
>> +        break;
>>  #endif
>>        case HSR_EC_INSTR_ABORT_LOWER_EL:
>> @@ -2189,6 +2196,11 @@ void do_trap_hyp_sync(struct cpu_user_regs *regs)
>>      case HSR_EC_BRK:
>>          do_trap_brk(regs, hsr);
>>          break;
>> +    case HSR_EC_SVE:
>> +        /* An SVE exception is a bug somewhere in hypervisor code */
>> +        printk("SVE trap at EL2.\n");
>> +        do_unexpected_trap("Hypervisor", regs);
> 
> I think it would be better if you pass "SVE trap at EL2" as a string rather 
> than adding your own printk above.

Ok I’ll remove the printk and do just do_unexpected_trap("SVE trap at EL2", 
regs);

> 
>> +        break;
>>  #endif
>>      case HSR_EC_DATA_ABORT_CURR_EL:
>>      case HSR_EC_INSTR_ABORT_CURR_EL:
> 
> Cheers,
> 
> -- 
> Julien Grall



 


Rackspace

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