[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH 08/21] xen/arm: vsmmuv3: Add support for registers emulation
- To: Julien Grall <julien@xxxxxxx>
- From: Rahul Singh <Rahul.Singh@xxxxxxx>
- Date: Mon, 5 Dec 2022 14:56:57 +0000
- Accept-language: 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=QLlUycEOhuBw36JwxjaJ1vE3H+TJfqAPzhtJXhPlg5Y=; b=jCPb968p6K9xFQNMU9KSbBt8iaveRJm+98yuGF8/O34qYlkPk9udfylFAiYSwmZIz/4yQKRm2nFJTaZ1XQDLaYkXIp0Dqpq0o7Zr7DDIBw8fj6EcVEC9SemZPf4YC0j00DONItKfb1MH0rkaCM1vjOAfkWD4vI2+d07slzSw+8e257KFn1zYtRaa/j5iJPUEoNZP7N3jPgNyNzPNyIzaPP84XGg8Vlp+W01BptEogaZXzPio84g5u4emiFp0Pj0DyLVKhkZq/0eTtCg+cOs9AV+zT3Ilm5mKMXOlddLkHHWDAVI2yjijrEf/OpBcRpoIRev2yLOtABZNWvP9Fj5xnA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EgkjERc0l+YVl6XGccxBtdokAkNOJGrI6LohibqJnqCiopjcIYkOeyp/OB0jvoSMe+sydOEBu1Xyi7hWcehyLqWlmv03jeitk4n4JaSTRS8tcxmo7E9rFjlCVkQfpLoSp5RCjXlBeS8G/T0FABiPxiy8vjeYOxj050mxBhYT59rZ1llkfY0jQMyJ3azppU6f6xIb0ukt6kgUA4v5RggYuYfW7EB1wefuQrZfayXK4E7JLBbOVK5WBCb9OfRrnNL6C7DsivS9arQHZTkWw1vSV9qjTHQr8B/xLKcbNW1drOJUayExBw3aNVXw6tczaXn9hdD4U0jt77KnbZ2I9VeLxA==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Cc: Xen developer discussion <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
- Delivery-date: Mon, 05 Dec 2022 14:57:14 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Nodisclaimer: true
- Thread-index: AQHZBZ9FZaLvsMLqiEuR+y6v1y6G4a5crcqAgAK6j4A=
- Thread-topic: [RFC PATCH 08/21] xen/arm: vsmmuv3: Add support for registers emulation
Hi Julien,
> On 3 Dec 2022, at 9:16 pm, Julien Grall <julien@xxxxxxx> wrote:
>
> Hi Rahul,
>
> I have only skimmed through the patch so far.
>
> On 01/12/2022 16:02, Rahul Singh wrote:
>> static int vsmmuv3_mmio_write(struct vcpu *v, mmio_info_t *info,
>> register_t r, void *priv)
>> {
>> + struct virt_smmu *smmu = priv;
>> + uint64_t reg;
>> + uint32_t reg32;
>> +
>> + switch ( info->gpa & 0xffff )
>> + {
>> + case VREG32(ARM_SMMU_CR0):
>
>
> Shouldn't this code (and all the other register emulations) be protected for
> concurrent access in some way?
Yes, I agree I will add the lock for register emulations in next v2.
>
>
>> + reg32 = smmu->cr[0];
>> + vreg_reg32_update(®32, r, info);
>> + smmu->cr[0] = reg32;
>> + smmu->cr0ack = reg32 & ~CR0_RESERVED;
>
> Looking at the use. I think it doesn't look necessary to have a copy of cr0
> with just the reserved bit(s) unset. Instead, it would be better to clear the
> bit(s) when reading it.
Ack.
Regards,
Rahul
|