Kristina Martsenko
63fba9ff76
arm64: KVM: fix VTTBR_BADDR_MASK BUG_ON off-by-one
...
commit 26aa7b3b1c upstream.
VTTBR_BADDR_MASK is used to sanity check the size and alignment of the
VTTBR address. It seems to currently be off by one, thereby only
allowing up to 47-bit addresses (instead of 48-bit) and also
insufficiently checking the alignment. This patch fixes it.
As an example, with 4k pages, before this patch we have:
PHYS_MASK_SHIFT = 48
VTTBR_X = 37 - 24 = 13
VTTBR_BADDR_SHIFT = 13 - 1 = 12
VTTBR_BADDR_MASK = ((1 << 35) - 1) << 12 = 0x00007ffffffff000
Which is wrong, because the mask doesn't allow bit 47 of the VTTBR
address to be set, and only requires the address to be 12-bit (4k)
aligned, while it actually needs to be 13-bit (8k) aligned because we
concatenate two 4k tables.
With this patch, the mask becomes 0x0000ffffffffe000, which is what we
want.
Fixes: 0369f6a34b ("arm64: KVM: EL2 register definitions")
Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com >
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org >
Signed-off-by: Kristina Martsenko <kristina.martsenko@arm.com >
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com >
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2017-12-14 09:28:14 +01:00
..
2016-07-06 10:34:46 +01:00
2015-03-25 11:49:30 +00:00
2017-07-05 14:40:29 +02:00
2016-11-05 20:59:06 +00:00
2016-10-06 10:49:01 -07:00
2016-09-23 17:19:25 +01:00
2015-03-27 13:44:35 +00:00
2017-06-14 15:06:05 +02:00
2017-07-05 14:40:25 +02:00
locking/atomic, arch/arm64: Implement atomic{,64}_fetch_{add,sub,and,andnot,or,xor}{,_relaxed,_acquire,_release}()
2016-06-16 10:48:21 +02:00
2016-09-09 18:12:34 +01:00
2016-06-16 10:48:32 +02:00
2017-05-25 15:44:45 +02:00
2014-04-18 11:40:33 +02:00
2014-12-22 16:47:32 +00:00
2016-02-18 18:16:53 +00:00
2016-02-23 17:43:25 +00:00
2016-02-23 17:43:25 +00:00
2015-10-28 19:09:17 +00:00
2016-08-22 10:00:48 +01:00
2015-10-28 18:32:12 +00:00
2016-06-21 15:09:11 +01:00
2016-09-23 17:19:25 +01:00
2017-05-25 15:44:44 +02:00
2015-11-17 13:24:36 +00:00
2012-09-17 13:42:21 +01:00
2015-05-19 16:09:29 +01:00
2016-07-12 16:09:37 +01:00
2016-11-05 20:59:06 +00:00
2016-11-05 20:59:06 +00:00
2015-06-19 14:46:39 +01:00
2016-09-09 18:12:08 +01:00
2016-09-09 11:41:13 +01:00
2016-09-23 11:25:01 +01:00
2014-12-04 12:41:49 +00:00
2016-06-06 13:48:54 -07:00
2014-11-05 09:03:25 +01:00
2016-07-27 11:16:05 -07:00
2017-08-24 17:12:20 -07:00
2016-09-09 15:03:29 +01:00
2016-03-25 16:37:42 -07:00
2016-10-20 09:50:54 +01:00
2012-09-17 13:42:04 +01:00
2016-02-26 15:22:53 +00:00
2014-05-08 11:31:57 +02:00
2015-01-29 17:24:39 +00:00
2016-03-04 18:19:17 +00:00
2016-02-24 14:57:26 +00:00
2016-02-16 15:12:32 +00:00
2015-12-21 17:26:00 +00:00
2016-09-09 11:43:50 +01:00
2015-10-21 15:35:58 +01:00
2013-06-07 10:39:45 +00:00
2016-09-09 15:03:28 +01:00
2016-09-08 11:04:13 +01:00
2015-07-27 11:08:40 +01:00
2015-12-21 17:26:01 +00:00
2016-07-19 16:59:40 +01:00
2015-08-03 11:34:15 +02:00
2016-02-18 18:16:44 +00:00
2016-09-09 15:05:08 +01:00
2016-04-14 16:15:08 +01:00
2016-06-27 16:31:25 +01:00
2016-06-16 19:20:51 +01:00
2016-08-11 17:38:16 +01:00
2017-12-14 09:28:14 +01:00
2016-11-04 17:56:28 +00:00
2014-07-11 04:57:44 -07:00
2017-05-20 14:28:36 +02:00
2016-11-04 17:56:28 +00:00
2016-09-08 12:53:00 +02:00
2016-05-20 15:39:42 +02:00
2017-03-12 06:41:47 +01:00
2014-04-30 04:18:57 -07:00
2012-10-20 11:12:01 +01:00
2016-11-05 20:59:06 +00:00
2012-09-17 13:41:56 +01:00
2017-01-26 08:24:43 +01:00
2016-09-09 11:43:50 +01:00
2016-07-01 11:56:26 +01:00
2016-04-15 18:06:09 +01:00
2016-10-17 12:42:16 +01:00
2014-05-08 11:31:57 +02:00
2016-05-30 14:27:09 +02:00
2016-03-29 16:04:57 +01:00
2016-06-03 10:57:18 +01:00
2015-12-21 14:40:54 +00:00
2016-03-07 10:40:02 -06:00
2016-10-19 15:37:29 +01:00
2016-11-18 09:06:58 +00:00
2016-06-24 17:23:52 -07:00
2016-09-09 11:43:50 +01:00
2016-08-25 18:00:29 +01:00
2016-05-03 09:58:38 +01:00
2017-11-30 08:39:01 +00:00
2016-07-19 15:03:21 +01:00
2015-05-19 15:27:42 +01:00
2016-10-20 09:50:53 +01:00
2016-06-21 15:09:11 +01:00
2016-07-27 11:16:05 -07:00
2014-11-28 10:24:59 +00:00
2016-08-25 18:00:30 +01:00
2015-12-02 14:00:10 +00:00
2014-08-06 12:56:16 +02:00
2015-07-29 18:32:09 +01:00
2016-06-27 16:24:51 +01:00
2014-08-19 20:23:02 +01:00
2015-07-27 11:09:34 +01:00
2016-10-03 08:58:35 -07:00
2014-07-09 12:23:48 +01:00
2015-12-21 17:26:02 +00:00
2016-04-21 14:58:21 +02:00
2016-04-21 14:58:21 +02:00
2016-04-21 14:58:21 +02:00
2012-10-11 11:05:13 +01:00
2015-10-12 17:46:36 +01:00
2016-08-26 11:21:25 +01:00
2013-06-07 10:39:45 +00:00
2014-07-10 11:06:00 +01:00
2017-06-14 15:05:56 +02:00
2016-08-31 13:45:46 +01:00
2016-09-09 11:43:50 +01:00
2013-06-10 17:58:20 +01:00
2015-10-07 11:56:21 +01:00
2016-09-28 10:44:05 +01:00
2016-04-15 18:06:09 +01:00
2016-08-25 18:00:29 +01:00
2017-06-14 15:06:05 +02:00
2016-06-01 18:48:20 +01:00
2016-06-01 18:48:20 +01:00
2016-07-12 16:06:32 +01:00
2012-09-17 13:42:09 +01:00
2016-09-09 11:42:27 +01:00
2016-02-24 14:57:26 +00:00