[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v6 13/18] s390x: protvirt: Disable address checks for PV gues
From: |
Janosch Frank |
Subject: |
Re: [PATCH v6 13/18] s390x: protvirt: Disable address checks for PV guest IO emulation |
Date: |
Thu, 5 Mar 2020 10:42:04 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 |
On 3/4/20 6:55 PM, David Hildenbrand wrote:
> On 04.03.20 12:42, Janosch Frank wrote:
>> IO instruction data is routed through SIDAD for protected guests, so
>> adresses do not need to be checked, as this is kernel memory.
>>
>> Signed-off-by: Janosch Frank <address@hidden>
>> Reviewed-by: Thomas Huth <address@hidden>
>> ---
>> target/s390x/ioinst.c | 26 +++++++++++++++++++-------
>> 1 file changed, 19 insertions(+), 7 deletions(-)
>>
>> diff --git a/target/s390x/ioinst.c b/target/s390x/ioinst.c
>> index c437a1d8c6..e4102430aa 100644
>> --- a/target/s390x/ioinst.c
>> +++ b/target/s390x/ioinst.c
>> @@ -17,6 +17,16 @@
>> #include "trace.h"
>> #include "hw/s390x/s390-pci-bus.h"
>>
>> +static uint64_t get_address_from_regs(CPUS390XState *env, uint32_t ipb,
>> + uint8_t *ar)
>> +{
>
> Please add a comment here why this is done. (e.g., make all address
> checks - like alignment checks - in the caller succeed, and we don't
> need the address).
* Addresses for protected guests are all offsets into the
* satellite block which holds the IO control structures. Those
* control structures are always aligned and accessible, so we can
* return 0 here which will pass the following address checks.
?
>
>> + if (env->pv) {
>> + *ar = 0;
>> + return 0;
>> + }
>> + return decode_basedisp_s(env, ipb, ar);
>> +}
>> +
>
> Reviewed-by: David Hildenbrand <address@hidden>
>
>
signature.asc
Description: OpenPGP digital signature
[PATCH v6 11/18] s390x: protvirt: Set guest IPL PSW, Janosch Frank, 2020/03/04
[PATCH v6 09/18] s390x: protvirt: Move STSI data over SIDAD, Janosch Frank, 2020/03/04
[PATCH v6 14/18] s390x: protvirt: Move IO control structures over SIDA, Janosch Frank, 2020/03/04