Re: [PATCH v7 13/13] s390: Recognize confidential-guest-support option

David Gibson
2021-01-15T00:20:30Z

[-- Attachment #1: Type: text/plain, Size: 1366 bytes --]

On Thu, Jan 14, 2021 at 10:24:57AM +0100, Christian Borntraeger wrote:
>
>
> On 14.01.21 10:19, Christian Borntraeger wrote:
> >
> >
> > On 14.01.21 10:10, Christian Borntraeger wrote:
> >>
> >>
> >> On 14.01.21 00:58, David Gibson wrote:
> >> [...]
> >>> +int s390_pv_init(ConfidentialGuestSupport *cgs, Error **errp)
> >>> +{
> >>> + if (!object_dynamic_cast(OBJECT(cgs), TYPE_S390_PV_GUEST)) {
> >>> + return 0;
> >>> + }
> >>> +
> >>> + if (!s390_has_feat(S390_FEAT_UNPACK)) {
> >>> + error_setg(errp,
> >>> + "CPU model does not support Protected Virtualization");
> >>> + return -1;
> >>> + }
> >>
> >> I am triggering this and I guess this is because the cpu model is not yet initialized at
> >> this point in time.
> >>
> > When I remove the check, things seems to work though ( I can access virtio-blk devices without
> > specifying iommu for example)
>
> Maybe we can turn things around and check in apply_cpu_model if the object exists but
> unpack was not specified?

That might work. If unpack *is* specified, you'd also need to set the
ready flag there, of course.

--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]